1 | /* $Id: NoCrtOutput.h 96449 2022-08-23 23:55:38Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * NoCrtOutput - ErrorMsgXxx and PrintXxx functions for small EXEs.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2022 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef GA_INCLUDED_WINNT_NoCrtOutput_h
|
---|
29 | #define GA_INCLUDED_WINNT_NoCrtOutput_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #include <iprt/win/windows.h>
|
---|
35 | #include <iprt/string.h>
|
---|
36 | #include <iprt/utf16.h>
|
---|
37 |
|
---|
38 |
|
---|
39 | /** @name Output helpers
|
---|
40 | *
|
---|
41 | * The general ASSUMPTION here is that all strings are restricted to 7-bit
|
---|
42 | * ASCII, with the exception of wchar_t ones.
|
---|
43 | *
|
---|
44 | * @note We don't use printf, RTPrintf or similar not for masochistic reasons
|
---|
45 | * but to keep the binary small and make it easier to switch between CRT
|
---|
46 | * and IPRT w/ no-CRT.
|
---|
47 | *
|
---|
48 | * @{
|
---|
49 | */
|
---|
50 |
|
---|
51 | DECLINLINE(void) OutputWStr(HANDLE hDst, const wchar_t *pwszStr)
|
---|
52 | {
|
---|
53 | DWORD cbIgn;
|
---|
54 | if (GetConsoleMode(hDst, &cbIgn))
|
---|
55 | WriteConsoleW(hDst, pwszStr, (DWORD)RTUtf16Len(pwszStr), &cbIgn, NULL);
|
---|
56 | else
|
---|
57 | {
|
---|
58 | char *pszTmp;
|
---|
59 | int rc = RTUtf16ToUtf8(pwszStr, &pszTmp);
|
---|
60 | if (RT_SUCCESS(rc))
|
---|
61 | {
|
---|
62 | char *pszInCodepage;
|
---|
63 | rc = RTStrUtf8ToCurrentCP(&pszInCodepage, pszTmp);
|
---|
64 | if (RT_SUCCESS(rc))
|
---|
65 | {
|
---|
66 | WriteFile(hDst, pszInCodepage, (DWORD)strlen(pszInCodepage), &cbIgn, NULL);
|
---|
67 | RTStrFree(pszInCodepage);
|
---|
68 | }
|
---|
69 | else
|
---|
70 | WriteFile(hDst, RT_STR_TUPLE("<RTStrUtf8ToCurrentCP error>"), &cbIgn, NULL);
|
---|
71 | RTStrFree(pszTmp);
|
---|
72 | }
|
---|
73 | else
|
---|
74 | WriteFile(hDst, RT_STR_TUPLE("<RTUtf16ToUtf8 error>"), &cbIgn, NULL);
|
---|
75 | }
|
---|
76 | }
|
---|
77 |
|
---|
78 |
|
---|
79 | DECLINLINE(void) ErrorMsgBegin(const char *pszMsg)
|
---|
80 | {
|
---|
81 | HANDLE const hStdErr = GetStdHandle(STD_ERROR_HANDLE);
|
---|
82 | DWORD cbIgn;
|
---|
83 | WriteFile(hStdErr, RT_STR_TUPLE("error: "), &cbIgn, NULL);
|
---|
84 | WriteFile(hStdErr, pszMsg, (DWORD)strlen(pszMsg), &cbIgn, NULL);
|
---|
85 | }
|
---|
86 |
|
---|
87 |
|
---|
88 | DECLINLINE(void) ErrorMsgStr(const char *pszMsg)
|
---|
89 | {
|
---|
90 | HANDLE const hStdErr = GetStdHandle(STD_ERROR_HANDLE);
|
---|
91 | DWORD cbIgn;
|
---|
92 | WriteFile(hStdErr, pszMsg, (DWORD)strlen(pszMsg), &cbIgn, NULL);
|
---|
93 | }
|
---|
94 |
|
---|
95 |
|
---|
96 | DECLINLINE(void) ErrorMsgWStr(const wchar_t *pwszStr)
|
---|
97 | {
|
---|
98 | OutputWStr(GetStdHandle(STD_ERROR_HANDLE), pwszStr);
|
---|
99 | }
|
---|
100 |
|
---|
101 |
|
---|
102 | DECLINLINE(int) ErrorMsgEnd(const char *pszMsg)
|
---|
103 | {
|
---|
104 | HANDLE const hStdErr = GetStdHandle(STD_ERROR_HANDLE);
|
---|
105 | DWORD cbIgn;
|
---|
106 | if (pszMsg)
|
---|
107 | WriteFile(hStdErr, pszMsg, (DWORD)strlen(pszMsg), &cbIgn, NULL);
|
---|
108 | WriteFile(hStdErr, RT_STR_TUPLE("\r\n"), &cbIgn, NULL);
|
---|
109 | #ifdef EXIT_FAIL /* VBoxDrvInst.cpp speciality */
|
---|
110 | return EXIT_FAIL;
|
---|
111 | #else
|
---|
112 | return RTEXITCODE_FAILURE;
|
---|
113 | #endif
|
---|
114 | }
|
---|
115 |
|
---|
116 |
|
---|
117 | DECLINLINE(void) ErrorMsgU64(uint64_t uValue, bool fSigned = false)
|
---|
118 | {
|
---|
119 | char szVal[128];
|
---|
120 | RTStrFormatU64(szVal, sizeof(szVal), uValue, 10, 0, 0, fSigned ? RTSTR_F_VALSIGNED : 0);
|
---|
121 | ErrorMsgStr(szVal);
|
---|
122 | }
|
---|
123 |
|
---|
124 |
|
---|
125 | DECLINLINE(int) ErrorMsg(const char *pszMsg)
|
---|
126 | {
|
---|
127 | ErrorMsgBegin(pszMsg);
|
---|
128 | return ErrorMsgEnd(NULL);
|
---|
129 | }
|
---|
130 |
|
---|
131 |
|
---|
132 | DECLINLINE(int) ErrorMsgSWS(const char *pszMsg1, const wchar_t *pwszMsg2, const char *pszMsg3)
|
---|
133 | {
|
---|
134 | ErrorMsgBegin(pszMsg1);
|
---|
135 | ErrorMsgWStr(pwszMsg2);
|
---|
136 | return ErrorMsgEnd(pszMsg3);
|
---|
137 | }
|
---|
138 |
|
---|
139 |
|
---|
140 | DECLINLINE(int) ErrorMsgSWSWS(const char *pszMsg1, const wchar_t *pwszMsg2, const char *pszMsg3,
|
---|
141 | const wchar_t *pwszMsg4, const char *pszMsg5)
|
---|
142 | {
|
---|
143 | ErrorMsgBegin(pszMsg1);
|
---|
144 | ErrorMsgWStr(pwszMsg2);
|
---|
145 | ErrorMsgStr(pszMsg3);
|
---|
146 | ErrorMsgWStr(pwszMsg4);
|
---|
147 | return ErrorMsgEnd(pszMsg5);
|
---|
148 | }
|
---|
149 |
|
---|
150 |
|
---|
151 | DECLINLINE(void) ErrorMsgErrVal(uint32_t uErrVal, bool fSigned)
|
---|
152 | {
|
---|
153 | char szVal[128];
|
---|
154 | ssize_t cchVal = RTStrFormatU32(szVal, sizeof(szVal) - 1, uErrVal, 10, 0, 0, fSigned ? RTSTR_F_VALSIGNED : 0);
|
---|
155 | szVal[cchVal++] = '/';
|
---|
156 | szVal[cchVal] = '\0';
|
---|
157 | ErrorMsgStr(szVal);
|
---|
158 |
|
---|
159 | RTStrFormatU32(szVal, sizeof(szVal) - 1, uErrVal, 16, 0, 0, RTSTR_F_SPECIAL);
|
---|
160 | ErrorMsgStr(szVal);
|
---|
161 | }
|
---|
162 |
|
---|
163 |
|
---|
164 | DECLINLINE(int) ErrorMsgErr(const char *pszMsg, uint32_t uErrVal, const char *pszErrIntro, bool fSigned)
|
---|
165 | {
|
---|
166 | ErrorMsgBegin(pszMsg);
|
---|
167 | ErrorMsgStr(pszErrIntro);
|
---|
168 | ErrorMsgErrVal(uErrVal, fSigned);
|
---|
169 | return ErrorMsgEnd(")");
|
---|
170 | }
|
---|
171 |
|
---|
172 |
|
---|
173 | DECLINLINE(int) ErrorMsgRc(int rcExit, const char *pszMsg)
|
---|
174 | {
|
---|
175 | ErrorMsgBegin(pszMsg);
|
---|
176 | ErrorMsgEnd(NULL);
|
---|
177 | return rcExit;
|
---|
178 | }
|
---|
179 |
|
---|
180 |
|
---|
181 | DECLINLINE(int) ErrorMsgRcSUS(int rcExit, const char *pszMsg1, uint64_t uValue, const char *pszMsg2)
|
---|
182 | {
|
---|
183 | ErrorMsgBegin(pszMsg1);
|
---|
184 | ErrorMsgU64(uValue);
|
---|
185 | ErrorMsgEnd(pszMsg2);
|
---|
186 | return rcExit;
|
---|
187 | }
|
---|
188 |
|
---|
189 |
|
---|
190 | DECLINLINE(int) ErrorMsgVBoxErr(const char *pszMsg, int rc)
|
---|
191 | {
|
---|
192 | return ErrorMsgErr(pszMsg, rc, " (", true);
|
---|
193 | }
|
---|
194 |
|
---|
195 |
|
---|
196 | DECLINLINE(int) ErrorMsgLastErr(const char *pszMsg)
|
---|
197 | {
|
---|
198 | return ErrorMsgErr(pszMsg, GetLastError(), " (last error ", false);
|
---|
199 | }
|
---|
200 |
|
---|
201 |
|
---|
202 | DECLINLINE(int) ErrorMsgLastErrSUR(const char *pszMsg1, uint64_t uValue)
|
---|
203 | {
|
---|
204 | DWORD dwErr = GetLastError();
|
---|
205 | ErrorMsgBegin(pszMsg1);
|
---|
206 | ErrorMsgU64(uValue);
|
---|
207 | ErrorMsgStr(" (last error ");
|
---|
208 | ErrorMsgErrVal(dwErr, false);
|
---|
209 | return ErrorMsgEnd(")");
|
---|
210 | }
|
---|
211 |
|
---|
212 |
|
---|
213 | DECLINLINE(int) ErrorMsgLastErrSWS(const char *pszMsg1, const wchar_t *pwszMsg2, const char *pszMsg3)
|
---|
214 | {
|
---|
215 | DWORD dwErr = GetLastError();
|
---|
216 | ErrorMsgBegin(pszMsg1);
|
---|
217 | ErrorMsgWStr(pwszMsg2);
|
---|
218 | ErrorMsgStr(pszMsg3);
|
---|
219 | ErrorMsgStr(" (last error ");
|
---|
220 | ErrorMsgErrVal(dwErr, false);
|
---|
221 | return ErrorMsgEnd(")");
|
---|
222 | }
|
---|
223 |
|
---|
224 |
|
---|
225 | DECLINLINE(int) ErrorMsgLastErrSWSWS(const char *pszMsg1, const wchar_t *pwszMsg2, const char *pszMsg3,
|
---|
226 | const wchar_t *pwszMsg4, const char *pszMsg5)
|
---|
227 | {
|
---|
228 | DWORD dwErr = GetLastError();
|
---|
229 | ErrorMsgBegin(pszMsg1);
|
---|
230 | ErrorMsgWStr(pwszMsg2);
|
---|
231 | ErrorMsgStr(pszMsg3);
|
---|
232 | ErrorMsgWStr(pwszMsg4);
|
---|
233 | ErrorMsgStr(pszMsg5);
|
---|
234 | ErrorMsgStr(" (last error ");
|
---|
235 | ErrorMsgErrVal(dwErr, false);
|
---|
236 | return ErrorMsgEnd(")");
|
---|
237 | }
|
---|
238 |
|
---|
239 |
|
---|
240 | DECLINLINE(int) ErrorMsgLastErrSWSRSUS(const char *pszMsg1, const wchar_t *pwszMsg2, const char *pszMsg3, const char *pszMsg4,
|
---|
241 | uint64_t uValue, const char *pszMsg5)
|
---|
242 | {
|
---|
243 | DWORD dwErr = GetLastError();
|
---|
244 | ErrorMsgBegin(pszMsg1);
|
---|
245 | ErrorMsgWStr(pwszMsg2);
|
---|
246 | ErrorMsgStr(pszMsg3);
|
---|
247 | ErrorMsgStr(" (last error ");
|
---|
248 | ErrorMsgErrVal(dwErr, false);
|
---|
249 | ErrorMsgStr(")");
|
---|
250 | ErrorMsgStr(pszMsg4);
|
---|
251 | ErrorMsgU64(uValue);
|
---|
252 | return ErrorMsgEnd(pszMsg5);
|
---|
253 | }
|
---|
254 |
|
---|
255 |
|
---|
256 | DECLINLINE(int) ErrorMsgLastErrSSS(const char *pszMsg1, const char *pszMsg2, const char *pszMsg3)
|
---|
257 | {
|
---|
258 | DWORD dwErr = GetLastError();
|
---|
259 | ErrorMsgBegin(pszMsg1);
|
---|
260 | ErrorMsgStr(pszMsg2);
|
---|
261 | ErrorMsgStr(pszMsg3);
|
---|
262 | ErrorMsgStr(" (last error ");
|
---|
263 | ErrorMsgErrVal(dwErr, false);
|
---|
264 | return ErrorMsgEnd(")");
|
---|
265 | }
|
---|
266 |
|
---|
267 |
|
---|
268 | DECLINLINE(int) ErrorMsgRcLastErr(int rcExit, const char *pszMsg)
|
---|
269 | {
|
---|
270 | ErrorMsgErr(pszMsg, GetLastError(), " (last error ", false);
|
---|
271 | return rcExit;
|
---|
272 | }
|
---|
273 |
|
---|
274 |
|
---|
275 | DECLINLINE(int) ErrorMsgRcLastErrSUR(int rcExit, const char *pszMsg1, uint64_t uValue)
|
---|
276 | {
|
---|
277 | ErrorMsgLastErrSUR(pszMsg1, uValue);
|
---|
278 | return rcExit;
|
---|
279 | }
|
---|
280 |
|
---|
281 |
|
---|
282 | static int ErrorMsgRcLastErrSWSR(int rcExit, const char *pszMsg1, const wchar_t *pwszMsg2, const char *pszMsg3)
|
---|
283 | {
|
---|
284 | DWORD dwErr = GetLastError();
|
---|
285 | ErrorMsgBegin(pszMsg1);
|
---|
286 | ErrorMsgWStr(pwszMsg2);
|
---|
287 | ErrorMsgStr(pszMsg3);
|
---|
288 | ErrorMsgStr(" (last error ");
|
---|
289 | ErrorMsgErrVal(dwErr, false);
|
---|
290 | ErrorMsgEnd(")");
|
---|
291 | return rcExit;
|
---|
292 | }
|
---|
293 |
|
---|
294 |
|
---|
295 |
|
---|
296 | DECLINLINE(int) ErrorMsgLStatus(const char *pszMsg, LSTATUS lrc)
|
---|
297 | {
|
---|
298 | return ErrorMsgErr(pszMsg, (DWORD)lrc, " (", true);
|
---|
299 | }
|
---|
300 |
|
---|
301 |
|
---|
302 | DECLINLINE(int) ErrorMsgLStatusSWSRS(const char *pszMsg1, const wchar_t *pwszMsg2, const char *pszMsg3,
|
---|
303 | LSTATUS lrc, const char *pszMsg4)
|
---|
304 | {
|
---|
305 | ErrorMsgBegin(pszMsg1);
|
---|
306 | ErrorMsgWStr(pwszMsg2);
|
---|
307 | ErrorMsgStr(pszMsg3);
|
---|
308 | ErrorMsgErrVal((DWORD)lrc, true);
|
---|
309 | return ErrorMsgEnd(pszMsg4);
|
---|
310 | }
|
---|
311 |
|
---|
312 |
|
---|
313 | DECLINLINE(int) ErrorMsgLStatusSWSWSRS(const char *pszMsg1, const wchar_t *pwszMsg2, const char *pszMsg3, const wchar_t *pwszMsg4,
|
---|
314 | const char *pszMsg5, LSTATUS lrc, const char *pszMsg6)
|
---|
315 | {
|
---|
316 | ErrorMsgBegin(pszMsg1);
|
---|
317 | ErrorMsgWStr(pwszMsg2);
|
---|
318 | ErrorMsgStr(pszMsg3);
|
---|
319 | ErrorMsgWStr(pwszMsg4);
|
---|
320 | ErrorMsgStr(pszMsg5);
|
---|
321 | ErrorMsgErrVal((DWORD)lrc, true);
|
---|
322 | return ErrorMsgEnd(pszMsg6);
|
---|
323 | }
|
---|
324 |
|
---|
325 |
|
---|
326 | DECLINLINE(int) ErrorMsgLStatusSWSWSWSRS(const char *pszMsg1, const wchar_t *pwszMsg2, const char *pszMsg3,
|
---|
327 | const wchar_t *pwszMsg4, const char *pszMsg5, const wchar_t *pwszMsg6,
|
---|
328 | const char *pszMsg7, LSTATUS lrc, const char *pszMsg8)
|
---|
329 | {
|
---|
330 | ErrorMsgBegin(pszMsg1);
|
---|
331 | ErrorMsgWStr(pwszMsg2);
|
---|
332 | ErrorMsgStr(pszMsg3);
|
---|
333 | ErrorMsgWStr(pwszMsg4);
|
---|
334 | ErrorMsgStr(pszMsg5);
|
---|
335 | ErrorMsgWStr(pwszMsg6);
|
---|
336 | ErrorMsgStr(pszMsg7);
|
---|
337 | ErrorMsgErrVal((DWORD)lrc, true);
|
---|
338 | return ErrorMsgEnd(pszMsg8);
|
---|
339 | }
|
---|
340 |
|
---|
341 |
|
---|
342 | DECLINLINE(int) ErrorMsgLStatusSWSWSWSWSRS(const char *pszMsg1, const wchar_t *pwszMsg2, const char *pszMsg3,
|
---|
343 | const wchar_t *pwszMsg4, const char *pszMsg5, const wchar_t *pwszMsg6,
|
---|
344 | const char *pszMsg7, const wchar_t *pwszMsg8, const char *pszMsg9, LSTATUS lrc,
|
---|
345 | const char *pszMsg10)
|
---|
346 | {
|
---|
347 | ErrorMsgBegin(pszMsg1);
|
---|
348 | ErrorMsgWStr(pwszMsg2);
|
---|
349 | ErrorMsgStr(pszMsg3);
|
---|
350 | ErrorMsgWStr(pwszMsg4);
|
---|
351 | ErrorMsgStr(pszMsg5);
|
---|
352 | ErrorMsgWStr(pwszMsg6);
|
---|
353 | ErrorMsgStr(pszMsg7);
|
---|
354 | ErrorMsgWStr(pwszMsg8);
|
---|
355 | ErrorMsgStr(pszMsg9);
|
---|
356 | ErrorMsgErrVal((DWORD)lrc, true);
|
---|
357 | return ErrorMsgEnd(pszMsg10);
|
---|
358 | }
|
---|
359 |
|
---|
360 |
|
---|
361 | DECLINLINE(int) ErrorBadArg(const char *pszName, wchar_t const *pwszArg, const char *pszValues = NULL)
|
---|
362 | {
|
---|
363 | ErrorMsgBegin("Bad argument '");
|
---|
364 | ErrorMsgStr(pszName);
|
---|
365 | ErrorMsgStr("': ");
|
---|
366 | ErrorMsgWStr(pwszArg);
|
---|
367 | if (pszValues)
|
---|
368 | ErrorMsgStr(", expected: ");
|
---|
369 | return ErrorMsgEnd(pszValues);
|
---|
370 | }
|
---|
371 |
|
---|
372 |
|
---|
373 | /** Simple fputs(stdout) replacement. */
|
---|
374 | DECLINLINE(void) PrintStr(const char *pszMsg)
|
---|
375 | {
|
---|
376 | HANDLE const hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
---|
377 | DWORD cbIgn;
|
---|
378 | WriteFile(hStdOut, pszMsg, (DWORD)strlen(pszMsg), &cbIgn, NULL);
|
---|
379 | }
|
---|
380 |
|
---|
381 |
|
---|
382 | /** Simple fputs(stdout) replacement. */
|
---|
383 | DECLINLINE(void) PrintWStr(const wchar_t *pwszStr)
|
---|
384 | {
|
---|
385 | OutputWStr(GetStdHandle(STD_OUTPUT_HANDLE), pwszStr);
|
---|
386 | }
|
---|
387 |
|
---|
388 |
|
---|
389 | DECLINLINE(void) PrintX64(uint64_t uValue)
|
---|
390 | {
|
---|
391 | char szVal[128];
|
---|
392 | RTStrFormatU64(szVal, sizeof(szVal), uValue, 16, 0, 0, RTSTR_F_64BIT | RTSTR_F_SPECIAL);
|
---|
393 | PrintStr(szVal);
|
---|
394 | }
|
---|
395 |
|
---|
396 |
|
---|
397 | DECLINLINE(void) PrintSWS(const char *pszMsg1, const wchar_t *pwszMsg2, const char *pszMsg3)
|
---|
398 | {
|
---|
399 | PrintStr(pszMsg1);
|
---|
400 | PrintWStr(pwszMsg2);
|
---|
401 | PrintStr(pszMsg3);
|
---|
402 | }
|
---|
403 |
|
---|
404 |
|
---|
405 | DECLINLINE(void) PrintSWSWS(const char *pszMsg1, const wchar_t *pwszMsg2, const char *pszMsg3,
|
---|
406 | const wchar_t *pwszMsg4, const char *pszMsg5)
|
---|
407 | {
|
---|
408 | PrintStr(pszMsg1);
|
---|
409 | PrintWStr(pwszMsg2);
|
---|
410 | PrintStr(pszMsg3);
|
---|
411 | PrintWStr(pwszMsg4);
|
---|
412 | PrintStr(pszMsg5);
|
---|
413 | }
|
---|
414 |
|
---|
415 |
|
---|
416 | DECLINLINE(void) PrintSWSWSWS(const char *pszMsg1, const wchar_t *pwszMsg2, const char *pszMsg3, const wchar_t *pwszMsg4,
|
---|
417 | const char *pszMsg5, const wchar_t *pwszMsg6, const char *pszMsg7)
|
---|
418 | {
|
---|
419 | PrintStr(pszMsg1);
|
---|
420 | PrintWStr(pwszMsg2);
|
---|
421 | PrintStr(pszMsg3);
|
---|
422 | PrintWStr(pwszMsg4);
|
---|
423 | PrintStr(pszMsg5);
|
---|
424 | PrintWStr(pwszMsg6);
|
---|
425 | PrintStr(pszMsg7);
|
---|
426 | }
|
---|
427 |
|
---|
428 |
|
---|
429 | DECLINLINE(void) PrintSWSWSWSWS(const char *pszMsg1, const wchar_t *pwszMsg2, const char *pszMsg3, const wchar_t *pwszMsg4,
|
---|
430 | const char *pszMsg5, const wchar_t *pwszMsg6, const char *pszMsg7, const wchar_t *pwszMsg8,
|
---|
431 | const char *pszMsg9)
|
---|
432 | {
|
---|
433 | PrintStr(pszMsg1);
|
---|
434 | PrintWStr(pwszMsg2);
|
---|
435 | PrintStr(pszMsg3);
|
---|
436 | PrintWStr(pwszMsg4);
|
---|
437 | PrintStr(pszMsg5);
|
---|
438 | PrintWStr(pwszMsg6);
|
---|
439 | PrintStr(pszMsg7);
|
---|
440 | PrintWStr(pwszMsg8);
|
---|
441 | PrintStr(pszMsg9);
|
---|
442 | }
|
---|
443 |
|
---|
444 |
|
---|
445 | DECLINLINE(void) PrintSXS(const char *pszMsg1, uint64_t uValue, const char *pszMsg2)
|
---|
446 | {
|
---|
447 | PrintStr(pszMsg1);
|
---|
448 | PrintX64(uValue);
|
---|
449 | PrintStr(pszMsg2);
|
---|
450 | }
|
---|
451 |
|
---|
452 |
|
---|
453 | DECLINLINE(void) PrintSWSWSWSXS(const char *pszMsg1, const wchar_t *pwszMsg2, const char *pszMsg3, const wchar_t *pwszMsg4,
|
---|
454 | const char *pszMsg5, const wchar_t *pwszMsg6, const char *pszMsg7, uint64_t uValue,
|
---|
455 | const char *pszMsg8)
|
---|
456 | {
|
---|
457 | PrintStr(pszMsg1);
|
---|
458 | PrintWStr(pwszMsg2);
|
---|
459 | PrintStr(pszMsg3);
|
---|
460 | PrintWStr(pwszMsg4);
|
---|
461 | PrintStr(pszMsg5);
|
---|
462 | PrintWStr(pwszMsg6);
|
---|
463 | PrintStr(pszMsg7);
|
---|
464 | PrintX64(uValue);
|
---|
465 | PrintStr(pszMsg8);
|
---|
466 | }
|
---|
467 |
|
---|
468 | /** @} */
|
---|
469 |
|
---|
470 | #endif /* !GA_INCLUDED_WINNT_NoCrtOutput_h */
|
---|
471 |
|
---|