#include "precomp.h"
#include <winioctl.h>
#include <mountdev.h>
Go to the source code of this file.
|
| #define | ok_type(condition, format, ...) ok(condition, "(%d): " format, DriveType, ##__VA_ARGS__) |
| |
| #define | skip_type(format, ...) skip("(%d): " format, DriveType, ##__VA_ARGS__) |
| |
| #define | IOCTL_KSEC_RANDOM_FILL_BUFFER CTL_CODE(FILE_DEVICE_KSEC, 0x02, METHOD_BUFFERED, FILE_ANY_ACCESS) |
| |
◆ IOCTL_KSEC_RANDOM_FILL_BUFFER
◆ ok_type
◆ skip_type
◆ GetDiskGeometry()
Definition at line 58 of file DeviceIoControl.c.
59{
64
67 ok_type(Ret == 0,
"DeviceIoControl succeed\n");
71
74
76 {
79 }
82
85 ok_type(Ret == 0,
"DeviceIoControl succeed\n");
89
94
99 {
101 }
102 else
103 {
105 }
106
108}
#define ok_type(condition, format,...)
#define skip_type(format,...)
#define IOCTL_DISK_GET_DRIVE_GEOMETRY
#define ERROR_INSUFFICIENT_BUFFER
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
#define IOCTL_DISK_GET_DRIVE_GEOMETRY_EX
_Must_inspect_result_ _In_ PUCXHUB_DEVICE_CREATE_INFO _Out_ UCXUSBDEVICE * Device
#define FIELD_OFFSET(t, f)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
DWORD WINAPI GetLastError(void)
Referenced by START_TEST().
◆ QueryDeviceName()
Definition at line 112 of file DeviceIoControl.c.
113{
118
121 ok_type(Ret == 0,
"DeviceIoControl succeed\n");
124 {
126 }
127 else
128 {
130 }
132
134 ok_type(Ret == 0,
"DeviceIoControl succeed\n");
138
140 if (AllocatedMDN ==
NULL)
141 {
142 skip_type(
"Memory allocation failure\n");
143 return;
144 }
145
151
152 if (Ret != 0)
153 {
156
159 {
161 }
163 {
164 IsValid = (AllocatedMDN->
Name[12] ==
Letter && AllocatedMDN->
Name[13] ==
L':');
165 }
166
168 }
169 else
170 {
171 skip_type(
"Failed to query device name\n");
172 }
173
175}
#define ERROR_INVALID_PARAMETER
#define HeapFree(x, y, z)
_ACRTIMP wchar_t *__cdecl wcsstr(const wchar_t *, const wchar_t *)
#define IOCTL_MOUNTDEV_QUERY_DEVICE_NAME
Referenced by START_TEST().
◆ QuerySuggestedLinkName()
| static VOID QuerySuggestedLinkName |
( |
VOID |
| ) |
|
|
static |
Definition at line 223 of file DeviceIoControl.c.
224{
228
231 ok_type(Ret == 0,
"DeviceIoControl succeed\n");
234 {
236 }
237 else
238 {
240 }
242
244 ok_type(Ret == 0,
"DeviceIoControl succeed\n");
247 {
249 }
250 else
251 {
253 }
255}
#define ERROR_FILE_NOT_FOUND
#define IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME
Referenced by START_TEST().
◆ QueryUniqueId()
Definition at line 179 of file DeviceIoControl.c.
180{
184
187 ok_type(Ret == 0,
"DeviceIoControl succeed\n");
190 {
192 }
193 else
194 {
196 }
198
200 ok_type(Ret == 0,
"DeviceIoControl succeed\n");
204
206 if (AllocatedMUI ==
NULL)
207 {
208 skip_type(
"Memory allocation failure\n");
209 return;
210 }
211
217
219}
#define IOCTL_MOUNTDEV_QUERY_UNIQUE_ID
Referenced by START_TEST().
◆ START_TEST()
Definition at line 257 of file DeviceIoControl.c.
258{
262 BOOL DiskDone, CdRomDone;
263
265
270 {
272 {
274 ok(Ret ==
S_OK,
"StringCchPrintfW failed: %d\n", Ret);
275
279 {
281 ok(Ret ==
S_OK,
"StringCchPrintfW failed: %d\n", Ret);
282
285 {
287 continue;
288 }
289
292
294 {
298 }
299
301 }
302
303 if (CdRomDone && DiskDone)
304 {
305 break;
306 }
307 }
308 }
309
310 if (!DiskDone)
311 {
312 skip(
"No disk drive found\n");
313 }
314
315 if (!CdRomDone)
316 {
317 skip(
"No CDROM drive found\n");
318 }
319}
static VOID QueryUniqueId(VOID)
static BOOL GetDiskGeometry(VOID)
static VOID QuerySuggestedLinkName(VOID)
static VOID QueryDeviceName(VOID)
static void Test_DeviceIoControl_Parameters(void)
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
DWORD WINAPI DECLSPEC_HOTPATCH GetLogicalDrives(void)
#define FILE_SHARE_DELETE
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
◆ Test_DeviceIoControl_Parameters()
| static void Test_DeviceIoControl_Parameters |
( |
void |
| ) |
|
|
static |
Definition at line 23 of file DeviceIoControl.c.
24{
25 static const PWSTR KsecDevicePath =
L"\\\\.\\Global\\GLOBALROOT\\Device\\KsecDD";
29
30
33 {
35 return;
36 }
37
38
44 0,
52
54}
#define IOCTL_KSEC_RANDOM_FILL_BUFFER
#define ok_eq_ulong(value, expected)
#define ok_eq_bool(value, expected)
#define EndSeh(ExpectedStatus)
#define _WIN32_WINNT_WIN8
#define STATUS_INVALID_PARAMETER
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
Referenced by START_TEST().
◆ Device
◆ DriveType
Definition at line 15 of file DeviceIoControl.c.
Referenced by CDrivesExtractIcon_CreateInstance(), DiskOpen(), DosDeviceIoControlDrive(), DosIsFileOnCdRom(), DriveType(), FormatDrive(), FreeLdrMigrateBootDrivePartWorker(), CDrivesFolder::GetDetailsOf(), GetDiskGeometry(), GetUnattendInfPath(), CDrvDefExt::InitGeneralPage(), ObpProcessDosDeviceSymbolicLink(), PcInitializeBootDevices(), QueryDeviceName(), QuerySuggestedLinkName(), QueryUniqueId(), and START_TEST().
◆ Letter
Definition at line 13 of file DeviceIoControl.c.
Referenced by _tmain(), AddDrive(), AssignDriveLetters(), BasepGetComputerNameFromNtPath(), CreateNewDriveLetterName(), CSR_API(), DefineDosDeviceW(), EjectDrive(), HandleNotify(), IsDriveLetter(), IsLetterOwned(), MountMgrMountedDeviceArrival(), OpenLetter(), QueryDeviceName(), RefreshDevicesList(), RemountImage(), RemoveDrive(), SetMountedDeviceValue(), ViCreateDriveAndMountImage(), ViCreateDriveLetter(), and ViLoadImagesFromRegistry().