ReactOS  0.4.12-dev-57-g7050ac4
misc.cpp File Reference
#include "rapps.h"
#include "gui.h"
#include "misc.h"
Include dependency graph for misc.cpp:

Go to the source code of this file.

Functions

INT GetWindowWidth (HWND hwnd)
 
INT GetWindowHeight (HWND hwnd)
 
INT GetClientWindowWidth (HWND hwnd)
 
INT GetClientWindowHeight (HWND hwnd)
 
VOID CopyTextToClipboard (LPCWSTR lpszText)
 
VOID SetWelcomeText ()
 
VOID ShowPopupMenu (HWND hwnd, UINT MenuID, UINT DefaultItem)
 
BOOL StartProcess (ATL::CStringW &Path, BOOL Wait)
 
BOOL StartProcess (LPWSTR lpPath, BOOL Wait)
 
BOOL GetStorageDirectory (ATL::CStringW &Directory)
 
VOID InitLogs ()
 
VOID FreeLogs ()
 
BOOL WriteLogMessage (WORD wType, DWORD dwEventID, LPCWSTR lpMsg)
 
BOOL GetInstalledVersion_WowUser (ATL::CStringW *szVersionResult, const ATL::CStringW &szRegName, BOOL IsUserKey, REGSAM keyWow)
 
BOOL GetInstalledVersion (ATL::CStringW *pszVersion, const ATL::CStringW &szRegName)
 

Variables

static HANDLE hLog = NULL
 

Function Documentation

◆ CopyTextToClipboard()

VOID CopyTextToClipboard ( LPCWSTR  lpszText)

Definition at line 49 of file misc.cpp.

Referenced by CMainWindow::OnCommand().

50 {
51  if (!OpenClipboard(NULL))
52  {
53  return;
54  }
55 
56  HRESULT hr;
57  HGLOBAL ClipBuffer;
58  LPWSTR Buffer;
60 
62  cchBuffer = wcslen(lpszText) + 1;
63  ClipBuffer = GlobalAlloc(GMEM_DDESHARE, cchBuffer * sizeof(WCHAR));
64 
65  Buffer = (PWCHAR) GlobalLock(ClipBuffer);
66  hr = StringCchCopyW(Buffer, cchBuffer, lpszText);
67  GlobalUnlock(ClipBuffer);
68 
69  if (SUCCEEDED(hr))
70  SetClipboardData(CF_UNICODETEXT, ClipBuffer);
71 
73 }
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
__wchar_t WCHAR
Definition: xmlstorage.h:180
uint16_t * PWCHAR
Definition: typedefs.h:54
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
static DWORD cchBuffer
Definition: fusion.c:83
#define CF_UNICODETEXT
Definition: constants.h:408
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI EmptyClipboard(void)
Definition: ntwrapper.h:190
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
#define GMEM_DDESHARE
Definition: winbase.h:295
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ FreeLogs()

VOID FreeLogs ( )

Definition at line 247 of file misc.cpp.

Referenced by CMainWindow::ProcessWindowMessage(), and wmain().

248 {
249  if (hLog)
250  {
252  }
253 }
static HANDLE hLog
Definition: misc.cpp:15
BOOL WINAPI DeregisterEventSource(IN HANDLE hEventLog)
Definition: eventlog.c:473

◆ GetClientWindowHeight()

INT GetClientWindowHeight ( HWND  hwnd)

Definition at line 41 of file misc.cpp.

Referenced by HSplitterWindowProc(), and VSplitterWindowProc().

42 {
43  RECT Rect;
44 
45  GetClientRect(hwnd, &Rect);
46  return (Rect.bottom - Rect.top);
47 }
LONG top
Definition: windef.h:297
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
LONG bottom
Definition: windef.h:299
struct Rect Rect

◆ GetClientWindowWidth()

INT GetClientWindowWidth ( HWND  hwnd)

Definition at line 33 of file misc.cpp.

Referenced by HSplitterWindowProc(), and VSplitterWindowProc().

34 {
35  RECT Rect;
36 
37  GetClientRect(hwnd, &Rect);
38  return (Rect.right - Rect.left);
39 }
LONG left
Definition: windef.h:296
LONG right
Definition: windef.h:298
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
struct Rect Rect

◆ GetInstalledVersion()

BOOL GetInstalledVersion ( ATL::CStringW pszVersion,
const ATL::CStringW szRegName 
)

Definition at line 316 of file misc.cpp.

Referenced by CAvailableApplicationInfo::RetrieveInstalledStatus(), and CAvailableApplicationInfo::RetrieveInstalledVersion().

317 {
318  return (!szRegName.IsEmpty()
319  && (GetInstalledVersion_WowUser(pszVersion, szRegName, TRUE, KEY_WOW64_32KEY)
320  || GetInstalledVersion_WowUser(pszVersion, szRegName, FALSE, KEY_WOW64_32KEY)
321  || GetInstalledVersion_WowUser(pszVersion, szRegName, TRUE, KEY_WOW64_64KEY)
322  || GetInstalledVersion_WowUser(pszVersion, szRegName, FALSE, KEY_WOW64_64KEY)));
323 }
#define TRUE
Definition: types.h:120
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46
bool IsEmpty() const
Definition: atlsimpstr.h:379
#define KEY_WOW64_32KEY
Definition: cmtypes.h:45
BOOL GetInstalledVersion_WowUser(ATL::CStringW *szVersionResult, const ATL::CStringW &szRegName, BOOL IsUserKey, REGSAM keyWow)
Definition: misc.cpp:272

◆ GetInstalledVersion_WowUser()

BOOL GetInstalledVersion_WowUser ( ATL::CStringW szVersionResult,
const ATL::CStringW szRegName,
BOOL  IsUserKey,
REGSAM  keyWow 
)

Definition at line 272 of file misc.cpp.

Referenced by GetInstalledVersion().

276 {
277  BOOL bHasSucceded = FALSE;
280  ATL::CStringW szPath = ATL::CStringW(L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%ls") + szRegName;
281 
282  if (key.Open(IsUserKey ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE,
283  szPath.GetString(),
284  keyWow | KEY_READ) != ERROR_SUCCESS)
285  {
286  return FALSE;
287  }
288 
289  if (szVersionResult != NULL)
290  {
291  ULONG dwSize = MAX_PATH * sizeof(WCHAR);
292 
293  if (key.QueryStringValue(L"DisplayVersion",
294  szVersion.GetBuffer(MAX_PATH),
295  &dwSize) == ERROR_SUCCESS)
296  {
297  szVersion.ReleaseBuffer();
298  *szVersionResult = szVersion;
299  bHasSucceded = TRUE;
300  }
301  else
302  {
303  szVersion.ReleaseBuffer();
304  }
305  }
306  else
307  {
308  bHasSucceded = TRUE;
309  szVersion.ReleaseBuffer();
310  }
311  key.Close();
312 
313  return bHasSucceded;
314 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define WCHAR
Definition: msvc.h:43
LONG Close()
Definition: atlbase.h:1061
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
smooth NULL
Definition: ftsmooth.c:416
unsigned int BOOL
Definition: ntddk_ex.h:94
#define MAX_PATH
Definition: compat.h:26
PCXSTR GetString() const
Definition: atlsimpstr.h:361
LONG Open(HKEY hKeyParent, LPCTSTR lpszKeyName, REGSAM samDesired=KEY_READ|KEY_WRITE)
Definition: atlbase.h:1078
LONG QueryStringValue(LPCTSTR pszValueName, LPTSTR pszValue, ULONG *pnChars)
Definition: atlbase.h:1157
static LPCWSTR szVersion
Definition: asmcache.c:748
static const WCHAR L[]
Definition: oid.c:1087
HKEY key
Definition: reg.c:42
LPCWSTR szPath
Definition: env.c:35
unsigned int ULONG
Definition: retypes.h:1
CAtlStringW CStringW
Definition: atlstr.h:130
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

◆ GetStorageDirectory()

BOOL GetStorageDirectory ( ATL::CStringW Directory)

Definition at line 187 of file misc.cpp.

Referenced by AvailableStrings::AvailableStrings(), CConfigParser::GetINIFullPath(), and CDownloadManager::ThreadFunc().

188 {
190  {
191  Directory.ReleaseBuffer();
192  return FALSE;
193  }
194 
195  Directory.ReleaseBuffer();
196  Directory += L"\\rapps";
197 
198  return (CreateDirectoryW(Directory.GetString(), NULL) || GetLastError() == ERROR_ALREADY_EXISTS);
199 }
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
#define TRUE
Definition: types.h:120
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
smooth NULL
Definition: ftsmooth.c:416
#define CSIDL_LOCAL_APPDATA
Definition: shlobj.h:2015
#define MAX_PATH
Definition: compat.h:26
PCXSTR GetString() const
Definition: atlsimpstr.h:361
static const WCHAR L[]
Definition: oid.c:1087
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
Definition: shellpath.c:2566
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80

◆ GetWindowHeight()

INT GetWindowHeight ( HWND  hwnd)

Definition at line 25 of file misc.cpp.

Referenced by HSplitterWindowProc(), and VSplitterWindowProc().

26 {
27  RECT Rect;
28 
29  GetWindowRect(hwnd, &Rect);
30  return (Rect.bottom - Rect.top);
31 }
LONG top
Definition: windef.h:297
LONG bottom
Definition: windef.h:299
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
struct Rect Rect

◆ GetWindowWidth()

INT GetWindowWidth ( HWND  hwnd)

Definition at line 17 of file misc.cpp.

Referenced by HSplitterWindowProc().

18 {
19  RECT Rect;
20 
21  GetWindowRect(hwnd, &Rect);
22  return (Rect.right - Rect.left);
23 }
LONG left
Definition: windef.h:296
LONG right
Definition: windef.h:298
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
struct Rect Rect

◆ InitLogs()

VOID InitLogs ( )

Definition at line 201 of file misc.cpp.

Referenced by wmain(), and wWinMain().

202 {
204  {
205  return;
206  }
207 
209  DWORD dwCategoryNum = 1;
210  DWORD dwDisp, dwData;
212 
213  if (key.Create(HKEY_LOCAL_MACHINE,
214  L"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\ReactOS Application Manager",
216  {
217  return;
218  }
219 
220  if (!GetModuleFileNameW(NULL, szPath, _countof(szPath)))
221  {
222  return;
223  }
224 
227 
228  if ((key.SetStringValue(L"EventMessageFile",
229  szPath,
231  && (key.SetStringValue(L"CategoryMessageFile",
232  szPath,
234  && (key.SetDWORDValue(L"TypesSupported",
235  dwData) == ERROR_SUCCESS)
236  && (key.SetDWORDValue(L"CategoryCount",
237  dwCategoryNum) == ERROR_SUCCESS))
238 
239  {
240  hLog = RegisterEventSourceW(NULL, L"ReactOS Application Manager");
241  }
242 
243  key.Close();
244 }
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:607
#define ERROR_SUCCESS
Definition: deptool.c:10
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: fontsub.cpp:30
static HANDLE ULONG_PTR dwData
Definition: file.c:35
LONG Close()
Definition: atlbase.h:1061
#define EVENTLOG_ERROR_TYPE
Definition: winnt_old.h:2630
smooth NULL
Definition: ftsmooth.c:416
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:19
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
LONG SetDWORDValue(LPCTSTR pszValueName, DWORD dwValue)
Definition: atlbase.h:1227
#define EVENTLOG_INFORMATION_TYPE
Definition: winnt_old.h:2632
#define EVENTLOG_WARNING_TYPE
Definition: winnt_old.h:2631
#define MAX_PATH
Definition: compat.h:26
static HANDLE hLog
Definition: misc.cpp:15
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1087
HKEY key
Definition: reg.c:42
LONG Create(HKEY hKeyParent, LPCTSTR lpszKeyName, LPTSTR lpszClass=REG_NONE, DWORD dwOptions=REG_OPTION_NON_VOLATILE, REGSAM samDesired=KEY_READ|KEY_WRITE, LPSECURITY_ATTRIBUTES lpSecAttr=NULL, LPDWORD lpdwDisposition=NULL)
Definition: atlbase.h:1099
BOOL bLogEnabled
Definition: winmain.h:9
LPCWSTR szPath
Definition: env.c:35
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define REG_NONE
Definition: nt_native.h:1492
HANDLE WINAPI RegisterEventSourceW(IN LPCWSTR lpUNCServerName, IN LPCWSTR lpSourceName)
Definition: eventlog.c:1295
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
LONG SetStringValue(LPCTSTR pszValueName, LPCTSTR pszValue, DWORD dwType=REG_SZ)
Definition: atlbase.h:1232

◆ SetWelcomeText()

VOID SetWelcomeText ( )

Definition at line 75 of file misc.cpp.

Referenced by CMainWindow::UpdateApplicationsList().

76 {
78 
79  szText.LoadStringW(IDS_WELCOME_TITLE);
80  NewRichEditText(szText, CFE_BOLD);
81 
82  szText.LoadStringW(IDS_WELCOME_TEXT);
83  InsertRichEditText(szText, 0);
84 
85  szText.LoadStringW(IDS_WELCOME_URL);
87 }
VOID NewRichEditText(LPCWSTR szText, DWORD flags)
Definition: gui.cpp:1792
#define IDS_WELCOME_TITLE
Definition: resource.h:91
#define IDS_WELCOME_TEXT
Definition: resource.h:92
#define CFE_BOLD
Definition: richedit.h:406
static const WCHAR szText[]
Definition: dialog.c:139
VOID InsertRichEditText(LPCWSTR szText, DWORD flags)
Definition: gui.cpp:1797
#define CFM_LINK
Definition: richedit.h:337
#define IDS_WELCOME_URL
Definition: resource.h:93

◆ ShowPopupMenu()

VOID ShowPopupMenu ( HWND  hwnd,
UINT  MenuID,
UINT  DefaultItem 
)

Definition at line 89 of file misc.cpp.

Referenced by CMainWindow::OnLink(), and CMainWindow::ProcessWindowMessage().

90 {
91  HMENU hMenu = NULL;
92  HMENU hPopupMenu;
93  MENUITEMINFO ItemInfo;
94  POINT pt;
95 
96  if (MenuID)
97  {
98  hMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(MenuID));
99  hPopupMenu = GetSubMenu(hMenu, 0);
100  }
101  else
102  {
103  hPopupMenu = GetMenu(hwnd);
104  }
105 
106  ZeroMemory(&ItemInfo, sizeof(ItemInfo));
107  ItemInfo.cbSize = sizeof(ItemInfo);
108  ItemInfo.fMask = MIIM_STATE;
109 
110  GetMenuItemInfoW(hPopupMenu, DefaultItem, FALSE, &ItemInfo);
111 
112  if (!(ItemInfo.fState & MFS_GRAYED))
113  {
114  SetMenuDefaultItem(hPopupMenu, DefaultItem, FALSE);
115  }
116 
117  GetCursorPos(&pt);
118 
119  SetForegroundWindow(hwnd);
120  TrackPopupMenu(hPopupMenu, 0, pt.x, pt.y, 0, hMainWnd, NULL);
121 
122  if (hMenu)
123  {
124  DestroyMenu(hMenu);
125  }
126 }
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define pt(x, y)
Definition: drawing.c:79
#define ZeroMemory
Definition: winbase.h:1635
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
#define MIIM_STATE
Definition: winuser.h:716
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
HWND hMainWnd
Definition: magnifier.c:33
#define MFS_GRAYED
Definition: winuser.h:746
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
BOOL WINAPI DestroyMenu(_In_ HMENU)
HINSTANCE hInst
Definition: dxdiag.c:13
BOOL WINAPI SetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)

◆ StartProcess() [1/2]

BOOL StartProcess ( ATL::CStringW Path,
BOOL  Wait 
)

Definition at line 128 of file misc.cpp.

Referenced by UninstallApplication().

129 {
130  return StartProcess(const_cast<LPWSTR>(Path.GetString()), Wait);;
131 }
PCXSTR GetString() const
Definition: atlsimpstr.h:361
BOOL StartProcess(ATL::CStringW &Path, BOOL Wait)
Definition: misc.cpp:128
IN BOOLEAN Wait
Definition: fatprocs.h:1529

◆ StartProcess() [2/2]

BOOL StartProcess ( LPWSTR  lpPath,
BOOL  Wait 
)

Definition at line 133 of file misc.cpp.

134 {
136  STARTUPINFOW si;
137  DWORD dwRet;
138  MSG msg;
139 
140  ZeroMemory(&si, sizeof(si));
141  si.cb = sizeof(si);
143  si.wShowWindow = SW_SHOW;
144 
145  if (!CreateProcessW(NULL, lpPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
146  {
147  return FALSE;
148  }
149 
150  CloseHandle(pi.hThread);
151 
152  if (Wait)
153  {
155  }
156 
157  while (Wait)
158  {
160  if (dwRet == WAIT_OBJECT_0 + 1)
161  {
162  while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
163  {
164  TranslateMessage(&msg);
165  DispatchMessageW(&msg);
166  }
167  }
168  else
169  {
170  if (dwRet == WAIT_OBJECT_0 || dwRet == WAIT_FAILED)
171  break;
172  }
173  }
174 
175  CloseHandle(pi.hProcess);
176 
177  if (Wait)
178  {
182  }
183 
184  return TRUE;
185 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define ZeroMemory
Definition: winbase.h:1635
HWND WINAPI SetFocus(_In_opt_ HWND)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
smooth NULL
Definition: ftsmooth.c:416
#define QS_ALLEVENTS
Definition: winuser.h:873
#define STARTF_USESHOWWINDOW
Definition: winbase.h:472
#define SW_SHOW
Definition: winuser.h:769
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4623
#define WAIT_OBJECT_0
Definition: winbase.h:387
DWORD cb
Definition: winbase.h:817
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WAIT_FAILED
Definition: winbase.h:394
static DWORD pi
Definition: protocol.c:150
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
HWND hMainWnd
Definition: magnifier.c:33
WORD wShowWindow
Definition: winbase.h:829
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define msg(x)
Definition: auth_time.c:54
BOOL WINAPI SetForegroundWindow(_In_ HWND)
DWORD dwFlags
Definition: winbase.h:828
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1182
#define INFINITE
Definition: serial.h:102
IN BOOLEAN Wait
Definition: fatprocs.h:1529

◆ WriteLogMessage()

BOOL WriteLogMessage ( WORD  wType,
DWORD  dwEventID,
LPCWSTR  lpMsg 
)

Definition at line 256 of file misc.cpp.

Referenced by UninstallApplication().

257 {
259  {
260  return TRUE;
261  }
262 
263  if (!ReportEventW(hLog, wType, 0, dwEventID,
264  NULL, 1, 0, &lpMsg, NULL))
265  {
266  return FALSE;
267  }
268 
269  return TRUE;
270 }
#define TRUE
Definition: types.h:120
smooth NULL
Definition: ftsmooth.c:416
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:19
static HANDLE hLog
Definition: misc.cpp:15
BOOL WINAPI ReportEventW(IN HANDLE hEventLog, IN WORD wType, IN WORD wCategory, IN DWORD dwEventID, IN PSID lpUserSid, IN WORD wNumStrings, IN DWORD dwDataSize, IN LPCWSTR *lpStrings, IN LPVOID lpRawData)
Definition: eventlog.c:1516
BOOL bLogEnabled
Definition: winmain.h:9

Variable Documentation

◆ hLog

HANDLE hLog = NULL
static

Definition at line 15 of file misc.cpp.

Referenced by ScmLogEvent(), SetupInitializeFileLogA(), SetupInitializeFileLogW(), and wmain().