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.

117 lines
4.6 KiB

  1. // Gemplus (C) 1999
  2. // This is main Driver object for the driver.
  3. //
  4. // Version 1.0
  5. // Author: Sergey Ivanov
  6. // Date of creation - 18.05.1999
  7. // Change log:
  8. //
  9. #ifndef WDMSYS_INT
  10. #define WDMSYS_INT
  11. #include "generic.h"
  12. #include "system.h"
  13. #pragma PAGEDCODE
  14. // Interface to general system services...
  15. class CWDMSystem : public CSystem
  16. {
  17. public:
  18. NTSTATUS m_Status;
  19. SAFE_DESTRUCTORS();
  20. virtual VOID dispose(VOID){self_delete();};
  21. protected:
  22. CWDMSystem(){m_Status = STATUS_SUCCESS;};
  23. virtual ~CWDMSystem(){};
  24. public:
  25. static CSystem* create(VOID);
  26. // This object will implement next interfaces...
  27. virtual NTSTATUS createDevice(PDRIVER_OBJECT DriverObject,
  28. ULONG DeviceExtensionSize,
  29. PUNICODE_STRING DeviceName OPTIONAL,
  30. DEVICE_TYPE DeviceType,
  31. ULONG DeviceCharacteristics,
  32. BOOLEAN Reserved,
  33. PDEVICE_OBJECT *DeviceObject);
  34. virtual VOID deleteDevice(PDEVICE_OBJECT DeviceObject);
  35. virtual PDEVICE_OBJECT attachDevice(PDEVICE_OBJECT FuncDevice,IN PDEVICE_OBJECT PhysDevice);
  36. virtual VOID detachDevice(PDEVICE_OBJECT TargetDevice);
  37. virtual NTSTATUS callDriver(PDEVICE_OBJECT DeviceObject,PIRP Irp);
  38. virtual NTSTATUS registerDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject,
  39. CONST GUID *InterfaceClassGuid,
  40. PUNICODE_STRING ReferenceString, OPTIONAL
  41. PUNICODE_STRING SymbolicLinkName);
  42. virtual NTSTATUS setDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName,BOOLEAN Enable);
  43. virtual NTSTATUS createSystemThread(OUT PHANDLE ThreadHandle,
  44. IN ULONG DesiredAccess,
  45. IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
  46. IN HANDLE ProcessHandle OPTIONAL,
  47. OUT PCLIENT_ID ClientId OPTIONAL,
  48. IN PKSTART_ROUTINE StartRoutine,
  49. IN PVOID StartContext);
  50. virtual NTSTATUS terminateSystemThread(IN NTSTATUS ExitStatus);
  51. virtual NTSTATUS referenceObjectByHandle(IN HANDLE Handle,
  52. IN ACCESS_MASK DesiredAccess,
  53. IN POBJECT_TYPE ObjectType OPTIONAL,
  54. IN KPROCESSOR_MODE AccessMode,
  55. OUT PVOID *Object,
  56. OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL
  57. );
  58. virtual VOID referenceObject(IN PVOID Object);
  59. virtual VOID dereferenceObject(IN PVOID Object);
  60. virtual PDEVICE_OBJECT getAttachedDeviceReference(IN PDEVICE_OBJECT DeviceObject);
  61. virtual NTSTATUS ZwClose(IN HANDLE Handle);
  62. virtual NTSTATUS createSymbolicLink(IN PUNICODE_STRING SymbolicLinkName,IN PUNICODE_STRING DeviceName);
  63. virtual NTSTATUS deleteSymbolicLink(IN PUNICODE_STRING SymbolicLinkName);
  64. virtual VOID invalidateDeviceRelations(IN PDEVICE_OBJECT DeviceObject,IN DEVICE_RELATION_TYPE Type);
  65. virtual NTSTATUS getDeviceObjectPointer(IN PUNICODE_STRING ObjectName,
  66. IN ACCESS_MASK DesiredAccess,
  67. OUT PFILE_OBJECT *FileObject,
  68. OUT PDEVICE_OBJECT *DeviceObject);
  69. virtual VOID raiseIrql(IN KIRQL NewIrql,OUT KIRQL* oldIrql);
  70. virtual VOID lowerIrql (IN KIRQL NewIrql);
  71. virtual KIRQL getCurrentIrql();
  72. virtual VOID initializeDeviceQueue(IN PKDEVICE_QUEUE DeviceQueue);
  73. virtual BOOLEAN insertDeviceQueue(IN PKDEVICE_QUEUE DeviceQueue,IN PKDEVICE_QUEUE_ENTRY DeviceQueueEntry);
  74. virtual BOOLEAN insertByKeyDeviceQueue(IN PKDEVICE_QUEUE DeviceQueue,IN PKDEVICE_QUEUE_ENTRY DeviceQueueEntry,IN ULONG SortKey);
  75. virtual PKDEVICE_QUEUE_ENTRY removeDeviceQueue(IN PKDEVICE_QUEUE DeviceQueue);
  76. virtual PKDEVICE_QUEUE_ENTRY removeByKeyDeviceQueue(IN PKDEVICE_QUEUE DeviceQueue,IN ULONG SortKey);
  77. virtual BOOLEAN removeEntryDeviceQueue(IN PKDEVICE_QUEUE DeviceQueue,IN PKDEVICE_QUEUE_ENTRY DeviceQueueEntry);
  78. virtual NTSTATUS openDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject,
  79. IN ULONG DevInstKeyType,
  80. IN ACCESS_MASK DesiredAccess,
  81. OUT PHANDLE DevInstRegKey
  82. );
  83. virtual NTSTATUS ZwQueryValueKey(IN HANDLE KeyHandle,
  84. IN PUNICODE_STRING ValueName,
  85. IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
  86. OUT PVOID KeyValueInformation,
  87. IN ULONG Length,
  88. OUT PULONG ResultLength
  89. );
  90. virtual NTSTATUS getDeviceProperty(IN PDEVICE_OBJECT DeviceObject,
  91. IN DEVICE_REGISTRY_PROPERTY DeviceProperty,
  92. IN ULONG BufferLength,
  93. OUT PVOID PropertyBuffer,
  94. OUT PULONG ResultLength
  95. );
  96. virtual VOID initializeFastMutex(IN PFAST_MUTEX FastMutex);
  97. virtual VOID acquireFastMutex(IN PFAST_MUTEX FastMutex);
  98. virtual VOID releaseFastMutex(IN PFAST_MUTEX FastMutex);
  99. };
  100. #endif //WDMSYS_INT