Fix up indentation.
[metze/wireshark/wip.git] / wsutil / win32-utils.h
1 /* win32-utils.h
2  * Windows utility definitions
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 2006 Gerald Combs
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22
23 #ifndef __WIN32UTIL_H__
24 #define __WIN32UTIL_H__
25
26 #include <config.h>
27
28 #include "ws_symbol_export.h"
29
30 #include <glib.h>
31 #include <windows.h>
32
33 /**
34  * @file
35  * Unicode convenience routines.
36  */
37
38 #ifdef  __cplusplus
39 extern "C" {
40 #endif
41
42 /** Quote the argument element if necessary, so that it will get
43  * reconstructed correctly in the C runtime startup code.  Note that
44  * the unquoting algorithm in the C runtime is really weird, and
45  * rather different than what Unix shells do. See stdargv.c in the C
46  * runtime sources (in the Platform SDK, in src/crt).
47  *
48  * Stolen from GLib's protect_argv(), an internal routine that quotes
49  * string in an argument list so that they arguments will be handled
50  * correctly in the command-line string passed to CreateProcess()
51  * if that string is constructed by gluing those strings together.
52  *
53  * @param argv The string to be quoted.  May be NULL.
54  * @return The string quoted to be used by CreateProcess
55  */
56 WS_DLL_PUBLIC
57 gchar * protect_arg (const gchar *argv);
58
59 /** Generate a string for a Win32 error.
60  *
61  * @param error The windows error code
62  * @return a localized string containing the corresponding error message
63  */
64 WS_DLL_PUBLIC
65 const char * win32strerror(DWORD error);
66
67 /** Generate a string for a Win32 exception code.
68  *
69  * @param exception The exception code
70  * @return a non-localized string containing the error message
71  */
72 WS_DLL_PUBLIC
73 const char * win32strexception(DWORD exception);
74
75 #ifdef  __cplusplus
76 }
77 #endif
78
79 #endif /* __WIN32UTIL_H__ */