Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.7 KiB

  1. /*
  2. * DLLFUNCS.CPP
  3. *
  4. * Contains entry and exit points for the DLL implementation
  5. * of the OLE 2.0 User Interface Support Library.
  6. *
  7. * This file is not needed if we are linking the static library
  8. * version of this library.
  9. *
  10. * Copyright (c)1992 Microsoft Corporation, All Right Reserved
  11. */
  12. #include "precomp.h"
  13. #include "common.h"
  14. #include "uiclass.h"
  15. OLEDBGDATA_MAIN(TEXT("OLEDLG"))
  16. /*
  17. * DllMain
  18. *
  19. * Purpose:
  20. * DLL-specific entry point called from LibEntry.
  21. */
  22. STDAPI_(BOOL) OleUIInitialize(HINSTANCE, HINSTANCE);
  23. STDAPI_(BOOL) OleUIUnInitialize();
  24. #pragma code_seg(".text$initseg")
  25. BOOL WINAPI DllMain(HINSTANCE hInst, DWORD Reason, LPVOID lpv)
  26. {
  27. if (Reason == DLL_PROCESS_DETACH)
  28. {
  29. OleDbgOut2(TEXT("DllMain: OLEDLG.DLL unloaded\r\n"));
  30. OleUIUnInitialize();
  31. }
  32. else if (Reason == DLL_PROCESS_ATTACH)
  33. {
  34. OSVERSIONINFO sVersion;
  35. sVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  36. if (GetVersionEx(&sVersion))
  37. {
  38. if (VER_PLATFORM_WIN32s == sVersion.dwPlatformId)
  39. {
  40. if ((1 == sVersion.dwMajorVersion) && (30 > sVersion.dwMinorVersion))
  41. {
  42. return(FALSE); // fail to load on older versions of Win32s
  43. }
  44. }
  45. }
  46. OleDbgOut2(TEXT("DllMain: OLEDLG.DLL loaded\r\n"));
  47. DisableThreadLibraryCalls(hInst);
  48. OleUIInitialize(hInst, (HINSTANCE)0);
  49. }
  50. return TRUE;
  51. }
  52. #pragma code_seg()