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.

51 lines
1.6 KiB

  1. // --------------------------------------------------------------------------
  2. // OEJUNK.CPP
  3. // Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  4. // --------------------------------------------------------------------------
  5. #include "pch.hxx"
  6. // --------------------------------------------------------------------------------
  7. // Globals
  8. // --------------------------------------------------------------------------------
  9. HINSTANCE g_hInst = NULL;
  10. IMalloc * g_pMalloc = NULL;
  11. // --------------------------------------------------------------------------------
  12. // Dll Entry Point
  13. // --------------------------------------------------------------------------------
  14. extern "C" BOOL WINAPI DllMain(HANDLE hInst, DWORD dwReason, LPVOID lpReserved)
  15. {
  16. // Process Attach
  17. if (DLL_PROCESS_ATTACH == dwReason)
  18. {
  19. // Save hInstance
  20. g_hInst = (HINSTANCE)hInst;
  21. // We don't care about thread attachs
  22. SideAssert(DisableThreadLibraryCalls((HINSTANCE)hInst));
  23. // Get the OLE Task Memory Allocator
  24. CoGetMalloc(1, &g_pMalloc);
  25. AssertSz(g_pMalloc, "We are in trouble now.");
  26. }
  27. // Process Detach
  28. else if (DLL_PROCESS_DETACH == dwReason)
  29. {
  30. // Release the task allocator
  31. SafeRelease(g_pMalloc);
  32. }
  33. // Done
  34. return TRUE;
  35. }
  36. // --------------------------------------------------------------------------------
  37. // GetDllMajorVersion
  38. // --------------------------------------------------------------------------------
  39. OEDLLVERSION WINAPI GetDllMajorVersion(void)
  40. {
  41. return OEDLL_VERSION_CURRENT;
  42. }