| 4349 | } |
| 4350 | |
| 4351 | BOOL |
| 4352 | Ext2SetRegistryMountPoint ( |
| 4353 | CHAR * dosPath, |
| 4354 | CHAR * devName, |
| 4355 | BOOL bSet |
| 4356 | ) |
| 4357 | { |
| 4358 | LONG status; |
| 4359 | HKEY hKey; |
| 4360 | CHAR keyPath[MAX_PATH]; |
| 4361 | CHAR drvPath[MAX_PATH]; |
| 4362 | |
| 4363 | /* set dos driver name */ |
| 4364 | sprintf(drvPath, "%c:", dosPath[0]); |
| 4365 | |
| 4366 | /* set dos deivce path */ |
| 4367 | strcpy (keyPath, "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\DOS Devices"); |
| 4368 | |
| 4369 | /* open session manager\dos devices */ |
| 4370 | status = ::RegOpenKeyEx(HKEY_LOCAL_MACHINE, |
| 4371 | keyPath, |
| 4372 | 0, |
| 4373 | KEY_ALL_ACCESS, |
| 4374 | &hKey) ; |
| 4375 | if (status != ERROR_SUCCESS) { |
| 4376 | return FALSE; |
| 4377 | } |
| 4378 | |
| 4379 | if (bSet) { |
| 4380 | /* set value */ |
| 4381 | status = RegSetValueEx( |
| 4382 | hKey, drvPath, |
| 4383 | 0, REG_SZ, |
| 4384 | (BYTE *)devName, |
| 4385 | (int)strlen(devName) |
| 4386 | ); |
| 4387 | } else { |
| 4388 | /* delete key */ |
| 4389 | status = RegDeleteValue( |
| 4390 | hKey, drvPath |
| 4391 | ); |
| 4392 | } |
| 4393 | |
| 4394 | RegCloseKey(hKey); |
| 4395 | |
| 4396 | if (status != ERROR_SUCCESS) { |
| 4397 | return FALSE; |
| 4398 | } |
| 4399 | |
| 4400 | return TRUE; |
| 4401 | } |
| 4402 | |
| 4403 | VOID |
| 4404 | Ext2UpdateDrvLetter( |
no outgoing calls
no test coverage detected