| 4288 | } |
| 4289 | |
| 4290 | CHAR |
| 4291 | Ext2QueryRegistryMountPoint ( |
| 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 | |