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.

99 lines
2.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994.
  5. //
  6. // File: ole2.cxx
  7. //
  8. // Contents: Thunk ole2.dll common code
  9. //
  10. // History: 07-Mar-94 DrewB Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #include <headers.cxx>
  14. #pragma hdrstop
  15. #include <call32.hxx>
  16. #include <apilist.hxx>
  17. #include <ole2int.h>
  18. DECLARE_INFOLEVEL(thk1);
  19. // Not in any OLE2 header
  20. extern UINT uOleMessage;
  21. HMODULE hmodOLE2 = NULL;
  22. //+---------------------------------------------------------------------------
  23. //
  24. // Function: LibMain, public, Local
  25. //
  26. // Synopsis: DLL initialization function
  27. //
  28. // Arguments: [hinst] - Instance handle
  29. // [wDataSeg] - Current DS
  30. // [cbHeapSize] - Heap size for the DLL
  31. // [lpszCmdLine] - Command line information
  32. //
  33. // Returns: One for success, zero for failure
  34. //
  35. // History: 21-Feb-94 DrewB Created
  36. //
  37. //----------------------------------------------------------------------------
  38. #if DBG == 1
  39. static char achInfoLevel[32];
  40. #endif
  41. extern "C" int CALLBACK LibMain(HINSTANCE hinst,
  42. WORD wDataSeg,
  43. WORD cbHeapSize,
  44. LPSTR lpszCmdLine)
  45. {
  46. #if DBG == 1
  47. if (GetProfileString("olethk32", "ole2", "3", achInfoLevel,
  48. sizeof(achInfoLevel)) > 0)
  49. {
  50. thk1InfoLevel = strtoul(achInfoLevel, NULL, 0);
  51. }
  52. if ((thk1InfoLevel == 3) &&
  53. GetProfileString("olethk32", "Infolevel", "3", achInfoLevel,
  54. sizeof(achInfoLevel)) > 0)
  55. {
  56. thk1InfoLevel = strtoul(achInfoLevel, NULL, 0);
  57. }
  58. #endif
  59. // The original OLE2 code does not check for success on this call
  60. // so neither do we
  61. uOleMessage = RegisterWindowMessage("OLE_MESSAHE");
  62. hmodOLE2 = hinst;
  63. return 1;
  64. }
  65. //+---------------------------------------------------------------------------
  66. //
  67. // Function: WEP, public, Local
  68. //
  69. // Synopsis: Windows Exit Point routine, for receiving DLL unload
  70. // notification
  71. //
  72. // Arguments: [nExitType] - Type of exit occurring
  73. //
  74. // Returns: One for success, zero for failure
  75. //
  76. // History: 21-Feb-94 DrewB Created
  77. //
  78. //----------------------------------------------------------------------------
  79. extern "C" int CALLBACK WEP(int nExitType)
  80. {
  81. // Clean up thunk objects?
  82. return 1;
  83. }