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.

113 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. precomp.h
  5. Abstract:
  6. Master include file for ULAPI.LIB user-mode interface to UL.SYS.
  7. Author:
  8. Keith Moore (keithmo) 15-Dec-1998
  9. Revision History:
  10. --*/
  11. #ifndef _PRECOMP_H_
  12. #define _PRECOMP_H_
  13. #include <nt.h>
  14. #include <ntrtl.h>
  15. #include <nturtl.h>
  16. #include <windows.h>
  17. #include <srapi.h>
  18. //
  19. // Private macros.
  20. //
  21. #define ALLOC_MEM(cb) RtlAllocateHeap( RtlProcessHeap(), 0, (cb) )
  22. #define FREE_MEM(ptr) RtlFreeHeap( RtlProcessHeap(), 0, (ptr) )
  23. #define ALIGN_DOWN(length, type) \
  24. ((ULONG)(length) & ~(sizeof(type) - 1))
  25. #define ALIGN_UP(length, type) \
  26. (ALIGN_DOWN(((ULONG)(length) + sizeof(type) - 1), type))
  27. #define OVERLAPPED_TO_IO_STATUS( pOverlapped ) \
  28. ((PIO_STATUS_BLOCK)&(pOverlapped)->Internal)
  29. #define DIMENSION( array ) \
  30. ( sizeof(array) / sizeof((array)[0]) )
  31. //
  32. // Private prototypes.
  33. //
  34. #define SrpNtStatusToWin32Status( Status ) \
  35. ( ( (Status) == STATUS_SUCCESS ) \
  36. ? NO_ERROR \
  37. : RtlNtStatusToDosError( Status ) )
  38. NTSTATUS
  39. SrpOpenDriverHelper(
  40. OUT PHANDLE pHandle,
  41. IN ACCESS_MASK DesiredAccess,
  42. IN ULONG Options,
  43. IN ULONG CreateDisposition,
  44. IN PSECURITY_ATTRIBUTES pSecurityAttributes OPTIONAL
  45. );
  46. NTSTATUS
  47. SrpSynchronousDeviceControl(
  48. IN HANDLE FileHandle,
  49. IN ULONG IoControlCode,
  50. IN PVOID pInputBuffer OPTIONAL,
  51. IN ULONG InputBufferLength,
  52. OUT PVOID pOutputBuffer OPTIONAL,
  53. IN ULONG OutputBufferLength,
  54. OUT PULONG pBytesTransferred OPTIONAL
  55. );
  56. NTSTATUS
  57. SrpOverlappedDeviceControl(
  58. IN HANDLE FileHandle,
  59. IN OUT LPOVERLAPPED pOverlapped,
  60. IN ULONG IoControlCode,
  61. IN PVOID pInputBuffer OPTIONAL,
  62. IN ULONG InputBufferLength,
  63. OUT PVOID pOutputBuffer OPTIONAL,
  64. IN ULONG OutputBufferLength,
  65. OUT PULONG pBytesTransferred OPTIONAL
  66. );
  67. ULONG
  68. SrpInitializeEventCache(
  69. VOID
  70. );
  71. ULONG
  72. SrpTerminateEventCache(
  73. VOID
  74. );
  75. BOOLEAN
  76. SrpTryToStartDriver(
  77. VOID
  78. );
  79. #endif // _PRECOMP_H_