D-Bus  1.10.12
dbus-sysdeps-win.h
00001 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
00002 /* dbus-sysdeps.c Wrappers around system/libc features (internal to D-BUS implementation)
00003  * 
00004  * Copyright (C) 2002, 2003  Red Hat, Inc.
00005  * Copyright (C) 2003 CodeFactory AB
00006  * Copyright (C) 2005 Novell, Inc.
00007  *
00008  * Licensed under the Academic Free License version 2.1
00009  * 
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  * 
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00023  *
00024  */
00025 
00026 #ifndef DBUS_SYSDEPS_WIN_H
00027 #define DBUS_SYSDEPS_WIN_H
00028 
00029 extern void *_dbus_win_get_dll_hmodule (void);
00030 #define WIN32_LEAN_AND_MEAN
00031 
00032 #include "dbus-hash.h"
00033 #include "dbus-string.h"
00034 #include <ctype.h>
00035 #include <malloc.h>
00036 #include <windows.h>
00037 #undef interface
00038 
00039 #define DBUS_CONSOLE_DIR "/var/run/console/"
00040 
00041 
00042 void _dbus_win_set_errno (int err);
00043 DBUS_PRIVATE_EXPORT
00044 const char* _dbus_win_error_from_last_error (void);
00045 
00046 dbus_bool_t _dbus_win_startup_winsock (void);
00047 void _dbus_win_warn_win_error  (const char *message,
00048                                 unsigned long code);
00049                                 
00050 DBUS_PRIVATE_EXPORT
00051 char * _dbus_win_error_string (int error_number);
00052 DBUS_PRIVATE_EXPORT
00053 void _dbus_win_free_error_string (char *string);
00054 
00055 extern const char* _dbus_lm_strerror  (int error_number);
00056 
00057 
00058 dbus_bool_t _dbus_win_account_to_sid (const wchar_t *waccount,
00059                                       void         **ppsid,
00060                                       DBusError     *error);
00061 
00062 dbus_bool_t
00063 _dbus_win32_sid_to_name_and_domain (dbus_uid_t  uid,
00064                                     wchar_t   **wname,
00065                                     wchar_t   **wdomain,
00066                                     DBusError  *error);
00067 
00068 
00069 /* Don't define DBUS_CONSOLE_DIR on Win32 */
00070 
00071 wchar_t    *_dbus_win_utf8_to_utf16 (const char  *str,
00072                                      DBusError   *error);
00073 char       *_dbus_win_utf16_to_utf8 (const wchar_t *str,
00074                                      DBusError *error);
00075 
00076 DBUS_PRIVATE_EXPORT
00077 void        _dbus_win_set_error_from_win_error (DBusError *error, int code);
00078 
00079 dbus_bool_t
00080 _dbus_win_sid_to_name_and_domain (dbus_uid_t uid,
00081                                   wchar_t  **wname,
00082                                   wchar_t  **wdomain,
00083                                   DBusError *error);
00084 
00085 dbus_bool_t _dbus_file_exists (const char *filename);
00086 
00087 DBUS_PRIVATE_EXPORT
00088 dbus_bool_t _dbus_get_install_root(char *prefix, int len);
00089 
00090 void        _dbus_threads_windows_init_global (void);
00091 void        _dbus_threads_windows_ensure_ctor_linked (void);
00092 
00093 DBUS_PRIVATE_EXPORT
00094 dbus_bool_t _dbus_getsid(char **sid, dbus_pid_t process_id);
00095 #endif
00096