diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/ole2ui32/dllfuncs.cpp | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'private/ole2ui32/dllfuncs.cpp')
-rw-r--r-- | private/ole2ui32/dllfuncs.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/private/ole2ui32/dllfuncs.cpp b/private/ole2ui32/dllfuncs.cpp new file mode 100644 index 000000000..830d2079c --- /dev/null +++ b/private/ole2ui32/dllfuncs.cpp @@ -0,0 +1,65 @@ +/* + * DLLFUNCS.CPP + * + * Contains entry and exit points for the DLL implementation + * of the OLE 2.0 User Interface Support Library. + * + * This file is not needed if we are linking the static library + * version of this library. + * + * Copyright (c)1992 Microsoft Corporation, All Right Reserved + */ + +#include "precomp.h" +#include "common.h" +#include "uiclass.h" + +OLEDBGDATA_MAIN(TEXT("OLEDLG")) + +/* + * DllMain + * + * Purpose: + * DLL-specific entry point called from LibEntry. + */ + +STDAPI_(BOOL) OleUIInitialize(HINSTANCE, HINSTANCE); +STDAPI_(BOOL) OleUIUnInitialize(); + +#pragma code_seg(".text$initseg") + +BOOL WINAPI DllMain(HINSTANCE hInst, DWORD Reason, LPVOID lpv) +{ + if (Reason == DLL_PROCESS_DETACH) + { + OleDbgOut2(TEXT("DllMain: OLEDLG.DLL unloaded\r\n")); + + OleUIUnInitialize(); + } + else if (Reason == DLL_PROCESS_ATTACH) + { + OSVERSIONINFO sVersion; + + sVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + + if (GetVersionEx(&sVersion)) + { + if (VER_PLATFORM_WIN32s == sVersion.dwPlatformId) + { + if ((1 == sVersion.dwMajorVersion) && (30 > sVersion.dwMinorVersion)) + { + return(FALSE); // fail to load on older versions of Win32s + } + } + } + + OleDbgOut2(TEXT("DllMain: OLEDLG.DLL loaded\r\n")); + + DisableThreadLibraryCalls(hInst); + + OleUIInitialize(hInst, (HINSTANCE)0); + } + return TRUE; +} + +#pragma code_seg() |