MCPcopy Create free account
hub / github.com/DamRsn/NeuralNote / DllEntryPoint

Function DllEntryPoint

ThirdParty/ASIO/common/dllentry.cpp:255–321  ·  view source on GitHub ↗

extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID); BOOL WINAPI DllEntryPoint(HINSTANCE hInstance,ULONG ulReason,LPVOID pv) BOOL WINAPI DllMain (HINSTANCE hInstance,ULONG ulReason,LPVOID pv)

Source from the content-addressed store, hash-verified

253//BOOL WINAPI DllEntryPoint(HINSTANCE hInstance,ULONG ulReason,LPVOID pv)
254//BOOL WINAPI DllMain (HINSTANCE hInstance,ULONG ulReason,LPVOID pv)
255BOOL WINAPI DllEntryPoint (HINSTANCE hInstance,ULONG ulReason,LPVOID pv)
256{
257
258 // DebugBreak();
259
260 switch (ulReason) {
261
262 case DLL_PROCESS_ATTACH:
263 DisableThreadLibraryCalls(hInstance);
264 DbgInitialise(hInstance);
265 {
266 // The platform identifier is used to work out whether
267 // full unicode support is available or not. Hence the
268 // default will be the lowest common denominator - i.e. N/A
269 g_amPlatform = VER_PLATFORM_WIN32_WINDOWS; // win95 assumed in case GetVersionEx fails
270
271 g_osInfo.dwOSVersionInfoSize = sizeof(g_osInfo);
272 if (GetVersionEx(&g_osInfo)) {
273 g_amPlatform = g_osInfo.dwPlatformId;
274 }
275 else {
276 DbgLog((LOG_ERROR, 1, "Failed to get the OS platform, assuming Win95"));
277 }
278 }
279 hinstance = hInstance;
280 DllInitClasses(TRUE);
281
282 break;
283
284 case DLL_PROCESS_DETACH:
285 DllInitClasses(FALSE);
286
287#ifdef DEBUG
288 if (CBaseObject::ObjectsActive()) {
289 DbgSetModuleLevel(LOG_MEMORY, 2);
290 TCHAR szInfo[512];
291 extern TCHAR m_ModuleName[]; // Cut down module name
292
293 TCHAR FullName[_MAX_PATH]; // Load the full path and module name
294 TCHAR *pName; // Searches from the end for a backslash
295
296 GetModuleFileName(NULL,FullName,_MAX_PATH);
297 pName = _tcsrchr(FullName,'\\');
298 if (pName == NULL) {
299 pName = FullName;
300 }
301 else {
302 pName++;
303 }
304
305 DWORD cch = wsprintf(szInfo, TEXT("Executable: %s Pid %x Tid %x. "),
306 pName, GetCurrentProcessId(), GetCurrentThreadId());
307
308 wsprintf(szInfo+cch, TEXT("Module %s, %d objects left active!"),
309 m_ModuleName, CBaseObject::ObjectsActive());
310 DbgAssert(szInfo, TEXT(__FILE__),__LINE__);
311
312 // If running remotely wait for the Assert to be acknowledged

Callers

nothing calls this directly

Calls 1

DllInitClassesFunction · 0.85

Tested by

no test coverage detected