From 2e07d4f89a26bb56a55b2743d39fb37532028ffd Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 31 Oct 2018 11:57:45 +0100 Subject: [PATCH] w32: Remove cruft in w32-io from WindowsME times. * src/w32-io.c (set_synchronize): Remove. (create_reader, create_writer): No need for set_synchronize. -- The set_synchronize dates back to 2001 at a time when I wrote the Windows support on WindowsME and Windows2000. Maybe this was required then due to bugs in that old NT or partly NT based Windows versions. Signed-off-by: Werner Koch --- src/w32-io.c | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/src/w32-io.c b/src/w32-io.c index 52327afa..aea0547e 100644 --- a/src/w32-io.c +++ b/src/w32-io.c @@ -247,33 +247,6 @@ get_desired_thread_priority (void) } -static HANDLE -set_synchronize (HANDLE hd) -{ -#ifdef HAVE_W32CE_SYSTEM - return hd; -#else - HANDLE new_hd; - - /* For NT we have to set the sync flag. It seems that the only way - to do it is by duplicating the handle. Tsss... */ - if (!DuplicateHandle (GetCurrentProcess (), hd, - GetCurrentProcess (), &new_hd, - EVENT_MODIFY_STATE | SYNCHRONIZE, FALSE, 0)) - { - TRACE1 (DEBUG_SYSIO, "gpgme:set_synchronize", hd, - "DuplicateHandle failed: ec=%d", (int) GetLastError ()); - /* FIXME: Should translate the error code. */ - gpg_err_set_errno (EIO); - return INVALID_HANDLE_VALUE; - } - - CloseHandle (hd); - return new_hd; -#endif -} - - static DWORD CALLBACK reader (void *arg) { @@ -470,7 +443,6 @@ create_reader (int fd) return NULL; } - ctx->have_data_ev = set_synchronize (ctx->have_data_ev); INIT_LOCK (ctx->mutex); #ifdef HAVE_W32CE_SYSTEM @@ -843,7 +815,6 @@ create_writer (int fd) return NULL; } - ctx->is_empty = set_synchronize (ctx->is_empty); INIT_LOCK (ctx->mutex); #ifdef HAVE_W32CE_SYSTEM