GPGME callback function problem

Shawn Walker swalker at bynari.net
Mon Sep 10 18:38:00 CEST 2007


Marcus Brinkmann wrote:
> At Fri, 31 Aug 2007 12:44:47 -0700 (PDT),
> alan_b <gtbui at yahoo.com> wrote:
>>
>> So, in that callback function, what W32 function call should I use to write
>> the password to the fd ?
>> The original code is write( ), which did not compile in Windows.  I replaced
>> it with _write( ), which gave the assertion error on the fd.
> 
> WriteFile
> 
> Marcus

Windows do support write(), you need to have the following inclues:

#include <fcntl.h>      /* Needed only for _O_RDWR definition */
#include <io.h>
#include <stdlib.h>
#include <stdio.h>
#include <share.h>
"include <stdio.h>"

and link with one of the fullowing C run-time libraries (CRT).

libcmt.lib Multithreaded, static link
msvcrt.lib Multithreaded, dynamic link
libcmtd.lib Multithreaded, static link (debug)
msvcrtd.lib Multithreaded, dynamic link (debug)
msvcmrt.lib C Runtime import library.
msvcurt.lib C Runtime import library compiled as 100% pure MSIL code





More information about the Gnupg-devel mailing list