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.

86 lines
1.6 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. pointprt.cpp
  5. Abstract:
  6. This file implements the code for point & print setup.
  7. Environment:
  8. WIN32 User Mode
  9. Author:
  10. Wesley Witt (wesw) 10-Sept-1997
  11. --*/
  12. #include "faxocm.h"
  13. #pragma hdrstop
  14. BOOL
  15. CopyClientFiles(
  16. LPWSTR SourceRoot
  17. );
  18. BOOL
  19. FaxPointPrintInstall(
  20. LPWSTR DirectoryName,
  21. LPWSTR PrinterName
  22. )
  23. {
  24. WCHAR SourceDirectory[MAX_PATH];
  25. WCHAR FaxPrinterName[MAX_PATH];
  26. WCHAR ClientSetupServerName[MAX_PATH];
  27. LPWSTR p;
  28. DWORD len;
  29. HANDLE FaxHandle = INVALID_HANDLE_VALUE;
  30. ClientSetupServerName[0] = 0;
  31. len = wcslen(DirectoryName);
  32. wcscpy( SourceDirectory, DirectoryName );
  33. if (SourceDirectory[len-1] != L'\\') {
  34. SourceDirectory[len] = L'\\';
  35. SourceDirectory[len+1] = 0;
  36. }
  37. p = wcschr( &SourceDirectory[2], TEXT('\\') );
  38. if (p) {
  39. *p = 0;
  40. wcscpy( ClientSetupServerName, &SourceDirectory[2] );
  41. *p = TEXT('\\');
  42. }
  43. if (PrinterName[0] == L'\\' && PrinterName[1] == L'\\') {
  44. wcscpy( FaxPrinterName, PrinterName );
  45. } else {
  46. FaxPrinterName[0] = TEXT('\\');
  47. FaxPrinterName[1] = TEXT('\\');
  48. FaxPrinterName[2] = 0;
  49. wcscat( FaxPrinterName, PrinterName );
  50. }
  51. if (ClientSetupServerName[0]) {
  52. if (!FaxConnectFaxServer( ClientSetupServerName, &FaxHandle )) {
  53. return FALSE;
  54. } else {
  55. FaxClose( FaxHandle );
  56. }
  57. }
  58. CopyClientFiles( SourceDirectory );
  59. SetClientRegistryData();
  60. DoExchangeInstall(NULL);
  61. CreateGroupItems( ClientSetupServerName );
  62. return TRUE;
  63. }