gchar *utmp;
#ifndef G_OS_WIN32
- glong max;
gsize size;
/* The number 256 * 256 is taken from the value of _POSIX_HOST_NAME_MAX,
* which is 255. Since we use _POSIX_HOST_NAME_MAX + 1 (= 256) in the
gchar *tmp;
#ifdef _SC_HOST_NAME_MAX
- max = sysconf (_SC_HOST_NAME_MAX);
- if (max > 0 && max <= G_MAXSIZE - 1)
- size = (gsize) max + 1;
- else
+ {
+ glong max;
+
+ max = sysconf (_SC_HOST_NAME_MAX);
+ if (max > 0 && (gsize) max <= G_MAXSIZE - 1)
+ size = (gsize) max + 1;
+ else
#ifdef HOST_NAME_MAX
- size = HOST_NAME_MAX + 1;
+ size = HOST_NAME_MAX + 1;
#else
- size = _POSIX_HOST_NAME_MAX + 1;
+ size = _POSIX_HOST_NAME_MAX + 1;
#endif /* HOST_NAME_MAX */
+ }
#else
/* Fallback to some reasonable value */
size = 256;
wchar_t *wcp;
- p_SHGetKnownFolderPath = (t_SHGetKnownFolderPath) GetProcAddress (GetModuleHandle ("shell32.dll"),
+ p_SHGetKnownFolderPath = (t_SHGetKnownFolderPath) GetProcAddress (GetModuleHandleW (L"shell32.dll"),
"SHGetKnownFolderPath");
g_user_special_dirs[G_USER_DIRECTORY_DESKTOP] = get_special_folder (CSIDL_DESKTOPDIRECTORY);
{
/* Holds the g_utils_global lock */
- static gboolean beenhere = FALSE;
- typedef BOOL (WINAPI *t_GetModuleHandleExA) (DWORD, LPCTSTR, HMODULE *);
- static t_GetModuleHandleExA p_GetModuleHandleExA = NULL;
HMODULE hmodule = NULL;
if (!address)
return NULL;
- if (!beenhere)
- {
- p_GetModuleHandleExA =
- (t_GetModuleHandleExA) GetProcAddress (GetModuleHandle ("kernel32.dll"),
- "GetModuleHandleExA");
- beenhere = TRUE;
- }
-
- if (p_GetModuleHandleExA == NULL ||
- !(*p_GetModuleHandleExA) (GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT |
- GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
- address, &hmodule))
+ if (!GetModuleHandleExW (GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT |
+ GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
+ address, &hmodule))
{
MEMORY_BASIC_INFORMATION mbi;
VirtualQuery (address, &mbi, sizeof (mbi));
{
/* One call to break the debugger */
DebugBreak ();
- /* One call in case CRT does get saner about abort() behaviour */
+ /* One call in case CRT changes its abort() behaviour */
abort ();
/* And one call to bind them all and terminate the program for sure */
ExitProcess (127);