19 |
*/ |
*/ |
20 |
|
|
21 |
#include <windows.h> |
#include <windows.h> |
|
#include <io.h> |
|
22 |
|
|
23 |
#include "wptGPG.h" |
#include "wptGPG.h" |
24 |
#include "wptCommonCtl.h" |
#include "wptCommonCtl.h" |
37 |
int prev_was_bad, int fd) |
int prev_was_bad, int fd) |
38 |
{ |
{ |
39 |
const char *pass = (const char*)hook; |
const char *pass = (const char*)hook; |
40 |
|
HANDLE hd = (HANDLE)fd; |
41 |
|
DWORD n; |
42 |
|
|
43 |
if (!pass) |
if (!pass) |
44 |
return gpg_error (GPG_ERR_INV_ARG); |
return gpg_error (GPG_ERR_INV_ARG); |
45 |
write (fd, pass, strlen (pass)); |
|
46 |
write (fd, "\n", 1); |
if (!WriteFile (hd, pass, strlen (pass), &n, NULL)) |
47 |
|
log_debug ("sym_passphrase_cb: WriteFile() failed ec=%d\n", w32_errno); |
48 |
|
if (!WriteFile (hd, "\n", 1, &n, NULL)) |
49 |
|
log_debug ("sym_passphrase_cb: WriteFile() failed ec=%d\n", w32_errno); |
50 |
|
|
51 |
return 0; |
return 0; |
52 |
} |
} |
53 |
|
|
83 |
msg_box (NULL, gpgme_strerror (rc), _("Symmetric Encryption"), MB_ERR); |
msg_box (NULL, gpgme_strerror (rc), _("Symmetric Encryption"), MB_ERR); |
84 |
else { |
else { |
85 |
show_msg (GetDesktopWindow (), 1500, _("GnuPG Status: Finished")); |
show_msg (GetDesktopWindow (), 1500, _("GnuPG Status: Finished")); |
86 |
gpg_data_release_and_set_clipboard (ciph, 0); |
gpg_data_release_and_set_clipboard (ciph, 1); |
87 |
ciph = NULL; |
ciph = NULL; |
88 |
} |
} |
89 |
|
|