Source code of Windows XP (NT5)
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.

110 lines
2.4 KiB

  1. /*
  2. * DLLFUNCS.C
  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. #define STRICT 1
  13. #include "ole2ui.h"
  14. #include "uiclass.h"
  15. #include "common.h"
  16. OLEDBGDATA_MAIN("ole2u32a")
  17. /*
  18. * LibMain
  19. *
  20. * Purpose:
  21. * DLL-specific entry point called from LibEntry. Initializes
  22. * the DLL's heap and registers the GizmoBar GizmoBar.
  23. *
  24. * Parameters:
  25. * hInst HINSTANCE instance of the DLL.
  26. * wDataSeg WORD segment selector of the DLL's data segment.
  27. * wHeapSize WORD byte count of the heap.
  28. * lpCmdLine LPSTR to command line used to start the module.
  29. *
  30. * Return Value:
  31. * HANDLE Instance handle of the DLL.
  32. *
  33. */
  34. #ifdef WIN32
  35. BOOL _cdecl LibMain(
  36. HINSTANCE hDll,
  37. DWORD dwReason,
  38. LPVOID lpvReserved)
  39. {
  40. if (dwReason == DLL_PROCESS_ATTACH)
  41. {
  42. // Initialize OLE UI libraries. If you're linking with the static
  43. // LIB version of this library, you need to make the below call in
  44. // your application (because this LibMain won't be executed).
  45. OleUIInitialize(hDll, (HINSTANCE)0, SZCLASSICONBOX, SZCLASSRESULTIMAGE);
  46. }
  47. else if (dwReason == DLL_PROCESS_DETACH)
  48. {
  49. OleUIUnInitialize();
  50. }
  51. return TRUE;
  52. }
  53. #else
  54. int FAR PASCAL LibMain(HINSTANCE hInst, WORD wDataSeg
  55. , WORD cbHeapSize, LPTSTR lpCmdLine)
  56. {
  57. OleDbgOut2(TEXT("LibMain: OLE2UI.DLL loaded\r\n"));
  58. // Initialize OLE UI libraries. If you're linking with the static LIB version
  59. // of this library, you need to make the below call in your application (because
  60. // this LibMain won't be executed).
  61. // The symbols SZCLASSICONBOX and SZCLASSRESULTIMAGE are both defined
  62. // in uiclass.h
  63. OleUIInitialize(hInst, (HINSTANCE)0, TEXT(SZCLASSICONBOX), TEXT(SZCLASSRESULTIMAGE));
  64. //All done...
  65. if (0!=cbHeapSize)
  66. UnlockData(0);
  67. return (int)hInst;
  68. }
  69. #endif
  70. /*
  71. * WEP
  72. *
  73. * Purpose:
  74. * Required DLL Exit function.
  75. *
  76. * Parameters:
  77. * bSystemExit BOOL indicating if the system is being shut
  78. * down or the DLL has just been unloaded.
  79. *
  80. * Return Value:
  81. * void
  82. *
  83. */
  84. int CALLBACK EXPORT WEP(int bSystemExit)
  85. {
  86. OleUIUnInitialize();
  87. return 0;
  88. }
  89.