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.

90 lines
5.0 KiB

  1. /* ---------------------------------------------------------------------------------------------------------------------------- */
  2. /* */
  3. /* DIRWAK2A.H */
  4. /* This a modified version of DIRWALK2.H by adding function parameters to support OEMPATCH. */
  5. /* Definitions for the DirectoryWalk function found in DIRWAK2A.C, and the related processing calls needed. */
  6. /* */
  7. /* ---------------------------------------------------------------------------------------------------------------------------- */
  8. #ifndef DIRWAK2A_H
  9. #define DIRWAK2A_H
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /*
  14. * User function definitions:
  15. *
  16. * The context is just a void * which gets passed to each callback. It is not used internally. The user may assign
  17. * any meaning desired. The same value will be passed to each callback.
  18. *
  19. * The parentID and childID values are "void *"s to DirectoryWalk. They are not used internally. The user may assign
  20. * any meaning desired to the value. DirectoryWalk simply requests an assignment via the Directory(), and reports the
  21. * corresponding assignment with each file reported to File(), then to DirectoryEnd().
  22. */
  23. typedef int (__cdecl FN_DIRECTORY)(
  24. void * pContext, /* global context */
  25. void * pParentID, /* the handle for the directory where this directory was found */
  26. const WCHAR * pwszDirectory, /* the name of the directory found, ie, "DOS" */
  27. const WCHAR * pwszPath, /* the full name of the directory, ie, "C:\DOS" */
  28. void * * ppChildID, /* Directory() assigns this directory a handle, and passes it back here */
  29. void * pTree);
  30. /*
  31. * If Directory() returns a non-zero value, DirectoryWalk will terminate and return that value. If NULL is passed
  32. * to DirectoryWalk() for a Directory() pointer, subdirectories will not be searched. For subdirectory searching
  33. * without specific per-directory processing, create a simple function which always returns DW_NO_ERROR (any other
  34. * return will terminate the search.)
  35. */
  36. typedef int (__cdecl FN_FILE)(
  37. void * pContext, /* global context */
  38. void * pParentID, /* the handle for the directory where this file was found */
  39. const WCHAR * pwszFilename, /* the name of the file found, ie, "ANSI.SYS" */
  40. const WCHAR * pwszPath, /* the full name of the directory where file was found, ie, "C:\DOS\" */
  41. DWORD attributes, /* the file's attribute bits */
  42. FILETIME lastWriteTime, /* the file's last modification time */
  43. FILETIME creationTime, /* the file's creation time */
  44. __int64 filesize, /* the file's size in bytes */
  45. void * pTree);
  46. /*
  47. * If File() returns a value other than DW_NO_ERROR, DirectoryWalk will terminate and return that value. NULL can
  48. * be passed to DirectoryWalk() for a File() pointer; file entries found will be ignored.
  49. */
  50. typedef int (__cdecl FN_DIRECTORY_END)(
  51. void * pContext, /* global context */
  52. void * pParentID, /* the handle for the directory where this directory was found */
  53. const WCHAR * pwszDirectory, /* the name of the directory found, ie, "DOS" */
  54. const WCHAR * pwszPath, /* the full name of the directory, ie, "C:\DOS" */
  55. void * pChildID); /* the handle assigned this directory by Directory() */
  56. /*
  57. * If NULL is passed to DirectoryWalk for the DirectoryEnd() pointer, no report of end of directories will be made.
  58. * If DirectoryEnd returns a value other than DW_NO_ERROR, DirectoryWalk will terminate and return that value.
  59. */
  60. extern int DirectoryWalk(
  61. void * pContext, /* global context for callbacks */
  62. void * pParentID, /* top-level parentID */
  63. const WCHAR * pwszPath, /* path to search, ie, "C:\" */
  64. FN_DIRECTORY * Directory, /* pointer to Directory() or NULL */
  65. FN_FILE * File, /* pointer to File() or NULL */
  66. FN_DIRECTORY_END * DirectoryEnd, /* pointer to DirectoryEnd() or NULL */
  67. void * pTree);
  68. #define DW_MEMORY (-10) /* unable to allocate for internal use */
  69. #define DW_ERROR (-11) /* find first/next reported an error */
  70. #define DW_DEPTH (-12) /* path name became too long */
  71. #define DW_NO_ERROR (0) /* no error detected */
  72. #define DW_OTHER_ERROR (-1) /* some error */
  73. #ifdef __cplusplus
  74. }
  75. #endif
  76. #endif // DIRWAK2A_H