Commit 9d4f32e8 authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

src/w32*.c: Whitespace fixes and typos.

parent 9650fc61
...@@ -315,8 +315,8 @@ is_windows_9x () ...@@ -315,8 +315,8 @@ is_windows_9x ()
if (g_b_init_is_windows_9x == 0) if (g_b_init_is_windows_9x == 0)
{ {
g_b_init_is_windows_9x = 1; g_b_init_is_windows_9x = 1;
ZeroMemory(&os_ver, sizeof(OSVERSIONINFO)); ZeroMemory (&os_ver, sizeof (OSVERSIONINFO));
os_ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); os_ver.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
if (GetVersionEx (&os_ver)) if (GetVersionEx (&os_ver))
{ {
s_b_ret = (os_ver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS); s_b_ret = (os_ver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS);
...@@ -334,7 +334,7 @@ w32_get_internal_run_time () ...@@ -334,7 +334,7 @@ w32_get_internal_run_time ()
if (get_process_times_fn) if (get_process_times_fn)
{ {
FILETIME create, exit, kernel, user; FILETIME create, exit, kernel, user;
HANDLE proc = GetCurrentProcess(); HANDLE proc = GetCurrentProcess ();
if ((*get_process_times_fn) (proc, &create, &exit, &kernel, &user)) if ((*get_process_times_fn) (proc, &create, &exit, &kernel, &user))
{ {
LARGE_INTEGER user_int, kernel_int, total; LARGE_INTEGER user_int, kernel_int, total;
...@@ -367,10 +367,10 @@ w32_get_internal_run_time () ...@@ -367,10 +367,10 @@ w32_get_internal_run_time ()
/* ** The wrapper functions ** */ /* ** The wrapper functions ** */
BOOL WINAPI open_process_token ( BOOL WINAPI
HANDLE ProcessHandle, open_process_token (HANDLE ProcessHandle,
DWORD DesiredAccess, DWORD DesiredAccess,
PHANDLE TokenHandle) PHANDLE TokenHandle)
{ {
static OpenProcessToken_Proc s_pfn_Open_Process_Token = NULL; static OpenProcessToken_Proc s_pfn_Open_Process_Token = NULL;
HMODULE hm_advapi32 = NULL; HMODULE hm_advapi32 = NULL;
...@@ -397,12 +397,12 @@ BOOL WINAPI open_process_token ( ...@@ -397,12 +397,12 @@ BOOL WINAPI open_process_token (
); );
} }
BOOL WINAPI get_token_information ( BOOL WINAPI
HANDLE TokenHandle, get_token_information (HANDLE TokenHandle,
TOKEN_INFORMATION_CLASS TokenInformationClass, TOKEN_INFORMATION_CLASS TokenInformationClass,
LPVOID TokenInformation, LPVOID TokenInformation,
DWORD TokenInformationLength, DWORD TokenInformationLength,
PDWORD ReturnLength) PDWORD ReturnLength)
{ {
static GetTokenInformation_Proc s_pfn_Get_Token_Information = NULL; static GetTokenInformation_Proc s_pfn_Get_Token_Information = NULL;
HMODULE hm_advapi32 = NULL; HMODULE hm_advapi32 = NULL;
...@@ -431,14 +431,14 @@ BOOL WINAPI get_token_information ( ...@@ -431,14 +431,14 @@ BOOL WINAPI get_token_information (
); );
} }
BOOL WINAPI lookup_account_sid ( BOOL WINAPI
LPCTSTR lpSystemName, lookup_account_sid (LPCTSTR lpSystemName,
PSID Sid, PSID Sid,
LPTSTR Name, LPTSTR Name,
LPDWORD cbName, LPDWORD cbName,
LPTSTR DomainName, LPTSTR DomainName,
LPDWORD cbDomainName, LPDWORD cbDomainName,
PSID_NAME_USE peUse) PSID_NAME_USE peUse)
{ {
static LookupAccountSid_Proc s_pfn_Lookup_Account_Sid = NULL; static LookupAccountSid_Proc s_pfn_Lookup_Account_Sid = NULL;
HMODULE hm_advapi32 = NULL; HMODULE hm_advapi32 = NULL;
...@@ -469,8 +469,8 @@ BOOL WINAPI lookup_account_sid ( ...@@ -469,8 +469,8 @@ BOOL WINAPI lookup_account_sid (
); );
} }
PSID_IDENTIFIER_AUTHORITY WINAPI get_sid_identifier_authority ( PSID_IDENTIFIER_AUTHORITY WINAPI
PSID pSid) get_sid_identifier_authority (PSID pSid)
{ {
static GetSidIdentifierAuthority_Proc s_pfn_Get_Sid_Identifier_Authority = NULL; static GetSidIdentifierAuthority_Proc s_pfn_Get_Sid_Identifier_Authority = NULL;
HMODULE hm_advapi32 = NULL; HMODULE hm_advapi32 = NULL;
...@@ -493,9 +493,8 @@ PSID_IDENTIFIER_AUTHORITY WINAPI get_sid_identifier_authority ( ...@@ -493,9 +493,8 @@ PSID_IDENTIFIER_AUTHORITY WINAPI get_sid_identifier_authority (
return (s_pfn_Get_Sid_Identifier_Authority (pSid)); return (s_pfn_Get_Sid_Identifier_Authority (pSid));
} }
PDWORD WINAPI get_sid_sub_authority ( PDWORD WINAPI
PSID pSid, get_sid_sub_authority (PSID pSid, DWORD n)
DWORD n)
{ {
static GetSidSubAuthority_Proc s_pfn_Get_Sid_Sub_Authority = NULL; static GetSidSubAuthority_Proc s_pfn_Get_Sid_Sub_Authority = NULL;
static DWORD zero = 0U; static DWORD zero = 0U;
...@@ -519,8 +518,8 @@ PDWORD WINAPI get_sid_sub_authority ( ...@@ -519,8 +518,8 @@ PDWORD WINAPI get_sid_sub_authority (
return (s_pfn_Get_Sid_Sub_Authority (pSid, n)); return (s_pfn_Get_Sid_Sub_Authority (pSid, n));
} }
PUCHAR WINAPI get_sid_sub_authority_count ( PUCHAR WINAPI
PSID pSid) get_sid_sub_authority_count (PSID pSid)
{ {
static GetSidSubAuthorityCount_Proc s_pfn_Get_Sid_Sub_Authority_Count = NULL; static GetSidSubAuthorityCount_Proc s_pfn_Get_Sid_Sub_Authority_Count = NULL;
static UCHAR zero = 0U; static UCHAR zero = 0U;
...@@ -544,12 +543,12 @@ PUCHAR WINAPI get_sid_sub_authority_count ( ...@@ -544,12 +543,12 @@ PUCHAR WINAPI get_sid_sub_authority_count (
return (s_pfn_Get_Sid_Sub_Authority_Count (pSid)); return (s_pfn_Get_Sid_Sub_Authority_Count (pSid));
} }
BOOL WINAPI get_file_security ( BOOL WINAPI
LPCTSTR lpFileName, get_file_security (LPCTSTR lpFileName,
SECURITY_INFORMATION RequestedInformation, SECURITY_INFORMATION RequestedInformation,
PSECURITY_DESCRIPTOR pSecurityDescriptor, PSECURITY_DESCRIPTOR pSecurityDescriptor,
DWORD nLength, DWORD nLength,
LPDWORD lpnLengthNeeded) LPDWORD lpnLengthNeeded)
{ {
static GetFileSecurity_Proc s_pfn_Get_File_Security = NULL; static GetFileSecurity_Proc s_pfn_Get_File_Security = NULL;
HMODULE hm_advapi32 = NULL; HMODULE hm_advapi32 = NULL;
...@@ -574,10 +573,10 @@ BOOL WINAPI get_file_security ( ...@@ -574,10 +573,10 @@ BOOL WINAPI get_file_security (
lpnLengthNeeded)); lpnLengthNeeded));
} }
BOOL WINAPI get_security_descriptor_owner ( BOOL WINAPI
PSECURITY_DESCRIPTOR pSecurityDescriptor, get_security_descriptor_owner (PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID *pOwner, PSID *pOwner,
LPBOOL lpbOwnerDefaulted) LPBOOL lpbOwnerDefaulted)
{ {
static GetSecurityDescriptorOwner_Proc s_pfn_Get_Security_Descriptor_Owner = NULL; static GetSecurityDescriptorOwner_Proc s_pfn_Get_Security_Descriptor_Owner = NULL;
HMODULE hm_advapi32 = NULL; HMODULE hm_advapi32 = NULL;
...@@ -601,10 +600,10 @@ BOOL WINAPI get_security_descriptor_owner ( ...@@ -601,10 +600,10 @@ BOOL WINAPI get_security_descriptor_owner (
lpbOwnerDefaulted)); lpbOwnerDefaulted));
} }
BOOL WINAPI get_security_descriptor_group ( BOOL WINAPI
PSECURITY_DESCRIPTOR pSecurityDescriptor, get_security_descriptor_group (PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID *pGroup, PSID *pGroup,
LPBOOL lpbGroupDefaulted) LPBOOL lpbGroupDefaulted)
{ {
static GetSecurityDescriptorGroup_Proc s_pfn_Get_Security_Descriptor_Group = NULL; static GetSecurityDescriptorGroup_Proc s_pfn_Get_Security_Descriptor_Group = NULL;
HMODULE hm_advapi32 = NULL; HMODULE hm_advapi32 = NULL;
...@@ -628,8 +627,8 @@ BOOL WINAPI get_security_descriptor_group ( ...@@ -628,8 +627,8 @@ BOOL WINAPI get_security_descriptor_group (
lpbGroupDefaulted)); lpbGroupDefaulted));
} }
BOOL WINAPI is_valid_sid ( BOOL WINAPI
PSID sid) is_valid_sid (PSID sid)
{ {
static IsValidSid_Proc s_pfn_Is_Valid_Sid = NULL; static IsValidSid_Proc s_pfn_Is_Valid_Sid = NULL;
HMODULE hm_advapi32 = NULL; HMODULE hm_advapi32 = NULL;
...@@ -652,9 +651,8 @@ BOOL WINAPI is_valid_sid ( ...@@ -652,9 +651,8 @@ BOOL WINAPI is_valid_sid (
return (s_pfn_Is_Valid_Sid (sid)); return (s_pfn_Is_Valid_Sid (sid));
} }
BOOL WINAPI equal_sid ( BOOL WINAPI
PSID sid1, equal_sid (PSID sid1, PSID sid2)
PSID sid2)
{ {
static EqualSid_Proc s_pfn_Equal_Sid = NULL; static EqualSid_Proc s_pfn_Equal_Sid = NULL;
HMODULE hm_advapi32 = NULL; HMODULE hm_advapi32 = NULL;
...@@ -677,8 +675,8 @@ BOOL WINAPI equal_sid ( ...@@ -677,8 +675,8 @@ BOOL WINAPI equal_sid (
return (s_pfn_Equal_Sid (sid1, sid2)); return (s_pfn_Equal_Sid (sid1, sid2));
} }
DWORD WINAPI get_length_sid ( DWORD WINAPI
PSID sid) get_length_sid (PSID sid)
{ {
static GetLengthSid_Proc s_pfn_Get_Length_Sid = NULL; static GetLengthSid_Proc s_pfn_Get_Length_Sid = NULL;
HMODULE hm_advapi32 = NULL; HMODULE hm_advapi32 = NULL;
...@@ -701,10 +699,8 @@ DWORD WINAPI get_length_sid ( ...@@ -701,10 +699,8 @@ DWORD WINAPI get_length_sid (
return (s_pfn_Get_Length_Sid (sid)); return (s_pfn_Get_Length_Sid (sid));
} }
BOOL WINAPI copy_sid ( BOOL WINAPI
DWORD destlen, copy_sid (DWORD destlen, PSID dest, PSID src)
PSID dest,
PSID src)
{ {
static CopySid_Proc s_pfn_Copy_Sid = NULL; static CopySid_Proc s_pfn_Copy_Sid = NULL;
HMODULE hm_advapi32 = NULL; HMODULE hm_advapi32 = NULL;
...@@ -733,8 +729,8 @@ BOOL WINAPI copy_sid ( ...@@ -733,8 +729,8 @@ BOOL WINAPI copy_sid (
supported in Windows NT / 2k / XP supported in Windows NT / 2k / XP
*/ */
void WINAPI get_native_system_info ( void WINAPI
LPSYSTEM_INFO lpSystemInfo) get_native_system_info (LPSYSTEM_INFO lpSystemInfo)
{ {
static GetNativeSystemInfo_Proc s_pfn_Get_Native_System_Info = NULL; static GetNativeSystemInfo_Proc s_pfn_Get_Native_System_Info = NULL;
if (is_windows_9x () != TRUE) if (is_windows_9x () != TRUE)
...@@ -753,10 +749,10 @@ void WINAPI get_native_system_info ( ...@@ -753,10 +749,10 @@ void WINAPI get_native_system_info (
lpSystemInfo->dwNumberOfProcessors = -1; lpSystemInfo->dwNumberOfProcessors = -1;
} }
BOOL WINAPI get_system_times( BOOL WINAPI
LPFILETIME lpIdleTime, get_system_times (LPFILETIME lpIdleTime,
LPFILETIME lpKernelTime, LPFILETIME lpKernelTime,
LPFILETIME lpUserTime) LPFILETIME lpUserTime)
{ {
static GetSystemTimes_Proc s_pfn_Get_System_times = NULL; static GetSystemTimes_Proc s_pfn_Get_System_times = NULL;
if (is_windows_9x () == TRUE) if (is_windows_9x () == TRUE)
...@@ -1691,7 +1687,7 @@ init_environment (char ** argv) ...@@ -1691,7 +1687,7 @@ init_environment (char ** argv)
for (p = modname; *p; p++) for (p = modname; *p; p++)
if (*p == '\\') *p = '/'; if (*p == '\\') *p = '/';
_snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname); _snprintf (buf, sizeof (buf)-1, "emacs_dir=%s", modname);
_putenv (strdup (buf)); _putenv (strdup (buf));
} }
/* Handle running emacs from the build directory: src/oo-spd/i386/ */ /* Handle running emacs from the build directory: src/oo-spd/i386/ */
...@@ -1715,7 +1711,7 @@ init_environment (char ** argv) ...@@ -1715,7 +1711,7 @@ init_environment (char ** argv)
for (p = modname; *p; p++) for (p = modname; *p; p++)
if (*p == '\\') *p = '/'; if (*p == '\\') *p = '/';
_snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname); _snprintf (buf, sizeof (buf)-1, "emacs_dir=%s", modname);
_putenv (strdup (buf)); _putenv (strdup (buf));
} }
} }
...@@ -1743,12 +1739,12 @@ init_environment (char ** argv) ...@@ -1743,12 +1739,12 @@ init_environment (char ** argv)
char buf1[SET_ENV_BUF_SIZE], buf2[SET_ENV_BUF_SIZE]; char buf1[SET_ENV_BUF_SIZE], buf2[SET_ENV_BUF_SIZE];
if (dwType == REG_EXPAND_SZ) if (dwType == REG_EXPAND_SZ)
ExpandEnvironmentStrings ((LPSTR) lpval, buf1, sizeof(buf1)); ExpandEnvironmentStrings ((LPSTR) lpval, buf1, sizeof (buf1));
else if (dwType == REG_SZ) else if (dwType == REG_SZ)
strcpy (buf1, lpval); strcpy (buf1, lpval);
if (dwType == REG_EXPAND_SZ || dwType == REG_SZ) if (dwType == REG_EXPAND_SZ || dwType == REG_SZ)
{ {
_snprintf (buf2, sizeof(buf2)-1, "%s=%s", env_vars[i].name, _snprintf (buf2, sizeof (buf2)-1, "%s=%s", env_vars[i].name,
buf1); buf1);
_putenv (strdup (buf2)); _putenv (strdup (buf2));
} }
...@@ -2091,7 +2087,7 @@ GetCachedVolumeInformation (char * root_dir) ...@@ -2091,7 +2087,7 @@ GetCachedVolumeInformation (char * root_dir)
involve network access, and so is extremely quick). */ involve network access, and so is extremely quick). */
/* Map drive letter to UNC if remote. */ /* Map drive letter to UNC if remote. */
if ( isalpha( root_dir[0] ) && !fixed[ DRIVE_INDEX( root_dir[0] ) ] ) if ( isalpha (root_dir[0]) && !fixed[ DRIVE_INDEX (root_dir[0]) ] )
{ {
char remote_name[ 256 ]; char remote_name[ 256 ];
char drive[3] = { root_dir[0], ':' }; char drive[3] = { root_dir[0], ':' };
...@@ -2490,8 +2486,8 @@ open_unc_volume (const char *path) ...@@ -2490,8 +2486,8 @@ open_unc_volume (const char *path)
nr.lpComment = NULL; nr.lpComment = NULL;
nr.lpProvider = NULL; nr.lpProvider = NULL;
result = WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_DISK, result = WNetOpenEnum (RESOURCE_GLOBALNET, RESOURCETYPE_DISK,
RESOURCEUSAGE_CONNECTABLE, &nr, &henum); RESOURCEUSAGE_CONNECTABLE, &nr, &henum);
if (result == NO_ERROR) if (result == NO_ERROR)
return henum; return henum;
...@@ -2667,7 +2663,7 @@ sys_creat (const char * path, int mode) ...@@ -2667,7 +2663,7 @@ sys_creat (const char * path, int mode)
} }
FILE * FILE *
sys_fopen(const char * path, const char * mode) sys_fopen (const char * path, const char * mode)
{ {
int fd; int fd;
int oflag; int oflag;
...@@ -2754,7 +2750,7 @@ sys_link (const char * old, const char * new) ...@@ -2754,7 +2750,7 @@ sys_link (const char * old, const char * new)
data.wid.dwStreamId = BACKUP_LINK; data.wid.dwStreamId = BACKUP_LINK;
data.wid.dwStreamAttributes = 0; data.wid.dwStreamAttributes = 0;
data.wid.Size.LowPart = wlen * sizeof(WCHAR); data.wid.Size.LowPart = wlen * sizeof (WCHAR);
data.wid.Size.HighPart = 0; data.wid.Size.HighPart = 0;
data.wid.dwStreamNameSize = 0; data.wid.dwStreamNameSize = 0;
...@@ -2980,7 +2976,7 @@ convert_time (FILETIME ft) ...@@ -2980,7 +2976,7 @@ convert_time (FILETIME ft)
if (!init) if (!init)
{ {
initialize_utc_base(); initialize_utc_base ();
init = 1; init = 1;
} }
...@@ -3167,7 +3163,7 @@ get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname, ...@@ -3167,7 +3163,7 @@ get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname,
char name[UNLEN+1]; char name[UNLEN+1];
DWORD name_len = sizeof (name); DWORD name_len = sizeof (name);
char domain[1024]; char domain[1024];
DWORD domain_len = sizeof(domain); DWORD domain_len = sizeof (domain);
char *mp = NULL; char *mp = NULL;
int use_dflt = 0; int use_dflt = 0;
int result; int result;
...@@ -3213,10 +3209,9 @@ get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname, ...@@ -3213,10 +3209,9 @@ get_name_and_id (PSECURITY_DESCRIPTOR psd, const char *fname,
} }
static void static void
get_file_owner_and_group ( get_file_owner_and_group (PSECURITY_DESCRIPTOR psd,
PSECURITY_DESCRIPTOR psd, const char *fname,
const char *fname, struct stat *st)
struct stat *st)
{ {
int dflt_usr = 0, dflt_grp = 0; int dflt_usr = 0, dflt_grp = 0;
...@@ -3642,9 +3637,8 @@ utime (const char *name, struct utimbuf *times) ...@@ -3642,9 +3637,8 @@ utime (const char *name, struct utimbuf *times)
/* Helper wrapper functions. */ /* Helper wrapper functions. */
HANDLE WINAPI create_toolhelp32_snapshot( HANDLE WINAPI
DWORD Flags, create_toolhelp32_snapshot (DWORD Flags, DWORD Ignored)
DWORD Ignored)
{ {
static CreateToolhelp32Snapshot_Proc s_pfn_Create_Toolhelp32_Snapshot = NULL; static CreateToolhelp32Snapshot_Proc s_pfn_Create_Toolhelp32_Snapshot = NULL;
...@@ -3662,9 +3656,8 @@ HANDLE WINAPI create_toolhelp32_snapshot( ...@@ -3662,9 +3656,8 @@ HANDLE WINAPI create_toolhelp32_snapshot(
return (s_pfn_Create_Toolhelp32_Snapshot (Flags, Ignored)); return (s_pfn_Create_Toolhelp32_Snapshot (Flags, Ignored));
} }
BOOL WINAPI process32_first( BOOL WINAPI
HANDLE hSnapshot, process32_first (HANDLE hSnapshot, LPPROCESSENTRY32 lppe)
LPPROCESSENTRY32 lppe)
{ {
static Process32First_Proc s_pfn_Process32_First = NULL; static Process32First_Proc s_pfn_Process32_First = NULL;
...@@ -3682,9 +3675,8 @@ BOOL WINAPI process32_first( ...@@ -3682,9 +3675,8 @@ BOOL WINAPI process32_first(
return (s_pfn_Process32_First (hSnapshot, lppe)); return (s_pfn_Process32_First (hSnapshot, lppe));
} }
BOOL WINAPI process32_next( BOOL WINAPI
HANDLE hSnapshot, process32_next (HANDLE hSnapshot, LPPROCESSENTRY32 lppe)
LPPROCESSENTRY32 lppe)
{ {
static Process32Next_Proc s_pfn_Process32_Next = NULL; static Process32Next_Proc s_pfn_Process32_Next = NULL;
...@@ -3702,11 +3694,11 @@ BOOL WINAPI process32_next( ...@@ -3702,11 +3694,11 @@ BOOL WINAPI process32_next(
return (s_pfn_Process32_Next (hSnapshot, lppe)); return (s_pfn_Process32_Next (hSnapshot, lppe));
} }
BOOL WINAPI open_thread_token ( BOOL WINAPI
HANDLE ThreadHandle, open_thread_token (HANDLE ThreadHandle,
DWORD DesiredAccess, DWORD DesiredAccess,
BOOL OpenAsSelf, BOOL OpenAsSelf,
PHANDLE TokenHandle) PHANDLE TokenHandle)
{ {
static OpenThreadToken_Proc s_pfn_Open_Thread_Token = NULL; static OpenThreadToken_Proc s_pfn_Open_Thread_Token = NULL;
HMODULE hm_advapi32 = NULL; HMODULE hm_advapi32 = NULL;
...@@ -3736,8 +3728,8 @@ BOOL WINAPI open_thread_token ( ...@@ -3736,8 +3728,8 @@ BOOL WINAPI open_thread_token (
); );
} }
BOOL WINAPI impersonate_self ( BOOL WINAPI
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel) impersonate_self (SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
{ {
static ImpersonateSelf_Proc s_pfn_Impersonate_Self = NULL; static ImpersonateSelf_Proc s_pfn_Impersonate_Self = NULL;
HMODULE hm_advapi32 = NULL; HMODULE hm_advapi32 = NULL;
...@@ -3759,7 +3751,8 @@ BOOL WINAPI impersonate_self ( ...@@ -3759,7 +3751,8 @@ BOOL WINAPI impersonate_self (
return s_pfn_Impersonate_Self (ImpersonationLevel); return s_pfn_Impersonate_Self (ImpersonationLevel);
} }
BOOL WINAPI revert_to_self (void) BOOL WINAPI
revert_to_self (void)
{ {
static RevertToSelf_Proc s_pfn_Revert_To_Self = NULL; static RevertToSelf_Proc s_pfn_Revert_To_Self = NULL;
HMODULE hm_advapi32 = NULL; HMODULE hm_advapi32 = NULL;
...@@ -3781,10 +3774,10 @@ BOOL WINAPI revert_to_self (void) ...@@ -3781,10 +3774,10 @@ BOOL WINAPI revert_to_self (void)
return s_pfn_Revert_To_Self (); return s_pfn_Revert_To_Self ();
} }
BOOL WINAPI get_process_memory_info ( BOOL WINAPI
HANDLE h_proc, get_process_memory_info (HANDLE h_proc,
PPROCESS_MEMORY_COUNTERS mem_counters, PPROCESS_MEMORY_COUNTERS mem_counters,
DWORD bufsize) DWORD bufsize)
{ {
static GetProcessMemoryInfo_Proc s_pfn_Get_Process_Memory_Info = NULL; static GetProcessMemoryInfo_Proc s_pfn_Get_Process_Memory_Info = NULL;
HMODULE hm_psapi = NULL; HMODULE hm_psapi = NULL;
...@@ -3807,10 +3800,8 @@ BOOL WINAPI get_process_memory_info ( ...@@ -3807,10 +3800,8 @@ BOOL WINAPI get_process_memory_info (
return s_pfn_Get_Process_Memory_Info (h_proc, mem_counters, bufsize); return s_pfn_Get_Process_Memory_Info (h_proc, mem_counters, bufsize);
} }
BOOL WINAPI get_process_working_set_size ( BOOL WINAPI
HANDLE h_proc, get_process_working_set_size (HANDLE h_proc, DWORD *minrss, DWORD *maxrss)
DWORD *minrss,
DWORD *maxrss)
{ {
static GetProcessWorkingSetSize_Proc static GetProcessWorkingSetSize_Proc
s_pfn_Get_Process_Working_Set_Size = NULL; s_pfn_Get_Process_Working_Set_Size = NULL;
...@@ -3833,8 +3824,8 @@ BOOL WINAPI get_process_working_set_size ( ...@@ -3833,8 +3824,8 @@ BOOL WINAPI get_process_working_set_size (
return s_pfn_Get_Process_Working_Set_Size (h_proc, minrss, maxrss); return s_pfn_Get_Process_Working_Set_Size (h_proc, minrss, maxrss);
} }
BOOL WINAPI global_memory_status ( BOOL WINAPI
MEMORYSTATUS *buf) global_memory_status (MEMORYSTATUS *buf)
{ {
static GlobalMemoryStatus_Proc s_pfn_Global_Memory_Status = NULL; static GlobalMemoryStatus_Proc s_pfn_Global_Memory_Status = NULL;
...@@ -3856,8 +3847,8 @@ BOOL WINAPI global_memory_status ( ...@@ -3856,8 +3847,8 @@ BOOL WINAPI global_memory_status (
return s_pfn_Global_Memory_Status (buf); return s_pfn_Global_Memory_Status (buf);
} }
BOOL WINAPI global_memory_status_ex ( BOOL WINAPI
MEMORY_STATUS_EX *buf) global_memory_status_ex (MEMORY_STATUS_EX *buf)
{ {
static GlobalMemoryStatusEx_Proc s_pfn_Global_Memory_Status_Ex = NULL; static GlobalMemoryStatusEx_Proc s_pfn_Global_Memory_Status_Ex = NULL;
...@@ -3992,8 +3983,8 @@ process_times (h_proc, ctime, etime, stime, utime, ttime, pcpu) ...@@ -3992,8 +3983,8 @@ process_times (h_proc, ctime, etime, stime, utime, ttime, pcpu)
if (!h_proc if (!h_proc
|| !get_process_times_fn || !get_process_times_fn
|| !(*get_process_times_fn)(h_proc, &ft_creation, &ft_exit, || !(*get_process_times_fn) (h_proc, &ft_creation, &ft_exit,
&ft_kernel, &ft_user)) &ft_kernel, &ft_user))
return 0; return 0;
GetSystemTimeAsFileTime (&ft_current); GetSystemTimeAsFileTime (&ft_current);
...@@ -4435,34 +4426,34 @@ init_winsock (int load_now) ...@@ -4435,34 +4426,34 @@ init_winsock (int load_now)
if ((pfn_##fn = (void *) GetProcAddress (winsock_lib, #fn)) == NULL) \ if ((pfn_##fn = (void *) GetProcAddress (winsock_lib, #fn)) == NULL) \
goto fail; goto fail;
LOAD_PROC( WSAStartup ); LOAD_PROC (WSAStartup);
LOAD_PROC( WSASetLastError ); LOAD_PROC (WSASetLastError);
LOAD_PROC( WSAGetLastError ); LOAD_PROC (WSAGetLastError);
LOAD_PROC( WSAEventSelect ); LOAD_PROC (WSAEventSelect);
LOAD_PROC( WSACreateEvent ); LOAD_PROC (WSACreateEvent);
LOAD_PROC( WSACloseEvent ); LOAD_PROC (WSACloseEvent);
LOAD_PROC( socket );