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.

107 lines
4.9 KiB

  1. #ifndef _COPY_H
  2. #define _COPY_H
  3. #include "ynlist.h"
  4. #define ISDIRFINDDATA(finddata) ((finddata).dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
  5. #define ISREPARSEFINDDATA(finddata) ((finddata).dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
  6. #define DE_SAMEFILE 0x71 // aahhh! these overlap winerror.h values
  7. #define DE_MANYSRC1DEST 0x72
  8. #define DE_DIFFDIR 0x73
  9. #define DE_ROOTDIR 0x74
  10. #define DE_DESTSUBTREE 0x76
  11. #define DE_WINDOWSFILE 0x77
  12. #define DE_ACCESSDENIEDSRC 0x78
  13. #define DE_PATHTODEEP 0x79
  14. #define DE_MANYDEST 0x7A
  15. // DE_RENAMREPLACE (0x7B) collided with ERROR_INVALID_NAME - but luckily was not used
  16. #define DE_INVALIDFILES 0x7C // dos device name or too long
  17. #define DE_DESTSAMETREE 0x7D
  18. #define DE_FLDDESTISFILE 0x7E
  19. #define DE_COMPRESSEDVOLUME 0x7F
  20. #define DE_FILEDESTISFLD 0x80
  21. #define DE_FILENAMETOOLONG 0x81
  22. #define DE_DEST_IS_CDROM 0x82
  23. #define DE_DEST_IS_DVD 0x83
  24. #define DE_DEST_IS_CDRECORD 0x84
  25. #define DE_ERROR_MAX 0xB7
  26. #define ERRORONDEST 0x10000 // indicate error on destination file
  27. STDAPI_(int) CallFileCopyHooks(HWND hwnd, UINT wFunc, FILEOP_FLAGS fFlags,
  28. LPCTSTR pszSrcFile, DWORD dwSrcAttribs,
  29. LPCTSTR pszDestFile, DWORD dwDestAttribs);
  30. STDAPI_(int) CallPrinterCopyHooks(HWND hwnd, UINT wFunc, PRINTEROP_FLAGS fFlags,
  31. LPCTSTR pszSrcPrinter, DWORD dwSrcAttribs,
  32. LPCTSTR pszDestPrinter, DWORD dwDestAttribs);
  33. STDAPI_(void) CopyHooksTerminate(void);
  34. #define CONFIRM_DELETE_FILE 0x00000001
  35. #define CONFIRM_DELETE_FOLDER 0x00000002
  36. #define CONFIRM_REPLACE_FILE 0x00000004
  37. #define CONFIRM_WONT_RECYCLE_FILE 0x00000008
  38. #define CONFIRM_REPLACE_FOLDER 0x00000010
  39. #define CONFIRM_MOVE_FILE 0x00000020
  40. #define CONFIRM_MOVE_FOLDER 0x00000040
  41. #define CONFIRM_WONT_RECYCLE_FOLDER 0x00000080
  42. #define CONFIRM_RENAME_FILE 0x00000100
  43. #define CONFIRM_RENAME_FOLDER 0x00000200
  44. #define CONFIRM_SYSTEM_FILE 0x00000400 // any destructive op on a system file
  45. #define CONFIRM_READONLY_FILE 0x00001000 // any destructive op on a read-only file
  46. #define CONFIRM_PROGRAM_FILE 0x00002000 // any destructive op on a program
  47. #define CONFIRM_MULTIPLE 0x00004000 // multiple file/folder confirm setting
  48. #define CONFIRM_LFNTOFAT 0x00008000
  49. #define CONFIRM_STREAMLOSS 0x00010000 // Multi-stream file copied from NTFS -> FAT
  50. #define CONFIRM_PATH_TOO_LONG 0x00020000 // give warning before really nuking paths that are too long to move to recycle bin
  51. #define CONFIRM_FAILED_ENCRYPT 0x00040000 // we failed to encrypt a file that we were moving into an encrypted directory
  52. #define CONFIRM_WONT_RECYCLE_OFFLINE 0x00080000 // give warning before really nuking paths that are offline and can't be recycled
  53. #define CONFIRM_LOST_ENCRYPT_FILE 0x00100000 // Can't move over encryption flag
  54. #define CONFIRM_LOST_ENCRYPT_FOLDER 0x00200000 // Can't move over encryption flag
  55. /// these parts below are true flags, those above are pseudo enums
  56. #define CONFIRM_WASTEBASKET_PURGE 0x01000000
  57. typedef LONG CONFIRM_FLAG;
  58. #define CONFIRM_FLAG_FLAG_MASK 0xFF000000
  59. #define CONFIRM_FLAG_TYPE_MASK 0x00FFFFFF
  60. typedef struct {
  61. CONFIRM_FLAG fConfirm; // confirm things with their bits set here
  62. CONFIRM_FLAG fNoToAll; // do "no to all" on things with these bits set
  63. } CONFIRM_DATA;
  64. //
  65. // BBDeleteFile returns one of the flags below in a out variable so that
  66. // the caller can detect why BBDeleteFile succeeded/failed.
  67. //
  68. #define BBDELETE_SUCCESS 0x00000000
  69. #define BBDELETE_UNKNOWN_ERROR 0x00000001
  70. #define BBDELETE_FORCE_NUKE 0x00000002
  71. #define BBDELETE_CANNOT_DELETE 0x00000004
  72. #define BBDELETE_SIZE_TOO_BIG 0x00000008
  73. #define BBDELETE_PATH_TOO_LONG 0x00000010
  74. #define BBDELETE_NUKE_OFFLINE 0x00000020
  75. #define BBDELETE_CANCELLED 0x00000040
  76. #ifndef INTERNAL_COPY_ENGINE
  77. STDAPI_(INT_PTR) ConfirmFileOp(HWND hwnd, LPVOID pcs, CONFIRM_DATA *pcd,
  78. int nSourceFiles, int cDepth, CONFIRM_FLAG fConfirm,
  79. LPCTSTR pFileSource, const WIN32_FIND_DATA *pfdSource,
  80. LPCTSTR pFileDest, const WIN32_FIND_DATA *pfdDest,
  81. LPCTSTR pStreamNames);
  82. STDAPI_(int) CountFiles(LPCTSTR pInput);
  83. #endif
  84. STDAPI_(INT_PTR) ValidateCreateFileFromClip(HWND hwnd, LPFILEDESCRIPTOR pfdSrc, TCHAR *szPathDest, PYNLIST pynl);
  85. STDAPI_(void) StartCopyEngine(HANDLE *phEventRunning);
  86. STDAPI_(void) EndCopyEngine(HANDLE hEventRunning);
  87. STDAPI_(BOOL) IsCopyEngineRunning();
  88. #endif // _COPY_H