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.

507 lines
21 KiB

  1. //**************************************************************************
  2. //
  3. // MSGAME.C -- Xena Gaming Project
  4. //
  5. // Version 3.XX
  6. //
  7. // Copyright (c) 1997 Microsoft Corporation. All rights reserved.
  8. //
  9. // @doc
  10. // @module MSGAME.C | Human Input Device (HID) gameport driver
  11. //**************************************************************************
  12. #include "msgame.h"
  13. //---------------------------------------------------------------------------
  14. // Alloc_text pragma to specify routines that can be paged out.
  15. //---------------------------------------------------------------------------
  16. #ifdef ALLOC_PRAGMA
  17. #pragma alloc_text (INIT, DriverEntry)
  18. #pragma alloc_text (INIT, MSGAME_ReadRegistry)
  19. #pragma alloc_text (PAGE, MSGAME_CreateClose)
  20. #pragma alloc_text (PAGE, MSGAME_SystemControl)
  21. #pragma alloc_text (PAGE, MSGAME_AddDevice)
  22. #endif
  23. //---------------------------------------------------------------------------
  24. // Private Data
  25. //---------------------------------------------------------------------------
  26. static UNICODE_STRING RegistryPath;
  27. //---------------------------------------------------------------------------
  28. // @func Main driver entry point
  29. // @parm PDRIVER_OBJECT | DriverObject | Pointer to driver object
  30. // @parm PUNICODE_STRING | registryPath | Registry path for this device
  31. // @rdesc Returns NT status code
  32. // @comm Public function
  33. //---------------------------------------------------------------------------
  34. NTSTATUS DriverEntry (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING registryPath)
  35. {
  36. NTSTATUS ntStatus;
  37. RTL_QUERY_REGISTRY_TABLE Parameters[2];
  38. HID_MINIDRIVER_REGISTRATION HidMinidriverRegistration;
  39. MsGamePrint ((DBG_CRITICAL, "%s: Built %s at %s\n", MSGAME_NAME, __DATE__, __TIME__));
  40. MsGamePrint ((DBG_INFORM, "%s: DriverEntry Enter\n", MSGAME_NAME));
  41. //
  42. // Fill in driver dispatch table
  43. //
  44. DriverObject->MajorFunction[IRP_MJ_CREATE] = MSGAME_CreateClose;
  45. DriverObject->MajorFunction[IRP_MJ_CLOSE] = MSGAME_CreateClose;
  46. DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = MSGAME_Internal_Ioctl;
  47. DriverObject->MajorFunction[IRP_MJ_PNP] = MSGAME_PnP;
  48. DriverObject->MajorFunction[IRP_MJ_POWER] = MSGAME_Power;
  49. DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = MSGAME_SystemControl;
  50. DriverObject->DriverUnload = MSGAME_Unload;
  51. DriverObject->DriverExtension->AddDevice = MSGAME_AddDevice;
  52. //
  53. // Register driver with Hid.Sys
  54. //
  55. HidMinidriverRegistration.Revision = HID_REVISION;
  56. HidMinidriverRegistration.DriverObject = DriverObject;
  57. HidMinidriverRegistration.RegistryPath = registryPath;
  58. HidMinidriverRegistration.DeviceExtensionSize = sizeof (DEVICE_EXTENSION);
  59. HidMinidriverRegistration.DevicesArePolled = TRUE;
  60. MsGamePrint ((DBG_CONTROL, "%s: Registering with HID.SYS\n", MSGAME_NAME));
  61. ntStatus = HidRegisterMinidriver (&HidMinidriverRegistration);
  62. //
  63. // Need to ensure that the registry path is null-terminated.
  64. // Allocate pool to hold a null-terminated copy of the path.
  65. //
  66. if (NT_SUCCESS(ntStatus))
  67. {
  68. RtlInitUnicodeString (&RegistryPath, NULL);
  69. RegistryPath.Length = registryPath->Length + sizeof(UNICODE_NULL);
  70. RegistryPath.MaximumLength = RegistryPath.Length;
  71. RegistryPath.Buffer = ExAllocatePool (PagedPool, RegistryPath.Length);
  72. RtlZeroMemory (RegistryPath.Buffer, RegistryPath.Length);
  73. RtlMoveMemory (RegistryPath.Buffer, registryPath->Buffer, registryPath->Length);
  74. }
  75. //
  76. // Read any driver specific registry values
  77. //
  78. if (NT_SUCCESS(ntStatus))
  79. {
  80. RtlZeroMemory (Parameters, sizeof(Parameters));
  81. Parameters[0].Flags = RTL_QUERY_REGISTRY_DIRECT;
  82. Parameters[0].Name = L"PollingInterval";
  83. Parameters[0].EntryContext = &PollingInterval;
  84. Parameters[0].DefaultType = REG_DWORD;
  85. Parameters[0].DefaultData = &PollingInterval;
  86. Parameters[0].DefaultLength = sizeof(ULONG);
  87. if (!NT_SUCCESS(RtlQueryRegistryValues (RTL_REGISTRY_ABSOLUTE, RegistryPath.Buffer, Parameters, NULL, NULL)))
  88. {
  89. MsGamePrint((DBG_INFORM,"%s: %s_DriverEntry RtlQueryRegistryValues failed\n", MSGAME_NAME, MSGAME_NAME));
  90. RtlWriteRegistryValue (RTL_REGISTRY_ABSOLUTE, RegistryPath.Buffer, L"PollingInterval", REG_DWORD, &PollingInterval, sizeof (ULONG));
  91. }
  92. MsGamePrint((DBG_CONTROL,"%s: Polling interval will be %lu milliseconds\n", MSGAME_NAME, PollingInterval));
  93. }
  94. //
  95. // Initialize portio layer on entry
  96. //
  97. if (NT_SUCCESS(ntStatus))
  98. ntStatus = PORTIO_DriverEntry ();
  99. //
  100. // Initialize device layer on entry
  101. //
  102. if (NT_SUCCESS(ntStatus))
  103. ntStatus = DEVICE_DriverEntry ();
  104. //
  105. // Return driver status
  106. //
  107. MsGamePrint ((DBG_INFORM, "%s: DriverEntry Exit = %x\n", MSGAME_NAME, ntStatus));
  108. return (ntStatus);
  109. }
  110. //---------------------------------------------------------------------------
  111. // @func Process the Create and Close IRPs
  112. // @parm PDEVICE_OBJECT | DeviceObject | Pointer to device object
  113. // @parm PIRP | pIrp | Pointer to IO request packet
  114. // @rdesc Returns NT status code
  115. // @comm Public function
  116. //---------------------------------------------------------------------------
  117. NTSTATUS MSGAME_CreateClose (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
  118. {
  119. PIO_STACK_LOCATION IrpStack;
  120. NTSTATUS ntStatus = STATUS_SUCCESS;
  121. PAGED_CODE ();
  122. MsGamePrint ((DBG_INFORM, "%s: %s_CreateClose Enter\n", MSGAME_NAME, MSGAME_NAME));
  123. //
  124. // Get pointer to current location in Irp
  125. //
  126. IrpStack = IoGetCurrentIrpStackLocation (Irp);
  127. //
  128. // Process Create or Close function call
  129. //
  130. switch (IrpStack->MajorFunction)
  131. {
  132. case IRP_MJ_CREATE:
  133. MsGamePrint ((DBG_VERBOSE, "%s: IRP_MJ_CREATE\n", MSGAME_NAME));
  134. Irp->IoStatus.Information = 0;
  135. break;
  136. case IRP_MJ_CLOSE:
  137. MsGamePrint ((DBG_VERBOSE, "%s: IRP_MJ_CLOSE\n", MSGAME_NAME));
  138. Irp->IoStatus.Information = 0;
  139. break;
  140. default:
  141. MsGamePrint ((DBG_SEVERE, "%s: Invalid CreateClose Parameter\n", MSGAME_NAME));
  142. ntStatus = STATUS_INVALID_PARAMETER;
  143. break;
  144. }
  145. //
  146. // Save Status for return and complete Irp
  147. //
  148. Irp->IoStatus.Status = ntStatus;
  149. IoCompleteRequest (Irp, IO_NO_INCREMENT);
  150. MsGamePrint ((DBG_INFORM, "%s: %s_CreateClose Exit = %x\n", MSGAME_NAME, MSGAME_NAME, ntStatus));
  151. return (ntStatus);
  152. }
  153. //---------------------------------------------------------------------------
  154. // @func Process the WMI system control IRPs
  155. // @parm PDEVICE_OBJECT | DeviceObject | Pointer to device object
  156. // @parm PIRP | pIrp | Pointer to IO request packet
  157. // @rdesc Returns NT status code
  158. // @comm Public function
  159. //---------------------------------------------------------------------------
  160. NTSTATUS MSGAME_SystemControl (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
  161. {
  162. NTSTATUS ntStatus = STATUS_SUCCESS;
  163. PAGED_CODE ();
  164. MsGamePrint ((DBG_INFORM, "%s: %s_SystemControl Enter\n", MSGAME_NAME, MSGAME_NAME));
  165. IoSkipCurrentIrpStackLocation (Irp);
  166. ntStatus = IoCallDriver (GET_NEXT_DEVICE_OBJECT(DeviceObject), Irp);
  167. MsGamePrint ((DBG_INFORM, "%s: %s_SystemControl Exit = %x\n", MSGAME_NAME, MSGAME_NAME, ntStatus));
  168. return (ntStatus);
  169. }
  170. //---------------------------------------------------------------------------
  171. // @func Processes the Pnp Add Device call
  172. // @parm PDRIVER_OBJECT | DriverObject | Pointer to driver object
  173. // @parm PDEVICE_OBJECT | DeviceObject | Pointer to device object
  174. // @rdesc Returns NT status code
  175. // @comm Public function
  176. //---------------------------------------------------------------------------
  177. NTSTATUS MSGAME_AddDevice (IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT DeviceObject)
  178. {
  179. NTSTATUS ntStatus = STATUS_SUCCESS;
  180. PDEVICE_EXTENSION pDevExt;
  181. PAGED_CODE ();
  182. MsGamePrint ((DBG_INFORM, "%s: %s_AddDevice Entry\n", MSGAME_NAME, MSGAME_NAME));
  183. //
  184. // Initialize the device extension
  185. //
  186. pDevExt = GET_MINIDRIVER_DEVICE_EXTENSION (DeviceObject);
  187. memset(pDevExt, 0, sizeof(DEVICE_EXTENSION));
  188. pDevExt->Driver = DriverObject;
  189. pDevExt->Self = DeviceObject;
  190. pDevExt->IrpCount = 1;
  191. pDevExt->Started = FALSE;
  192. pDevExt->Removed = FALSE;
  193. pDevExt->Surprised = FALSE;
  194. pDevExt->Removing = FALSE;
  195. pDevExt->TopOfStack = NULL;
  196. KeInitializeEvent (&pDevExt->StartEvent, NotificationEvent, FALSE);
  197. KeInitializeEvent (&pDevExt->RemoveEvent, SynchronizationEvent, FALSE);
  198. //
  199. // Clear device initialization flags
  200. //
  201. DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
  202. //
  203. // Attach our functional driver to the device stack. The return value of
  204. // IoAttachDeviceToDeviceStack is the top of the attachment chain. This
  205. // is where all the IRPs should be routed.
  206. //
  207. pDevExt->TopOfStack = GET_NEXT_DEVICE_OBJECT(DeviceObject);
  208. //
  209. // If this attachment fails then top of stack will be null. Failure
  210. // for attachment is an indication of a broken plug play system.
  211. //
  212. ASSERT (pDevExt->TopOfStack);
  213. //
  214. // Return status
  215. //
  216. MsGamePrint ((DBG_INFORM, "%s: %s_AddDevice Exit = %x\n", MSGAME_NAME, MSGAME_NAME, ntStatus));
  217. return (ntStatus);
  218. }
  219. //---------------------------------------------------------------------------
  220. // @func Processes the driver unload call
  221. // @parm PDRIVER_OBJECT | DriverObject | Pointer to driver object
  222. // @rdesc Returns NT status code
  223. // @comm Public function
  224. //---------------------------------------------------------------------------
  225. VOID MSGAME_Unload (IN PDRIVER_OBJECT DriverObject)
  226. {
  227. PAGED_CODE();
  228. MsGamePrint ((DBG_INFORM, "%s: %s_Unload Enter\n", MSGAME_NAME, MSGAME_NAME));
  229. //
  230. // All the device objects should be gone
  231. //
  232. ASSERT (!DriverObject->DeviceObject);
  233. //
  234. // Free the unicode strings.
  235. //
  236. ExFreePool (RegistryPath.Buffer);
  237. MsGamePrint ((DBG_CONTROL, "%s: %s_Unload Exit\n", MSGAME_NAME, MSGAME_NAME));
  238. }
  239. //---------------------------------------------------------------------------
  240. // @func Reads registry data for a named device
  241. // @parm PCHAR | DeviceName | Device name string
  242. // @parm PDEVICE_VALUES | DeviceValues | Device values structure to fill
  243. // @rdesc Returns nothing
  244. // @comm Public function
  245. //---------------------------------------------------------------------------
  246. VOID MSGAME_ReadRegistry (PCHAR DeviceName, PDEVICE_VALUES DeviceValues)
  247. {
  248. #define PARAMS_PLUS_ONE 13
  249. NTSTATUS ntStatus;
  250. ANSI_STRING AnsiName;
  251. UNICODE_STRING UnicodeName;
  252. UNICODE_STRING ParametersPath;
  253. PRTL_QUERY_REGISTRY_TABLE Parameters;
  254. MsGamePrint((DBG_INFORM,"%s: %s_ReadRegistry Enter\n", MSGAME_NAME, MSGAME_NAME));
  255. //
  256. // Initialize local variables
  257. //
  258. RtlInitAnsiString (&AnsiName, DeviceName);
  259. RtlInitUnicodeString (&UnicodeName, NULL);
  260. RtlInitUnicodeString (&ParametersPath, NULL);
  261. Parameters = ExAllocatePool (PagedPool, sizeof(RTL_QUERY_REGISTRY_TABLE) * PARAMS_PLUS_ONE);
  262. if (!Parameters)
  263. {
  264. MsGamePrint((DBG_CRITICAL, "%s: %s_ReadRegistry couldn't allocate Rtl query table for %ws\n", MSGAME_NAME, MSGAME_NAME, RegistryPath.Buffer));
  265. goto ReadRegistryExit;
  266. }
  267. RtlZeroMemory (Parameters, sizeof(RTL_QUERY_REGISTRY_TABLE) * PARAMS_PLUS_ONE);
  268. //
  269. // Form a path to this driver's Parameters subkey.
  270. //
  271. ParametersPath.MaximumLength = RegistryPath.Length + MAX_DEVICE_NAME;
  272. ParametersPath.Buffer = ExAllocatePool (PagedPool, ParametersPath.MaximumLength);
  273. if (!ParametersPath.Buffer)
  274. {
  275. MsGamePrint((DBG_CRITICAL, "%s: %s_ReadRegistry couldn't allocate path string for %ws\n", MSGAME_NAME, MSGAME_NAME, RegistryPath.Buffer));
  276. goto ReadRegistryExit;
  277. }
  278. //
  279. // Form the Parameters path.
  280. //
  281. RtlZeroMemory (ParametersPath.Buffer, ParametersPath.MaximumLength);
  282. RtlAppendUnicodeToString (&ParametersPath, RegistryPath.Buffer);
  283. RtlAppendUnicodeToString (&ParametersPath, L"\\");
  284. RtlAnsiStringToUnicodeString (&UnicodeName, &AnsiName, TRUE);
  285. RtlAppendUnicodeStringToString (&ParametersPath, &UnicodeName);
  286. RtlFreeUnicodeString (&UnicodeName);
  287. MsGamePrint((DBG_VERBOSE, "%s: %s_ReadRegistry path is %ws\n", MSGAME_NAME, MSGAME_NAME, ParametersPath.Buffer));
  288. //
  289. // Gather all device information from the registry.
  290. //
  291. Parameters[0].Flags = RTL_QUERY_REGISTRY_DIRECT;
  292. Parameters[0].Name = L"PacketStartTimeout";
  293. Parameters[0].EntryContext = &DeviceValues->PacketStartTimeout;
  294. Parameters[0].DefaultType = REG_DWORD;
  295. Parameters[0].DefaultData = &DeviceValues->PacketStartTimeout;
  296. Parameters[0].DefaultLength = sizeof(ULONG);
  297. Parameters[1].Flags = RTL_QUERY_REGISTRY_DIRECT;
  298. Parameters[1].Name = L"PacketLowHighTimeout";
  299. Parameters[1].EntryContext = &DeviceValues->PacketLowHighTimeout;
  300. Parameters[1].DefaultType = REG_DWORD;
  301. Parameters[1].DefaultData = &DeviceValues->PacketLowHighTimeout;
  302. Parameters[1].DefaultLength = sizeof(ULONG);
  303. Parameters[2].Flags = RTL_QUERY_REGISTRY_DIRECT;
  304. Parameters[2].Name = L"PacketHighLowTimeout";
  305. Parameters[2].EntryContext = &DeviceValues->PacketHighLowTimeout;
  306. Parameters[2].DefaultType = REG_DWORD;
  307. Parameters[2].DefaultData = &DeviceValues->PacketHighLowTimeout;
  308. Parameters[2].DefaultLength = sizeof(ULONG);
  309. Parameters[3].Flags = RTL_QUERY_REGISTRY_DIRECT;
  310. Parameters[3].Name = L"IdStartTimeout";
  311. Parameters[3].EntryContext = &DeviceValues->IdStartTimeout;
  312. Parameters[3].DefaultType = REG_DWORD;
  313. Parameters[3].DefaultData = &DeviceValues->IdStartTimeout;
  314. Parameters[3].DefaultLength = sizeof(ULONG);
  315. Parameters[4].Flags = RTL_QUERY_REGISTRY_DIRECT;
  316. Parameters[4].Name = L"IdLowHighTimeout";
  317. Parameters[4].EntryContext = &DeviceValues->IdLowHighTimeout;
  318. Parameters[4].DefaultType = REG_DWORD;
  319. Parameters[4].DefaultData = &DeviceValues->IdLowHighTimeout;
  320. Parameters[4].DefaultLength = sizeof(ULONG);
  321. Parameters[5].Flags = RTL_QUERY_REGISTRY_DIRECT;
  322. Parameters[5].Name = L"IdHighLowTimeout";
  323. Parameters[5].EntryContext = &DeviceValues->IdHighLowTimeout;
  324. Parameters[5].DefaultType = REG_DWORD;
  325. Parameters[5].DefaultData = &DeviceValues->IdHighLowTimeout;
  326. Parameters[5].DefaultLength = sizeof(ULONG);
  327. Parameters[6].Flags = RTL_QUERY_REGISTRY_DIRECT;
  328. Parameters[6].Name = L"InterruptDelay";
  329. Parameters[6].EntryContext = &DeviceValues->InterruptDelay;
  330. Parameters[6].DefaultType = REG_DWORD;
  331. Parameters[6].DefaultData = &DeviceValues->InterruptDelay;
  332. Parameters[6].DefaultLength = sizeof(ULONG);
  333. Parameters[7].Flags = RTL_QUERY_REGISTRY_DIRECT;
  334. Parameters[7].Name = L"MaxClockDutyCycle";
  335. Parameters[7].EntryContext = &DeviceValues->MaxClockDutyCycle;
  336. Parameters[7].DefaultType = REG_DWORD;
  337. Parameters[7].DefaultData = &DeviceValues->MaxClockDutyCycle;
  338. Parameters[7].DefaultLength = sizeof(ULONG);
  339. Parameters[8].Flags = RTL_QUERY_REGISTRY_DIRECT;
  340. Parameters[8].Name = L"StatusStartTimeout";
  341. Parameters[8].EntryContext = &DeviceValues->StatusStartTimeout;
  342. Parameters[8].DefaultType = REG_DWORD;
  343. Parameters[8].DefaultData = &DeviceValues->StatusStartTimeout;
  344. Parameters[8].DefaultLength = sizeof(ULONG);
  345. Parameters[9].Flags = RTL_QUERY_REGISTRY_DIRECT;
  346. Parameters[9].Name = L"StatusLowHighTimeout";
  347. Parameters[9].EntryContext = &DeviceValues->StatusLowHighTimeout;
  348. Parameters[9].DefaultType = REG_DWORD;
  349. Parameters[9].DefaultData = &DeviceValues->StatusLowHighTimeout;
  350. Parameters[9].DefaultLength = sizeof(ULONG);
  351. Parameters[10].Flags = RTL_QUERY_REGISTRY_DIRECT;
  352. Parameters[10].Name = L"StatusHighLowTimeout";
  353. Parameters[10].EntryContext = &DeviceValues->StatusHighLowTimeout;
  354. Parameters[10].DefaultType = REG_DWORD;
  355. Parameters[10].DefaultData = &DeviceValues->StatusHighLowTimeout;
  356. Parameters[10].DefaultLength = sizeof(ULONG);
  357. Parameters[11].Flags = RTL_QUERY_REGISTRY_DIRECT;
  358. Parameters[11].Name = L"StatusGateTimeout";
  359. Parameters[11].EntryContext = &DeviceValues->StatusGateTimeout;
  360. Parameters[11].DefaultType = REG_DWORD;
  361. Parameters[11].DefaultData = &DeviceValues->StatusGateTimeout;
  362. Parameters[11].DefaultLength = sizeof(ULONG);
  363. ntStatus = RtlQueryRegistryValues (RTL_REGISTRY_ABSOLUTE, ParametersPath.Buffer, Parameters, NULL, NULL);
  364. if (!NT_SUCCESS(ntStatus))
  365. {
  366. MsGamePrint((DBG_INFORM,"%s: %s_ReadRegistry RtlQueryRegistryValues failed with 0x%x\n", MSGAME_NAME, MSGAME_NAME, ntStatus));
  367. //
  368. // Create registry entries as needed
  369. //
  370. RtlWriteRegistryValue (RTL_REGISTRY_ABSOLUTE, ParametersPath.Buffer, L"PacketStartTimeout", REG_DWORD, &DeviceValues->PacketStartTimeout, sizeof (ULONG));
  371. RtlWriteRegistryValue (RTL_REGISTRY_ABSOLUTE, ParametersPath.Buffer, L"PacketLowHighTimeout", REG_DWORD, &DeviceValues->PacketLowHighTimeout, sizeof (ULONG));
  372. RtlWriteRegistryValue (RTL_REGISTRY_ABSOLUTE, ParametersPath.Buffer, L"PacketHighLowTimeout", REG_DWORD, &DeviceValues->PacketHighLowTimeout, sizeof (ULONG));
  373. RtlWriteRegistryValue (RTL_REGISTRY_ABSOLUTE, ParametersPath.Buffer, L"IdStartTimeout", REG_DWORD, &DeviceValues->IdStartTimeout, sizeof (ULONG));
  374. RtlWriteRegistryValue (RTL_REGISTRY_ABSOLUTE, ParametersPath.Buffer, L"IdLowHighTimeout", REG_DWORD, &DeviceValues->IdLowHighTimeout, sizeof (ULONG));
  375. RtlWriteRegistryValue (RTL_REGISTRY_ABSOLUTE, ParametersPath.Buffer, L"IdHighLowTimeout", REG_DWORD, &DeviceValues->IdHighLowTimeout, sizeof (ULONG));
  376. RtlWriteRegistryValue (RTL_REGISTRY_ABSOLUTE, ParametersPath.Buffer, L"InterruptDelay", REG_DWORD, &DeviceValues->InterruptDelay, sizeof (ULONG));
  377. RtlWriteRegistryValue (RTL_REGISTRY_ABSOLUTE, ParametersPath.Buffer, L"MaxClockDutyCycle", REG_DWORD, &DeviceValues->MaxClockDutyCycle, sizeof (ULONG));
  378. RtlWriteRegistryValue (RTL_REGISTRY_ABSOLUTE, ParametersPath.Buffer, L"StatusStartTimeout", REG_DWORD, &DeviceValues->StatusStartTimeout, sizeof (ULONG));
  379. RtlWriteRegistryValue (RTL_REGISTRY_ABSOLUTE, ParametersPath.Buffer, L"StatusLowHighTimeout", REG_DWORD, &DeviceValues->StatusLowHighTimeout, sizeof (ULONG));
  380. RtlWriteRegistryValue (RTL_REGISTRY_ABSOLUTE, ParametersPath.Buffer, L"StatusHighLowTimeout", REG_DWORD, &DeviceValues->StatusHighLowTimeout, sizeof (ULONG));
  381. RtlWriteRegistryValue (RTL_REGISTRY_ABSOLUTE, ParametersPath.Buffer, L"StatusGateTimeout", REG_DWORD, &DeviceValues->StatusGateTimeout, sizeof (ULONG));
  382. }
  383. // -----------------
  384. ReadRegistryExit:
  385. // -----------------
  386. if (ParametersPath.Buffer)
  387. ExFreePool(ParametersPath.Buffer);
  388. if (Parameters)
  389. ExFreePool(Parameters);
  390. #undef PARAMS_PLUS_ONE
  391. }
  392. //---------------------------------------------------------------------------
  393. // @func Posts a transaction to hooking driver
  394. // @parm PPACKETINFO | PacketInfo | Device packet info struct
  395. // @rdesc None
  396. // @comm Public function
  397. //---------------------------------------------------------------------------
  398. VOID MSGAME_PostTransaction (PPACKETINFO PacketInfo)
  399. {
  400. //
  401. // Not Implemented
  402. //
  403. }