X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwinsftp.c;h=c786f7a65d686d65d165391674e878ed42fd7e91;hb=1de7240eb88fa24a8532ded116b4ec72dd213008;hp=a0341274f3637241d547278ff8a100606c470ec4;hpb=b0b5d5fbe63e982d6a230269a2e2a823e2586512;p=PuTTY.git diff --git a/windows/winsftp.c b/windows/winsftp.c index a0341274..c786f7a6 100644 --- a/windows/winsftp.c +++ b/windows/winsftp.c @@ -8,6 +8,7 @@ #include "psftp.h" #include "ssh.h" #include "int64.h" +#include "winsecur.h" char *get_ttymode(void *frontend, const char *mode) { return NULL; } @@ -102,8 +103,12 @@ RFile *open_existing_file(const char *name, uint64 *size, ret = snew(RFile); ret->h = h; - if (size) - size->lo=GetFileSize(h, &(size->hi)); + if (size) { + DWORD lo, hi; + lo = GetFileSize(h, &hi); + size->lo = lo; + size->hi = hi; + } if (mtime || atime) { FILETIME actime, wrtime; @@ -170,8 +175,12 @@ WFile *open_existing_wfile(const char *name, uint64 *size) ret = snew(WFile); ret->h = h; - if (size) - size->lo=GetFileSize(h, &(size->hi)); + if (size) { + DWORD lo, hi; + lo = GetFileSize(h, &hi); + size->lo = lo; + size->hi = hi; + } return ret; } @@ -221,7 +230,10 @@ int seek_file(WFile *f, uint64 offset, int whence) return -1; } - SetFilePointer(f->h, offset.lo, &(offset.hi), movemethod); + { + LONG lo = offset.lo, hi = offset.hi; + SetFilePointer(f->h, lo, &hi, movemethod); + } if (GetLastError() != NO_ERROR) return -1; @@ -232,9 +244,11 @@ int seek_file(WFile *f, uint64 offset, int whence) uint64 get_file_posn(WFile *f) { uint64 ret; + LONG lo, hi = 0; - ret.hi = 0L; - ret.lo = SetFilePointer(f->h, 0L, &(ret.hi), FILE_CURRENT); + lo = SetFilePointer(f->h, 0L, &hi, FILE_CURRENT); + ret.lo = lo; + ret.hi = hi; return ret; } @@ -735,7 +749,7 @@ char *ssh_sftp_get_cmdline(const char *prompt, int no_fds_ok) void platform_psftp_post_option_setup(void) { -#ifndef UNPROTECT +#if !defined UNPROTECT && !defined NO_SECURITY /* * Protect our process. */