MCPcopy Create free account
hub / github.com/baldurk/renderdoc / Execute

Method Execute

renderdoccmd/renderdoccmd_win32.cpp:575–768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

573 }
574 virtual rdcarray<rdcstr> ReplayArgs() { return {"--crash"}; }
575 virtual int Execute(const CaptureOptions &)
576 {
577 CrashGenerationServer *crashServer = NULL;
578
579 wchar_t tempPath[MAX_PATH] = {0};
580 GetTempPathW(MAX_PATH - 1, tempPath);
581
582 std::wstring dumpFolder = tempPath;
583
584 // create each parent directory separately, and use \\s
585
586 dumpFolder += L"RenderDoc";
587 CreateDirectoryW(dumpFolder.c_str(), NULL);
588
589 dumpFolder += L"\\dumps";
590 CreateDirectoryW(dumpFolder.c_str(), NULL);
591
592 crashServer =
593 new CrashGenerationServer(pipe.c_str(), NULL, OnClientConnected, NULL, OnClientCrashed,
594 NULL, OnClientExited, NULL, NULL, NULL, true, &dumpFolder);
595
596 if(!crashServer->Start())
597 {
598 delete crashServer;
599 crashServer = NULL;
600 return 1;
601 }
602
603 HANDLE readyEvent = CreateEventA(NULL, TRUE, FALSE, "RENDERDOC_CRASHHANDLE");
604
605 if(readyEvent != NULL)
606 {
607 SetEvent(readyEvent);
608
609 CloseHandle(readyEvent);
610 }
611
612 const int loopSleep = 100;
613 int elapsedTime = 0;
614
615 MSG msg;
616 ZeroMemory(&msg, sizeof(msg));
617 while(!exitServer)
618 {
619 // Check to see if any messages are waiting in the queue
620 while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
621 {
622 // Translate the message and dispatch it to WindowProc()
623 TranslateMessage(&msg);
624 DispatchMessage(&msg);
625 }
626
627 // If the message is WM_QUIT, exit the while loop
628 if(msg.message == WM_QUIT)
629 break;
630
631 Sleep(loopSleep);
632 elapsedTime += loopSleep;

Callers

nothing calls this directly

Calls 10

rdcstrClass · 0.85
convFunction · 0.70
SleepFunction · 0.50
fcloseFunction · 0.50
c_strMethod · 0.45
StartMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected