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.

83 lines
1.4 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. faxitg.cpp
  5. Abstract:
  6. This file implements the dll exports from this
  7. control(s).
  8. Author:
  9. Wesley Witt (wesw) 13-May-1997
  10. Environment:
  11. User Mode
  12. --*/
  13. #include "stdafx.h"
  14. #include "resource.h"
  15. #include "initguid.h"
  16. #include "faxitg.h"
  17. #include "faxitg_i.c"
  18. #include "FaxQueue.h"
  19. CComModule _Module;
  20. WCHAR g_ClientDir[MAX_PATH*2];
  21. WSADATA g_WsaData;
  22. BEGIN_OBJECT_MAP(ObjectMap)
  23. OBJECT_ENTRY(CLSID_FaxQueue, CFaxQueue)
  24. END_OBJECT_MAP()
  25. extern "C"
  26. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  27. {
  28. if (dwReason == DLL_PROCESS_ATTACH) {
  29. _Module.Init(ObjectMap, hInstance);
  30. DisableThreadLibraryCalls(hInstance);
  31. if (WSAStartup( 0x0101, &g_WsaData ) != 0) {
  32. return FALSE;
  33. }
  34. ExpandEnvironmentStrings( L"%windir%\\itg\\", g_ClientDir, sizeof(g_ClientDir)/sizeof(WCHAR) );
  35. CreateDirectory( g_ClientDir, NULL );
  36. } else if (dwReason == DLL_PROCESS_DETACH) {
  37. _Module.Term();
  38. }
  39. return TRUE;
  40. }
  41. STDAPI DllCanUnloadNow(void)
  42. {
  43. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  44. }
  45. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  46. {
  47. return _Module.GetClassObject(rclsid, riid, ppv);
  48. }
  49. STDAPI DllRegisterServer(void)
  50. {
  51. return _Module.RegisterServer(TRUE);
  52. }
  53. STDAPI DllUnregisterServer(void)
  54. {
  55. _Module.UnregisterServer();
  56. return S_OK;
  57. }