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.

111 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. uninstal.c
  5. Abstract:
  6. This file implements the un-install case.
  7. Environment:
  8. WIN32 User Mode
  9. Author:
  10. Wesley Witt (wesw) 17-Feb-1996
  11. --*/
  12. #include "faxocm.h"
  13. #pragma hdrstop
  14. DWORD
  15. DoUninstall(
  16. VOID
  17. )
  18. {
  19. DWORD ErrorCode = 0;
  20. HKEY hKey;
  21. HKEY hKeyDevice;
  22. DWORD RegSize;
  23. DWORD RegType;
  24. LONG rVal;
  25. DWORD i = 0;
  26. WCHAR Buffer[MAX_PATH*2];
  27. //
  28. // kill the clients dir
  29. //
  30. wcscpy( Buffer, Platforms[0].DriverDir );
  31. RemoveLastNode( Buffer );
  32. wcscat( Buffer, FAXCLIENTS_DIR );
  33. DeleteDirectoryTree( Buffer );
  34. //
  35. // kill the fax receieve dir(s)
  36. //
  37. rVal = RegOpenKey( HKEY_LOCAL_MACHINE, REGKEY_FAX_DEVICES, &hKey );
  38. if (rVal == ERROR_SUCCESS) {
  39. while (RegEnumKey( hKey, i++, Buffer, sizeof(Buffer)/sizeof(WCHAR) ) == ERROR_SUCCESS) {
  40. wcscat( Buffer, L"\\" );
  41. wcscat( Buffer, REGKEY_ROUTING );
  42. rVal = RegOpenKey( hKey, Buffer, &hKeyDevice );
  43. if (rVal == ERROR_SUCCESS) {
  44. RegSize = sizeof(Buffer);
  45. rVal = RegQueryValueEx(
  46. hKeyDevice,
  47. REGVAL_ROUTING_DIR,
  48. 0,
  49. &RegType,
  50. (LPBYTE) Buffer,
  51. &RegSize
  52. );
  53. if (rVal == ERROR_SUCCESS) {
  54. DeleteDirectoryTree( Buffer );
  55. }
  56. RegCloseKey( hKeyDevice );
  57. }
  58. }
  59. RegCloseKey( hKey );
  60. }
  61. //
  62. // clean out the registry
  63. //
  64. SetProgress( IDS_DELETING_REGISTRY );
  65. DeleteFaxRegistryData();
  66. //
  67. // remove the fax service
  68. //
  69. SetProgress( IDS_DELETING_FAX_SERVICE );
  70. MyDeleteService( L"Fax" );
  71. //
  72. // remove the program groups
  73. //
  74. SetProgress( IDS_DELETING_GROUPS );
  75. DeleteGroupItems();
  76. DeleteFaxMsgServices();
  77. if (InstallType & FAX_INSTALL_SERVER) {
  78. DeleteNetworkShare( FAXCLIENTS_DIR );
  79. }
  80. return TRUE;
  81. }