diff options
author | Charlie Savage <cfis@savagexi.com> | 2023-04-20 00:39:51 -0700 |
---|---|---|
committer | Charlie Savage <cfis@savagexi.com> | 2023-04-20 10:24:50 -0700 |
commit | 4de2bc1b1db4d3109d54d2b58ba433e2574fa675 (patch) | |
tree | dba7c57cf9d027e019b657ee8dbc7deacceed508 | |
parent | 82c018810d8bbd72428606ec4fd3b0fcf42caa5a (diff) | |
download | ffi-4de2bc1b1db4d3109d54d2b58ba433e2574fa675.tar.gz |
CreateNamedPipe and CreateFile map to CreateNamedPipeW and CreateFileW when compiling with MSVC 22. These apis take a widechar - LPCWSTR. Thus these tests fail because Windows considers the pipe names to be invalid. Thus switch to the Ansi versions.
-rw-r--r-- | spec/ffi/fixtures/PipeHelperWindows.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/ffi/fixtures/PipeHelperWindows.c b/spec/ffi/fixtures/PipeHelperWindows.c index 0bdbd2e..31b4a2a 100644 --- a/spec/ffi/fixtures/PipeHelperWindows.c +++ b/spec/ffi/fixtures/PipeHelperWindows.c @@ -16,7 +16,7 @@ int pipeHelperCreatePipe(FD_TYPE pipefd[2]) sprintf( name, "\\\\.\\Pipe\\pipeHelper-%u-%i", (unsigned int)GetCurrentProcessId(), pipe_idx++ ); - pipefd[0] = CreateNamedPipe( name, PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED, + pipefd[0] = CreateNamedPipeA( name, PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE | PIPE_WAIT, 1, // Number of pipes 5, // Out buffer size @@ -26,7 +26,7 @@ int pipeHelperCreatePipe(FD_TYPE pipefd[2]) if(pipefd[0] == INVALID_HANDLE_VALUE) return -1; - pipefd[1] = CreateFile( name, GENERIC_WRITE, 0, NULL, + pipefd[1] = CreateFileA( name, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); |