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

Function Ext2BuildCMDA

Ext2Mgr/Ext2Pipe.cpp:473–505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

471}
472
473TCHAR * Ext2BuildCMDA()
474{
475 TCHAR cmd[512] = {0}, *p, *refresh = NULL;
476 int len = 0;
477
478 if (GetModuleFileName(NULL, cmd, 510)) {
479 } else {
480 strcpy(cmd, GetCommandLine());
481 }
482
483 len = (int)_tcslen(cmd) + 2;
484 refresh = new TCHAR[len];
485 if (!refresh)
486 goto errorout;
487 memset(refresh, 0, sizeof(TCHAR)*len);
488 _tcscpy(refresh, cmd);
489 p = _tcsstr(refresh, _T("/"));
490 if (p)
491 *p = 0;
492
493 p = Ext2StrLastA(refresh, "Ext2Mgr");
494 if (p) {
495 p[4] = 'S';
496 p[5] = 'r';
497 p[6] = 'v';
498 } else {
499 delete [] refresh;
500 refresh = NULL;
501 }
502
503errorout:
504 return refresh;
505}
506
507WCHAR *Ext2StrLastW(WCHAR *t, WCHAR *s)
508{

Callers 1

Ext2StartSrvAsElevatedFunction · 0.85

Calls 1

Ext2StrLastAFunction · 0.85

Tested by

no test coverage detected