Skip to content

Commit 84396be

Browse files
committed
Use CreateFile rather than CreateFileA
In order to ensure correct character encodings are used. `CreateFileA` specifies the variation of this API call which uses a particular fixed character encoding. The Windows API defines `CreateFile` to be the character encoding variation which matches the build configuration.
1 parent c55b214 commit 84396be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util/piped_process.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ piped_processt::piped_processt(const std::vector<std::string> &commandvec)
156156
throw system_exceptiont("Input pipe creation failed for child_std_IN_Rd");
157157
}
158158
// Connect to the other side of the pipe
159-
child_std_IN_Wr = CreateFileA(
159+
child_std_IN_Wr = CreateFile(
160160
in_name.c_str(),
161161
GENERIC_WRITE, // Write side
162162
FILE_SHARE_READ | FILE_SHARE_WRITE, // Shared read/write
@@ -187,7 +187,7 @@ piped_processt::piped_processt(const std::vector<std::string> &commandvec)
187187
{
188188
throw system_exceptiont("Output pipe creation failed for child_std_OUT_Rd");
189189
}
190-
child_std_OUT_Wr = CreateFileA(
190+
child_std_OUT_Wr = CreateFile(
191191
out_name.c_str(),
192192
GENERIC_WRITE, // Write side
193193
FILE_SHARE_READ | FILE_SHARE_WRITE, // Shared read/write

0 commit comments

Comments
 (0)