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.

132 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. event.h
  5. Abstract:
  6. contains prototypes for functions in event.c
  7. Author:
  8. Paul McDaniel (paulmcd) 01-March-2000
  9. Revision History:
  10. --*/
  11. #ifndef _EVENT_H_
  12. #define _EVENT_H_
  13. #define IS_VALID_OVERWRITE_INFO(pObject) \
  14. (((pObject) != NULL) && ((pObject)->Signature == SR_OVERWRITE_INFO_TAG))
  15. typedef struct _SR_OVERWRITE_INFO
  16. {
  17. //
  18. // = SR_OVERWRITE_INFO_TAG
  19. //
  20. ULONG Signature;
  21. //
  22. // IN the irp on input
  23. //
  24. PIRP pIrp;
  25. //
  26. // OUT did we rename the file?
  27. //
  28. BOOLEAN RenamedFile;
  29. //
  30. // OUT did we copied the file instead of renaming it?
  31. //
  32. BOOLEAN CopiedFile;
  33. //
  34. // OUT did we ignore the file because we thought the overwrite would fail?
  35. //
  36. BOOLEAN IgnoredFile;
  37. //
  38. // OUT the file attributes use in the create. these have to be returned
  39. // as they must match for CreateFile to success for H/S files.
  40. //
  41. ULONG CreateFileAttributes;
  42. //
  43. // OUT OPTIONAL the name we renamed it to IF we ended up renaming
  44. //
  45. PFILE_RENAME_INFORMATION pRenameInformation;
  46. } SR_OVERWRITE_INFO, *PSR_OVERWRITE_INFO;
  47. NTSTATUS
  48. SrHandleEvent (
  49. IN PSR_DEVICE_EXTENSION pExtension,
  50. IN SR_EVENT_TYPE EventType,
  51. IN PFILE_OBJECT pFileObject,
  52. IN PSR_STREAM_CONTEXT pFileContext OPTIONAL,
  53. IN OUT PSR_OVERWRITE_INFO pOverwriteInfo OPTIONAL,
  54. IN PUNICODE_STRING pFileName2 OPTIONAL
  55. );
  56. NTSTATUS
  57. SrLogEvent(
  58. IN PSR_DEVICE_EXTENSION pExtension,
  59. IN SR_EVENT_TYPE EventType,
  60. IN PFILE_OBJECT pFileObject OPTIONAL,
  61. IN PUNICODE_STRING pFileName,
  62. IN USHORT FileNameStreamLength,
  63. IN PUNICODE_STRING pTempName OPTIONAL,
  64. IN PUNICODE_STRING pFileName2 OPTIONAL,
  65. IN USHORT FileName2StreamLength OPTIONAL,
  66. IN PUNICODE_STRING pShortName OPTIONAL
  67. );
  68. NTSTATUS
  69. SrCreateRestoreLocation (
  70. IN PSR_DEVICE_EXTENSION pExtension
  71. );
  72. NTSTATUS
  73. SrHandleDirectoryRename (
  74. IN PSR_DEVICE_EXTENSION pExtension,
  75. IN PUNICODE_STRING pDirectoryName,
  76. IN BOOLEAN EventDelete
  77. );
  78. NTSTATUS
  79. SrHandleFileRenameOutOfMonitoredSpace(
  80. IN PSR_DEVICE_EXTENSION pExtension,
  81. IN PFILE_OBJECT pFileObject,
  82. IN PSR_STREAM_CONTEXT pFileContext,
  83. OUT PBOOLEAN pOptimizeDelete,
  84. OUT PUNICODE_STRING *ppDestFileName
  85. );
  86. NTSTATUS
  87. SrHandleOverwriteFailure (
  88. IN PSR_DEVICE_EXTENSION pExtension,
  89. IN PUNICODE_STRING pOriginalFileName,
  90. IN ULONG CreateFileAttributes,
  91. IN PFILE_RENAME_INFORMATION pRenameInformation
  92. );
  93. #endif // _EVENT_H_