MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / Ext2QueryRegistryMountPoint

Function Ext2QueryRegistryMountPoint

Ext2Mgr/enumDisk.cpp:4290–4349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4288}
4289
4290CHAR
4291Ext2QueryRegistryMountPoint (
4292 CHAR * devName
4293 )
4294{
4295 DWORD i = 0;
4296
4297 LONG status;
4298 HKEY hKey;
4299
4300 DWORD drvSize;
4301 DWORD dosSize;
4302 DWORD valType;
4303
4304 CHAR keyPath[MAX_PATH];
4305 CHAR drvPath[MAX_PATH];
4306 CHAR dosPath[64];
4307
4308 /* set dos deivce path */
4309 strcpy (keyPath, "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\DOS Devices");
4310
4311 /* open session manager\dos devices */
4312 status = ::RegOpenKeyEx(HKEY_LOCAL_MACHINE,
4313 keyPath,
4314 0,
4315 KEY_ALL_ACCESS,
4316 &hKey) ;
4317 if (status != ERROR_SUCCESS) {
4318 return FALSE;
4319 }
4320
4321
4322 /* enum all values and compare devName ... */
4323 while (status != ERROR_NO_MORE_ITEMS && i < 1024) {
4324
4325 valType = REG_SZ;
4326 dosSize = 64;
4327 drvSize = MAX_PATH;
4328
4329 status = RegEnumValue(hKey,
4330 i++,
4331 &dosPath[0],
4332 &dosSize,
4333 NULL,
4334 &valType,
4335 (LPBYTE)&drvPath[0],
4336 &drvSize);
4337
4338 if (status == ERROR_SUCCESS) {
4339 if (_stricmp(devName, drvPath) == 0) {
4340 RegCloseKey(hKey);
4341 return dosPath[0];
4342 }
4343 }
4344 }
4345
4346 RegCloseKey(hKey);
4347

Callers 1

OnInitDialogMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected