| 281 | } |
| 282 | |
| 283 | DECLSPEC_NOINLINE |
| 284 | BOOL WINAPI _DllEntryPoint(HINSTANCE hInstance, ULONG ulReason, __inout_opt LPVOID pv) |
| 285 | { |
| 286 | #ifdef DEBUG |
| 287 | extern bool g_fDbgInDllEntryPoint; |
| 288 | g_fDbgInDllEntryPoint = true; |
| 289 | #endif |
| 290 | |
| 291 | switch (ulReason) |
| 292 | { |
| 293 | |
| 294 | case DLL_PROCESS_ATTACH: |
| 295 | DisableThreadLibraryCalls(hInstance); |
| 296 | DbgInitialise(hInstance); |
| 297 | |
| 298 | { |
| 299 | // The platform identifier is used to work out whether |
| 300 | // full unicode support is available or not. Hence the |
| 301 | // default will be the lowest common denominator - i.e. N/A |
| 302 | g_amPlatform = VER_PLATFORM_WIN32_WINDOWS; // win95 assumed in case GetVersionEx fails |
| 303 | |
| 304 | g_osInfo.dwOSVersionInfoSize = sizeof(g_osInfo); |
| 305 | if (GetVersionEx(&g_osInfo)) |
| 306 | { |
| 307 | g_amPlatform = g_osInfo.dwPlatformId; |
| 308 | } |
| 309 | else |
| 310 | { |
| 311 | DbgLog((LOG_ERROR, 1, TEXT("Failed to get the OS platform, assuming Win95"))); |
| 312 | } |
| 313 | } |
| 314 | |
| 315 | g_hInst = hInstance; |
| 316 | DllInitClasses(TRUE); |
| 317 | break; |
| 318 | |
| 319 | case DLL_PROCESS_DETACH: DllInitClasses(FALSE); |
| 320 | |
| 321 | #ifdef DEBUG |
| 322 | if (CBaseObject::ObjectsActive()) |
| 323 | { |
| 324 | DbgSetModuleLevel(LOG_MEMORY, 2); |
| 325 | TCHAR szInfo[512]; |
| 326 | extern TCHAR m_ModuleName[]; // Cut down module name |
| 327 | |
| 328 | TCHAR FullName[_MAX_PATH]; // Load the full path and module name |
| 329 | TCHAR *pName; // Searches from the end for a backslash |
| 330 | |
| 331 | GetModuleFileName(NULL, FullName, _MAX_PATH); |
| 332 | pName = _tcsrchr(FullName, '\\'); |
| 333 | if (pName == NULL) |
| 334 | { |
| 335 | pName = FullName; |
| 336 | } |
| 337 | else |
| 338 | { |
| 339 | pName++; |
| 340 | } |
no test coverage detected