#include "precomp.h"
#include <winioctl.h>
#include <mountdev.h>
Go to the source code of this file.
◆ ok_type
◆ skip_type
◆ GetDiskGeometry()
Definition at line 22 of file DeviceIoControl.c.
23{
28
31 ok_type(Ret == 0,
"DeviceIoControl succeed\n");
35
38
40 {
43 }
46
49 ok_type(Ret == 0,
"DeviceIoControl succeed\n");
53
58
63 {
65 }
66 else
67 {
69 }
70
72}
#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
#define FIELD_OFFSET(t, f)
_Must_inspect_result_ _In_ WDFDEVICE Device
_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 76 of file DeviceIoControl.c.
77{
82
85 ok_type(Ret == 0,
"DeviceIoControl succeed\n");
88 {
90 }
91 else
92 {
94 }
96
98 ok_type(Ret == 0,
"DeviceIoControl succeed\n");
102
104 if (AllocatedMDN ==
NULL)
105 {
106 skip_type(
"Memory allocation failure\n");
107 return;
108 }
109
115
116 if (Ret != 0)
117 {
120
123 {
125 }
127 {
128 IsValid = (AllocatedMDN->
Name[12] ==
Letter && AllocatedMDN->
Name[13] ==
L':');
129 }
130
132 }
133 else
134 {
135 skip_type(
"Failed to query device name\n");
136 }
137
139}
#define ERROR_INVALID_PARAMETER
#define HeapFree(x, y, z)
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
#define IOCTL_MOUNTDEV_QUERY_DEVICE_NAME
Referenced by START_TEST().
◆ QuerySuggestedLinkName()
static VOID QuerySuggestedLinkName |
( |
VOID |
| ) |
|
|
static |
Definition at line 187 of file DeviceIoControl.c.
188{
192
195 ok_type(Ret == 0,
"DeviceIoControl succeed\n");
198 {
200 }
201 else
202 {
204 }
206
208 ok_type(Ret == 0,
"DeviceIoControl succeed\n");
211 {
213 }
214 else
215 {
217 }
219}
#define ERROR_FILE_NOT_FOUND
#define IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME
Referenced by START_TEST().
◆ QueryUniqueId()
Definition at line 143 of file DeviceIoControl.c.
144{
148
151 ok_type(Ret == 0,
"DeviceIoControl succeed\n");
154 {
156 }
157 else
158 {
160 }
162
164 ok_type(Ret == 0,
"DeviceIoControl succeed\n");
168
170 if (AllocatedMUI ==
NULL)
171 {
172 skip_type(
"Memory allocation failure\n");
173 return;
174 }
175
181
183}
#define IOCTL_MOUNTDEV_QUERY_UNIQUE_ID
Referenced by START_TEST().
◆ START_TEST()
Definition at line 221 of file DeviceIoControl.c.
222{
225 DWORD DriveMap, Current;
226 BOOL DiskDone, CdRomDone;
227
231 for (Current = 0; Current < 26; ++Current)
232 {
233 if (DriveMap & (1 << Current))
234 {
236 ok(Ret ==
S_OK,
"StringCchPrintfW failed: %d\n", Ret);
237
241 {
243 ok(Ret ==
S_OK,
"StringCchPrintfW failed: %d\n", Ret);
244
247 {
249 continue;
250 }
251
254
256 {
260 }
261
263 }
264
265 if (CdRomDone && DiskDone)
266 {
267 break;
268 }
269 }
270 }
271
272 if (!DiskDone)
273 {
274 skip(
"No disk drive found\n");
275 }
276
277 if (!CdRomDone)
278 {
279 skip(
"No CDROM drive found\n");
280 }
281}
static VOID QueryUniqueId(VOID)
static BOOL GetDiskGeometry(VOID)
static VOID QuerySuggestedLinkName(VOID)
static VOID QueryDeviceName(VOID)
PRTL_UNICODE_STRING_BUFFER Path
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
#define FILE_SHARE_DELETE
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
DWORD WINAPI GetLogicalDrives(void)
◆ Device
◆ DriveType
Definition at line 15 of file DeviceIoControl.c.
Referenced by CDrivesExtractIcon_CreateInstance(), DosDeviceIoControlDrive(), DosIsFileOnCdRom(), DriveType(), FormatDrive(), FreeLdrMigrateBootDrivePartWorker(), CDrivesFolder::GetDetailsOf(), GetDiskGeometry(), CDrivesFolder::GetDisplayNameOf(), CDrvDefExt::InitGeneralPage(), ObpProcessDosDeviceSymbolicLink(), 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().