MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / Run

Function Run

WinArk/WinArk.cpp:103–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103int Run(LPTSTR lpstrCmdLine = nullptr, int nCmdShow = SW_SHOWDEFAULT) {
104 CMessageLoop theLoop;
105 _Module.AddMessageLoop(&theLoop);
106
107 HANDLE hThread = ::CreateThread(nullptr, 0, [](auto param)->DWORD {
108 std::string name = Helpers::GetNtosFileName();
109 std::wstring osFileName = Helpers::StringToWstring(name);
110 InitSymbols(osFileName.c_str());
111 if (!g_hasSymbol)
112 return -1;
113 InitSymbols(L"user32.dll");
114 if (!g_hasSymbol)
115 return -1;
116 InitSymbols(L"ntdll.dll");
117 if (!g_hasSymbol)
118 return -1;
119 InitSymbols(L"win32k.sys");
120 if (!g_hasSymbol)
121 return -1;
122 InitSymbols(L"drivers\\fltmgr.sys");
123 if (!g_hasSymbol)
124 return -1;
125
126
127 return 0;
128 }, nullptr, 0, nullptr);
129
130 ::WaitForSingleObject(hThread, INFINITE);
131 if (!g_hasSymbol||NULL == hThread) {
132 AtlMessageBox(0, L"Failed init symbols,\r\nWinArk will exit...\r\n���ų�ʼ��ʧ�ܣ������˳�...", L"WinArk", MB_ICONERROR);
133 ClearSymbols();
134 return 0;
135 }
136 ::CloseHandle(hThread);
137
138
139 SymbolHelper::Init();
140
141 InitColorSys();
142 InitFontSys();
143 InitPenSys();
144 InitBrushSys();
145 InitSchemSys();
146
147 CMainFrame wndMain;
148
149 /*CString cmdLine(lpstrCmdLine);
150 cmdLine.Trim(L" \"");
151 if(!cmdLine.IsEmpty()&&cmdLine.Right(11).CompareNoCase(L"regedit.exe")!=0)*/
152
153 // CreateEx�Ż���� IDR_MAINFRAME��ص���Դ
154 _hMainWnd = wndMain.CreateEx(NULL);
155 if (_hMainWnd == NULL) {
156 ATLTRACE(_T("Main dialog creation failed!\n"));
157 return 0;
158 }
159 AddNotifyIcon();
160

Callers 1

_tWinMainFunction · 0.85

Calls 11

InitSymbolsFunction · 0.85
ClearSymbolsFunction · 0.85
InitColorSysFunction · 0.85
InitFontSysFunction · 0.85
InitPenSysFunction · 0.85
InitBrushSysFunction · 0.85
InitSchemSysFunction · 0.85
AddNotifyIconFunction · 0.85
ShowIconNoticationFunction · 0.85
RemoveNotifyIconFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected