You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ro...@apache.org on 2014/12/06 16:30:39 UTC

thrift git commit: THRIFT-2873 Make TPipe and TPipeServer working with unicode on windows

Repository: thrift
Updated Branches:
  refs/heads/master 9db4b51b6 -> 3de6b8fe2


THRIFT-2873 Make TPipe and TPipeServer working with unicode on windows

Signed-off-by: Pascal Bach <pa...@siemens.com>


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/3de6b8fe
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/3de6b8fe
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/3de6b8fe

Branch: refs/heads/master
Commit: 3de6b8fe23af201caa86fff51bd6dcd745bd4123
Parents: 9db4b51
Author: Pascal Bach <pa...@siemens.com>
Authored: Thu Dec 4 09:24:34 2014 +0100
Committer: Roger Meier <ro...@apache.org>
Committed: Sat Dec 6 16:30:03 2014 +0100

----------------------------------------------------------------------
 lib/cpp/src/thrift/transport/TPipe.cpp       | 4 ++--
 lib/cpp/src/thrift/transport/TPipeServer.cpp | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/3de6b8fe/lib/cpp/src/thrift/transport/TPipe.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/transport/TPipe.cpp b/lib/cpp/src/thrift/transport/TPipe.cpp
index 15e4845..4f3eca0 100644
--- a/lib/cpp/src/thrift/transport/TPipe.cpp
+++ b/lib/cpp/src/thrift/transport/TPipe.cpp
@@ -262,7 +262,7 @@ void TPipe::open() {
   TAutoHandle hPipe;
   do {
     DWORD flags = FILE_FLAG_OVERLAPPED; // async mode, so we can do reads at the same time as writes
-    hPipe.reset(CreateFile(pipename_.c_str(),
+    hPipe.reset(CreateFileA(pipename_.c_str(),
                            GENERIC_READ | GENERIC_WRITE,
                            0,             // no sharing
                            NULL,          // default security attributes
@@ -277,7 +277,7 @@ void TPipe::open() {
       GlobalOutput.perror("TPipe::open ::CreateFile errored GLE=", ::GetLastError());
       throw TTransportException(TTransportException::NOT_OPEN, "Unable to open pipe");
     }
-  } while (::WaitNamedPipe(pipename_.c_str(), TimeoutSeconds_ * 1000));
+  } while (::WaitNamedPipeA(pipename_.c_str(), TimeoutSeconds_ * 1000));
 
   if (hPipe.h == INVALID_HANDLE_VALUE) {
     GlobalOutput.perror("TPipe::open ::CreateFile errored GLE=", ::GetLastError());

http://git-wip-us.apache.org/repos/asf/thrift/blob/3de6b8fe/lib/cpp/src/thrift/transport/TPipeServer.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/transport/TPipeServer.cpp b/lib/cpp/src/thrift/transport/TPipeServer.cpp
index a8e72d0..9ea5d50 100644
--- a/lib/cpp/src/thrift/transport/TPipeServer.cpp
+++ b/lib/cpp/src/thrift/transport/TPipeServer.cpp
@@ -323,7 +323,7 @@ bool TNamedPipeServer::createNamedPipe() {
   ea.grfInheritance = NO_INHERITANCE;
   ea.Trustee.TrusteeForm = TRUSTEE_IS_SID;
   ea.Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP;
-  ea.Trustee.ptstrName = (LPSTR)everyone_sid;
+  ea.Trustee.ptstrName = static_cast<LPTSTR>(everyone_sid);
 
   PACL acl = NULL;
   SetEntriesInAcl(1, &ea, NULL, &acl);
@@ -338,7 +338,7 @@ bool TNamedPipeServer::createNamedPipe() {
   sa.bInheritHandle = FALSE;
 
   // Create an instance of the named pipe
-  TAutoHandle hPipe(CreateNamedPipe(pipename_.c_str(),    // pipe name
+  TAutoHandle hPipe(CreateNamedPipeA(pipename_.c_str(),   // pipe name
                                     PIPE_ACCESS_DUPLEX |  // read/write access
                                     FILE_FLAG_OVERLAPPED, // async mode
                                     PIPE_TYPE_BYTE |      // byte type pipe