OLD | NEW |
1 #include <Windows.h> | 1 #include <Windows.h> |
2 #include <Lmcons.h> | 2 #include <Lmcons.h> |
3 #include <Sddl.h> | 3 #include <Sddl.h> |
4 | 4 |
5 #include "Communication.h" | 5 #include "Communication.h" |
6 #include "Utils.h" | 6 #include "Utils.h" |
7 | 7 |
8 namespace | 8 namespace |
9 { | 9 { |
10 const int bufferSize = 1024; | 10 const int bufferSize = 1024; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 } | 150 } |
151 stream << std::string(buffer.get(), bytesRead); | 151 stream << std::string(buffer.get(), bytesRead); |
152 } | 152 } |
153 return Communication::InputBuffer(stream.str()); | 153 return Communication::InputBuffer(stream.str()); |
154 } | 154 } |
155 | 155 |
156 void Communication::Pipe::WriteMessage(Communication::OutputBuffer& message) | 156 void Communication::Pipe::WriteMessage(Communication::OutputBuffer& message) |
157 { | 157 { |
158 DWORD bytesWritten; | 158 DWORD bytesWritten; |
159 std::string data = message.Get(); | 159 std::string data = message.Get(); |
160 if (!data.length()) | |
161 return; | |
162 if (!WriteFile(pipe, data.c_str(), data.length(), &bytesWritten, 0)) | 160 if (!WriteFile(pipe, data.c_str(), data.length(), &bytesWritten, 0)) |
163 throw std::runtime_error("Failed to write to pipe"); | 161 throw std::runtime_error("Failed to write to pipe"); |
164 } | 162 } |
OLD | NEW |