summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2006-09-03 23:51:22 +0000
committerChris Wilson <chris+github@qwirx.com>2006-09-03 23:51:22 +0000
commita1ccaaebe529e4c054812c13394b597974c58123 (patch)
tree6452712646b4c28ef6f4d90702161b188f6f5ee4 /lib
parenta64a6f4c9c71dfe925bf5492c6e6aa828611fba0 (diff)
(refs #3)
Pass requested open flags to OpenFileByNameUtf8
Diffstat (limited to 'lib')
-rw-r--r--lib/win32/emu.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/win32/emu.cpp b/lib/win32/emu.cpp
index c0bdd609..0239724c 100644
--- a/lib/win32/emu.cpp
+++ b/lib/win32/emu.cpp
@@ -681,9 +681,10 @@ int emu_fstat(HANDLE hdir, struct stat * st)
// Created: 10th December 2004
//
// --------------------------------------------------------------------------
-HANDLE OpenFileByNameUtf8(const char* pFileName)
+HANDLE OpenFileByNameUtf8(const char* pFileName, DWORD flags)
{
- std::string AbsPathWithUnicode = ConvertPathToAbsoluteUnicode(pFileName);
+ std::string AbsPathWithUnicode =
+ ConvertPathToAbsoluteUnicode(pFileName);
if (AbsPathWithUnicode.size() == 0)
{
@@ -701,7 +702,7 @@ HANDLE OpenFileByNameUtf8(const char* pFileName)
}
HANDLE handle = CreateFileW(pBuffer,
- FILE_READ_ATTRIBUTES | FILE_LIST_DIRECTORY | FILE_READ_EA,
+ flags,
FILE_SHARE_READ | FILE_SHARE_DELETE | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
@@ -757,12 +758,8 @@ HANDLE OpenFileByNameUtf8(const char* pFileName)
// --------------------------------------------------------------------------
int emu_stat(const char * pName, struct stat * st)
{
- // at the mo
- st->st_uid = 0;
- st->st_gid = 0;
- st->st_nlink = 1;
-
- HANDLE handle = OpenFileByNameUtf8(pName);
+ HANDLE handle = OpenFileByNameUtf8(pName,
+ FILE_READ_ATTRIBUTES | FILE_READ_EA);
if (handle == NULL)
{
@@ -795,7 +792,8 @@ int emu_stat(const char * pName, struct stat * st)
// --------------------------------------------------------------------------
int statfs(const char * pName, struct statfs * s)
{
- HANDLE handle = OpenFileByNameUtf8(pName);
+ HANDLE handle = OpenFileByNameUtf8(pName,
+ FILE_READ_ATTRIBUTES | FILE_READ_EA);
if (handle == NULL)
{