Changeset 55159fd in nscp
- Timestamp:
- 02/16/05 23:30:52 (8 years ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2, stable
- Children:
- 50744c5
- Parents:
- 402f042
- Files:
-
- 4 edited
-
StdAfx.h (modified) (1 diff)
-
include/NSCHelper.cpp (modified) (4 diffs)
-
include/NSCHelper.h (modified) (2 diffs)
-
include/thread.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
StdAfx.h
ra0528c4 r55159fd 25 25 #include <singleton.h> 26 26 #include <charEx.h> 27 #include <memory> 27 28 28 29 #endif // !defined(AFX_STDAFX_H__6B96F953_C431_11D3_BCD2_00A0D21A1A22__INCLUDED_) -
include/NSCHelper.cpp
ra0528c4 r55159fd 59 59 60 60 namespace NSCModuleHelper { 61 lpNSAPIGetBasePath fNSAPIGetBasePath = NULL; 61 62 lpNSAPIGetApplicationName fNSAPIGetApplicationName = NULL; 62 63 lpNSAPIGetApplicationVersionStr fNSAPIGetApplicationVersionStr = NULL; … … 141 142 } 142 143 /** 143 * Retrieve the application name (in human readable format) from the core.144 * @return A string representing the application name.145 */144 * Retrieve the application name (in human readable format) from the core. 145 * @return A string representing the application name. 146 */ 146 147 std::string NSCModuleHelper::getApplicationName() { 147 148 if (!fNSAPIGetApplicationName) … … 150 151 if (fNSAPIGetApplicationName(buffer, BUFF_LEN) != NSCAPI::success) 151 152 throw "Application name could not be retrieved"; 153 std::string ret = buffer; 154 delete [] buffer; 155 return ret; 156 } 157 /** 158 * Retrieve the directory root of the application from the core. 159 * @return A string representing the base path. 160 */ 161 std::string NSCModuleHelper::getBasePath() { 162 if (!fNSAPIGetBasePath) 163 return "NSCore has not been initiated..."; 164 char *buffer = new char[BUFF_LEN+1]; 165 if (fNSAPIGetBasePath(buffer, BUFF_LEN) != NSCAPI::success) 166 throw "Base path could not be retrieved"; 152 167 std::string ret = buffer; 153 168 delete [] buffer; … … 216 231 NSCModuleHelper::fNSAPIStopServer = (NSCModuleHelper::lpNSAPIStopServer)f("NSAPIStopServer"); 217 232 NSCModuleHelper::fNSAPIInject = (NSCModuleHelper::lpNSAPIInject)f("NSAPIInject"); 233 NSCModuleHelper::fNSAPIGetBasePath = (NSCModuleHelper::lpNSAPIGetBasePath)f("NSAPIGetBasePath"); 218 234 return NSCAPI::success; 219 235 } 220 236 /** 221 * Wrap the GetModuleName function call222 * @param buf Buffer to store the module name223 * @param bufLen Length of buffer224 * @param str String to store inside the buffer225 * @return buffer copy status226 */237 * Wrap the GetModuleName function call 238 * @param buf Buffer to store the module name 239 * @param bufLen Length of buffer 240 * @param str String to store inside the buffer 241 * @return buffer copy status 242 */ 227 243 int NSCModuleWrapper::wrapGetModuleName(char* buf, unsigned int bufLen, std::string str) { 228 244 return NSCHelper::wrapReturnString(buf, bufLen, str); -
include/NSCHelper.h
ra0528c4 r55159fd 15 15 { 16 16 // Types for the Callbacks into the main program 17 typedef int (*lpNSAPIGetBasePath)(char*,unsigned int); 17 18 typedef int (*lpNSAPIGetApplicationName)(char*,unsigned int); 18 19 typedef int (*lpNSAPIGetApplicationVersionStr)(char*,unsigned int); … … 32 33 std::string InjectCommand(std::string command); 33 34 void StopService(void); 35 std::string getBasePath(); 34 36 }; 35 37 -
include/thread.h
ra0528c4 r55159fd 164 164 throw "Could not terminate thread, has not been started yet..."; 165 165 pObject_->exitThread(); 166 std::cout << "Waiting for socket to close..." << std::endl;167 166 DWORD dwWaitResult = endMutext.wait(5000L); 168 167 switch (dwWaitResult) {
Note: See TracChangeset
for help on using the changeset viewer.








