ReactOS  0.4.13-dev-249-gcba1a2f
inseng_private.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016 Michael Müller
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18 
19 #pragma once
20 
21 #include "windef.h"
22 #include "winbase.h"
23 #include "winuser.h"
24 #include "ole2.h"
25 #include "rpcproxy.h"
26 #include "inseng.h"
27 #include "wine/heap.h"
28 #include "wine/unicode.h"
29 
30 static inline char *strdupA(const char *src)
31 {
32  char *dest = heap_alloc(strlen(src) + 1);
33  if (dest) strcpy(dest, src);
34  return dest;
35 }
36 
37 static inline WCHAR *strdupW(const WCHAR *src)
38 {
39  WCHAR *dest;
40  if (!src) return NULL;
41  dest = HeapAlloc(GetProcessHeap(), 0, (strlenW(src) + 1) * sizeof(WCHAR));
42  if (dest) strcpyW(dest, src);
43  return dest;
44 }
45 
46 static inline LPWSTR strAtoW(const char *str)
47 {
48  LPWSTR ret = NULL;
49 
50  if (str)
51  {
52  DWORD len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
53  if ((ret = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))))
55  }
56 
57  return ret;
58 }
59 
60 struct inf_value;
61 struct inf_section;
62 struct inf_file;
63 
64 HRESULT inf_load(const char *path, struct inf_file **inf_file) DECLSPEC_HIDDEN;
65 void inf_free(struct inf_file *inf) DECLSPEC_HIDDEN;
66 
67 BOOL inf_next_section(struct inf_file *inf, struct inf_section **sec) DECLSPEC_HIDDEN;
68 struct inf_section *inf_get_section(struct inf_file *inf, const char *name) DECLSPEC_HIDDEN;
71 
72 struct inf_value *inf_get_value(struct inf_section *sec, const char *key) DECLSPEC_HIDDEN;
75 
76 char *trim(char *str, char **last_chr, BOOL strip_quotes) DECLSPEC_HIDDEN;
77 
BOOL inf_next_section(struct inf_file *inf, struct inf_section **sec) DECLSPEC_HIDDEN
Definition: inf.c:185
void component_set_downloaded(ICifComponent *iface, BOOL value) DECLSPEC_HIDDEN
Definition: icif.c:325
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
char * inf_section_get_name(struct inf_section *section) DECLSPEC_HIDDEN
Definition: inf.c:214
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define CP_ACP
Definition: compat.h:99
static WCHAR * strdupW(const WCHAR *src)
char * inf_value_get_key(struct inf_value *value) DECLSPEC_HIDDEN
Definition: inf.c:248
Definition: parser.c:55
void inf_free(struct inf_file *inf) DECLSPEC_HIDDEN
Definition: inf.c:172
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
char * trim(char *str, char **last_chr, BOOL strip_quotes) DECLSPEC_HIDDEN
Definition: inf.c:258
unsigned int BOOL
Definition: ntddk_ex.h:94
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
void component_set_installed(ICifComponent *iface, BOOL value) DECLSPEC_HIDDEN
Definition: icif.c:332
static char * strdupA(const char *src)
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
struct inf_section * inf_get_section(struct inf_file *inf, const char *name) DECLSPEC_HIDDEN
Definition: inf.c:201
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static LPWSTR strAtoW(const char *str)
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
void component_set_actual_download_size(ICifComponent *iface, DWORD size) DECLSPEC_HIDDEN
Definition: icif.c:318
HRESULT inf_load(const char *path, struct inf_file **inf_file) DECLSPEC_HIDDEN
Definition: inf.c:405
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
char * inf_value_get_value(struct inf_value *value) DECLSPEC_HIDDEN
Definition: inf.c:253
#define DECLSPEC_HIDDEN
Definition: precomp.h:8
Definition: inf.c:30
char * component_get_id(ICifComponent *iface) DECLSPEC_HIDDEN
Definition: icif.c:339
Definition: services.c:325
#define MultiByteToWideChar
Definition: compat.h:100
Definition: name.c:36
BOOL inf_section_next_value(struct inf_section *sec, struct inf_value **value) DECLSPEC_HIDDEN
Definition: inf.c:219
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
static char * dest
Definition: rtl.c:135
static void strip_quotes(WCHAR *word, WCHAR **end)
Definition: xcopy.c:701
WCHAR * LPWSTR
Definition: xmlstorage.h:184
Definition: inf.c:48
Definition: path.c:42
struct inf_value * inf_get_value(struct inf_section *sec, const char *key) DECLSPEC_HIDDEN
Definition: inf.c:235