[SHELL32] CDrivesFolder: Implement the eject and disconnect menu items. CORE-13841
[reactos.git] / dll / win32 / mapi32 / mapi32_main.c
index 324d53d..471010a 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
+#include "precomp.h"
 
-#include <stdarg.h>
-
-#include <windef.h>
-#include <winbase.h>
-//#include "winerror.h"
-//#include "objbase.h"
-#include <initguid.h>
-#include <mapix.h>
-//#include "mapiform.h"
-//#include "mapi.h"
-#include <wine/debug.h>
-#include "util.h"
-
-WINE_DEFAULT_DEBUG_CHANNEL(mapi);
-
-LONG MAPI_ObjectCount = 0;
-HINSTANCE hInstMAPI32;
+DECLSPEC_HIDDEN LONG MAPI_ObjectCount = 0;
+DECLSPEC_HIDDEN HINSTANCE hInstMAPI32;
 
 /***********************************************************************
  *              DllMain (MAPI32.init)
@@ -55,6 +38,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
         load_mapi_providers();
         break;
     case DLL_PROCESS_DETACH:
+        if (fImpLoad) break;
        TRACE("DLL_PROCESS_DETACH: %d objects remaining\n", MAPI_ObjectCount);
         unload_mapi_providers();
        break;