ReactOS  0.4.15-dev-3175-g222acf5
misc.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <windef.h>
4 #include <atlstr.h>
5 
6 #define EPOCH_DIFF 116444736000000000 //FILETIME starts from 1601-01-01 UTC, UnixTime starts from 1970-01-01
7 #define RATE_DIFF 10000000
8 
9 #ifdef _M_IX86
10 #define CurrentArchitecture L"x86"
11 #elif defined(_M_AMD64)
12 #define CurrentArchitecture L"amd64"
13 #elif defined(_M_ARM)
14 #define CurrentArchitecture L"arm"
15 #elif defined(_M_ARM64)
16 #define CurrentArchitecture L"arm64"
17 #elif defined(_M_IA64)
18 #define CurrentArchitecture L"ia64"
19 #elif defined(_M_PPC)
20 #define CurrentArchitecture L"ppc"
21 #endif
22 
27 
29 VOID ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem);
30 VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem);
34 
35 VOID InitLogs();
36 VOID FreeLogs();
37 BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg);
38 BOOL GetInstalledVersion(ATL::CStringW *pszVersion, const ATL::CStringW &szRegName);
39 
40 BOOL ExtractFilesFromCab(const ATL::CStringW& szCabName,
41  const ATL::CStringW& szCabDir,
42  const ATL::CStringW& szOutputDir);
43 
45 {
46  // Locale names cache
47  const static INT m_cchLocaleSize = 5;
48 
52 
54 
57  BOOL GetStringWorker(const ATL::CStringW& KeyName, PCWSTR Suffix, ATL::CStringW& ResultString);
58 
59 public:
61 
62  BOOL GetString(const ATL::CStringW& KeyName, ATL::CStringW& ResultString);
63  BOOL GetInt(const ATL::CStringW& KeyName, INT& iResult);
64 };
65 
66 BOOL PathAppendNoDirEscapeW(LPWSTR pszPath, LPCWSTR pszMore);
67 
69 
71 
72 void UnixTimeToFileTime(DWORD dwUnixTime, LPFILETIME pFileTime);
73 
74 BOOL SearchPatternMatch(LPCWSTR szHaystack, LPCWSTR szNeedle);
75 
76 template<class T>
77 class CLocalPtr : public CHeapPtr<T, CLocalAllocator>
78 {
79 };
80 
VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem)
Definition: misc.cpp:115
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL ExtractFilesFromCab(const ATL::CStringW &szCabName, const ATL::CStringW &szCabDir, const ATL::CStringW &szOutputDir)
Definition: cabinet.cpp:281
const uint16_t * PCWSTR
Definition: typedefs.h:57
ATL::CStringW GetINIFullPath(const ATL::CStringW &FileName)
Definition: misc.cpp:323
ATL::CStringW m_szLocaleID
Definition: misc.h:49
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
BOOL GetInstalledVersion(ATL::CStringW *pszVersion, const ATL::CStringW &szRegName)
Definition: misc.cpp:307
static const INT m_cchLocaleSize
Definition: misc.h:47
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:167
BOOL IsSystem64Bit()
Definition: misc.cpp:478
ATL::CStringW m_szCachedINISectionLocaleNeutral
Definition: misc.h:51
BOOL GetInt(const ATL::CStringW &KeyName, INT &iResult)
Definition: misc.cpp:409
VOID FreeLogs()
Definition: misc.cpp:239
int32_t INT
Definition: typedefs.h:58
BOOL StartProcess(ATL::CStringW &Path, BOOL Wait)
Definition: misc.cpp:121
BOOL SearchPatternMatch(LPCWSTR szHaystack, LPCWSTR szNeedle)
Definition: misc.cpp:543
ATL::CStringW m_szCachedINISectionLocale
Definition: misc.h:50
VOID InitLogs()
Definition: misc.cpp:195
unsigned int BOOL
Definition: ntddk_ex.h:94
const ATL::CStringW szConfigPath
Definition: misc.h:53
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2697
VOID CacheINILocale()
Definition: misc.cpp:334
_In_opt_ LPCSTR lpDirectory
Definition: shellapi.h:482
BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg)
Definition: misc.cpp:248
INT GetSystemColorDepth()
Definition: misc.cpp:506
INT GetClientWindowWidth(HWND hwnd)
Definition: misc.cpp:34
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL GetStorageDirectory(ATL::CStringW &lpDirectory)
Definition: misc.cpp:180
INT GetWindowHeight(HWND hwnd)
Definition: misc.cpp:26
VOID CopyTextToClipboard(LPCWSTR lpszText)
Definition: misc.cpp:50
PRTL_UNICODE_STRING_BUFFER Path
BOOL GetString(const ATL::CStringW &KeyName, ATL::CStringW &ResultString)
Definition: misc.cpp:389
INT GetWindowWidth(HWND hwnd)
Definition: misc.cpp:18
void UnixTimeToFileTime(DWORD dwUnixTime, LPFILETIME pFileTime)
Definition: misc.cpp:533
unsigned int UINT
Definition: ndis.h:50
CConfigParser(const ATL::CStringW &FileName="")
Definition: misc.cpp:318
INT GetClientWindowHeight(HWND hwnd)
Definition: misc.cpp:42
BOOL PathAppendNoDirEscapeW(LPWSTR pszPath, LPCWSTR pszMore)
Definition: misc.cpp:431
Definition: misc.h:77
VOID ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem)
Definition: misc.cpp:76
BOOL GetStringWorker(const ATL::CStringW &KeyName, PCWSTR Suffix, ATL::CStringW &ResultString)
Definition: misc.cpp:351
WCHAR * LPWSTR
Definition: xmlstorage.h:184