Mercurial > trustbridge
comparison cinst/nssstore_win.c @ 329:b1059360a0c7
Debugprintf with output debug string on windows.
Makes debugging with redirectred input easier
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Tue, 08 Apr 2014 14:52:31 +0000 |
parents | eff8e7ce4dae |
children | 1e6d1eab8395 |
comparison
equal
deleted
inserted
replaced
328:18b31e2498a3 | 329:b1059360a0c7 |
---|---|
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <strsafe.h> | 9 #include <strsafe.h> |
10 #include <stdbool.h> | 10 #include <stdbool.h> |
11 #include <userenv.h> | 11 #include <userenv.h> |
12 #include <io.h> | |
12 | 13 |
13 #include "logging.h" | 14 #include "logging.h" |
14 #include "util.h" | 15 #include "util.h" |
15 | 16 |
16 #define PROCESS_TIMEOUT 30000 /* In milliseconds */ | 17 #define PROCESS_TIMEOUT 30000 /* In milliseconds */ |
18 #define BUFSIZE 4096 /* used for reading childs stdout */ | 19 #define BUFSIZE 4096 /* used for reading childs stdout */ |
19 | 20 |
20 #define PRINTLASTERROR(msg) \ | 21 #define PRINTLASTERROR(msg) \ |
21 char *my_error = getLastErrorMsg(); \ | 22 char *my_error = getLastErrorMsg(); \ |
22 if (my_error) { \ | 23 if (my_error) { \ |
23 DEBUGMSG(msg " :"); \ | 24 DEBUGPRINTF(msg " : %s\n", my_error); \ |
24 DEBUGMSG(my_error); \ | |
25 ERRORPRINTF(msg" : %s\n", my_error); \ | 25 ERRORPRINTF(msg" : %s\n", my_error); \ |
26 free (my_error); \ | 26 free (my_error); \ |
27 } \ | 27 } \ |
28 DEBUGMSG ("Failed to get error information\n"); | 28 DEBUGPRINTF ("Failed to get error information\n"); |
29 | 29 |
30 /**@brief Write strv of instructions to a handle | 30 /**@brief Write strv of instructions to a handle |
31 * | 31 * |
32 * Writes the null terminated list of instructions to | 32 * Writes the null terminated list of instructions to |
33 * the handle. | 33 * the handle. |