Cygwin: drop all usages of WINAPI

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2022-08-04 21:16:32 +02:00
parent 73aefcb5c2
commit b28edc7b86
29 changed files with 93 additions and 94 deletions

View File

@ -21,7 +21,7 @@ details. */
is not easy to understand. In all other case, use the ntdll.dll is not easy to understand. In all other case, use the ntdll.dll
equivalent. */ equivalent. */
BOOL WINAPI BOOL
RevertToSelf () RevertToSelf ()
{ {
HANDLE tok = NULL; HANDLE tok = NULL;
@ -31,7 +31,7 @@ RevertToSelf ()
DEFAULT_NTSTATUS_TO_BOOL_RETURN DEFAULT_NTSTATUS_TO_BOOL_RETURN
} }
BOOL WINAPI BOOL
DuplicateTokenEx (HANDLE tok, DWORD access, LPSECURITY_ATTRIBUTES sec_attr, DuplicateTokenEx (HANDLE tok, DWORD access, LPSECURITY_ATTRIBUTES sec_attr,
SECURITY_IMPERSONATION_LEVEL level, TOKEN_TYPE type, SECURITY_IMPERSONATION_LEVEL level, TOKEN_TYPE type,
PHANDLE new_tok) PHANDLE new_tok)
@ -46,7 +46,7 @@ DuplicateTokenEx (HANDLE tok, DWORD access, LPSECURITY_ATTRIBUTES sec_attr,
DEFAULT_NTSTATUS_TO_BOOL_RETURN DEFAULT_NTSTATUS_TO_BOOL_RETURN
} }
BOOL WINAPI BOOL
ImpersonateLoggedOnUser (HANDLE tok) ImpersonateLoggedOnUser (HANDLE tok)
{ {
NTSTATUS status; NTSTATUS status;
@ -86,7 +86,7 @@ ImpersonateLoggedOnUser (HANDLE tok)
DEFAULT_NTSTATUS_TO_BOOL_RETURN DEFAULT_NTSTATUS_TO_BOOL_RETURN
} }
BOOL WINAPI BOOL
ImpersonateNamedPipeClient (HANDLE pipe) ImpersonateNamedPipeClient (HANDLE pipe)
{ {
IO_STATUS_BLOCK io; IO_STATUS_BLOCK io;

View File

@ -200,7 +200,7 @@ aionotify (struct aiocb *aio)
} }
} }
static DWORD WINAPI __attribute__ ((noreturn)) static DWORD __attribute__ ((noreturn))
aiowaiter (void *unused) aiowaiter (void *unused)
{ /* One instance, called on its own cygthread; runs until program exits */ { /* One instance, called on its own cygthread; runs until program exits */
struct aiocb *aio; struct aiocb *aio;
@ -327,7 +327,7 @@ asyncwrite (struct aiocb *aio)
} }
/* Have to forward ref because of chicken v. egg situation */ /* Have to forward ref because of chicken v. egg situation */
static DWORD WINAPI __attribute__ ((noreturn)) aioworker (void *); static DWORD __attribute__ ((noreturn)) aioworker (void *);
static void static void
aioinit (void) aioinit (void)
@ -400,7 +400,7 @@ aioqueue (struct aiocb *aio)
return 0; return 0;
} }
static DWORD WINAPI __attribute__ ((noreturn)) static DWORD __attribute__ ((noreturn))
aioworker (void *unused) aioworker (void *unused)
{ /* Multiple instances; called on own cygthreads; runs 'til program exits */ { /* Multiple instances; called on own cygthreads; runs 'til program exits */
struct aiocb *aio; struct aiocb *aio;

View File

@ -52,7 +52,7 @@ cygthread::callfunc (bool issimplestub)
/* Initial stub called by cygthread constructor. Performs initial /* Initial stub called by cygthread constructor. Performs initial
per-thread initialization and loops waiting for another thread function per-thread initialization and loops waiting for another thread function
to execute. */ to execute. */
DWORD WINAPI DWORD
cygthread::stub (VOID *arg) cygthread::stub (VOID *arg)
{ {
cygthread *info = (cygthread *) arg; cygthread *info = (cygthread *) arg;
@ -122,7 +122,7 @@ cygthread::stub (VOID *arg)
/* Overflow stub called by cygthread constructor. Calls specified function /* Overflow stub called by cygthread constructor. Calls specified function
and then exits the thread. */ and then exits the thread. */
DWORD WINAPI DWORD
cygthread::simplestub (VOID *arg) cygthread::simplestub (VOID *arg)
{ {
cygthread *info = (cygthread *) arg; cygthread *info = (cygthread *) arg;

View File

@ -7,7 +7,7 @@ details. */
#ifndef _CYGTHREAD_H #ifndef _CYGTHREAD_H
#define _CYGTHREAD_H #define _CYGTHREAD_H
typedef void WINAPI (*LPVOID_THREAD_START_ROUTINE) (void *) __attribute__((noreturn)); // Input queue thread typedef void (*LPVOID_THREAD_START_ROUTINE) (void *) __attribute__((noreturn)); // Input queue thread
class cygthread class cygthread
{ {
@ -32,8 +32,8 @@ class cygthread
static void CALLBACK async_create (ULONG_PTR); static void CALLBACK async_create (ULONG_PTR);
public: public:
bool terminate_thread (); bool terminate_thread ();
static DWORD WINAPI stub (VOID *); static DWORD stub (VOID *);
static DWORD WINAPI simplestub (VOID *); static DWORD simplestub (VOID *);
static DWORD main_thread_id; static DWORD main_thread_id;
static const char *name (DWORD = 0); static const char *name (DWORD = 0);
void callfunc (bool) __attribute__ ((noinline, )); void callfunc (bool) __attribute__ ((noinline, ));

View File

@ -55,7 +55,7 @@ PWCHAR debugger_command;
extern uint8_t _sigbe; extern uint8_t _sigbe;
extern uint8_t _sigdelayed_end; extern uint8_t _sigdelayed_end;
static BOOL WINAPI ctrl_c_handler (DWORD); static BOOL ctrl_c_handler (DWORD);
static const struct static const struct
{ {
@ -528,7 +528,7 @@ exception::myfault (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in,
TODO: What we do here is to handle only __try/__except blocks in Cygwin. TODO: What we do here is to handle only __try/__except blocks in Cygwin.
"Normal" exceptions will simply exit the process. Still, better "Normal" exceptions will simply exit the process. Still, better
than nothing... */ than nothing... */
LONG WINAPI LONG
myfault_altstack_handler (EXCEPTION_POINTERS *exc) myfault_altstack_handler (EXCEPTION_POINTERS *exc)
{ {
_cygtls& me = _my_tls; _cygtls& me = _my_tls;
@ -976,7 +976,7 @@ has_visible_window_station ()
} }
/* Keyboard interrupt handler. */ /* Keyboard interrupt handler. */
static BOOL WINAPI static BOOL
ctrl_c_handler (DWORD type) ctrl_c_handler (DWORD type)
{ {
static bool saw_close; static bool saw_close;
@ -1207,7 +1207,7 @@ set_signal_mask (sigset_t& setmask, sigset_t newmask)
} }
DWORD WINAPI DWORD
dumpstack_overflow_wrapper (PVOID arg) dumpstack_overflow_wrapper (PVOID arg)
{ {
cygwin_exception *exc = (cygwin_exception *) arg; cygwin_exception *exc = (cygwin_exception *) arg;

View File

@ -198,7 +198,7 @@ console_unit::console_unit (HWND me0):
api_fatal ("console device allocation failure - too many consoles in use, max consoles is 32"); api_fatal ("console device allocation failure - too many consoles in use, max consoles is 32");
} }
static DWORD WINAPI static DWORD
cons_master_thread (VOID *arg) cons_master_thread (VOID *arg)
{ {
fhandler_console *fh = (fhandler_console *) arg; fhandler_console *fh = (fhandler_console *) arg;
@ -3988,7 +3988,7 @@ DEF_HOOK (CreateProcessW);
DEF_HOOK (ContinueDebugEvent); DEF_HOOK (ContinueDebugEvent);
DEF_HOOK (GetProcAddress); /* Hooked for ConEmu cygwin connector */ DEF_HOOK (GetProcAddress); /* Hooked for ConEmu cygwin connector */
static BOOL WINAPI static BOOL
CreateProcessA_Hooked CreateProcessA_Hooked
(LPCSTR n, LPSTR c, LPSECURITY_ATTRIBUTES pa, LPSECURITY_ATTRIBUTES ta, (LPCSTR n, LPSTR c, LPSECURITY_ATTRIBUTES pa, LPSECURITY_ATTRIBUTES ta,
BOOL inh, DWORD f, LPVOID e, LPCSTR d, BOOL inh, DWORD f, LPVOID e, LPCSTR d,
@ -4003,7 +4003,7 @@ CreateProcessA_Hooked
return CreateProcessA_Orig (n, c, pa, ta, inh, f, e, d, si, pi); return CreateProcessA_Orig (n, c, pa, ta, inh, f, e, d, si, pi);
} }
static BOOL WINAPI static BOOL
CreateProcessW_Hooked CreateProcessW_Hooked
(LPCWSTR n, LPWSTR c, LPSECURITY_ATTRIBUTES pa, LPSECURITY_ATTRIBUTES ta, (LPCWSTR n, LPWSTR c, LPSECURITY_ATTRIBUTES pa, LPSECURITY_ATTRIBUTES ta,
BOOL inh, DWORD f, LPVOID e, LPCWSTR d, BOOL inh, DWORD f, LPVOID e, LPCWSTR d,
@ -4018,7 +4018,7 @@ CreateProcessW_Hooked
return CreateProcessW_Orig (n, c, pa, ta, inh, f, e, d, si, pi); return CreateProcessW_Orig (n, c, pa, ta, inh, f, e, d, si, pi);
} }
static BOOL WINAPI static BOOL
ContinueDebugEvent_Hooked ContinueDebugEvent_Hooked
(DWORD p, DWORD t, DWORD s) (DWORD p, DWORD t, DWORD s)
{ {
@ -4029,7 +4029,7 @@ ContinueDebugEvent_Hooked
} }
/* Hooked for ConEmu cygwin connector */ /* Hooked for ConEmu cygwin connector */
static FARPROC WINAPI static FARPROC
GetProcAddress_Hooked (HMODULE h, LPCSTR n) GetProcAddress_Hooked (HMODULE h, LPCSTR n)
{ {
if (strcmp(n, "RequestTermConnector") == 0) if (strcmp(n, "RequestTermConnector") == 0)

View File

@ -446,7 +446,7 @@ fhandler_fifo::update_shared_handlers ()
return 0; return 0;
} }
static DWORD WINAPI static DWORD
fifo_reader_thread (LPVOID param) fifo_reader_thread (LPVOID param)
{ {
fhandler_fifo *fh = (fhandler_fifo *) param; fhandler_fifo *fh = (fhandler_fifo *) param;

View File

@ -63,7 +63,7 @@ wnet_dbg_out (const char *func, DWORD ndi_ret)
debug_printf ("WNetGetLastError failed: %u", gle_ret); debug_printf ("WNetGetLastError failed: %u", gle_ret);
} }
static DWORD WINAPI static DWORD
thread_netdrive (void *arg) thread_netdrive (void *arg)
{ {
netdriveinf *ndi = (netdriveinf *) arg; netdriveinf *ndi = (netdriveinf *) arg;

View File

@ -928,7 +928,7 @@ struct conn_wait_info_t
}; };
/* Just hop to the wait_pipe_thread method. */ /* Just hop to the wait_pipe_thread method. */
DWORD WINAPI DWORD
connect_wait_func (LPVOID param) connect_wait_func (LPVOID param)
{ {
conn_wait_info_t *wait_info = (conn_wait_info_t *) param; conn_wait_info_t *wait_info = (conn_wait_info_t *) param;

View File

@ -268,7 +268,7 @@ atexit_func (void)
DEF_HOOK (CreateProcessA); DEF_HOOK (CreateProcessA);
DEF_HOOK (CreateProcessW); DEF_HOOK (CreateProcessW);
static BOOL WINAPI static BOOL
CreateProcessA_Hooked CreateProcessA_Hooked
(LPCSTR n, LPSTR c, LPSECURITY_ATTRIBUTES pa, LPSECURITY_ATTRIBUTES ta, (LPCSTR n, LPSTR c, LPSECURITY_ATTRIBUTES pa, LPSECURITY_ATTRIBUTES ta,
BOOL inh, DWORD f, LPVOID e, LPCSTR d, BOOL inh, DWORD f, LPVOID e, LPCSTR d,
@ -307,7 +307,7 @@ CreateProcessA_Hooked
return ret; return ret;
} }
static BOOL WINAPI static BOOL
CreateProcessW_Hooked CreateProcessW_Hooked
(LPCWSTR n, LPWSTR c, LPSECURITY_ATTRIBUTES pa, LPSECURITY_ATTRIBUTES ta, (LPCWSTR n, LPWSTR c, LPSECURITY_ATTRIBUTES pa, LPSECURITY_ATTRIBUTES ta,
BOOL inh, DWORD f, LPVOID e, LPCWSTR d, BOOL inh, DWORD f, LPVOID e, LPCWSTR d,
@ -2666,7 +2666,7 @@ reply:
return 0; return 0;
} }
static DWORD WINAPI static DWORD
pty_master_thread (VOID *arg) pty_master_thread (VOID *arg)
{ {
fhandler_pty_master::master_thread_param_t p; fhandler_pty_master::master_thread_param_t p;
@ -2873,7 +2873,7 @@ fhandler_pty_master::pty_master_fwd_thread (const master_fwd_thread_param_t *p)
return 0; return 0;
} }
static DWORD WINAPI static DWORD
pty_master_fwd_thread (VOID *arg) pty_master_fwd_thread (VOID *arg)
{ {
fhandler_pty_master::master_fwd_thread_param_t p; fhandler_pty_master::master_fwd_thread_param_t p;

View File

@ -642,7 +642,7 @@ lockf_t::create_lock_obj_attr (lockfattr_t *attr, ULONG flags, void *sd_buf)
return &attr->attr; return &attr->attr;
} }
DWORD WINAPI DWORD
create_lock_in_parent (PVOID param) create_lock_in_parent (PVOID param)
{ {
HANDLE lf_obj; HANDLE lf_obj;
@ -721,7 +721,7 @@ err:
return 1; return 1;
} }
DWORD WINAPI DWORD
delete_lock_in_parent (PVOID param) delete_lock_in_parent (PVOID param)
{ {
inode_t *node, *next_node; inode_t *node, *next_node;
@ -1870,7 +1870,7 @@ struct lock_parms {
NTSTATUS status; NTSTATUS status;
}; };
static DWORD WINAPI static DWORD
blocking_lock_thr (LPVOID param) blocking_lock_thr (LPVOID param)
{ {
struct lock_parms *lp = (struct lock_parms *) param; struct lock_parms *lp = (struct lock_parms *) param;

View File

@ -22,7 +22,7 @@ details. */
#define DECLARE_CYGWIN_DLL(Entry) \ #define DECLARE_CYGWIN_DLL(Entry) \
\ \
CDECL_BEGIN \ CDECL_BEGIN \
int WINAPI Entry (HINSTANCE h, DWORD reason, void *ptr); \ int Entry (HINSTANCE h, DWORD reason, void *ptr); \
typedef int (*mainfunc) (int, char **, char **); \ typedef int (*mainfunc) (int, char **, char **); \
extern PVOID cygwin_attach_dll (HMODULE, mainfunc); \ extern PVOID cygwin_attach_dll (HMODULE, mainfunc); \
extern void cygwin_detach_dll (PVOID); \ extern void cygwin_detach_dll (PVOID); \
@ -42,7 +42,7 @@ static int __dllMain (int a __attribute__ ((__unused__)), \
\ \
static PVOID dll_index; \ static PVOID dll_index; \
\ \
int WINAPI _cygwin_dll_entry (HINSTANCE h, DWORD reason, void *ptr) \ int _cygwin_dll_entry (HINSTANCE h, DWORD reason, void *ptr) \
{ \ { \
int ret; \ int ret; \
ret = 1; \ ret = 1; \

View File

@ -19,7 +19,7 @@ unsigned threadfunc_ix[8];
static bool dll_finished_loading; static bool dll_finished_loading;
#define OLDFUNC_OFFSET -1 #define OLDFUNC_OFFSET -1
static void WINAPI static void
threadfunc_fe (VOID *arg) threadfunc_fe (VOID *arg)
{ {
_cygtls::call ((DWORD (*) (void *, void *)) TlsGetValue (_my_oldfunc), arg); _cygtls::call ((DWORD (*) (void *, void *)) TlsGetValue (_my_oldfunc), arg);
@ -70,7 +70,7 @@ void dll_crt0_0 ();
need the alloca'd space in the DLL_PROCESS_ATTACH case below... */ need the alloca'd space in the DLL_PROCESS_ATTACH case below... */
void *alloca_dummy; void *alloca_dummy;
extern "C" BOOL WINAPI extern "C" BOOL
dll_entry (HANDLE h, DWORD reason, void *static_load) dll_entry (HANDLE h, DWORD reason, void *static_load)
{ {
BOOL test_stack_marker; BOOL test_stack_marker;

View File

@ -22,7 +22,7 @@ details. */
/* Implement CreateEvent/OpenEvent so that named objects are always created in /* Implement CreateEvent/OpenEvent so that named objects are always created in
Cygwin shared object namespace. */ Cygwin shared object namespace. */
HANDLE WINAPI HANDLE
CreateEventW (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, CreateEventW (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset,
BOOL bInitialState, LPCWSTR lpName) BOOL bInitialState, LPCWSTR lpName)
{ {
@ -57,7 +57,7 @@ CreateEventW (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset,
return evt; return evt;
} }
HANDLE WINAPI HANDLE
CreateEventA (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, CreateEventA (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset,
BOOL bInitialState, LPCSTR lpName) BOOL bInitialState, LPCSTR lpName)
{ {
@ -72,7 +72,7 @@ CreateEventA (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset,
lpName ? name : NULL); lpName ? name : NULL);
} }
HANDLE WINAPI HANDLE
OpenEventW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName) OpenEventW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
{ {
HANDLE evt; HANDLE evt;
@ -100,7 +100,7 @@ OpenEventW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
return evt; return evt;
} }
HANDLE WINAPI HANDLE
OpenEventA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName) OpenEventA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
{ {
WCHAR name[MAX_PATH]; WCHAR name[MAX_PATH];
@ -116,7 +116,7 @@ OpenEventA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
/* Implement CreateMutex/OpenMutex so that named objects are always created in /* Implement CreateMutex/OpenMutex so that named objects are always created in
Cygwin shared object namespace. */ Cygwin shared object namespace. */
HANDLE WINAPI HANDLE
CreateMutexW (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, CreateMutexW (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner,
LPCWSTR lpName) LPCWSTR lpName)
{ {
@ -148,7 +148,7 @@ CreateMutexW (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner,
return mtx; return mtx;
} }
HANDLE WINAPI HANDLE
CreateMutexA (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, CreateMutexA (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner,
LPCSTR lpName) LPCSTR lpName)
{ {
@ -162,7 +162,7 @@ CreateMutexA (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner,
return CreateMutexW (lpMutexAttributes, bInitialOwner, lpName ? name : NULL); return CreateMutexW (lpMutexAttributes, bInitialOwner, lpName ? name : NULL);
} }
HANDLE WINAPI HANDLE
OpenMutexW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName) OpenMutexW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
{ {
HANDLE mtx; HANDLE mtx;
@ -190,7 +190,7 @@ OpenMutexW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
return mtx; return mtx;
} }
HANDLE WINAPI HANDLE
OpenMutexA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName) OpenMutexA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
{ {
WCHAR name[MAX_PATH]; WCHAR name[MAX_PATH];
@ -206,7 +206,7 @@ OpenMutexA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
/* Implement CreateSemaphore/OpenSemaphore so that named objects are always /* Implement CreateSemaphore/OpenSemaphore so that named objects are always
created in Cygwin shared object namespace. */ created in Cygwin shared object namespace. */
HANDLE WINAPI HANDLE
CreateSemaphoreW (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, CreateSemaphoreW (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName) LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName)
{ {
@ -240,7 +240,7 @@ CreateSemaphoreW (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
return sem; return sem;
} }
HANDLE WINAPI HANDLE
CreateSemaphoreA (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, CreateSemaphoreA (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
LONG lInitialCount, LONG lMaximumCount, LPCSTR lpName) LONG lInitialCount, LONG lMaximumCount, LPCSTR lpName)
{ {
@ -255,7 +255,7 @@ CreateSemaphoreA (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
lpName ? name : NULL); lpName ? name : NULL);
} }
HANDLE WINAPI HANDLE
OpenSemaphoreW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName) OpenSemaphoreW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
{ {
HANDLE sem; HANDLE sem;
@ -283,7 +283,7 @@ OpenSemaphoreW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
return sem; return sem;
} }
HANDLE WINAPI HANDLE
OpenSemaphoreA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName) OpenSemaphoreA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
{ {
WCHAR name[MAX_PATH]; WCHAR name[MAX_PATH];
@ -299,7 +299,7 @@ OpenSemaphoreA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
/* Implement CreateFileMapping/OpenFileMapping so that named objects are always /* Implement CreateFileMapping/OpenFileMapping so that named objects are always
created in Cygwin shared object namespace. */ created in Cygwin shared object namespace. */
HANDLE WINAPI HANDLE
CreateFileMappingW (HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, CreateFileMappingW (HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes,
DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD flProtect, DWORD dwMaximumSizeHigh,
DWORD dwMaximumSizeLow, LPCWSTR lpName) DWORD dwMaximumSizeLow, LPCWSTR lpName)
@ -354,7 +354,7 @@ CreateFileMappingW (HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes,
return sect; return sect;
} }
HANDLE WINAPI HANDLE
CreateFileMappingA (HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, CreateFileMappingA (HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes,
DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD flProtect, DWORD dwMaximumSizeHigh,
DWORD dwMaximumSizeLow, LPCSTR lpName) DWORD dwMaximumSizeLow, LPCSTR lpName)
@ -370,7 +370,7 @@ CreateFileMappingA (HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes,
dwMaximumSizeLow, lpName ? name : NULL); dwMaximumSizeLow, lpName ? name : NULL);
} }
HANDLE WINAPI HANDLE
OpenFileMappingW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName) OpenFileMappingW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
{ {
HANDLE sect; HANDLE sect;
@ -398,7 +398,7 @@ OpenFileMappingW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName)
return sect; return sect;
} }
HANDLE WINAPI HANDLE
OpenFileMappingA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName) OpenFileMappingA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName)
{ {
WCHAR name[MAX_PATH]; WCHAR name[MAX_PATH];
@ -433,7 +433,7 @@ ucmd ()
/* Cygwin replacement for GetCommandLineW. Returns a concatenated wide string /* Cygwin replacement for GetCommandLineW. Returns a concatenated wide string
representing the argv list, constructed using roughly the same mechanism as representing the argv list, constructed using roughly the same mechanism as
child_info_spawn::worker */ child_info_spawn::worker */
extern "C" LPWSTR WINAPI extern "C" LPWSTR
cygwin_GetCommandLineW (void) cygwin_GetCommandLineW (void)
{ {
return ucmd ()->Buffer; return ucmd ()->Buffer;
@ -442,7 +442,7 @@ cygwin_GetCommandLineW (void)
/* Cygwin replacement for GetCommandLineA. Returns a concatenated string /* Cygwin replacement for GetCommandLineA. Returns a concatenated string
representing the argv list, constructed using roughly the same mechanism representing the argv list, constructed using roughly the same mechanism
as child_info_spawn::worker */ as child_info_spawn::worker */
extern "C" LPSTR WINAPI extern "C" LPSTR
cygwin_GetCommandLineA (void) cygwin_GetCommandLineA (void)
{ {
static ANSI_STRING cmd; static ANSI_STRING cmd;

View File

@ -208,7 +208,7 @@ cyg_ldap::connect_non_ssl (PCWSTR domain)
return ret; return ret;
} }
static DWORD WINAPI static DWORD
ldap_init_thr (LPVOID param) ldap_init_thr (LPVOID param)
{ {
cyg_ldap_init *cl = (cyg_ldap_init *) param; cyg_ldap_init *cl = (cyg_ldap_init *) param;
@ -251,7 +251,7 @@ cyg_ldap::search_s (PWCHAR base, ULONG scope, PWCHAR filter, PWCHAR *attrs)
return ret; return ret;
} }
static DWORD WINAPI static DWORD
ldap_search_thr (LPVOID param) ldap_search_thr (LPVOID param)
{ {
cyg_ldap_search *cl = (cyg_ldap_search *) param; cyg_ldap_search *cl = (cyg_ldap_search *) param;
@ -293,7 +293,7 @@ cyg_ldap::next_page_s ()
return ret; return ret;
} }
static DWORD WINAPI static DWORD
ldap_next_page_thr (LPVOID param) ldap_next_page_thr (LPVOID param)
{ {
cyg_ldap_next_page *cl = (cyg_ldap_next_page *) param; cyg_ldap_next_page *cl = (cyg_ldap_next_page *) param;

View File

@ -19,7 +19,7 @@ details. */
#include "mmap_alloc.h" #include "mmap_alloc.h"
/* not yet prototyped in w32api */ /* not yet prototyped in w32api */
extern "C" HRESULT WINAPI SetThreadDescription (HANDLE hThread, PCWSTR lpThreadDescription); extern "C" HRESULT SetThreadDescription (HANDLE hThread, PCWSTR lpThreadDescription);
/* Get handle count of an object. */ /* Get handle count of an object. */
ULONG ULONG
@ -202,7 +202,7 @@ nice_to_winprio (int &nice)
/* Minimal overlapped pipe I/O implementation for signal and commune stuff. */ /* Minimal overlapped pipe I/O implementation for signal and commune stuff. */
BOOL WINAPI BOOL
CreatePipeOverlapped (PHANDLE hr, PHANDLE hw, LPSECURITY_ATTRIBUTES sa) CreatePipeOverlapped (PHANDLE hr, PHANDLE hw, LPSECURITY_ATTRIBUTES sa)
{ {
int ret = fhandler_pipe::create (sa, hr, hw, 0, NULL, int ret = fhandler_pipe::create (sa, hr, hw, 0, NULL,
@ -212,7 +212,7 @@ CreatePipeOverlapped (PHANDLE hr, PHANDLE hw, LPSECURITY_ATTRIBUTES sa)
return ret == 0; return ret == 0;
} }
BOOL WINAPI BOOL
ReadPipeOverlapped (HANDLE h, PVOID buf, DWORD len, LPDWORD ret_len, ReadPipeOverlapped (HANDLE h, PVOID buf, DWORD len, LPDWORD ret_len,
DWORD timeout) DWORD timeout)
{ {
@ -232,7 +232,7 @@ ReadPipeOverlapped (HANDLE h, PVOID buf, DWORD len, LPDWORD ret_len,
return ret; return ret;
} }
BOOL WINAPI BOOL
WritePipeOverlapped (HANDLE h, LPCVOID buf, DWORD len, LPDWORD ret_len, WritePipeOverlapped (HANDLE h, LPCVOID buf, DWORD len, LPDWORD ret_len,
DWORD timeout) DWORD timeout)
{ {
@ -376,7 +376,7 @@ struct pthread_wrapper_arg
ULONG guardsize; ULONG guardsize;
}; };
DWORD WINAPI DWORD
pthread_wrapper (PVOID arg) pthread_wrapper (PVOID arg)
{ {
/* Just plain paranoia. */ /* Just plain paranoia. */
@ -601,7 +601,7 @@ create_new_main_thread_stack (PVOID &allocationbase)
return ((PBYTE) allocationbase + stacksize - 16); return ((PBYTE) allocationbase + stacksize - 16);
} }
HANDLE WINAPI HANDLE
CygwinCreateThread (LPTHREAD_START_ROUTINE thread_func, PVOID thread_arg, CygwinCreateThread (LPTHREAD_START_ROUTINE thread_func, PVOID thread_arg,
PVOID stackaddr, ULONG stacksize, ULONG guardsize, PVOID stackaddr, ULONG stacksize, ULONG guardsize,
DWORD creation_flags, LPDWORD thread_id) DWORD creation_flags, LPDWORD thread_id)

View File

@ -49,11 +49,11 @@ DWORD nice_to_winprio (int &);
bool create_pipe (PHANDLE, PHANDLE, LPSECURITY_ATTRIBUTES, DWORD); bool create_pipe (PHANDLE, PHANDLE, LPSECURITY_ATTRIBUTES, DWORD);
BOOL WINAPI CreatePipeOverlapped (PHANDLE read_handle, PHANDLE write_handle, BOOL CreatePipeOverlapped (PHANDLE read_handle, PHANDLE write_handle,
LPSECURITY_ATTRIBUTES sa); LPSECURITY_ATTRIBUTES sa);
BOOL WINAPI ReadPipeOverlapped (HANDLE h, PVOID buf, DWORD len, BOOL ReadPipeOverlapped (HANDLE h, PVOID buf, DWORD len,
LPDWORD ret_len, DWORD timeout); LPDWORD ret_len, DWORD timeout);
BOOL WINAPI WritePipeOverlapped (HANDLE h, LPCVOID buf, DWORD len, BOOL WritePipeOverlapped (HANDLE h, LPCVOID buf, DWORD len,
LPDWORD ret_len, DWORD timeout); LPDWORD ret_len, DWORD timeout);
/* class for per-line reading using native functions. The caller provides /* class for per-line reading using native functions. The caller provides
@ -110,12 +110,11 @@ ssize_t check_iovec (const struct iovec *, int, bool);
extern PVOID create_new_main_thread_stack (PVOID &allocationbase); extern PVOID create_new_main_thread_stack (PVOID &allocationbase);
extern "C" DWORD WINAPI pthread_wrapper (PVOID arg); extern "C" DWORD pthread_wrapper (PVOID arg);
extern "C" HANDLE WINAPI CygwinCreateThread (LPTHREAD_START_ROUTINE thread_func, extern "C" HANDLE CygwinCreateThread (LPTHREAD_START_ROUTINE thread_func,
PVOID thread_arg, PVOID stackaddr, PVOID thread_arg, PVOID stackaddr,
ULONG stacksize, ULONG guardsize, ULONG stacksize, ULONG guardsize,
DWORD creation_flags, DWORD creation_flags, LPDWORD thread_id);
LPDWORD thread_id);
void SetThreadName (DWORD dwThreadID, const char* threadName); void SetThreadName (DWORD dwThreadID, const char* threadName);

View File

@ -1522,7 +1522,7 @@ extern "C"
PVOID, ULONG, PULONG); PVOID, ULONG, PULONG);
NTSTATUS NTAPI NtQuerySystemInformation (SYSTEM_INFORMATION_CLASS, NTSTATUS NTAPI NtQuerySystemInformation (SYSTEM_INFORMATION_CLASS,
PVOID, ULONG, PULONG); PVOID, ULONG, PULONG);
NTSTATUS WINAPI NtQuerySystemTime (PLARGE_INTEGER); NTSTATUS NTAPI NtQuerySystemTime (PLARGE_INTEGER);
NTSTATUS NTAPI NtQuerySecurityObject (HANDLE, SECURITY_INFORMATION, NTSTATUS NTAPI NtQuerySecurityObject (HANDLE, SECURITY_INFORMATION,
PSECURITY_DESCRIPTOR, ULONG, PULONG); PSECURITY_DESCRIPTOR, ULONG, PULONG);
NTSTATUS NTAPI NtQuerySymbolicLinkObject (HANDLE, PUNICODE_STRING, PULONG); NTSTATUS NTAPI NtQuerySymbolicLinkObject (HANDLE, PUNICODE_STRING, PULONG);

View File

@ -597,7 +597,7 @@ _pinfo::alive ()
return !!h; return !!h;
} }
DWORD WINAPI DWORD
commune_process (void *arg) commune_process (void *arg)
{ {
siginfo_t& si = *((siginfo_t *) arg); siginfo_t& si = *((siginfo_t *) arg);
@ -1234,7 +1234,7 @@ _pinfo::environ (size_t& n)
is received on the pipe, it is assumed that the cygwin pid has exited. is received on the pipe, it is assumed that the cygwin pid has exited.
Otherwise, various "signals" can be sent to the parent to inform the Otherwise, various "signals" can be sent to the parent to inform the
parent to perform a certain action. */ parent to perform a certain action. */
static DWORD WINAPI static DWORD
proc_waiter (void *arg) proc_waiter (void *arg)
{ {
pinfo vchild = *(pinfo *) arg; pinfo vchild = *(pinfo *) arg;

View File

@ -131,7 +131,7 @@ public:
friend class pinfo_minimal; friend class pinfo_minimal;
}; };
DWORD WINAPI commune_process (void *); DWORD commune_process (void *);
enum parent_alerter enum parent_alerter
{ {

View File

@ -228,7 +228,7 @@ out:
return 0; return 0;
} }
static DWORD WINAPI static DWORD
timer_thread (VOID *x) timer_thread (VOID *x)
{ {
timer_tracker *tt = ((timer_tracker *) x); timer_tracker *tt = ((timer_tracker *) x);

View File

@ -153,7 +153,7 @@ profile_on (struct profinfo *p)
return -1; return -1;
} }
p->profthr = CreateThread (0, 0, (DWORD (WINAPI *)(LPVOID)) profthr_func, p->profthr = CreateThread (0, 0, (DWORD (*)(LPVOID)) profthr_func,
(void *) p, 0, &thrid); (void *) p, 0, &thrid);
if (!p->profthr) if (!p->profthr)

View File

@ -770,7 +770,7 @@ out:
static int start_thread_pipe (select_record *me, select_stuff *stuff); static int start_thread_pipe (select_record *me, select_stuff *stuff);
static DWORD WINAPI static DWORD
thread_pipe (void *arg) thread_pipe (void *arg)
{ {
select_pipe_info *pi = (select_pipe_info *) arg; select_pipe_info *pi = (select_pipe_info *) arg;
@ -973,7 +973,7 @@ out:
static int start_thread_fifo (select_record *me, select_stuff *stuff); static int start_thread_fifo (select_record *me, select_stuff *stuff);
static DWORD WINAPI static DWORD
thread_fifo (void *arg) thread_fifo (void *arg)
{ {
select_fifo_info *pi = (select_fifo_info *) arg; select_fifo_info *pi = (select_fifo_info *) arg;
@ -1161,7 +1161,7 @@ verify_console (select_record *me, fd_set *rfds, fd_set *wfds,
static int console_startup (select_record *me, select_stuff *stuff); static int console_startup (select_record *me, select_stuff *stuff);
static DWORD WINAPI static DWORD
thread_console (void *arg) thread_console (void *arg)
{ {
select_console_info *ci = (select_console_info *) arg; select_console_info *ci = (select_console_info *) arg;
@ -1397,7 +1397,7 @@ out:
static int pty_slave_startup (select_record *me, select_stuff *stuff); static int pty_slave_startup (select_record *me, select_stuff *stuff);
static DWORD WINAPI static DWORD
thread_pty_slave (void *arg) thread_pty_slave (void *arg)
{ {
select_pipe_info *pi = (select_pipe_info *) arg; select_pipe_info *pi = (select_pipe_info *) arg;
@ -1773,7 +1773,7 @@ peek_socket (select_record *me, bool)
static int start_thread_socket (select_record *, select_stuff *); static int start_thread_socket (select_record *, select_stuff *);
static DWORD WINAPI static DWORD
thread_socket (void *arg) thread_socket (void *arg)
{ {
select_socket_info *si = (select_socket_info *) arg; select_socket_info *si = (select_socket_info *) arg;

View File

@ -100,7 +100,7 @@ static int checkstate (waitq *);
static __inline__ bool get_proc_lock (DWORD, DWORD); static __inline__ bool get_proc_lock (DWORD, DWORD);
static int remove_proc (int); static int remove_proc (int);
static bool stopped_or_terminated (waitq *, _pinfo *); static bool stopped_or_terminated (waitq *, _pinfo *);
static void WINAPI wait_sig (VOID *arg); static void wait_sig (VOID *arg);
/* wait_sig bookkeeping */ /* wait_sig bookkeeping */
@ -116,7 +116,7 @@ public:
void clear (int sig) {sigs[sig].si.si_signo = 0;} void clear (int sig) {sigs[sig].si.si_signo = 0;}
void clear (_cygtls *tls); void clear (_cygtls *tls);
friend void sig_dispatch_pending (bool); friend void sig_dispatch_pending (bool);
friend void WINAPI wait_sig (VOID *arg); friend void wait_sig (VOID *arg);
}; };
Static pending_signals sigq; Static pending_signals sigq;
@ -1313,7 +1313,7 @@ pending_signals::add (sigpacket& pack)
/* Process signals by waiting for signal data to arrive in a pipe. /* Process signals by waiting for signal data to arrive in a pipe.
Set a completion event if one was specified. */ Set a completion event if one was specified. */
static void WINAPI static void
wait_sig (VOID *) wait_sig (VOID *)
{ {
_sig_tls = &_my_tls; _sig_tls = &_my_tls;

View File

@ -1989,7 +1989,7 @@ pthread_spinlock::unlock ()
return result; return result;
} }
DWORD WINAPI DWORD
pthread::thread_init_wrapper (void *arg) pthread::thread_init_wrapper (void *arg)
{ {
exception protect; exception protect;

View File

@ -430,7 +430,7 @@ public:
virtual void pop_cleanup_handler (int const execute); virtual void pop_cleanup_handler (int const execute);
static pthread* self (); static pthread* self ();
static DWORD WINAPI thread_init_wrapper (void *); static DWORD thread_init_wrapper (void *);
virtual unsigned long getsequence_np(); virtual unsigned long getsequence_np();

View File

@ -225,7 +225,7 @@ canceled:
return 0; return 0;
} }
static DWORD WINAPI static DWORD
timerfd_thread (VOID *arg) timerfd_thread (VOID *arg)
{ {
timerfd_tracker *tt = ((timerfd_tracker *) arg); timerfd_tracker *tt = ((timerfd_tracker *) arg);

View File

@ -52,7 +52,7 @@ process_window_events (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
} }
/* Handle windows events. Inherits ownership of the wininfo lock */ /* Handle windows events. Inherits ownership of the wininfo lock */
DWORD WINAPI DWORD
wininfo::winthread () wininfo::winthread ()
{ {
MSG msg; MSG msg;
@ -92,7 +92,7 @@ wininfo::winthread ()
return 0; return 0;
} }
static DWORD WINAPI static DWORD
winthread (VOID *arg) winthread (VOID *arg)
{ {
return ((wininfo *) arg)->winthread (); return ((wininfo *) arg)->winthread ();

View File

@ -16,7 +16,7 @@ public:
int process (HWND, UINT, WPARAM, LPARAM); int process (HWND, UINT, WPARAM, LPARAM);
void lock (); void lock ();
void release (); void release ();
DWORD WINAPI winthread (); DWORD winthread ();
}; };
extern wininfo winmsg; extern wininfo winmsg;