D-Bus  1.14.99
dbus-sysdeps-win.h
1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* dbus-sysdeps.c Wrappers around system/libc features (internal to D-BUS implementation)
3  *
4  * Copyright (C) 2002, 2003 Red Hat, Inc.
5  * Copyright (C) 2003 CodeFactory AB
6  * Copyright (C) 2005 Novell, Inc.
7  *
8  * Licensed under the Academic Free License version 2.1
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
26 #ifndef DBUS_SYSDEPS_WIN_H
27 #define DBUS_SYSDEPS_WIN_H
28 
29 extern void *_dbus_win_get_dll_hmodule (void);
30 #define WIN32_LEAN_AND_MEAN
31 
32 #include "dbus-hash.h"
33 #include "dbus-string.h"
34 #include "dbus-threads-internal.h"
35 #include <ctype.h>
36 #include <malloc.h>
37 #include <windows.h>
38 #undef interface
39 
40 #define DBUS_CONSOLE_DIR "/var/run/console/"
41 
42 
43 void _dbus_win_set_errno (int err);
44 DBUS_PRIVATE_EXPORT
45 const char* _dbus_win_error_from_last_error (void);
46 
47 dbus_bool_t _dbus_win_startup_winsock (void);
48 void _dbus_win_warn_win_error (const char *message,
49  unsigned long code);
50 DBUS_PRIVATE_EXPORT
51 char * _dbus_win_error_string (int error_number);
52 DBUS_PRIVATE_EXPORT
53 void _dbus_win_free_error_string (char *string);
54 
55 extern const char* _dbus_lm_strerror (int error_number);
56 
57 
58 dbus_bool_t _dbus_win_account_to_sid (const wchar_t *waccount,
59  void **ppsid,
60  DBusError *error);
61 
63 _dbus_win32_sid_to_name_and_domain (dbus_uid_t uid,
64  wchar_t **wname,
65  wchar_t **wdomain,
66  DBusError *error);
67 
68 
69 /* Don't define DBUS_CONSOLE_DIR on Win32 */
70 
71 wchar_t *_dbus_win_utf8_to_utf16 (const char *str,
72  DBusError *error);
73 char *_dbus_win_utf16_to_utf8 (const wchar_t *str,
74  DBusError *error);
75 
76 DBUS_PRIVATE_EXPORT
77 void _dbus_win_set_error_from_win_error (DBusError *error, int code);
78 
80 _dbus_win_sid_to_name_and_domain (dbus_uid_t uid,
81  wchar_t **wname,
82  wchar_t **wdomain,
83  DBusError *error);
84 
85 DBUS_PRIVATE_EXPORT
86 dbus_bool_t _dbus_get_install_root (DBusString *str);
87 
88 void _dbus_threads_windows_init_global (void);
89 void _dbus_threads_windows_ensure_ctor_linked (void);
90 
91 DBUS_PRIVATE_EXPORT
92 dbus_bool_t _dbus_getsid(char **sid, dbus_pid_t process_id);
93 
94 HANDLE _dbus_spawn_program (const char *name,
95  char **argv,
96  char **envp,
97  dbus_bool_t inherit_handles,
98  DBusError *error);
99 
100 DBUS_PRIVATE_EXPORT
101 void _dbus_win_set_error_from_last_error (DBusError *error,
102  const char *format,
103  ...) _DBUS_GNUC_PRINTF (2, 3);
104 
105 DBUS_PRIVATE_EXPORT
106 HANDLE _dbus_win_event_create_inheritable (DBusError *error);
107 DBUS_PRIVATE_EXPORT
108 dbus_bool_t _dbus_win_event_set (HANDLE handle, DBusError *error);
109 DBUS_PRIVATE_EXPORT
110 dbus_bool_t _dbus_win_event_wait (HANDLE handle, int timeout, DBusError *error);
111 DBUS_PRIVATE_EXPORT
112 dbus_bool_t _dbus_win_event_free (HANDLE handle, DBusError *error);
113 
114 dbus_bool_t _dbus_daemon_is_session_bus_address_published (const char *scope);
115 dbus_bool_t _dbus_daemon_publish_session_bus_address (const char *address,
116  const char *shm_name);
117 DBUS_PRIVATE_EXPORT
118 DBusRMutex *_dbus_win_rmutex_named_new (const char* name);
119 
120 DBUS_PRIVATE_EXPORT
121 void _dbus_test_win_autolaunch_set_command_line_parameter (const char *path);
122 DBUS_PRIVATE_EXPORT
123 void _dbus_test_win_set_autolaunch_handle_location (HANDLE *location);
124 #endif
125 
unsigned long dbus_uid_t
A user ID.
Definition: dbus-sysdeps.h:137
unsigned long dbus_pid_t
A process ID.
Definition: dbus-sysdeps.h:135
dbus_uint32_t dbus_bool_t
A boolean, valid values are TRUE and FALSE.
Definition: dbus-types.h:35
Object representing an exception.
Definition: dbus-errors.h:49