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.

81 lines
1.8 KiB

  1. #define INCL_INETSRV_INCS
  2. #include "smtpinc.h"
  3. #include "iiscnfg.h"
  4. #include <mdmsg.h>
  5. #include <commsg.h>
  6. #include <imd.h>
  7. #include <mb.hxx>
  8. #include <nsepname.hxx>
  9. extern DWORD g_UseMapiDriver ;
  10. HINSTANCE g_hStoredll = NULL;
  11. HINSTANCE g_hAqdll = NULL;
  12. BOOL StoreDriverInitialized = FALSE;
  13. AQ_INITIALIZE_EX_FUNCTION g_pfnInitializeAQ = NULL;
  14. AQ_DEINITIALIZE_EX_FUNCTION g_pfnDeinitializeAQ = NULL;
  15. static void STDAPICALLTYPE DeInitialize(DWORD InstanceId)
  16. {
  17. return;
  18. }
  19. void UnLoadQueueDriver(void)
  20. {
  21. if(g_hAqdll != NULL)
  22. {
  23. FreeLibrary(g_hAqdll);
  24. g_hAqdll = NULL;
  25. }
  26. }
  27. BOOL LoadAdvancedQueueing(char *szAQDll)
  28. {
  29. TraceFunctEnterEx((LPARAM) NULL, "LoadAdvancedQueueing");
  30. DWORD dwErr = ERROR_SUCCESS;
  31. g_hAqdll = LoadLibraryEx(szAQDll, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
  32. if (g_hAqdll != NULL) {
  33. g_pfnInitializeAQ =
  34. (AQ_INITIALIZE_EX_FUNCTION)
  35. GetProcAddress(g_hAqdll, AQ_INITIALIZE_FUNCTION_NAME_EX);
  36. if (g_pfnInitializeAQ != NULL) {
  37. g_pfnDeinitializeAQ =
  38. (AQ_DEINITIALIZE_EX_FUNCTION)
  39. GetProcAddress(g_hAqdll, AQ_DEINITIALIZE_FUNCTION_NAME_EX);
  40. }
  41. if (g_pfnInitializeAQ == NULL || g_pfnDeinitializeAQ == NULL) {
  42. dwErr = GetLastError();
  43. DebugTrace((LPARAM) NULL, "Error getting address of %s - %d",
  44. g_pfnInitializeAQ ? AQ_DEINITIALIZE_FUNCTION_NAME_EX :
  45. AQ_INITIALIZE_FUNCTION_NAME_EX, dwErr);
  46. }
  47. } else {
  48. dwErr = GetLastError();
  49. DebugTrace((LPARAM) NULL, "Error loading %s - %d", szAQDll, dwErr);
  50. }
  51. TraceFunctLeaveEx((LPARAM) NULL);
  52. return (dwErr == ERROR_SUCCESS);
  53. }