From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 66F97385736F; Thu, 4 Aug 2022 20:14:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66F97385736F Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: drop all usages of WINAPI X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: 73aefcb5c23b9ca186746ad2df55f82741fff6bb X-Git-Newrev: b28edc7b86c0b031c92ae9cd98c0c058f0b8aff3 Message-Id: <20220804201441.66F97385736F@sourceware.org> Date: Thu, 4 Aug 2022 20:14:41 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2022 20:14:41 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Db28edc7b86c= 0b031c92ae9cd98c0c058f0b8aff3 commit b28edc7b86c0b031c92ae9cd98c0c058f0b8aff3 Author: Corinna Vinschen Date: Thu Aug 4 21:16:32 2022 +0200 Cygwin: drop all usages of WINAPI =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/advapi32.cc | 8 +++---- winsup/cygwin/aio.cc | 6 +++--- winsup/cygwin/cygthread.cc | 4 ++-- winsup/cygwin/cygthread.h | 6 +++--- winsup/cygwin/exceptions.cc | 8 +++---- winsup/cygwin/fhandler_console.cc | 10 ++++----- winsup/cygwin/fhandler_fifo.cc | 2 +- winsup/cygwin/fhandler_netdrive.cc | 2 +- winsup/cygwin/fhandler_socket_unix.cc | 2 +- winsup/cygwin/fhandler_tty.cc | 8 +++---- winsup/cygwin/flock.cc | 6 +++--- winsup/cygwin/include/cygwin/cygwin_dll.h | 4 ++-- winsup/cygwin/init.cc | 4 ++-- winsup/cygwin/kernel32.cc | 36 +++++++++++++++------------= ---- winsup/cygwin/ldap.cc | 6 +++--- winsup/cygwin/miscfuncs.cc | 12 +++++------ winsup/cygwin/miscfuncs.h | 23 ++++++++++---------- winsup/cygwin/ntdll.h | 2 +- winsup/cygwin/pinfo.cc | 4 ++-- winsup/cygwin/pinfo.h | 2 +- winsup/cygwin/posix_timer.cc | 2 +- winsup/cygwin/profil.c | 2 +- winsup/cygwin/select.cc | 10 ++++----- winsup/cygwin/sigproc.cc | 6 +++--- winsup/cygwin/thread.cc | 2 +- winsup/cygwin/thread.h | 2 +- winsup/cygwin/timerfd.cc | 2 +- winsup/cygwin/window.cc | 4 ++-- winsup/cygwin/wininfo.h | 2 +- 29 files changed, 93 insertions(+), 94 deletions(-) diff --git a/winsup/cygwin/advapi32.cc b/winsup/cygwin/advapi32.cc index 56c96c915..3769f2782 100644 --- a/winsup/cygwin/advapi32.cc +++ b/winsup/cygwin/advapi32.cc @@ -21,7 +21,7 @@ details. */ is not easy to understand. In all other case, use the ntdll.dll equivalent. */ =20 -BOOL WINAPI +BOOL RevertToSelf () { HANDLE tok =3D NULL; @@ -31,7 +31,7 @@ RevertToSelf () DEFAULT_NTSTATUS_TO_BOOL_RETURN } =20 -BOOL WINAPI +BOOL DuplicateTokenEx (HANDLE tok, DWORD access, LPSECURITY_ATTRIBUTES sec_attr, SECURITY_IMPERSONATION_LEVEL level, TOKEN_TYPE type, PHANDLE new_tok) @@ -46,7 +46,7 @@ DuplicateTokenEx (HANDLE tok, DWORD access, LPSECURITY_AT= TRIBUTES sec_attr, DEFAULT_NTSTATUS_TO_BOOL_RETURN } =20 -BOOL WINAPI +BOOL ImpersonateLoggedOnUser (HANDLE tok) { NTSTATUS status; @@ -86,7 +86,7 @@ ImpersonateLoggedOnUser (HANDLE tok) DEFAULT_NTSTATUS_TO_BOOL_RETURN } =20 -BOOL WINAPI +BOOL ImpersonateNamedPipeClient (HANDLE pipe) { IO_STATUS_BLOCK io; diff --git a/winsup/cygwin/aio.cc b/winsup/cygwin/aio.cc index 4d1c2ee45..1c17aa7f6 100644 --- a/winsup/cygwin/aio.cc +++ b/winsup/cygwin/aio.cc @@ -200,7 +200,7 @@ aionotify (struct aiocb *aio) } } =20 -static DWORD WINAPI __attribute__ ((noreturn)) +static DWORD __attribute__ ((noreturn)) aiowaiter (void *unused) { /* One instance, called on its own cygthread; runs until program exits */ struct aiocb *aio; @@ -327,7 +327,7 @@ asyncwrite (struct aiocb *aio) } =20 /* Have to forward ref because of chicken v. egg situation */ -static DWORD WINAPI __attribute__ ((noreturn)) aioworker (void *); +static DWORD __attribute__ ((noreturn)) aioworker (void *); =20 static void aioinit (void) @@ -400,7 +400,7 @@ aioqueue (struct aiocb *aio) return 0; } =20 -static DWORD WINAPI __attribute__ ((noreturn)) +static DWORD __attribute__ ((noreturn)) aioworker (void *unused) { /* Multiple instances; called on own cygthreads; runs 'til program exits= */ struct aiocb *aio; diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc index 66a317934..54918e767 100644 --- a/winsup/cygwin/cygthread.cc +++ b/winsup/cygwin/cygthread.cc @@ -52,7 +52,7 @@ cygthread::callfunc (bool issimplestub) /* Initial stub called by cygthread constructor. Performs initial per-thread initialization and loops waiting for another thread function to execute. */ -DWORD WINAPI +DWORD cygthread::stub (VOID *arg) { cygthread *info =3D (cygthread *) arg; @@ -122,7 +122,7 @@ cygthread::stub (VOID *arg) =20 /* Overflow stub called by cygthread constructor. Calls specified function and then exits the thread. */ -DWORD WINAPI +DWORD cygthread::simplestub (VOID *arg) { cygthread *info =3D (cygthread *) arg; diff --git a/winsup/cygwin/cygthread.h b/winsup/cygwin/cygthread.h index ed57c9301..241180f2b 100644 --- a/winsup/cygwin/cygthread.h +++ b/winsup/cygwin/cygthread.h @@ -7,7 +7,7 @@ details. */ #ifndef _CYGTHREAD_H #define _CYGTHREAD_H =20 -typedef void WINAPI (*LPVOID_THREAD_START_ROUTINE) (void *) __attribute__(= (noreturn)); // Input queue thread +typedef void (*LPVOID_THREAD_START_ROUTINE) (void *) __attribute__((noretu= rn)); // Input queue thread =20 class cygthread { @@ -32,8 +32,8 @@ class cygthread static void CALLBACK async_create (ULONG_PTR); public: bool terminate_thread (); - static DWORD WINAPI stub (VOID *); - static DWORD WINAPI simplestub (VOID *); + static DWORD stub (VOID *); + static DWORD simplestub (VOID *); static DWORD main_thread_id; static const char *name (DWORD =3D 0); void callfunc (bool) __attribute__ ((noinline, )); diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 5a154c35b..1c59b1597 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -55,7 +55,7 @@ PWCHAR debugger_command; extern uint8_t _sigbe; extern uint8_t _sigdelayed_end; =20 -static BOOL WINAPI ctrl_c_handler (DWORD); +static BOOL ctrl_c_handler (DWORD); =20 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. "Normal" exceptions will simply exit the process. Still, better than nothing... */ -LONG WINAPI +LONG myfault_altstack_handler (EXCEPTION_POINTERS *exc) { _cygtls& me =3D _my_tls; @@ -976,7 +976,7 @@ has_visible_window_station () } =20 /* Keyboard interrupt handler. */ -static BOOL WINAPI +static BOOL ctrl_c_handler (DWORD type) { static bool saw_close; @@ -1207,7 +1207,7 @@ set_signal_mask (sigset_t& setmask, sigset_t newmask) } =20 =20 -DWORD WINAPI +DWORD dumpstack_overflow_wrapper (PVOID arg) { cygwin_exception *exc =3D (cygwin_exception *) arg; diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_con= sole.cc index e3d87331f..a4a367005 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -198,7 +198,7 @@ console_unit::console_unit (HWND me0): api_fatal ("console device allocation failure - too many consoles in u= se, max consoles is 32"); } =20 -static DWORD WINAPI +static DWORD cons_master_thread (VOID *arg) { fhandler_console *fh =3D (fhandler_console *) arg; @@ -3988,7 +3988,7 @@ DEF_HOOK (CreateProcessW); DEF_HOOK (ContinueDebugEvent); DEF_HOOK (GetProcAddress); /* Hooked for ConEmu cygwin connector */ =20 -static BOOL WINAPI +static BOOL CreateProcessA_Hooked (LPCSTR n, LPSTR c, LPSECURITY_ATTRIBUTES pa, LPSECURITY_ATTRIBUTES t= a, 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); } =20 -static BOOL WINAPI +static BOOL CreateProcessW_Hooked (LPCWSTR n, LPWSTR c, LPSECURITY_ATTRIBUTES pa, LPSECURITY_ATTRIBUTES= ta, 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); } =20 -static BOOL WINAPI +static BOOL ContinueDebugEvent_Hooked (DWORD p, DWORD t, DWORD s) { @@ -4029,7 +4029,7 @@ ContinueDebugEvent_Hooked } =20 /* Hooked for ConEmu cygwin connector */ -static FARPROC WINAPI +static FARPROC GetProcAddress_Hooked (HMODULE h, LPCSTR n) { if (strcmp(n, "RequestTermConnector") =3D=3D 0) diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc index fa4ac7890..1d3e42908 100644 --- a/winsup/cygwin/fhandler_fifo.cc +++ b/winsup/cygwin/fhandler_fifo.cc @@ -446,7 +446,7 @@ fhandler_fifo::update_shared_handlers () return 0; } =20 -static DWORD WINAPI +static DWORD fifo_reader_thread (LPVOID param) { fhandler_fifo *fh =3D (fhandler_fifo *) param; diff --git a/winsup/cygwin/fhandler_netdrive.cc b/winsup/cygwin/fhandler_ne= tdrive.cc index 306d77dd2..58ab8811b 100644 --- a/winsup/cygwin/fhandler_netdrive.cc +++ b/winsup/cygwin/fhandler_netdrive.cc @@ -63,7 +63,7 @@ wnet_dbg_out (const char *func, DWORD ndi_ret) debug_printf ("WNetGetLastError failed: %u", gle_ret); } =20 -static DWORD WINAPI +static DWORD thread_netdrive (void *arg) { netdriveinf *ndi =3D (netdriveinf *) arg; diff --git a/winsup/cygwin/fhandler_socket_unix.cc b/winsup/cygwin/fhandler= _socket_unix.cc index 524f18d81..0cd97f625 100644 --- a/winsup/cygwin/fhandler_socket_unix.cc +++ b/winsup/cygwin/fhandler_socket_unix.cc @@ -928,7 +928,7 @@ struct conn_wait_info_t }; =20 /* Just hop to the wait_pipe_thread method. */ -DWORD WINAPI +DWORD connect_wait_func (LPVOID param) { conn_wait_info_t *wait_info =3D (conn_wait_info_t *) param; diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index a7e25ba83..0f9dec570 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -268,7 +268,7 @@ atexit_func (void) DEF_HOOK (CreateProcessA); DEF_HOOK (CreateProcessW); =20 -static BOOL WINAPI +static BOOL CreateProcessA_Hooked (LPCSTR n, LPSTR c, LPSECURITY_ATTRIBUTES pa, LPSECURITY_ATTRIBUTES t= a, BOOL inh, DWORD f, LPVOID e, LPCSTR d, @@ -307,7 +307,7 @@ CreateProcessA_Hooked return ret; } =20 -static BOOL WINAPI +static BOOL CreateProcessW_Hooked (LPCWSTR n, LPWSTR c, LPSECURITY_ATTRIBUTES pa, LPSECURITY_ATTRIBUTES= ta, BOOL inh, DWORD f, LPVOID e, LPCWSTR d, @@ -2666,7 +2666,7 @@ reply: return 0; } =20 -static DWORD WINAPI +static DWORD pty_master_thread (VOID *arg) { fhandler_pty_master::master_thread_param_t p; @@ -2873,7 +2873,7 @@ fhandler_pty_master::pty_master_fwd_thread (const mas= ter_fwd_thread_param_t *p) return 0; } =20 -static DWORD WINAPI +static DWORD pty_master_fwd_thread (VOID *arg) { fhandler_pty_master::master_fwd_thread_param_t p; diff --git a/winsup/cygwin/flock.cc b/winsup/cygwin/flock.cc index 2f12fc07e..50db7fe28 100644 --- a/winsup/cygwin/flock.cc +++ b/winsup/cygwin/flock.cc @@ -642,7 +642,7 @@ lockf_t::create_lock_obj_attr (lockfattr_t *attr, ULONG= flags, void *sd_buf) return &attr->attr; } =20 -DWORD WINAPI +DWORD create_lock_in_parent (PVOID param) { HANDLE lf_obj; @@ -721,7 +721,7 @@ err: return 1; } =20 -DWORD WINAPI +DWORD delete_lock_in_parent (PVOID param) { inode_t *node, *next_node; @@ -1870,7 +1870,7 @@ struct lock_parms { NTSTATUS status; }; =20 -static DWORD WINAPI +static DWORD blocking_lock_thr (LPVOID param) { struct lock_parms *lp =3D (struct lock_parms *) param; diff --git a/winsup/cygwin/include/cygwin/cygwin_dll.h b/winsup/cygwin/incl= ude/cygwin/cygwin_dll.h index 10a8bc7ed..1e4cf98ba 100644 --- a/winsup/cygwin/include/cygwin/cygwin_dll.h +++ b/winsup/cygwin/include/cygwin/cygwin_dll.h @@ -22,7 +22,7 @@ details. */ #define DECLARE_CYGWIN_DLL(Entry) \ \ 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 **); \ extern PVOID cygwin_attach_dll (HMODULE, mainfunc); \ extern void cygwin_detach_dll (PVOID); \ @@ -42,7 +42,7 @@ static int __dllMain (int a __attribute__ ((__unused__)),= \ \ 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; \ ret =3D 1; \ diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc index d822a3851..ce6484aff 100644 --- a/winsup/cygwin/init.cc +++ b/winsup/cygwin/init.cc @@ -19,7 +19,7 @@ unsigned threadfunc_ix[8]; static bool dll_finished_loading; #define OLDFUNC_OFFSET -1 =20 -static void WINAPI +static void threadfunc_fe (VOID *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... */ void *alloca_dummy; =20 -extern "C" BOOL WINAPI +extern "C" BOOL dll_entry (HANDLE h, DWORD reason, void *static_load) { BOOL test_stack_marker; diff --git a/winsup/cygwin/kernel32.cc b/winsup/cygwin/kernel32.cc index 05c5d4d70..6248aefd5 100644 --- a/winsup/cygwin/kernel32.cc +++ b/winsup/cygwin/kernel32.cc @@ -22,7 +22,7 @@ details. */ /* Implement CreateEvent/OpenEvent so that named objects are always create= d in Cygwin shared object namespace. */ =20 -HANDLE WINAPI +HANDLE CreateEventW (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCWSTR lpName) { @@ -57,7 +57,7 @@ CreateEventW (LPSECURITY_ATTRIBUTES lpEventAttributes, BO= OL bManualReset, return evt; } =20 -HANDLE WINAPI +HANDLE CreateEventA (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) { @@ -72,7 +72,7 @@ CreateEventA (LPSECURITY_ATTRIBUTES lpEventAttributes, BO= OL bManualReset, lpName ? name : NULL); } =20 -HANDLE WINAPI +HANDLE OpenEventW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName) { HANDLE evt; @@ -100,7 +100,7 @@ OpenEventW (DWORD dwDesiredAccess, BOOL bInheritHandle,= LPCWSTR lpName) return evt; } =20 -HANDLE WINAPI +HANDLE OpenEventA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName) { WCHAR name[MAX_PATH]; @@ -116,7 +116,7 @@ OpenEventA (DWORD dwDesiredAccess, BOOL bInheritHandle,= LPCSTR lpName) /* Implement CreateMutex/OpenMutex so that named objects are always create= d in Cygwin shared object namespace. */ =20 -HANDLE WINAPI +HANDLE CreateMutexW (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCWSTR lpName) { @@ -148,7 +148,7 @@ CreateMutexW (LPSECURITY_ATTRIBUTES lpMutexAttributes, = BOOL bInitialOwner, return mtx; } =20 -HANDLE WINAPI +HANDLE CreateMutexA (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCSTR lpName) { @@ -162,7 +162,7 @@ CreateMutexA (LPSECURITY_ATTRIBUTES lpMutexAttributes, = BOOL bInitialOwner, return CreateMutexW (lpMutexAttributes, bInitialOwner, lpName ? name : N= ULL); } =20 -HANDLE WINAPI +HANDLE OpenMutexW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName) { HANDLE mtx; @@ -190,7 +190,7 @@ OpenMutexW (DWORD dwDesiredAccess, BOOL bInheritHandle,= LPCWSTR lpName) return mtx; } =20 -HANDLE WINAPI +HANDLE OpenMutexA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName) { WCHAR name[MAX_PATH]; @@ -206,7 +206,7 @@ OpenMutexA (DWORD dwDesiredAccess, BOOL bInheritHandle,= LPCSTR lpName) /* Implement CreateSemaphore/OpenSemaphore so that named objects are always created in Cygwin shared object namespace. */ =20 -HANDLE WINAPI +HANDLE CreateSemaphoreW (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName) { @@ -240,7 +240,7 @@ CreateSemaphoreW (LPSECURITY_ATTRIBUTES lpSemaphoreAttr= ibutes, return sem; } =20 -HANDLE WINAPI +HANDLE CreateSemaphoreA (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCSTR lpName) { @@ -255,7 +255,7 @@ CreateSemaphoreA (LPSECURITY_ATTRIBUTES lpSemaphoreAttr= ibutes, lpName ? name : NULL); } =20 -HANDLE WINAPI +HANDLE OpenSemaphoreW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpName) { HANDLE sem; @@ -283,7 +283,7 @@ OpenSemaphoreW (DWORD dwDesiredAccess, BOOL bInheritHan= dle, LPCWSTR lpName) return sem; } =20 -HANDLE WINAPI +HANDLE OpenSemaphoreA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpName) { WCHAR name[MAX_PATH]; @@ -299,7 +299,7 @@ OpenSemaphoreA (DWORD dwDesiredAccess, BOOL bInheritHan= dle, LPCSTR lpName) /* Implement CreateFileMapping/OpenFileMapping so that named objects are a= lways created in Cygwin shared object namespace. */ =20 -HANDLE WINAPI +HANDLE CreateFileMappingW (HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCWSTR lpName) @@ -354,7 +354,7 @@ CreateFileMappingW (HANDLE hFile, LPSECURITY_ATTRIBUTES= lpAttributes, return sect; } =20 -HANDLE WINAPI +HANDLE CreateFileMappingA (HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCSTR lpName) @@ -370,7 +370,7 @@ CreateFileMappingA (HANDLE hFile, LPSECURITY_ATTRIBUTES= lpAttributes, dwMaximumSizeLow, lpName ? name : NULL); } =20 -HANDLE WINAPI +HANDLE OpenFileMappingW (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCWSTR lpNa= me) { HANDLE sect; @@ -398,7 +398,7 @@ OpenFileMappingW (DWORD dwDesiredAccess, BOOL bInheritH= andle, LPCWSTR lpName) return sect; } =20 -HANDLE WINAPI +HANDLE OpenFileMappingA (DWORD dwDesiredAccess, BOOL bInheritHandle, LPCSTR lpNam= e) { WCHAR name[MAX_PATH]; @@ -433,7 +433,7 @@ ucmd () /* Cygwin replacement for GetCommandLineW. Returns a concatenated wide st= ring representing the argv list, constructed using roughly the same mechanis= m as child_info_spawn::worker */ -extern "C" LPWSTR WINAPI +extern "C" LPWSTR cygwin_GetCommandLineW (void) { return ucmd ()->Buffer; @@ -442,7 +442,7 @@ cygwin_GetCommandLineW (void) /* Cygwin replacement for GetCommandLineA. Returns a concatenated string representing the argv list, constructed using roughly the same mechanism as child_info_spawn::worker */ -extern "C" LPSTR WINAPI +extern "C" LPSTR cygwin_GetCommandLineA (void) { static ANSI_STRING cmd; diff --git a/winsup/cygwin/ldap.cc b/winsup/cygwin/ldap.cc index 3c9fd13a1..ed2fa3f7f 100644 --- a/winsup/cygwin/ldap.cc +++ b/winsup/cygwin/ldap.cc @@ -208,7 +208,7 @@ cyg_ldap::connect_non_ssl (PCWSTR domain) return ret; } =20 -static DWORD WINAPI +static DWORD ldap_init_thr (LPVOID param) { cyg_ldap_init *cl =3D (cyg_ldap_init *) param; @@ -251,7 +251,7 @@ cyg_ldap::search_s (PWCHAR base, ULONG scope, PWCHAR fi= lter, PWCHAR *attrs) return ret; } =20 -static DWORD WINAPI +static DWORD ldap_search_thr (LPVOID param) { cyg_ldap_search *cl =3D (cyg_ldap_search *) param; @@ -293,7 +293,7 @@ cyg_ldap::next_page_s () return ret; } =20 -static DWORD WINAPI +static DWORD ldap_next_page_thr (LPVOID param) { cyg_ldap_next_page *cl =3D (cyg_ldap_next_page *) param; diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc index a5e381dad..bc362e331 100644 --- a/winsup/cygwin/miscfuncs.cc +++ b/winsup/cygwin/miscfuncs.cc @@ -19,7 +19,7 @@ details. */ #include "mmap_alloc.h" =20 /* not yet prototyped in w32api */ -extern "C" HRESULT WINAPI SetThreadDescription (HANDLE hThread, PCWSTR lpT= hreadDescription); +extern "C" HRESULT SetThreadDescription (HANDLE hThread, PCWSTR lpThreadDe= scription); =20 /* Get handle count of an object. */ ULONG @@ -202,7 +202,7 @@ nice_to_winprio (int &nice) =20 /* Minimal overlapped pipe I/O implementation for signal and commune stuff= . */ =20 -BOOL WINAPI +BOOL CreatePipeOverlapped (PHANDLE hr, PHANDLE hw, LPSECURITY_ATTRIBUTES sa) { int ret =3D fhandler_pipe::create (sa, hr, hw, 0, NULL, @@ -212,7 +212,7 @@ CreatePipeOverlapped (PHANDLE hr, PHANDLE hw, LPSECURIT= Y_ATTRIBUTES sa) return ret =3D=3D 0; } =20 -BOOL WINAPI +BOOL ReadPipeOverlapped (HANDLE h, PVOID buf, DWORD len, LPDWORD ret_len, DWORD timeout) { @@ -232,7 +232,7 @@ ReadPipeOverlapped (HANDLE h, PVOID buf, DWORD len, LPD= WORD ret_len, return ret; } =20 -BOOL WINAPI +BOOL WritePipeOverlapped (HANDLE h, LPCVOID buf, DWORD len, LPDWORD ret_len, DWORD timeout) { @@ -376,7 +376,7 @@ struct pthread_wrapper_arg ULONG guardsize; }; =20 -DWORD WINAPI +DWORD pthread_wrapper (PVOID arg) { /* Just plain paranoia. */ @@ -601,7 +601,7 @@ create_new_main_thread_stack (PVOID &allocationbase) return ((PBYTE) allocationbase + stacksize - 16); } =20 -HANDLE WINAPI +HANDLE CygwinCreateThread (LPTHREAD_START_ROUTINE thread_func, PVOID thread_arg, PVOID stackaddr, ULONG stacksize, ULONG guardsize, DWORD creation_flags, LPDWORD thread_id) diff --git a/winsup/cygwin/miscfuncs.h b/winsup/cygwin/miscfuncs.h index 565029561..fc791c2aa 100644 --- a/winsup/cygwin/miscfuncs.h +++ b/winsup/cygwin/miscfuncs.h @@ -49,12 +49,12 @@ DWORD nice_to_winprio (int &); =20 bool create_pipe (PHANDLE, PHANDLE, LPSECURITY_ATTRIBUTES, DWORD); =20 -BOOL WINAPI CreatePipeOverlapped (PHANDLE read_handle, PHANDLE write_handl= e, - LPSECURITY_ATTRIBUTES sa); -BOOL WINAPI ReadPipeOverlapped (HANDLE h, PVOID buf, DWORD len, - LPDWORD ret_len, DWORD timeout); -BOOL WINAPI WritePipeOverlapped (HANDLE h, LPCVOID buf, DWORD len, - LPDWORD ret_len, DWORD timeout); +BOOL CreatePipeOverlapped (PHANDLE read_handle, PHANDLE write_handle, + LPSECURITY_ATTRIBUTES sa); +BOOL ReadPipeOverlapped (HANDLE h, PVOID buf, DWORD len, + LPDWORD ret_len, DWORD timeout); +BOOL WritePipeOverlapped (HANDLE h, LPCVOID buf, DWORD len, + LPDWORD ret_len, DWORD timeout); =20 /* class for per-line reading using native functions. The caller provides the file as an POBJECT_ATTRIBUTES, and the buffer space. */ @@ -110,12 +110,11 @@ ssize_t check_iovec (const struct iovec *, int, bool); =20 extern PVOID create_new_main_thread_stack (PVOID &allocationbase); =20 -extern "C" DWORD WINAPI pthread_wrapper (PVOID arg); -extern "C" HANDLE WINAPI CygwinCreateThread (LPTHREAD_START_ROUTINE thread= _func, - PVOID thread_arg, PVOID stackaddr, - ULONG stacksize, ULONG guardsize, - DWORD creation_flags, - LPDWORD thread_id); +extern "C" DWORD pthread_wrapper (PVOID arg); +extern "C" HANDLE CygwinCreateThread (LPTHREAD_START_ROUTINE thread_func, + PVOID thread_arg, PVOID stackaddr, + ULONG stacksize, ULONG guardsize, + DWORD creation_flags, LPDWORD thread_id); =20 void SetThreadName (DWORD dwThreadID, const char* threadName); =20 diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h index ad9c2e0c6..70d463d81 100644 --- a/winsup/cygwin/ntdll.h +++ b/winsup/cygwin/ntdll.h @@ -1522,7 +1522,7 @@ extern "C" PVOID, ULONG, PULONG); NTSTATUS NTAPI NtQuerySystemInformation (SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG); - NTSTATUS WINAPI NtQuerySystemTime (PLARGE_INTEGER); + NTSTATUS NTAPI NtQuerySystemTime (PLARGE_INTEGER); NTSTATUS NTAPI NtQuerySecurityObject (HANDLE, SECURITY_INFORMATION, PSECURITY_DESCRIPTOR, ULONG, PULONG); NTSTATUS NTAPI NtQuerySymbolicLinkObject (HANDLE, PUNICODE_STRING, PULON= G); diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index 2e336c1a3..e086ab9a8 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -597,7 +597,7 @@ _pinfo::alive () return !!h; } =20 -DWORD WINAPI +DWORD commune_process (void *arg) { siginfo_t& si =3D *((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. Otherwise, various "signals" can be sent to the parent to inform the parent to perform a certain action. */ -static DWORD WINAPI +static DWORD proc_waiter (void *arg) { pinfo vchild =3D *(pinfo *) arg; diff --git a/winsup/cygwin/pinfo.h b/winsup/cygwin/pinfo.h index 7e4170341..463f0e851 100644 --- a/winsup/cygwin/pinfo.h +++ b/winsup/cygwin/pinfo.h @@ -131,7 +131,7 @@ public: friend class pinfo_minimal; }; =20 -DWORD WINAPI commune_process (void *); +DWORD commune_process (void *); =20 enum parent_alerter { diff --git a/winsup/cygwin/posix_timer.cc b/winsup/cygwin/posix_timer.cc index 75cd4fa60..69c758aa7 100644 --- a/winsup/cygwin/posix_timer.cc +++ b/winsup/cygwin/posix_timer.cc @@ -228,7 +228,7 @@ out: return 0; } =20 -static DWORD WINAPI +static DWORD timer_thread (VOID *x) { timer_tracker *tt =3D ((timer_tracker *) x); diff --git a/winsup/cygwin/profil.c b/winsup/cygwin/profil.c index 2c3a7a5eb..30b37244a 100644 --- a/winsup/cygwin/profil.c +++ b/winsup/cygwin/profil.c @@ -153,7 +153,7 @@ profile_on (struct profinfo *p) return -1; } =20 - p->profthr =3D CreateThread (0, 0, (DWORD (WINAPI *)(LPVOID)) profthr_fu= nc, + p->profthr =3D CreateThread (0, 0, (DWORD (*)(LPVOID)) profthr_func, (void *) p, 0, &thrid); =20 if (!p->profthr) diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 0fa60bcdb..76ab91bbb 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -770,7 +770,7 @@ out: =20 static int start_thread_pipe (select_record *me, select_stuff *stuff); =20 -static DWORD WINAPI +static DWORD thread_pipe (void *arg) { select_pipe_info *pi =3D (select_pipe_info *) arg; @@ -973,7 +973,7 @@ out: =20 static int start_thread_fifo (select_record *me, select_stuff *stuff); =20 -static DWORD WINAPI +static DWORD thread_fifo (void *arg) { select_fifo_info *pi =3D (select_fifo_info *) arg; @@ -1161,7 +1161,7 @@ verify_console (select_record *me, fd_set *rfds, fd_s= et *wfds, =20 static int console_startup (select_record *me, select_stuff *stuff); =20 -static DWORD WINAPI +static DWORD thread_console (void *arg) { select_console_info *ci =3D (select_console_info *) arg; @@ -1397,7 +1397,7 @@ out: =20 static int pty_slave_startup (select_record *me, select_stuff *stuff); =20 -static DWORD WINAPI +static DWORD thread_pty_slave (void *arg) { select_pipe_info *pi =3D (select_pipe_info *) arg; @@ -1773,7 +1773,7 @@ peek_socket (select_record *me, bool) =20 static int start_thread_socket (select_record *, select_stuff *); =20 -static DWORD WINAPI +static DWORD thread_socket (void *arg) { select_socket_info *si =3D (select_socket_info *) arg; diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index 0ccbc5046..6b1a4137d 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -100,7 +100,7 @@ static int checkstate (waitq *); static __inline__ bool get_proc_lock (DWORD, DWORD); static int remove_proc (int); static bool stopped_or_terminated (waitq *, _pinfo *); -static void WINAPI wait_sig (VOID *arg); +static void wait_sig (VOID *arg); =20 /* wait_sig bookkeeping */ =20 @@ -116,7 +116,7 @@ public: void clear (int sig) {sigs[sig].si.si_signo =3D 0;} void clear (_cygtls *tls); friend void sig_dispatch_pending (bool); - friend void WINAPI wait_sig (VOID *arg); + friend void wait_sig (VOID *arg); }; =20 Static pending_signals sigq; @@ -1313,7 +1313,7 @@ pending_signals::add (sigpacket& pack) =20 /* Process signals by waiting for signal data to arrive in a pipe. Set a completion event if one was specified. */ -static void WINAPI +static void wait_sig (VOID *) { _sig_tls =3D &_my_tls; diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index 72c04dbda..dc59294e7 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -1989,7 +1989,7 @@ pthread_spinlock::unlock () return result; } =20 -DWORD WINAPI +DWORD pthread::thread_init_wrapper (void *arg) { exception protect; diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h index ddb2d7dbf..9939c4224 100644 --- a/winsup/cygwin/thread.h +++ b/winsup/cygwin/thread.h @@ -430,7 +430,7 @@ public: virtual void pop_cleanup_handler (int const execute); =20 static pthread* self (); - static DWORD WINAPI thread_init_wrapper (void *); + static DWORD thread_init_wrapper (void *); =20 virtual unsigned long getsequence_np(); =20 diff --git a/winsup/cygwin/timerfd.cc b/winsup/cygwin/timerfd.cc index f1a4c2804..c692e1bd1 100644 --- a/winsup/cygwin/timerfd.cc +++ b/winsup/cygwin/timerfd.cc @@ -225,7 +225,7 @@ canceled: return 0; } =20 -static DWORD WINAPI +static DWORD timerfd_thread (VOID *arg) { timerfd_tracker *tt =3D ((timerfd_tracker *) arg); diff --git a/winsup/cygwin/window.cc b/winsup/cygwin/window.cc index 002053869..69430326a 100644 --- a/winsup/cygwin/window.cc +++ b/winsup/cygwin/window.cc @@ -52,7 +52,7 @@ process_window_events (HWND hwnd, UINT uMsg, WPARAM wPara= m, LPARAM lParam) } =20 /* Handle windows events. Inherits ownership of the wininfo lock */ -DWORD WINAPI +DWORD wininfo::winthread () { MSG msg; @@ -92,7 +92,7 @@ wininfo::winthread () return 0; } =20 -static DWORD WINAPI +static DWORD winthread (VOID *arg) { return ((wininfo *) arg)->winthread (); diff --git a/winsup/cygwin/wininfo.h b/winsup/cygwin/wininfo.h index 9dfba1a8c..323d272a5 100644 --- a/winsup/cygwin/wininfo.h +++ b/winsup/cygwin/wininfo.h @@ -16,7 +16,7 @@ public: int process (HWND, UINT, WPARAM, LPARAM); void lock (); void release (); - DWORD WINAPI winthread (); + DWORD winthread (); }; =20 extern wininfo winmsg;