From 934c7f7d9d178de212dafdb44c62c0d703907dce Mon Sep 17 00:00:00 2001
From: Alberto Massari <amassari@apache.org>
Date: Thu, 3 Aug 2006 09:14:29 +0000
Subject: [PATCH] Implement open(const char* path) by invoking open(const
 XMLCh* path)

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@428289 13f79535-47bb-0310-9956-ffa450edef68
---
 .../util/FileManagers/WindowsFileMgr.cpp      | 20 ++++---------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/src/xercesc/util/FileManagers/WindowsFileMgr.cpp b/src/xercesc/util/FileManagers/WindowsFileMgr.cpp
index c4520e5d7..d7eefdda7 100644
--- a/src/xercesc/util/FileManagers/WindowsFileMgr.cpp
+++ b/src/xercesc/util/FileManagers/WindowsFileMgr.cpp
@@ -178,23 +178,11 @@ WindowsFileMgr::open(const XMLCh* fileName, bool toWrite, MemoryManager* const m
 
 
 FileHandle
-WindowsFileMgr::open(const char* path, bool toWrite, MemoryManager* const /*manager*/)
+WindowsFileMgr::open(const char* path, bool toWrite, MemoryManager* const manager)
 {
-    FileHandle retVal = ::CreateFileA
-    (
-        path
-        , toWrite?GENERIC_WRITE:GENERIC_READ
-        , FILE_SHARE_READ
-        , 0
-        , toWrite?OPEN_ALWAYS:OPEN_EXISTING
-        , toWrite?FILE_ATTRIBUTE_NORMAL:FILE_FLAG_SEQUENTIAL_SCAN
-        , 0
-    );
-
-    if (retVal == INVALID_HANDLE_VALUE)
-        return 0;
-
-    return retVal;
+    XMLCh* tmpFileName = XMLString::transcode(path, manager);
+    ArrayJanitor<XMLCh> janText(tmpFileName, manager);
+    return open(tmpFileName, toWrite, manager);
 }
 
 
-- 
GitLab