| 517 | } |
| 518 | |
| 519 | WCHAR *Ext2BuildCMDW() |
| 520 | { |
| 521 | WCHAR cmd[512] = {0}, *p, *refresh = NULL; |
| 522 | int len = 0; |
| 523 | |
| 524 | if (GetModuleFileNameW(NULL, cmd, 510)) { |
| 525 | } else { |
| 526 | wcscpy(cmd, GetCommandLineW()); |
| 527 | } |
| 528 | |
| 529 | len = (int)wcslen(cmd) + 2; |
| 530 | refresh = new WCHAR[len]; |
| 531 | if (!refresh) |
| 532 | goto errorout; |
| 533 | memset(refresh, 0, sizeof(WCHAR)*len); |
| 534 | wcscpy(refresh, cmd); |
| 535 | p = wcsstr(refresh, L"/"); |
| 536 | if (p) |
| 537 | *p = 0; |
| 538 | |
| 539 | p = Ext2StrLastW(refresh, L"Ext2Mgr"); |
| 540 | if (p) { |
| 541 | p[4] = 'S'; |
| 542 | p[5] = 'r'; |
| 543 | p[6] = 'v'; |
| 544 | } else { |
| 545 | delete [] refresh; |
| 546 | refresh = NULL; |
| 547 | } |
| 548 | |
| 549 | errorout: |
| 550 | return refresh; |
| 551 | } |
| 552 | |
| 553 | PROCESS_INFORMATION g_Ext2Srv; |
| 554 |
no test coverage detected