| 291 | } |
| 292 | |
| 293 | static LONG deleteRegPath (HKEY mainkey,char *szregpath,char *szdelpath) |
| 294 | { |
| 295 | HKEY hkey; |
| 296 | LONG cr,rc = -1; |
| 297 | KEYLIST klist; |
| 298 | LPKEYLIST pkl,k; |
| 299 | char *keyname = 0; |
| 300 | |
| 301 | if ((cr = RegOpenKey(mainkey,szregpath,&hkey)) == ERROR_SUCCESS) { |
| 302 | |
| 303 | keyname = new char[strlen(szdelpath)+1]; |
| 304 | if (!keyname) { |
| 305 | RegCloseKey(hkey); |
| 306 | return rc; |
| 307 | } |
| 308 | strcpy(keyname,szdelpath); |
| 309 | klist.next = 0; |
| 310 | |
| 311 | findAllSubKeys(hkey,0,0,keyname,&klist); |
| 312 | |
| 313 | if (klist.next) { |
| 314 | pkl = klist.next; |
| 315 | |
| 316 | while (pkl) { |
| 317 | RegCloseKey(pkl->subKey); |
| 318 | cr = RegDeleteKey(pkl->mainKey,pkl->keyname); |
| 319 | delete pkl->keyname; |
| 320 | k = pkl; |
| 321 | pkl = pkl->next; |
| 322 | delete k; |
| 323 | } |
| 324 | rc = 0; |
| 325 | } |
| 326 | |
| 327 | RegCloseKey(hkey); |
| 328 | } |
| 329 | |
| 330 | return rc; |
| 331 | } |
| 332 |
no test coverage detected