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

Function Ext2BuildCMDW

Ext2Mgr/Ext2Pipe.cpp:519–551  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517}
518
519WCHAR *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
549errorout:
550 return refresh;
551}
552
553PROCESS_INFORMATION g_Ext2Srv;
554

Callers 1

Ext2StartSrvAsUserFunction · 0.85

Calls 1

Ext2StrLastWFunction · 0.85

Tested by

no test coverage detected