int _NonAppStart ( void *NLMHandle, void *errorScreen, const char *cmdLine, const char *loadDirPath, size_t uninitializedDataLength, void *NLMFileHandle, int (*readRoutineP)( int conn, void *fileHandle, size_t offset, size_t nbytes, size_t *bytesRead, void *buffer ), size_t customDataOffset, size_t customDataSize, int messageCount, const char **messages ) { NX_LOCK_INFO_ALLOC(liblock, "Per-Application Data Lock", 0); #pragma unused(cmdLine) #pragma unused(loadDirPath) #pragma unused(uninitializedDataLength) #pragma unused(NLMFileHandle) #pragma unused(readRoutineP) #pragma unused(customDataOffset) #pragma unused(customDataSize) #pragma unused(messageCount) #pragma unused(messages) /* Here we process our command line, post errors (to the error screen), * perform initializations and anything else we need to do before being able * to accept calls into us. If we succeed, we return non-zero and the NetWare * Loader will leave us up, otherwise we fail to load and get dumped. */ /** gAllocTag = AllocateResourceTag(NLMHandle, "<library-name> memory allocations", AllocSignature); if (!gAllocTag) { OutputToScreen(errorScreen, "Unable to allocate resource tag for " "library memory allocations.\n"); return -1; } **/ gLibId = register_library(DisposeLibraryData); if (gLibId == -1) { OutputToScreen(errorScreen, "Unable to register library with kernel.\n"); return -1; } gLibHandle = NLMHandle; gLibLock = NXMutexAlloc(0, 0, &liblock); if (!gLibLock) { OutputToScreen(errorScreen, "Unable to allocate library data lock.\n"); return -1; } return 0; }
bool interface_dll_tests() { output("\n"); for (const char** pszDlls = get_dlls(); *pszDlls; ++pszDlls) { // Register the library Omega::string_t strLibName = make_absolute(*pszDlls); output(" %-45s",strLibName.c_str()); // Register the library bool bSkipped; bool res = register_library("/Local User",strLibName,bSkipped); if (bSkipped) continue; if (res) { output("\n"); res = do_local_library_test("/Local User"); unregister_library("/Local User"); if (res) output("[Ok]"); } res = register_library("/All Users",strLibName,bSkipped); if (res && !bSkipped) { output("\n"); res = do_local_library_test("/All Users"); unregister_library("/All Users"); if (res) output("[Ok]\n"); } } output(" %-46s","Result"); return true; }
int _NonAppStart ( void *NLMHandle, void *errorScreen, const char *cmdLine, const char *loadDirPath, size_t uninitializedDataLength, void *NLMFileHandle, int (*readRoutineP)( int conn, void *fileHandle, size_t offset, size_t nbytes, size_t *bytesRead, void *buffer ), size_t customDataOffset, size_t customDataSize, int messageCount, const char **messages ) { WSADATA wsaData; apr_status_t status; NX_LOCK_INFO_ALLOC(liblock, "Per-Application Data Lock", 0); #pragma unused(cmdLine) #pragma unused(loadDirPath) #pragma unused(uninitializedDataLength) #pragma unused(NLMFileHandle) #pragma unused(readRoutineP) #pragma unused(customDataOffset) #pragma unused(customDataSize) #pragma unused(messageCount) #pragma unused(messages) gLibId = register_library(DisposeLibraryData); if (gLibId < -1) { OutputToScreen(errorScreen, "Unable to register library with kernel.\n"); return -1; } gLibHandle = NLMHandle; gLibLock = NXMutexAlloc(0, 0, &liblock); if (!gLibLock) { OutputToScreen(errorScreen, "Unable to allocate library data lock.\n"); return -1; } apr_netware_setup_time(); if ((status = apr_pool_initialize()) != APR_SUCCESS) return status; return WSAStartup((WORD) MAKEWORD(2, 0), &wsaData); }
static bool do_library_test(const Omega::string_t& strLibName, const char* pszEndpoint, bool& bSkipped) { // Register the library ready for local loopback stuff output(" %-45s ",strLibName.c_str()); // Register the library TEST(register_library("/Local User",strLibName,bSkipped)); if (bSkipped) return true; OTL::ObjectPtr<Omega::TestSuite::ISimpleTest> ptrSimpleTest("Test.Library@" + Omega::string_t(pszEndpoint)); TEST(ptrSimpleTest); interface_tests(ptrSimpleTest); TEST(unregister_library("/Local User")); return true; }