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.

166 lines
4.0 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. wmi.c
  5. Abstract:
  6. WMI entry points for ARP1394.
  7. Revision History:
  8. Who When What
  9. -------- -------- ----------------------------------------------
  10. josephj 11-23-98 Created
  11. Notes:
  12. --*/
  13. #include <precomp.h>
  14. //
  15. // File-specific debugging defaults.
  16. //
  17. #define TM_CURRENT TM_WMI
  18. NTSTATUS
  19. ArpWmiDispatch(
  20. IN PDEVICE_OBJECT pDeviceObject,
  21. IN PIRP pIrp
  22. )
  23. /*++
  24. Routine Description:
  25. System dispatch function for handling IRP_MJ_SYSTEM_CONTROL IRPs from WMI.
  26. Arguments:
  27. pDeviceObject - Pointer to device object. The device extension field
  28. contains a pointer to the Interface
  29. pIrp - Pointer to IRP.
  30. Return Value:
  31. NT status code.
  32. --*/
  33. {
  34. PIO_STACK_LOCATION pIrpSp = IoGetCurrentIrpStackLocation(pIrp);
  35. PVOID DataPath = pIrpSp->Parameters.WMI.DataPath;
  36. ULONG BufferSize = pIrpSp->Parameters.WMI.BufferSize;
  37. PVOID pBuffer = pIrpSp->Parameters.WMI.Buffer;
  38. NTSTATUS Status = STATUS_UNSUCCESSFUL;
  39. ULONG ReturnSize;
  40. ENTER("WmiDispatch", 0x9141e00e)
  41. #if 0
  42. PATMARP_INTERFACE pInterface;
  43. pInterface = AA_PDO_TO_INTERFACE(pDeviceObject);
  44. AA_STRUCT_ASSERT(pInterface, aai);
  45. ReturnSize = 0;
  46. switch (pIrpSp->MinorFunction)
  47. {
  48. case IRP_MN_REGINFO:
  49. Status = AtmArpWmiRegister(
  50. pInterface,
  51. PtrToUlong(DataPath),
  52. pBuffer,
  53. BufferSize,
  54. &ReturnSize
  55. );
  56. break;
  57. case IRP_MN_QUERY_ALL_DATA:
  58. Status = AtmArpWmiQueryAllData(
  59. pInterface,
  60. (LPGUID)DataPath,
  61. (PWNODE_ALL_DATA)pBuffer,
  62. BufferSize,
  63. &ReturnSize
  64. );
  65. break;
  66. case IRP_MN_QUERY_SINGLE_INSTANCE:
  67. Status = AtmArpWmiQuerySingleInstance(
  68. pInterface,
  69. pBuffer,
  70. BufferSize,
  71. &ReturnSize
  72. );
  73. break;
  74. case IRP_MN_CHANGE_SINGLE_INSTANCE:
  75. Status = AtmArpWmiChangeSingleInstance(
  76. pInterface,
  77. pBuffer,
  78. BufferSize,
  79. &ReturnSize
  80. );
  81. break;
  82. case IRP_MN_CHANGE_SINGLE_ITEM:
  83. Status = AtmArpWmiChangeSingleItem(
  84. pInterface,
  85. pBuffer,
  86. BufferSize,
  87. &ReturnSize
  88. );
  89. break;
  90. case IRP_MN_ENABLE_EVENTS:
  91. Status = AtmArpWmiSetEventStatus(
  92. pInterface,
  93. (LPGUID)DataPath,
  94. TRUE // Enable
  95. );
  96. break;
  97. case IRP_MN_DISABLE_EVENTS:
  98. Status = AtmArpWmiSetEventStatus(
  99. pInterface,
  100. (LPGUID)DataPath,
  101. FALSE // Disable
  102. );
  103. break;
  104. case IRP_MN_ENABLE_COLLECTION:
  105. case IRP_MN_DISABLE_COLLECTION:
  106. default:
  107. Status = STATUS_INVALID_DEVICE_REQUEST;
  108. break;
  109. }
  110. pIrp->IoStatus.Status = Status;
  111. pIrp->IoStatus.Information = (NT_SUCCESS(Status) ? ReturnSize: 0);
  112. AADEBUGP(AAD_INFO,
  113. ("WmiDispatch done: IF x%p, MinorFn %d, Status x%p, ReturnInfo %d\n",
  114. pInterface, pIrpSp->MinorFunction, Status, pIrp->IoStatus.Information));
  115. IoCompleteRequest(pIrp, IO_NO_INCREMENT);
  116. #endif // 0
  117. EXIT()
  118. return (Status);
  119. }