in reply to Re: OID Power Status Query
in thread OID Power Status Query
On the plus side, I was able to track down some stuff yesterday afternoon. After my original posting, I was thinking that the hardcoded use of IOCTL_NDIS_QUERY_GLOBAL_STATS may be the problem. I ran across some other possibilities that could be used, here:
I couldn't make much sense of the CTL_CODE macro, but found documentation on it here, and found a freeBSD implementation of it at this link:// // NtDeviceIoControlFile IoControlCode values for this device. // // Warning: Remember that the low two bits of the code specify how the // buffers are passed to the driver! // #define _NDIS_CONTROL_CODE(request,method) \ CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD, request, method, FI +LE_ANY_ACCESS) #define IOCTL_NDIS_QUERY_GLOBAL_STATS _NDIS_CONTROL_CODE(0, METHOD_O +UT_DIRECT) #define IOCTL_NDIS_QUERY_ALL_STATS _NDIS_CONTROL_CODE(1, METHOD_O +UT_DIRECT) #define IOCTL_NDIS_DO_PNP_OPERATION _NDIS_CONTROL_CODE(2, METHOD_B +UFFERED) #define IOCTL_NDIS_QUERY_SELECTED_STATS _NDIS_CONTROL_CODE(3, METHOD_O +UT_DIRECT) #define IOCTL_NDIS_ENUMERATE_INTERFACES _NDIS_CONTROL_CODE(4, METHOD_B +UFFERED) #define IOCTL_NDIS_ADD_TDI_DEVICE _NDIS_CONTROL_CODE(5, METHOD_B +UFFERED) #define IOCTL_NDIS_GET_LOG_DATA _NDIS_CONTROL_CODE(7, METHOD_O +UT_DIRECT) #define IOCTL_NDIS_GET_VERSION _NDIS_CONTROL_CODE(8, METHOD_O +UT_DIRECT)
Using any of these didn't help me any towards a solution (although you may have to deal with the METHOD_BUFFERED differently), and that's as far as I've gotten so far.#define CTL_CODE(devType, func, meth, acc) (((devType) << 16) | ((acc) + << 14) | ((func) << 2) | (meth))
Also, thanks for the DBD::WMI code! Alas, I'm constrained to only using modules distributed via activestate, and this isn't one of them. I actually asked for some help on solving this issue last November, but got nowhere.
Any other thoughts, or pointers are welcome!
-Craig
|
|---|