Go to the source code of this file.
Definition at line 90 of file win32_misc.cpp.
91 typedef const char *(__cdecl *t_wine_get_build_id)(
void);
92 typedef void (__cdecl *t_wine_get_host_version)(
const char **sysname,
const char **release );
93 const HMODULE ntdll = GetModuleHandle(_T(
"ntdll.dll"));
94 if (ntdll == NULL)
return false;
95 t_wine_get_build_id wine_get_build_id;
96 t_wine_get_host_version wine_get_host_version;
97 wine_get_build_id = (t_wine_get_build_id)GetProcAddress(ntdll,
"wine_get_build_id");
98 wine_get_host_version = (t_wine_get_host_version)GetProcAddress(ntdll,
"wine_get_host_version");
99 if (wine_get_build_id == NULL || wine_get_host_version == NULL) {
100 if (GetProcAddress(ntdll,
"wine_server_call") != NULL) {
101 out <<
"wine (unknown version)";
106 const char * sysname = NULL;
const char * release = NULL;
107 wine_get_host_version(&sysname, &release);
108 out << wine_get_build_id() <<
", on: " << sysname <<
" / " << release;
Definition at line 81 of file win32_misc.cpp.
void GetOSVersionStringAppend(pfc::string_base &out)
Definition at line 111 of file win32_misc.cpp.
115 OSVERSIONINFO ver = {}; ver.dwOSVersionInfoSize =
sizeof(ver);
116 WIN32_OP( GetVersionEx(&ver) );
117 SYSTEM_INFO
info = {};
118 GetNativeSystemInfo(&info);
120 out <<
"Windows " << (int)ver.dwMajorVersion <<
"." << (
int)ver.dwMinorVersion <<
"." << (int)ver.dwBuildNumber;
123 switch(info.wProcessorArchitecture) {
124 case PROCESSOR_ARCHITECTURE_AMD64:
125 out <<
" x64";
break;
126 case PROCESSOR_ARCHITECTURE_IA64:
127 out <<
" IA64";
break;
128 case PROCESSOR_ARCHITECTURE_INTEL:
129 out <<
" x86";
break;
void info(const char *p_message)
string_utf8_from_wide string_utf8_from_os
static bool FetchWineInfoAppend(pfc::string_base &out)
bool IsMenuNonEmpty |
( |
HMENU |
menu | ) |
|
Definition at line 43 of file win32_misc.cpp.
44 unsigned n,m=GetMenuItemCount(menu);
46 if (GetSubMenu(menu,n))
return true;
47 if (!(GetMenuState(menu,n,MF_BYPOSITION)&MF_SEPARATOR))
return true;
unsigned QueryScreenDPI |
( |
| ) |
|
Definition at line 27 of file win32_misc.cpp.
29 unsigned ret = GetDeviceCaps(dc,LOGPIXELSY);
SIZE QueryScreenDPIEx |
( |
| ) |
|
Definition at line 35 of file win32_misc.cpp.
37 SIZE ret = { GetDeviceCaps(dc,LOGPIXELSY), GetDeviceCaps(dc,LOGPIXELSY) };
static bool running_under_wine |
( |
void |
| ) |
|
|
static |
Definition at line 85 of file win32_misc.cpp.
86 HMODULE module = GetModuleHandle(_T(
"ntdll.dll"));
87 if (!module)
return false;
88 return GetProcAddress(module,
"wine_server_call") != NULL;
bool SetClipboardDataBlock |
( |
UINT |
p_format, |
|
|
const void * |
p_block, |
|
|
t_size |
p_block_size |
|
) |
| |
Definition at line 143 of file win32_misc.cpp.
145 if (OpenClipboard(NULL)) {
147 HANDLE handle = GlobalAlloc(GMEM_MOVEABLE,p_block_size);
148 if (handle == NULL) {
150 throw std::bad_alloc();
152 {
CGlobalLock lock(handle);memcpy(lock.GetPtr(),p_block,p_block_size);}
153 if (SetClipboardData(p_format,handle) == NULL) {
typedef HANDLE(WINAPI *pPowerCreateRequest_t)(__in void *Context)
void SetDefaultMenuItem |
( |
HMENU |
p_menu, |
|
|
unsigned |
p_id |
|
) |
| |
Definition at line 134 of file win32_misc.cpp.
136 info.fMask = MIIM_STATE;
137 GetMenuItemInfo(p_menu,p_id,FALSE,&info);
138 info.fState |= MFS_DEFAULT;
139 SetMenuItemInfo(p_menu,p_id,FALSE,&info);
void info(const char *p_message)
void WIN32_OP_D_FAIL |
( |
const wchar_t * |
_Message, |
|
|
const wchar_t * |
_File, |
|
|
unsigned |
_Line |
|
) |
| |
Definition at line 66 of file win32_misc.cpp.
67 const DWORD code = GetLastError();
69 wsprintfW(msgFormatted.
get_ptr(), L
"%s (code: %u)", _Message, code);
70 if (IsDebuggerPresent()) {
71 OutputDebugString(TEXT(
"WIN32_OP_D() failure:\n"));
72 OutputDebugString(msgFormatted.
get_ptr());
73 OutputDebugString(TEXT(
"\n"));
76 _wassert(msgFormatted.
get_ptr(),_File,_Line);
const t_item * get_ptr() const
t_size strlen_t(const t_char *p_string, t_size p_length=~0)
void set_size(t_size p_size)
PFC_NORETURN PFC_NOINLINE void WIN32_OP_FAIL |
( |
| ) |
|
Definition at line 52 of file win32_misc.cpp.
53 const DWORD code = GetLastError();
54 PFC_ASSERT( code != NO_ERROR );
PFC_NORETURN PFC_NOINLINE void WIN32_OP_FAIL_CRITICAL |
( |
const char * |
what | ) |
|
Definition at line 58 of file win32_misc.cpp.
59 const DWORD code = GetLastError();
60 PFC_ASSERT( code != NO_ERROR );
const char * get_ptr() const
PFC_NORETURN void SHARED_EXPORT uBugCheck()