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.

95 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. client.c
  5. Abstract:
  6. This file implements the file copy code.
  7. Environment:
  8. WIN32 User Mode
  9. Author:
  10. Wesley Witt (wesw) 17-Feb-1996
  11. --*/
  12. #include "wizard.h"
  13. #pragma hdrstop
  14. FILE_QUEUE_INFO RemoteAdminFileQueue[] =
  15. {
  16. //-----------------------------------------------------------------------------------------------------------------------------------------------------
  17. // Section Name Dest Dir INF Dir Id Dest Dir Id Platforms Copy Flags
  18. //-----------------------------------------------------------------------------------------------------------------------------------------------------
  19. { TEXT("RemoteAdminFiles"), NULL, DIRID_SYSTEM, DIRID_SYSTEM, PLATFORM_NONE, SP_COPY_NEWER }
  20. };
  21. #define CountRemoteAdminFileQueue (sizeof(RemoteAdminFileQueue)/sizeof(FILE_QUEUE_INFO))
  22. DWORD
  23. RemoteAdminCopyThread(
  24. HWND hwnd
  25. )
  26. {
  27. HINF FaxSetupInf;
  28. HSPFILEQ *FileQueue;
  29. PVOID QueueContext;
  30. DWORD ErrorCode = 0;
  31. if (InstallMode & INSTALL_NEW) {
  32. SendMessage( hwnd, WM_MY_PROGRESS, 0xff, 10 );
  33. }
  34. if (!InitializeFileQueue( hwnd, &FaxSetupInf, &FileQueue, &QueueContext, SourceDirectory )) {
  35. ErrorCode = IDS_COULD_NOT_COPY_FILES;
  36. goto error_exit;
  37. }
  38. if (!ProcessFileQueue( FaxSetupInf, FileQueue, QueueContext, SourceDirectory,
  39. RemoteAdminFileQueue, CountRemoteAdminFileQueue, InstallQueueCallback, SETUP_ACTION_COPY )) {
  40. ErrorCode = IDS_COULD_NOT_COPY_FILES;
  41. goto error_exit;
  42. }
  43. if (!CloseFileQueue( FileQueue, QueueContext )) {
  44. ErrorCode = IDS_COULD_NOT_COPY_FILES;
  45. goto error_exit;
  46. }
  47. if (InstallMode & INSTALL_NEW) {
  48. SetProgress( hwnd, IDS_CREATING_GROUPS );
  49. SetInstalledFlag( TRUE );
  50. SetInstallType( FAX_INSTALL_REMOTE_ADMIN );
  51. SetUnInstallInfo();
  52. CreateGroupItems( TRUE, NULL );
  53. }
  54. SetWindowLong( hwnd, DWL_MSGRESULT, 0 );
  55. PropSheet_PressButton( GetParent(hwnd), PSBTN_NEXT );
  56. return TRUE;
  57. error_exit:
  58. InstallThreadError = ErrorCode;
  59. PopUpMsg( hwnd, ErrorCode, TRUE, 0 );
  60. OkToCancel = TRUE;
  61. PropSheet_PressButton( GetParent(hwnd), PSBTN_CANCEL );
  62. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  63. return FALSE;
  64. }