ReactOS 0.4.15-dev-7788-g1ad9096
fxdeviceapium.cpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxDeviceApiUm.cpp
8
9Abstract:
10
11 This module exposes the "C" interface to the FxDevice object.
12
13Author:
14
15
16Environment:
17
18 user mode only
19
20Revision History:
21
22--*/
23
24#include "coreprivshared.hpp"
25#include "fxiotarget.hpp"
26#include <intsafe.h>
27
28extern "C" {
29#include "FxDeviceApiUm.tmh"
30}
31
32//
33// extern "C" the entire file
34//
35extern "C" {
36
37//
38// Verifier Functions
39//
40// Do not specify argument names
45 _In_ MdIrp,
48 );
49
53WDFEXPORT(WdfDevicePostEvent)(
55 _In_ WDFDEVICE Device,
60 )
61/*++
62
63Routine Description:
64
65 This method asynchronously notifies applications that are waiting for the
66 specified event from a driver.
67
68Arguments:
69 Device - WDF Device handle.
70
71 EventGuid: The GUID for the event. The GUID is determined by the application
72 and the driver and is opaque to the framework.
73
74 EventType: A WDF_EVENT_TYPE-typed value that identifies the type of
75 event. In the current version of UMDF, the driver must set EventType
76 to WdfEventBroadcast (1). WdfEventBroadcast indicates that the event
77 is broadcast. Applications can subscribe to WdfEventBroadcast-type
78 events. To receive broadcast events, the application must register
79 for notification through the Microsoft Win32
80 RegisterDeviceNotification function. WdfEventBroadcast-type events
81 are exposed as DBT_CUSTOMEVENT-type events to applications.
82
83 Data: A pointer to a buffer that contains data that is associated with the
84 event. NULL is a valid value.
85
86 DataSizeCb : The size, in bytes, of data that Data points to. Zero is a
87 valid size value if Data is set to NULL.
88
89Return Value:
90 An NTSTATUS value that denotes success or failure of the DDI
91
92--*/
93{
94 DDI_ENTRY();
95
100
101 //
102 // Validate the Device object handle and get its FxDevice. Also get the
103 // driver globals pointer.
104 //
106 Device,
108 (PVOID *) &pDevice,
110
111 if (DataSizeCb > 0) {
113 }
114
115 //
116 // Currently only broadcast events are supported.
117 //
118 if (WdfEventType != WdfEventBroadcast) {
122 "WDFDEVICE 0x%p WdfEventType %d not expected %!STATUS!",
125 return status;
126 }
127
128 //
129 // post the event
130 //
131 hr = pDevice->GetDeviceStack()->PostEvent(EventGuid,
133 Data,
134 DataSizeCb);
135
136 if (FAILED(hr)) {
140 "WDFDEVICE 0x%p Failed to post event %!STATUS!",
141 Device, status);
142 }
143 else {
145 }
146
147 return status;
148}
149
152WDFAPI
154WDFEXPORT(WdfDeviceMapIoSpace)(
155 _In_
157 _In_
158 WDFDEVICE Device,
159 _In_
161 _In_
163 _In_
165 _Out_
167 )
168/*++
169
170Routine Description:
171
172 This routine maps given physical address of a device register into
173 system address space and optionally into user-mode address space.
174
175Arguments:
176
177 DriverGlobals - DriverGlobals pointer
178
179 Device - WDF Device handle.
180
181 PhysicalAddress - Address of MMIO register to be mapped
182
183 NumberOfBytes - Length of resource to be mapped in bytes.
184
185 CacheType - supplies type of caching desired
186
187 PseudoBaseAddress - Pseudo base address (opaque base address) of the
188 mapped resource.
189
190Return Value:
191
192 HRESULT
193
194--*/
195{
196 DDI_ENTRY();
197
202 HRESULT hr;
203
204 //
205 // Validate the Device object handle and get its FxDevice. Also get the
206 // driver globals pointer.
207 //
209 Device,
211 (PVOID *) &pDevice,
213
214 //
215 // Is direct hardware access allowed?
216 //
217 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO),
220 DriverGlobals->DriverName);
221
222 //
223 // Validate input parameters.
224 //
225 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK_NOT_NULL(PhysicalAddress.QuadPart),
226 DriverGlobals->DriverName);
227 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK("NumberOfBytes should be > 0",
228 (NumberOfBytes > 0)), DriverGlobals->DriverName);
229 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK("CacheType incorrect",
232 DriverGlobals->DriverName);
233 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK_NOT_NULL(PseudoBaseAddress),
234 DriverGlobals->DriverName);
235
240 CacheType,
242 if (FAILED(hr)) {
244 }
245 else {
247 }
248
249 return status;
250}
251
253WDFAPI
254VOID
255WDFEXPORT(WdfDeviceUnmapIoSpace)(
256 _In_
258 _In_
259 WDFDEVICE Device,
260 _In_
262 _In_
264 )
265/*++
266
267Routine Description:
268
269 This routine unmaps a previously mapped register resource.
270
271Arguments:
272 DriverGlobals - DriverGlobals pointer
273
274 Device - WDF Device handle.
275
276 PseudoBaseAddress - Address to be unmapped
277
278 NumberOfBytes - Length of resource to be mapped in bytes.
279
280Return Value:
281
282 VOID
283
284--*/
285{
286 DDI_ENTRY();
287
288 IWudfDeviceStack *deviceStack;
289 HRESULT hr;
294
295 //
296 // Validate the Device object handle and get its FxDevice. Also get the
297 // driver globals pointer.
298 //
300 Device,
302 (PVOID *) &pDevice,
304
305 //
306 // Is direct hardware access allowed?
307 //
308 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO),
311 DriverGlobals->DriverName);
312
313 //
314 // Validate input parameters.
315 //
316 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK_NOT_NULL(PseudoBaseAddress),
317 DriverGlobals->DriverName);
318 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK("NumberOfBytes should be > 0",
319 (NumberOfBytes > 0)), DriverGlobals->DriverName);
320 //
321 // Get system address.
322 //
324
325 //
326 // Validate that caller has given correct base address and length, and if
327 // so clear the mapping from resource table
328 //
332
333 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK("Driver attempted to unmap "
334 "incorrect register address, or provided incorrect size",
335 SUCCEEDED(hr)), DriverGlobals->DriverName);
336
337 //
338 // call host
339 //
342
344 }
345
346 return;
347}
348
350WDFAPI
351PVOID
352WDFEXPORT(WdfDeviceGetHardwareRegisterMappedAddress)(
353 _In_
355 _In_
356 WDFDEVICE Device,
357 _In_
359 )
360/*++
361
362Routine Description:
363
364 This routine returns user-mode base address where registers corresponing
365 to supplied pseudo base address have been mapped..
366
367Arguments:
368 DriverGlobals - DriverGlobals pointer
369
370 Device - WDF Device handle.
371
372 PseudoBaseAddress - Pseudo base address for which the caller needs to get
373 user-mode mapped address.
374
375Return Value:
376
377 User-mode mapped base address.
378
379--*/
380{
381 DDI_ENTRY();
382
383 HRESULT hr;
389
390 //
391 // Validate the Device object handle and get its FxDevice. Also get the
392 // driver globals pointer.
393 //
395 Device,
397 (PVOID *) &pDevice,
399
400 //
401 // Is direct hardware access allowed?
402 //
403 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO),
406 DriverGlobals->DriverName);
407
408 //
409 // Is user-mode mapping of registers enabled
410 //
411 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK("Incorrect register access mode."
412 " Register mapping to user-mode is not enabled. Set the INF directive"
413 " UmdfRegisterAccessMode to RegisterAccessUsingUserModeMapping"
414 " in driver's INF file to enable Register mapping to user-mode",
416
417 //
418 // Validate input parameters.
419 //
420 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK_NOT_NULL(PseudoBaseAddress),
421 DriverGlobals->DriverName);
422
423 //
424 // check if this base address is valid.
425 //
429
432
433 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK("Driver provided incorrect base "
434 "address", SUCCEEDED(hr)), DriverGlobals->DriverName);
435
436 return usermodeBaseAddress;
437}
438
440SIZE_T
441WDFAPI
442WDFEXPORT(WdfDeviceReadFromHardware)(
443 _In_
445 _In_
446 WDFDEVICE Device,
447 _In_
448 WDF_DEVICE_HWACCESS_TARGET_TYPE Type,
449 _In_
450 WDF_DEVICE_HWACCESS_TARGET_SIZE Size,
451 _In_
457 )
458/*++
459
460Routine Description:
461
462 This routine does read from a device port or register.
463
464Arguments:
465 DriverGlobals - DriverGlobals pointer
466
467 Device - WDF Device handle.
468
469 Type - Specified whether it is port or register
470
471 Size - Supplies size of read in bytes.
472
473 TargetAddress - Supplies address of port or register to read from
474
475 Buffer - Supplies optionally a buffer to receive the read data
476
477 Count - Size of buffer in bytes
478
479Return Value:
480
481 Returns the read value if it is non-buffered port or register.
482 Otherwise zero.
483
484--*/
485{
486 DDI_ENTRY();
487
490 HRESULT hr = S_OK;
495
496 //
497 // ETW event for perf measurement
498 //
500
501 //
502 // Validate the Device object handle and get its FxDevice. Also get the
503 // driver globals pointer.
504 //
506 Device,
508 (PVOID *) &pDevice,
510
511 //
512 // See if direct hwaccess is allowed
513 //
514 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO),
517 DriverGlobals->DriverName);
518
519 //
520 // validate parameters
521 //
522 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO),
523 CHECK("Incorrect Type parameter",
524 (Type > WdfDeviceHwAccessTargetTypeInvalid &&
525 Type < WdfDeviceHwAccessTargetTypeMaximum)),
526 DriverGlobals->DriverName);
527
528 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO),
529 CHECK("Incorrect Size parameter",
530 (Size > WdfDeviceHwAccessTargetSizeInvalid &&
531 Size < WdfDeviceHwAccessTargetSizeMaximum)),
532 DriverGlobals->DriverName);
533
534 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK_NOT_NULL(TargetAddress),
535 DriverGlobals->DriverName);
536
538 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK_NOT_NULL(Buffer), DriverGlobals->DriverName);
539 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK("Count should be > 0", (Count > 0)),
540 DriverGlobals->DriverName);
541 }
542 else {
543 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK_NULL(Buffer), DriverGlobals->DriverName);
544 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK("Count should be 0", (Count == 0)),
545 DriverGlobals->DriverName);
546 }
547
548#if !defined(_WIN64)
549 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK("ULONG64 write is allowed only"
550 "on 64-bit platform", (Size != WdfDeviceHwAccessTargetSizeUlong64)),
551 DriverGlobals->DriverName);
552#endif
553
554 //
555 // get system address from pseudo address for registers
556 //
557 if (pDevice->IsRegister(Type)){
559 }
560
562
563 //
564 // For buffer access for registers, compute the length of buffer using Count.
565 // Count is the element count in the buffer (of UCHAR/USHORT/ULONG/ULONG64).
566 // Note that Port is accessed differently than registers - the buffer is
567 // written into the port address of specified size (UCHAR/USHORT/ULONG).
568 //
570 size_t tmp;
571
572 hr = SizeTMult(Count, length, &tmp);
573 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK("Integer overflow occurred "
574 "when computing length of read access", (SUCCEEDED(hr))),
575 DriverGlobals->DriverName);
576
577 length = tmp;
578 }
579
581
582 //
583 // Port access is always handled through system call.
584 // Register access can be handled in usermode if driver enabled
585 // mapping registers to usermode.
586 //
588 PVOID umAddress = NULL;
589
590 //
591 // Acquire the resource validation table lock for read/write as well
592 // since a driver's thread accessing hardware register/port and
593 // race with Map/Unmap operations.
594 //
596
598 length,
599 &umAddress);
600
601 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO),
602 CHECK("Driver attempted to read from invalid register address or "
603 "address range", (SUCCEEDED(hr))),
604 DriverGlobals->DriverName);
605
606 if (pDevice->IsBufferType(Type)) {
608 }
609 else {
610 value = pDevice->ReadRegister(Size, umAddress);
611 }
612
614 }
615 else {
616 //
617 // Registers are not mapped to user-mode address space so send
618 // message to reflector to use system HAL routines to access register.
619 // Acquire validation table lock here as well since some read/write
620 // thread might race with PrepareHardware/ReleaseHardware that may be
621 // building/deleting the table.
622 //
623 IWudfDeviceStack *deviceStack;
624
626
627 if (pDevice->IsRegister(Type)) {
629 length,
630 NULL);
631 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO),
632 CHECK("Driver attempted to read from invalid register address "
633 "or address range", (SUCCEEDED(hr))),
634 DriverGlobals->DriverName);
635 }
636 else {
638 length);
639 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO),
640 CHECK("Driver attempted to read from invalid port address or "
641 "address range", (SUCCEEDED(hr))),
642 DriverGlobals->DriverName);
643 }
644
646
648 deviceStack->ReadFromHardware((UMINT::WDF_DEVICE_HWACCESS_TARGET_TYPE)Type,
649 (UMINT::WDF_DEVICE_HWACCESS_TARGET_SIZE)Size,
651 &value,
652 Buffer,
653 Count);
654 }
655
656 //
657 // ETW event for perf measurement
658 //
660
661 return value;
662}
663
665VOID
666WDFAPI
667WDFEXPORT(WdfDeviceWriteToHardware)(
668 _In_
670 _In_
671 WDFDEVICE Device,
672 _In_
673 WDF_DEVICE_HWACCESS_TARGET_TYPE Type,
674 _In_
675 WDF_DEVICE_HWACCESS_TARGET_SIZE Size,
676 _In_
678 _In_
684 )
685/*++
686
687Routine Description:
688
689 This routine does writes to a device port or register.
690
691Arguments:
692 DriverGlobals - DriverGlobals pointer
693
694 Device - WDF Device handle.
695
696 Type - Specified whether it is port or register
697
698 Size - Supplies size of read in bytes.
699
700 TargetAddress - Supplies address of port or register to read from
701
702 Value - value to write
703
704 Buffer - Supplies optionally a buffer that has data that needs to be
705 written.
706
707 Count - Size of buffer in bytes
708
709Return Value:
710
711 void
712
713--*/
714{
715 DDI_ENTRY();
716
719 HRESULT hr = S_OK;
720 SIZE_T length = 0;
723
724 //
725 // ETW event for perf measurement
726 //
728
729 //
730 // Validate the Device object handle and get its FxDevice. Also get the
731 // driver globals pointer.
732 //
734 Device,
736 (PVOID *) &pDevice,
738
739 //
740 // See if direct hwaccess is allowed
741 //
742 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO),
745 DriverGlobals->DriverName);
746
747 //
748 // validate parameters
749 //
750 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO),
751 CHECK("Incorrect Type parameter",
752 (Type > WdfDeviceHwAccessTargetTypeInvalid &&
753 Type < WdfDeviceHwAccessTargetTypeMaximum)),
754 DriverGlobals->DriverName);
755
756 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO),
757 CHECK("Incorrect Size parameter",
758 (Size > WdfDeviceHwAccessTargetSizeInvalid &&
759 Size < WdfDeviceHwAccessTargetSizeMaximum)),
760 DriverGlobals->DriverName);
761
762 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK_NOT_NULL(TargetAddress),
763 DriverGlobals->DriverName);
764
765 if (pDevice->IsBufferType(Type)) {
766 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK_NOT_NULL(Buffer),
767 DriverGlobals->DriverName);
768 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK("Count should be > 0", (Count > 0)),
769 DriverGlobals->DriverName);
770 }
771 else {
772 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK_NULL(Buffer), DriverGlobals->DriverName);
773 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK("Count should be 0", (Count == 0)),
774 DriverGlobals->DriverName);
775 }
776
777#if !defined(_WIN64)
778 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK("ULONG64 write is allowed only"
779 "on 64-bit platform", (Size != WdfDeviceHwAccessTargetSizeUlong64)),
780 DriverGlobals->DriverName);
781#endif
782
783 //
784 // get system address from pseudo address for registers
785 //
786 if (pDevice->IsRegister(Type)){
788 }
789
791
792 //
793 // For buffer access for registers, compute the length of buffer using Count.
794 // Count is the element count in the buffer (of UCHAR/USHORT/ULONG/ULONG64).
795 // Note that Port is accessed differently than registers - the buffer is
796 // written into the port address of specified size (UCHAR/USHORT/ULONG).
797 //
799 size_t tmp;
800
801 hr = SizeTMult(Count, length, &tmp);
802 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK("Integer overflow occurred "
803 "when computing length of write access", (SUCCEEDED(hr))),
804 DriverGlobals->DriverName);
805
806 length = tmp;
807 }
808
810
811 //
812 // Port access is always handled through system call.
813 // Register access can be handled in usermode if driver enabled
814 // mapping registers to usermode.
815 //
817 PVOID umAddress = NULL;
818
819 //
820 // Acquire the resource validation table lock for read/write as well
821 // since a driver's thread accessing hardware register/port and
822 // race with Map/Unmap operations.
823 //
825
826
828 length,
829 &umAddress);
830
831 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO),
832 CHECK("Driver attempted to write to invalid register address or "
833 "address range", (SUCCEEDED(hr))),
834 DriverGlobals->DriverName);
835
836 if (pDevice->IsBufferType(Type)) {
838 }
839 else {
840 pDevice->WriteRegister(Size, umAddress, Value);
841 }
842
844 }
845 else {
846 //
847 // Registers are not mapped to user-mode address space so send
848 // message to reflector to use system HAL routines to access register.
849 // Acquire validation table lock here as well since some read/write
850 // thread might race with PrepareHardware/ReleaseHardware that may be
851 // building/deleting the table.
852 //
853 IWudfDeviceStack *deviceStack;
854
856
857 if (pDevice->IsRegister(Type)) {
859 length,
860 NULL);
861 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO),
862 CHECK("Driver attempted to write to invalid register address "
863 "or address range", (SUCCEEDED(hr))),
864 DriverGlobals->DriverName);
865
866 }
867 else {
869 length);
870 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO),
871 CHECK("Driver attempted to write to invalid port address or "
872 "address range", (SUCCEEDED(hr))),
873 DriverGlobals->DriverName);
874 }
875
877
879 deviceStack->WriteToHardware((UMINT::WDF_DEVICE_HWACCESS_TARGET_TYPE)Type,
880 (UMINT::WDF_DEVICE_HWACCESS_TARGET_SIZE)Size,
882 Value,
883 Buffer,
884 Count);
885 }
886
887 //
888 // ETW event for perf measurement
889 //
891
892 return;
893}
894
896WDFAPI
898WDFEXPORT(WdfDeviceAssignInterfaceProperty) (
899 _In_
901 _In_
902 WDFDEVICE Device,
903 _In_
904 PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData,
905 _In_
907 _In_
911 )
912/*++
913
914Routine Description:
915
916 This routine assigns interface property.
917
918Arguments:
919
920 DriverGlobals - DriverGlobals pointer
921
922 Device - WDF Device handle.
923
924 PropertyData - A pointer to WDF_DEVICE_INTERFACE_PROPERTY_ DATA structure.
925
926 Type - Set this parameter to the DEVPROPTYPE value that specifies the type
927 of the data that is supplied in the Data buffer.
928
929 BufferLength - Specifies the length, in bytes, of the buffer that
930 PropertyBuffer points to.
931
932 PropertyBuffer - optional, A pointer to the device interface property data.
933 Set this parameter to NULL to delete the specified property.
934
935Return Value:
936
937 Mthod returns an NTSTATUS value. This routine might return one of the
938 following values. It might return other NTSTATUS-codes as well.
939
940 STATUS_SUCCESS - The operation succeeded.
941 STATUS_INVALID_PARAMETER - One of the parameters is incorrect.
942
943--*/
944{
945 DDI_ENTRY();
946
950
951 //
952 // Validate the Device object handle and get its FxDevice. Also get the
953 // driver globals pointer.
954 //
956 Device,
958 (PVOID *) &pDevice,
960
961 //
962 // Validate PropertyData
963 //
966 return status;
967 }
968
972 "Property buffer size is zero, while the buffer is non-NULL"
973 ", %!STATUS!", status);
974 return status;
975 }
976
979 Type,
982 );
983 return status;
984}
985
987WDFAPI
989WDFEXPORT(WdfDeviceAllocAndQueryInterfaceProperty) (
990 _In_
992 _In_
993 WDFDEVICE Device,
994 _In_
995 PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData,
996 _In_
1000 _Out_
1001 WDFMEMORY* PropertyMemory,
1002 _Out_
1004 )
1005/*++
1006
1007Routine Description:
1008
1009 This routine queries interface property.
1010
1011Arguments:
1012
1013 DriverGlobals - DriverGlobals pointer
1014
1015 Device - WDF Device handle.
1016
1017 PropertyData - A pointer to WDF_DEVICE_INTERFACE_PROPERTY_ DATA structure.
1018
1019 PoolType - A POOL_TYPE-typed enumerator that specifies the type of memory
1020 to be allocated.
1021
1022 PropertyMemoryAttributes - optional, A pointer to a caller-allocated
1023 WDF_OBJECT_ATTRIBUTES structure that describes object attributes
1024 for the memory object that the function will allocate. This
1025 parameter is optional and can be WDF_NO_OBJECT_ATTRIBUTES.
1026
1027 PropertyMemory - A pointer to a WDFMEMORY-typed location that receives a
1028 handle to a framework memory object.
1029
1030 Type - A pointer to a DEVPROPTYPE variable. If method successfully retrieves
1031 the property data, the routine writes the property type value to
1032 this variable. This value indicates the type of property data
1033 that is in the Data buffer.
1034
1035
1036Return Value:
1037
1038 Method returns an NTSTATUS value. This routine might return one of the
1039 following values. It might return other NTSTATUS-codes as well.
1040
1041 STATUS_SUCCESS The operation succeeded.
1042 STATUS_INVALID_PARAMETER One of the parameters is incorrect.
1043
1044--*/
1045{
1046 DDI_ENTRY();
1047
1051
1053 Device,
1055 (PVOID *) &pDevice,
1057
1058 //
1059 // Validate PropertyData
1060 //
1062 if (!NT_SUCCESS(status)) {
1063 return status;
1064 }
1065
1068
1070
1072 if (!NT_SUCCESS(status)) {
1073 return status;
1074 }
1075
1077 if (!NT_SUCCESS(status)) {
1078 return status;
1079 }
1080
1082 NULL,
1083 pDevice,
1086 PoolType,
1089 Type);
1090 return status;
1091}
1092
1093
1095WDFAPI
1097WDFEXPORT(WdfDeviceQueryInterfaceProperty) (
1098 _In_
1100 _In_
1101 WDFDEVICE Device,
1102 _In_
1103 PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData,
1104 _In_
1106 _Out_
1108 _Out_
1110 _Out_
1112 )
1113/*++
1114
1115Routine Description:
1116
1117 This routine queries interface property.
1118
1119Arguments:
1120
1121 DriverGlobals - DriverGlobals pointer
1122
1123 Device - WDF Device handle.
1124
1125 PropertyData - A pointer to WDF_DEVICE_INTERFACE_PROPERTY_ DATA structure.
1126
1127 BufferLength - The size, in bytes, of the buffer that is pointed to by
1128 PropertyBuffer.
1129
1130 PropertyBuffer - A caller-supplied pointer to a caller-allocated buffer that
1131 receives the requested information. The pointer can be NULL
1132 if the BufferLength parameter is zero.
1133
1134 ResultLength - A caller-supplied location that, on return, contains the
1135 size, in bytes, of the information that the method stored in
1136 PropertyBuffer. If the function's return value is
1137 STATUS_BUFFER_TOO_SMALL, this location receives the required
1138 buffer size.
1139
1140 Type - A pointer to a DEVPROPTYPE variable. If method successfully retrieves
1141 the property data, the routine writes the property type value
1142 to this variable. This value indicates the type of property
1143 data that is in the Data buffer.
1144
1145Return Value:
1146
1147 Method returns an NTSTATUS value. This routine might return one of the
1148 following values.
1149
1150 STATUS_BUFFER_TOO_SMALL - The supplied buffer is too small to receive the
1151 information. The ResultLength member receives the
1152 size of buffer required.
1153 STATUS_SUCCESS - The operation succeeded.
1154 STATUS_INVALID_PARAMETER - One of the parameters is incorrect.
1155
1156 The method might return other NTSTATUS values.
1157
1158--*/
1159{
1160 DDI_ENTRY();
1161
1165
1167 Device,
1169 (PVOID *) &pDevice,
1171
1172 //
1173 // Validate PropertyData
1174 //
1176 if (!NT_SUCCESS(status)) {
1177 return status;
1178 }
1179
1182
1186 "Property buffer size is non-zero, while the buffer is NULL"
1187 ", %!STATUS!", status);
1188 return status;
1189 }
1190
1191 if (BufferLength == 0 && PropertyBuffer != NULL) {
1194 "Property buffer size is zero, while the buffer is non-NULL"
1195 ", %!STATUS!", status);
1196 return status;
1197 }
1198
1200 NULL,
1201 pDevice,
1207 PropertyType);
1208 return status;
1209}
1210
1212WDFAPI
1213VOID
1214WDFEXPORT(WdfDeviceGetDeviceStackIoType) (
1215 _In_
1217 _In_
1218 WDFDEVICE Device,
1219 _Out_
1221 _Out_
1223 )
1224{
1225 DDI_ENTRY();
1226
1229
1231 Device,
1233 (PVOID *) &pDevice,
1235
1238
1242 );
1243}
1244
1248WDFEXPORT(WdfDeviceHidNotifyPresence)(
1249 _In_
1251 _In_
1252 WDFDEVICE Device,
1253 _In_
1255 )
1256{
1257 DDI_ENTRY();
1258
1260 HRESULT hr;
1262 IWudfDeviceStack* pDevStack;
1264
1266 Device,
1268 (PVOID *)&pDevice,
1270
1272
1273 hr = pDevStack->HidNotifyPresence(IsPresent);
1275 if (!NT_SUCCESS(status)) {
1277 "HidNotifyPresence(%s) failed, %!STATUS! - Make sure to call "
1278 "WdfDeviceInitEnableHidInterface in EvtDriverDeviceAdd "
1279 "before calling WdfDeviceHidNotifyPresence.",
1280 IsPresent ? "TRUE" : "FALSE", status);
1281 }
1282
1283 return status;
1284}
1285
1287WDFFILEOBJECT
1288WDFEXPORT(WdfDeviceGetFileObject)(
1289 __in
1291 __in
1292 WDFDEVICE Device,
1293 __in
1295 )
1296/*++
1297
1298Routine Description:
1299
1300 This functions returns the WDFFILEOBJECT corresponding to the WDM fileobject.
1301
1302Arguments:
1303
1304 Device - Handle to the device to which the WDM fileobject is related to.
1305
1306 FileObject - WDM FILE_OBJECT structure.
1307
1308Return Value:
1309
1310--*/
1311
1312{
1315
1316 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO),
1317 TRAPMSG("The DDI WdfDeviceGetFileObject is not supported for UMDF"),
1318 DriverGlobals->DriverName);
1319
1320 return NULL;
1321}
1322
1326WDFEXPORT(WdfDeviceWdmDispatchIrpToIoQueue)(
1327 __in
1329 __in
1330 WDFDEVICE Device,
1331 __in
1333 __in
1334 WDFQUEUE Queue,
1335 __in
1337 )
1338{
1343
1345 Device,
1347 (PVOID *) &pDevice,
1349
1351 Queue,
1353 (PVOID*)&pQueue);
1354
1356
1358
1359 //
1360 // Unlike in KMDF, It's not possible for UMDF to forward to a parent queue.
1361 //
1363
1365 pDevice,
1366 Irp,
1367 pQueue,
1368 Flags);
1369 if (!NT_SUCCESS(status)) {
1370
1372 fxIrp.SetInformation(0x0);
1374
1375 return status;
1376 }
1377
1378 //
1379 // DispatchStep2 will convert the IRP to a WDFRequest and queue it, dispatching
1380 // the request to the driver if possible.
1381 //
1382 return pDevice->m_PkgIo->DispatchStep2(reinterpret_cast<MdIrp>(Irp),
1383 NULL,
1384 pQueue);
1385}
1386
1387
1391WDFEXPORT(WdfDeviceWdmDispatchIrp)(
1392 _In_
1394 _In_
1395 WDFDEVICE Device,
1396 _In_
1398 _In_
1400 )
1401
1402/*++
1403
1404Routine Description:
1405
1406 This DDI returns control of the IRP to the framework.
1407 This must only be called from the dispatch callback passed to
1408 WdfDeviceConfigureWdmIrpDispatchCallback
1409
1410
1411Arguments:
1412
1413 Device - Handle to the I/O device.
1414
1415 pIrp - Opaque handle to a _WUDF_IRP_WITH_VALIDATION structure.
1416
1417 DispatchContext - Framework dispatch context passed as a parameter to the
1418 dispatch callback.
1419
1420Returns:
1421
1422 IRP's status.
1423
1424--*/
1425{
1426 DDI_ENTRY();
1427
1430
1432 Device,
1434 (PVOID *) &pDevice,
1436
1437 //
1438 // Validate parameters and dispatch state. DispatchContext has already been
1439 // validated in DispatchStep1.
1440 //
1443
1444 FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO),
1445 CHECK("This function must be called from within a "
1446 "EVT_WDFDEVICE_WDM_IRP_DISPATCH callback",
1448 DriverGlobals->DriverName);
1449
1450 //
1451 // Adjust this context
1452 //
1453 DispatchContext = (WDFCONTEXT)((ULONG_PTR)DispatchContext & ~FX_IN_DISPATCH_CALLBACK);
1454
1455 //
1456 // Cast this pIrp back to its composite parts and dispatch it again
1457 //
1458 return pDevice->m_PkgIo->DispatchStep1(reinterpret_cast<MdIrp>(pIrp),
1460}
1461
1462} // extern "C"
#define CHECK(hwndTarget)
unsigned char BOOLEAN
#define TODO
Definition: SAX2.c:44
Type
Definition: Type.h:7
LONG NTSTATUS
Definition: precomp.h:26
Definition: bufpool.h:45
HRESULT ValidatePortAddressRange(__in PVOID Address, __in SIZE_T Length)
HRESULT ValidateAndClearMapping(__in PVOID Address, __in SIZE_T Length)
HRESULT ValidateRegisterSystemBaseAddress(__in PVOID Address, __out PVOID *UsermodeBaseAddress)
HRESULT ValidateRegisterSystemAddressRange(__in PVOID SystemAddress, __in SIZE_T Length, __out_opt PVOID *UsermodeAddress)
__inline void LockResourceTable()
Definition: fxresource.hpp:487
HRESULT MapIoSpaceWorker(__in PHYSICAL_ADDRESS PhysicalAddress, __in SIZE_T NumberOfBytes, __in MEMORY_CACHING_TYPE CacheType, __deref_out VOID **PseudoBaseAddress)
__inline void UnlockResourceTable()
Definition: fxresource.hpp:500
FxCmResList * GetTranslatedResources()
Definition: fxdevice.hpp:1854
VOID ReadRegisterBuffer(__in WDF_DEVICE_HWACCESS_TARGET_SIZE Size, __in PVOID Register, __out_ecount_full(Count) PVOID Buffer, __in ULONG Count)
Definition: fxdeviceum.hpp:233
PVOID GetSystemAddressFromPseudoAddress(__in PVOID PseudoAddress)
Definition: fxdevice.hpp:2108
VOID WriteRegisterBuffer(__in WDF_DEVICE_HWACCESS_TARGET_SIZE Size, __in PVOID Register, __in_ecount(Count) PVOID Buffer, __in ULONG Count)
Definition: fxdeviceum.hpp:323
VOID WriteRegister(__in WDF_DEVICE_HWACCESS_TARGET_SIZE Size, __in PVOID Register, __in SIZE_T Value)
Definition: fxdeviceum.hpp:279
VOID GetDeviceStackIoType(_Out_ WDF_DEVICE_IO_TYPE *ReadWriteIoType, _Out_ WDF_DEVICE_IO_TYPE *IoControlIoType)
BOOL IsRegister(__in WDF_DEVICE_HWACCESS_TARGET_TYPE Type)
Definition: fxdevice.hpp:2145
BOOLEAN AreRegistersMappedToUsermode(VOID)
Definition: fxdevice.hpp:2092
static _Must_inspect_result_ NTSTATUS _QueryPropertyEx(_In_ PFX_DRIVER_GLOBALS DriverGlobals, _In_opt_ PWDFDEVICE_INIT DeviceInit, _In_opt_ FxDevice *Device, _In_ PVOID PropertyData, _In_ FxPropertyType FxPropertyType, _In_ ULONG BufferLength, _Out_ PVOID PropertyBuffer, _Out_ PULONG ResultLength, _Out_ PDEVPROPTYPE PropertyType)
Definition: fxdevicekm.cpp:859
BOOLEAN IsDirectHardwareAccessAllowed()
Definition: fxdevice.hpp:2072
CfxDevice * m_ParentDevice
Definition: fxdevice.hpp:569
_Must_inspect_result_ NTSTATUS FxValidateInterfacePropertyData(_In_ PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData)
static NTSTATUS NtStatusFromHr(_In_ IWudfDeviceStack *DevStack, _In_ HRESULT Hr)
Definition: fxdeviceum.cpp:826
_Must_inspect_result_ NTSTATUS AssignProperty(_In_ PVOID PropertyData, _In_ FxPropertyType FxPropertyType, _In_ DEVPROPTYPE Type, _In_ ULONG BufferLength, _In_opt_ PVOID PropertyBuffer)
Definition: fxdevicekm.cpp:668
FxPkgIo * m_PkgIo
Definition: fxdevice.hpp:669
IWudfDeviceStack * GetDeviceStack(VOID)
Definition: fxdeviceum.hpp:435
static ULONG __inline GetLength(__in WDF_DEVICE_HWACCESS_TARGET_SIZE Size)
Definition: fxdevice.hpp:2118
static _Must_inspect_result_ NTSTATUS _AllocAndQueryPropertyEx(_In_ PFX_DRIVER_GLOBALS DriverGlobals, _In_opt_ PWDFDEVICE_INIT DeviceInit, _In_opt_ FxDevice *Device, _In_ PVOID PropertyData, _In_ FxPropertyType FxPropertyType, _In_ POOL_TYPE PoolType, _In_opt_ PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes, _Out_ WDFMEMORY *PropertyMemory, _Out_ PDEVPROPTYPE PropertyType)
Definition: fxdevice.cpp:2063
IWudfDeviceStack * m_DevStack
Definition: fxdevice.hpp:743
BOOL IsBufferType(__in WDF_DEVICE_HWACCESS_TARGET_TYPE Type)
Definition: fxdevice.hpp:2171
SIZE_T ReadRegister(__in WDF_DEVICE_HWACCESS_TARGET_SIZE Size, __in PVOID Register)
Definition: fxdeviceum.hpp:186
__inline CfxDevice * GetDevice(VOID)
Definition: fxioqueue.hpp:773
Definition: fxirp.hpp:28
VOID CompleteRequest(__in_opt CCHAR PriorityBoost=IO_NO_INCREMENT)
Definition: fxirpum.cpp:24
VOID SetStatus(__in NTSTATUS Status)
Definition: fxirpum.cpp:457
VOID SetInformation(__in ULONG_PTR Information)
Definition: fxirpum.cpp:504
_Must_inspect_result_ NTSTATUS __fastcall DispatchStep1(__inout MdIrp Irp, __in WDFCONTEXT DispatchContext)
Definition: fxpkgio.cpp:165
_Must_inspect_result_ NTSTATUS __fastcall DispatchStep2(__inout MdIrp Irp, __in_opt FxIoInCallerContext *IoInCallerCtx, __in_opt FxIoQueue *Queue)
Definition: fxpkgio.cpp:342
_In_ PIRP Irp
Definition: csq.h:116
#define __in
Definition: dbghelp.h:35
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define ERROR_STRING_HW_ACCESS_NOT_ALLOWED
Definition: device_common.h:40
ULONG DEVPROPTYPE
Definition: devpropdef.h:24
ULONG * PDEVPROPTYPE
Definition: devpropdef.h:24
#define TRUE
Definition: types.h:120
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define _IRQL_requires_max_(irql)
Definition: driverspecs.h:230
#define __drv_maxIRQL(irql)
Definition: driverspecs.h:291
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
@ FxInterfaceProperty
Definition: fxdevice.hpp:87
_Must_inspect_result_ NTSTATUS FX_VF_FUNCTION() VerifyWdfDeviceWdmDispatchIrpToIoQueue(_In_ PFX_DRIVER_GLOBALS FxDriverGlobals, _In_ FxDevice *device, _In_ MdIrp Irp, _In_ FxIoQueue *queue, _In_ ULONG Flags)
NTSTATUS status
PVOID systemBaseAddress
_Must_inspect_result_ _In_ WDFDEVICE _In_ REFGUID _In_ WDF_EVENT_TYPE _In_ ULONG DataSizeCb
FxIrp fxIrp(Irp)
_In_ WDFDEVICE _In_ WDF_DEVICE_HWACCESS_TARGET_TYPE _In_ WDF_DEVICE_HWACCESS_TARGET_SIZE _In_ PVOID _In_opt_ ULONG Count
_Must_inspect_result_ _In_ WDFDEVICE _In_ PHYSICAL_ADDRESS _In_ SIZE_T _In_ MEMORY_CACHING_TYPE _Out_ PVOID * PseudoBaseAddress
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP pIrp
IWudfDeviceStack * deviceStack
return NULL
_Must_inspect_result_ _In_ WDFDEVICE Device
_In_ WDFDEVICE _Out_ WDF_DEVICE_IO_TYPE * ReadWriteIoType
_In_ WDFDEVICE _In_ WDF_DEVICE_HWACCESS_TARGET_TYPE Type
_Must_inspect_result_ __in WDFDEVICE __in MdIrp __in WDFQUEUE __in ULONG Flags
_Must_inspect_result_ __in WDFDEVICE __in MdIrp Irp
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFCONTEXT DispatchContext
FxDevice * pDevice
_Must_inspect_result_ __in WDFDEVICE __in MdIrp __in WDFQUEUE Queue
_In_ WDFDEVICE _In_ PWDF_DEVICE_INTERFACE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG ResultLength
_Must_inspect_result_ _In_ WDFDEVICE _In_ REFGUID _In_ WDF_EVENT_TYPE WdfEventType
PVOID systemAddress
FxCmResList * transResources
_In_ WDFDEVICE _In_ PWDF_DEVICE_INTERFACE_PROPERTY_DATA PropertyData
IWudfDeviceStack * pDevStack
_In_ WDFDEVICE _Out_ WDF_DEVICE_IO_TYPE _Out_ WDF_DEVICE_IO_TYPE * IoControlIoType
FxObjectHandleGetPtr(pFxDriverGlobals, Queue, FX_TYPE_QUEUE,(PVOID *)&pQueue)
_In_ WDFDEVICE _In_ WDF_DEVICE_HWACCESS_TARGET_TYPE _In_ WDF_DEVICE_HWACCESS_TARGET_SIZE _In_ PVOID TargetAddress
_In_ WDFDEVICE _In_ PWDF_DEVICE_INTERFACE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG BufferLength
_In_ WDFDEVICE _In_ WDF_DEVICE_HWACCESS_TARGET_TYPE _In_ WDF_DEVICE_HWACCESS_TARGET_SIZE Size
EventWriteEVENT_UMDF_FX_DDI_READ_FROM_HARDWARE_START(Type, Size, Count)
FxCmResList * resources
_In_ WDFDEVICE _In_ PWDF_DEVICE_INTERFACE_PROPERTY_DATA _In_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *) &pDevice, &pFxDriverGlobals)
FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK(ERROR_STRING_HW_ACCESS_NOT_ALLOWED,(pDevice->IsDirectHardwareAccessAllowed()==TRUE)), DriverGlobals->DriverName)
_In_ WDFDEVICE _In_ PWDF_DEVICE_INTERFACE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG _Out_ PDEVPROPTYPE PropertyType
_Must_inspect_result_ _In_ WDFDEVICE _In_ PHYSICAL_ADDRESS _In_ SIZE_T _In_ MEMORY_CACHING_TYPE CacheType
SIZE_T value
__in WDFDEVICE __in MdFileObject FileObject
PVOID usermodeBaseAddress
EventWriteEVENT_UMDF_FX_DDI_WRITE_TO_HARDWARE_END(Type, Size, Count)
EventWriteEVENT_UMDF_FX_DDI_READ_FROM_HARDWARE_END(Type, Size, Count)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PHYSICAL_ADDRESS PhysicalAddress
_In_ WDFDEVICE _In_ PWDF_DEVICE_INTERFACE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG _In_opt_ PVOID PropertyBuffer
HRESULT hr
FxIoQueue * pQueue
_In_ WDFDEVICE _In_ PWDF_DEVICE_INTERFACE_PROPERTY_DATA _In_ POOL_TYPE PoolType
_Must_inspect_result_ _In_ WDFDEVICE _In_ REFGUID EventGuid
EventWriteEVENT_UMDF_FX_DDI_WRITE_TO_HARDWARE_START(Type, Size, Count)
_In_ WDFDEVICE _In_ PWDF_DEVICE_INTERFACE_PROPERTY_DATA _In_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFMEMORY * PropertyMemory
_In_ WDFDEVICE _In_ WDF_DEVICE_HWACCESS_TARGET_TYPE _In_ WDF_DEVICE_HWACCESS_TARGET_SIZE _In_ PVOID _In_ SIZE_T Value
_Must_inspect_result_ _In_ WDFDEVICE _In_ PHYSICAL_ADDRESS _In_ SIZE_T NumberOfBytes
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN IsPresent
PFX_DRIVER_GLOBALS pFxDriverGlobals
FxVerifierDbgBreakPoint(pFxDriverGlobals)
DriverGlobals
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
#define DDI_ENTRY()
Definition: fxglobalskm.h:56
#define FX_DECLARE_VF_FUNCTION_P4(rt, fnName, at1, at2, at3, at4)
Definition: fxmacros.hpp:151
#define WDFEXPORT(a)
Definition: fxmacros.hpp:157
#define FxPointerNotNull(FxDriverGlobals, Ptr)
Definition: fxmacros.hpp:253
#define FX_IN_DISPATCH_CALLBACK
Definition: fxpkgio.hpp:39
@ FX_TYPE_DEVICE
Definition: fxtypes.h:47
@ FX_TYPE_QUEUE
Definition: fxtypes.h:48
_Must_inspect_result_ NTSTATUS FxValidateObjectAttributes(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
__inline NTSTATUS FxVerifierCheckIrqlLevel(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in KIRQL Irql)
Definition: fxverifier.h:158
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
Windows helper functions for integer overflow prevention.
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define ASSERT(a)
Definition: mode.c:44
#define _In_reads_bytes_(size)
Definition: ms_sal.h:321
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define _Out_writes_all_opt_(size)
Definition: ms_sal.h:358
#define _Out_
Definition: ms_sal.h:345
#define _In_reads_opt_(size)
Definition: ms_sal.h:320
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
PFILE_OBJECT MdFileObject
Definition: mxgeneralkm.h:32
IWudfIrp * MdIrp
Definition: mxum.h:103
enum _WDF_EVENT_TYPE WDF_EVENT_TYPE
Definition: mxum.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
Definition: scsiwmi.h:51
Definition: ps.c:97
uint32_t * PULONG
Definition: typedefs.h:59
INT POOL_TYPE
Definition: typedefs.h:78
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONGLONG QuadPart
Definition: typedefs.h:114
Definition: pdh_main.c:94
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES PropertyMemoryAttributes
Definition: wdfdevice.h:3817
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFMEMORY * PropertyMemory
Definition: wdfdevice.h:3820
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
_In_ UCHAR _In_ UCHAR _In_ ULONG _In_ WDFCONTEXT _Inout_ PIRP _In_ WDFCONTEXT DispatchContext
Definition: wdfdevice.h:1708
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3815
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID PropertyBuffer
Definition: wdfdevice.h:4437
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2225
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
enum _WDF_DEVICE_IO_TYPE WDF_DEVICE_IO_TYPE
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
#define WDFAPI
Definition: wdftypes.h:53
PVOID WDFCONTEXT
Definition: wdftypes.h:94
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define IO_NO_INCREMENT
Definition: iotypes.h:598
enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE
@ MmNonCached
Definition: mmtypes.h:129
@ MmMaximumCacheType
Definition: mmtypes.h:135
unsigned char UCHAR
Definition: xmlstorage.h:181
unsigned char BYTE
Definition: xxhash.c:193