summaryrefslogtreecommitdiffstats
path: root/common/iobuf.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2010-03-02 22:25:08 +0100
committerWerner Koch <wk@gnupg.org>2010-03-02 22:25:08 +0100
commitd232fd2e543fb81151d7fe25e9f0692610870788 (patch)
tree8ce5ef17c07737c2ae873f945f99fb255f6573a3 /common/iobuf.c
parentFinished jnlib port to CE. (diff)
downloadgnupg2-d232fd2e543fb81151d7fe25e9f0692610870788.tar.xz
gnupg2-d232fd2e543fb81151d7fe25e9f0692610870788.zip
First steps towards the W32CE port
Diffstat (limited to 'common/iobuf.c')
-rw-r--r--common/iobuf.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/common/iobuf.c b/common/iobuf.c
index 0d2a5a5ba..356e9cdc3 100644
--- a/common/iobuf.c
+++ b/common/iobuf.c
@@ -306,7 +306,21 @@ direct_open (const char *fname, const char *mode)
sm = FILE_SHARE_READ;
}
+#ifdef HAVE_W32CE_SYSTEM
+ {
+ wchar_t *wfname = utf8_to_wchar (fname);
+ if (wfname)
+ {
+ hfile = CreateFile (wfname, da, sm, NULL, cd,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+ xfree (wfname);
+ }
+ else
+ hfile = INVALID_HANDLE_VALUE;
+ }
+#else
hfile = CreateFile (fname, da, sm, NULL, cd, FILE_ATTRIBUTE_NORMAL, NULL);
+#endif
return hfile;
#else /*!HAVE_W32_SYSTEM*/
int oflag;
@@ -1188,7 +1202,14 @@ iobuf_cancel (iobuf_t a)
{
/* Argg, MSDOS does not allow to remove open files. So
* we have to do it here */
+#ifdef HAVE_W32CE_SYSTEM
+ wchar_t *wtmp = utf8_to_wchar (remove_name);
+ if (wtmp)
+ DeleteFile (wtmp);
+ xfree (wtmp);
+#else
remove (remove_name);
+#endif
xfree (remove_name);
}
#endif