|
24 | 24 | #define NDEBUG |
25 | 25 | #include <debug.h> |
26 | 26 |
|
27 | | -VOID NTAPI |
28 | | -IntInterfaceReference(PVOID Context) |
| 27 | +VOID |
| 28 | +NTAPI |
| 29 | +IntInterfaceReference( |
| 30 | + _In_ PVOID Context) |
29 | 31 | { |
30 | | - /* Do nothing */ |
| 32 | + /* Do nothing */ |
31 | 33 | } |
32 | 34 |
|
33 | | -VOID NTAPI |
34 | | -IntInterfaceDereference(PVOID Context) |
| 35 | +VOID |
| 36 | +NTAPI |
| 37 | +IntInterfaceDereference( |
| 38 | + _In_ PVOID Context) |
35 | 39 | { |
36 | | - /* Do nothing */ |
| 40 | + /* Do nothing */ |
37 | 41 | } |
38 | 42 |
|
39 | | -VP_STATUS NTAPI |
| 43 | +VP_STATUS |
| 44 | +NTAPI |
40 | 45 | VideoPortQueryServices( |
41 | | - IN PVOID HwDeviceExtension, |
42 | | - IN VIDEO_PORT_SERVICES ServicesType, |
43 | | - IN OUT PINTERFACE Interface) |
| 46 | + _In_ PVOID HwDeviceExtension, |
| 47 | + _In_ VIDEO_PORT_SERVICES ServicesType, |
| 48 | + _Inout_ PINTERFACE Interface) |
44 | 49 | { |
45 | | - TRACE_(VIDEOPRT, "VideoPortQueryServices - ServicesType: 0x%x\n", ServicesType); |
46 | | - |
47 | | - switch (ServicesType) |
48 | | - { |
49 | | - case VideoPortServicesInt10: |
50 | | - if (Interface->Version >= VIDEO_PORT_INT10_INTERFACE_VERSION_1 || |
51 | | - Interface->Size >= sizeof(VIDEO_PORT_INT10_INTERFACE)) |
52 | | - { |
53 | | - VIDEO_PORT_INT10_INTERFACE *Int10Interface = |
54 | | - (VIDEO_PORT_INT10_INTERFACE *)Interface; |
55 | | - |
56 | | - Interface->InterfaceReference = IntInterfaceReference; |
57 | | - Interface->InterfaceDereference = IntInterfaceDereference; |
58 | | - Int10Interface->Int10AllocateBuffer = IntInt10AllocateBuffer; |
59 | | - Int10Interface->Int10FreeBuffer = IntInt10FreeBuffer; |
60 | | - Int10Interface->Int10ReadMemory = IntInt10ReadMemory; |
61 | | - Int10Interface->Int10WriteMemory = IntInt10WriteMemory; |
62 | | - Int10Interface->Int10CallBios = IntInt10CallBios; |
63 | | - return NO_ERROR; |
64 | | - } |
65 | | - break; |
66 | | - |
67 | | - case VideoPortServicesAGP: |
68 | | - if ((Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_2 && |
69 | | - Interface->Size >= sizeof(VIDEO_PORT_AGP_INTERFACE_2)) || |
70 | | - (Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_1 && |
71 | | - Interface->Size >= sizeof(VIDEO_PORT_AGP_INTERFACE))) |
72 | | - { |
73 | | - if (NT_SUCCESS(IntAgpGetInterface(HwDeviceExtension, Interface))) |
| 50 | + TRACE_(VIDEOPRT, "VideoPortQueryServices - ServicesType: 0x%x\n", ServicesType); |
| 51 | + |
| 52 | + switch (ServicesType) |
| 53 | + { |
| 54 | + case VideoPortServicesInt10: |
| 55 | + if (Interface->Version >= VIDEO_PORT_INT10_INTERFACE_VERSION_1 || |
| 56 | + Interface->Size >= sizeof(VIDEO_PORT_INT10_INTERFACE)) |
| 57 | + { |
| 58 | + PVIDEO_PORT_INT10_INTERFACE Int10Interface = |
| 59 | + (PVIDEO_PORT_INT10_INTERFACE)Interface; |
| 60 | + |
| 61 | + Interface->InterfaceReference = IntInterfaceReference; |
| 62 | + Interface->InterfaceDereference = IntInterfaceDereference; |
| 63 | + Int10Interface->Int10AllocateBuffer = IntInt10AllocateBuffer; |
| 64 | + Int10Interface->Int10FreeBuffer = IntInt10FreeBuffer; |
| 65 | + Int10Interface->Int10ReadMemory = IntInt10ReadMemory; |
| 66 | + Int10Interface->Int10WriteMemory = IntInt10WriteMemory; |
| 67 | + Int10Interface->Int10CallBios = IntInt10CallBios; |
| 68 | + return NO_ERROR; |
| 69 | + } |
| 70 | + break; |
| 71 | + |
| 72 | + case VideoPortServicesAGP: |
| 73 | + if ((Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_2 && |
| 74 | + Interface->Size >= sizeof(VIDEO_PORT_AGP_INTERFACE_2)) || |
| 75 | + (Interface->Version == VIDEO_PORT_AGP_INTERFACE_VERSION_1 && |
| 76 | + Interface->Size >= sizeof(VIDEO_PORT_AGP_INTERFACE))) |
74 | 77 | { |
75 | | - return NO_ERROR; |
| 78 | + if (NT_SUCCESS(IntAgpGetInterface(HwDeviceExtension, Interface))) |
| 79 | + { |
| 80 | + return NO_ERROR; |
| 81 | + } |
76 | 82 | } |
77 | | - } |
78 | | - break; |
| 83 | + break; |
79 | 84 |
|
80 | | - case VideoPortServicesI2C: |
81 | | - UNIMPLEMENTED; |
82 | | - return ERROR_INVALID_FUNCTION; |
| 85 | + case VideoPortServicesI2C: |
| 86 | + UNIMPLEMENTED; |
| 87 | + return ERROR_INVALID_FUNCTION; |
83 | 88 |
|
84 | | - case VideoPortServicesHeadless: |
85 | | - UNIMPLEMENTED; |
86 | | - return ERROR_INVALID_FUNCTION; |
| 89 | + case VideoPortServicesHeadless: |
| 90 | + UNIMPLEMENTED; |
| 91 | + return ERROR_INVALID_FUNCTION; |
87 | 92 |
|
88 | | - default: |
89 | | - break; |
90 | | - } |
| 93 | + default: |
| 94 | + break; |
| 95 | + } |
91 | 96 |
|
92 | | - return ERROR_INVALID_FUNCTION; |
| 97 | + return ERROR_INVALID_FUNCTION; |
93 | 98 | } |
94 | 99 |
|
95 | | -BOOLEAN NTAPI |
| 100 | +BOOLEAN |
| 101 | +NTAPI |
96 | 102 | VideoPortGetAgpServices( |
97 | | - IN PVOID HwDeviceExtension, |
98 | | - OUT PVIDEO_PORT_AGP_SERVICES AgpServices) |
| 103 | + _In_ PVOID HwDeviceExtension, |
| 104 | + _Out_ PVIDEO_PORT_AGP_SERVICES AgpServices) |
99 | 105 | { |
100 | | - VIDEO_PORT_AGP_INTERFACE Interface; |
101 | | - VP_STATUS Status; |
| 106 | + VIDEO_PORT_AGP_INTERFACE Interface; |
| 107 | + VP_STATUS Status; |
102 | 108 |
|
103 | | - TRACE_(VIDEOPRT, "VideoPortGetAgpServices\n"); |
| 109 | + TRACE_(VIDEOPRT, "VideoPortGetAgpServices\n"); |
104 | 110 |
|
105 | | - Interface.Size = sizeof(Interface); |
106 | | - Interface.Version = VIDEO_PORT_AGP_INTERFACE_VERSION_1; |
| 111 | + Interface.Size = sizeof(Interface); |
| 112 | + Interface.Version = VIDEO_PORT_AGP_INTERFACE_VERSION_1; |
107 | 113 |
|
108 | | - Status = VideoPortQueryServices(HwDeviceExtension, VideoPortServicesAGP, |
109 | | - (PINTERFACE)&Interface); |
110 | | - if (Status != NO_ERROR) |
111 | | - { |
112 | | - WARN_(VIDEOPRT, "VideoPortQueryServices() failed!\n"); |
113 | | - return FALSE; |
114 | | - } |
| 114 | + Status = VideoPortQueryServices(HwDeviceExtension, VideoPortServicesAGP, |
| 115 | + (PINTERFACE)&Interface); |
| 116 | + if (Status != NO_ERROR) |
| 117 | + { |
| 118 | + WARN_(VIDEOPRT, "VideoPortQueryServices() failed!\n"); |
| 119 | + return FALSE; |
| 120 | + } |
115 | 121 |
|
116 | | - RtlCopyMemory(AgpServices, &Interface.AgpReservePhysical, sizeof(VIDEO_PORT_AGP_SERVICES)); |
117 | | - return TRUE; |
| 122 | + RtlCopyMemory(AgpServices, &Interface.AgpReservePhysical, sizeof(*AgpServices)); |
| 123 | + return TRUE; |
118 | 124 | } |
0 commit comments