ReactOS 0.4.15-dev-7674-gc0b4db1
inseng_private.h File Reference
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "rpcproxy.h"
#include "inseng.h"
#include "wine/heap.h"
Include dependency graph for inseng_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static charstrdupA (const char *src)
 
static WCHARstrdupW (const WCHAR *src)
 
static LPWSTR strAtoW (const char *str)
 
HRESULT inf_load (const char *path, struct inf_file **inf_file) DECLSPEC_HIDDEN
 
void inf_free (struct inf_file *inf) DECLSPEC_HIDDEN
 
BOOL inf_next_section (struct inf_file *inf, struct inf_section **sec) DECLSPEC_HIDDEN
 
struct inf_sectioninf_get_section (struct inf_file *inf, const char *name) DECLSPEC_HIDDEN
 
charinf_section_get_name (struct inf_section *section) DECLSPEC_HIDDEN
 
BOOL inf_section_next_value (struct inf_section *sec, struct inf_value **value) DECLSPEC_HIDDEN
 
struct inf_valueinf_get_value (struct inf_section *sec, const char *key) DECLSPEC_HIDDEN
 
charinf_value_get_key (struct inf_value *value) DECLSPEC_HIDDEN
 
charinf_value_get_value (struct inf_value *value) DECLSPEC_HIDDEN
 
chartrim (char *str, char **last_chr, BOOL strip_quotes) DECLSPEC_HIDDEN
 
void component_set_actual_download_size (ICifComponent *iface, DWORD size) DECLSPEC_HIDDEN
 
void component_set_downloaded (ICifComponent *iface, BOOL value) DECLSPEC_HIDDEN
 
void component_set_installed (ICifComponent *iface, BOOL value) DECLSPEC_HIDDEN
 
charcomponent_get_id (ICifComponent *iface) DECLSPEC_HIDDEN
 

Function Documentation

◆ component_get_id()

char * component_get_id ( ICifComponent iface)

Definition at line 339 of file icif.c.

340{
342
343 return This->id;
344}
static struct cifcomponent * impl_from_ICifComponent(ICifComponent *iface)
Definition: icif.c:163

Referenced by InstallEngine_EnumDownloadIDs().

◆ component_set_actual_download_size()

void component_set_actual_download_size ( ICifComponent iface,
DWORD  size 
)

Definition at line 318 of file icif.c.

319{
321
322 This->size_actual_download = size;
323}
GLsizeiptr size
Definition: glext.h:5919

◆ component_set_downloaded()

void component_set_downloaded ( ICifComponent iface,
BOOL  value 
)

Definition at line 325 of file icif.c.

326{
328
329 This->downloaded = value;
330}
Definition: pdh_main.c:94

Referenced by process_component().

◆ component_set_installed()

void component_set_installed ( ICifComponent iface,
BOOL  value 
)

Definition at line 332 of file icif.c.

333{
335
336 This->installed = value;
337}

◆ inf_free()

void inf_free ( struct inf_file inf)

Definition at line 172 of file inf.c.

173{
174 struct inf_section *sec, *sec_next;
175 LIST_FOR_EACH_ENTRY_SAFE(sec, sec_next, &inf->sections, struct inf_section, entry)
176 {
177 list_remove(&sec->entry);
178 inf_section_free(sec);
179 }
180
181 heap_free(inf->content);
182 heap_free(inf);
183}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void inf_section_free(struct inf_section *section)
Definition: inf.c:60
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
struct list sections
Definition: inf.c:52
char * content
Definition: inf.c:50
struct list entry
Definition: inf.c:41

Referenced by inf_load(), and load_ciffile().

◆ inf_get_section()

struct inf_section * inf_get_section ( struct inf_file inf,
const char name 
)

Definition at line 201 of file inf.c.

202{
203 struct inf_section *sec = NULL;
204
205 while (inf_next_section(inf, &sec))
206 {
207 if (!strcasecmp(sec->name, name))
208 return sec;
209 }
210
211 return NULL;
212}
#define NULL
Definition: types.h:112
#define strcasecmp
Definition: fake.h:9
BOOL inf_next_section(struct inf_file *inf, struct inf_section **sec)
Definition: inf.c:185
char * name
Definition: inf.c:42
Definition: name.c:39

Referenced by get_substitution().

◆ inf_get_value()

struct inf_value * inf_get_value ( struct inf_section sec,
const char key 
)

Definition at line 235 of file inf.c.

236{
237 struct inf_value *value = NULL;
238
239 while (inf_section_next_value(sec, &value))
240 {
241 if (!strcasecmp(value->key, key))
242 return value;
243 }
244
245 return NULL;
246}
BOOL inf_section_next_value(struct inf_section *sec, struct inf_value **value)
Definition: inf.c:219
Definition: inf.c:31
char * value
Definition: inf.c:34
Definition: copy.c:22

Referenced by section_get_dword(), section_get_dword_field(), and section_get_str().

◆ inf_load()

HRESULT inf_load ( const char path,
struct inf_file **  inf_file 
)

Definition at line 405 of file inf.c.

406{
408 struct inf_file *inf;
409 HRESULT hr = E_FAIL;
410 HANDLE file;
411 DWORD read;
412
414 if (file == INVALID_HANDLE_VALUE) return E_FAIL;
415
416 inf = heap_alloc_zero(sizeof(*inf));
417 if (!inf) goto error;
418
420 goto error;
421
422 inf->size = file_size.QuadPart;
423
424 inf->content = heap_alloc_zero(inf->size);
425 if (!inf->content) goto error;
426
427 list_init(&inf->sections);
428
429 if (!ReadFile(file, inf->content, inf->size, &read, NULL) || read != inf->size)
430 goto error;
431
432 hr = inf_process_content(inf);
433 if (FAILED(hr)) goto error;
434
436 *inf_file = inf;
437 return S_OK;
438
439error:
440 if (inf) inf_free(inf);
442 return hr;
443}
#define read
Definition: acwin.h:96
static void list_init(struct list_entry *head)
Definition: list.h:51
#define E_FAIL
Definition: ddrawi.h:102
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define ReadFile(a, b, c, d, e)
Definition: compat.h:742
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define GENERIC_READ
Definition: compat.h:135
#define GetFileSizeEx
Definition: compat.h:757
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
unsigned long DWORD
Definition: ntddk_ex.h:95
void inf_free(struct inf_file *inf)
Definition: inf.c:172
static HRESULT inf_process_content(struct inf_file *inf)
Definition: inf.c:387
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define error(str)
Definition: mkdosfs.c:1605
static unsigned int file_size
Definition: regtests2xml.c:47
HRESULT hr
Definition: shlfolder.c:183
Definition: fci.c:127
Definition: inf.c:49
DWORD size
Definition: inf.c:51

Referenced by load_ciffile().

◆ inf_next_section()

BOOL inf_next_section ( struct inf_file inf,
struct inf_section **  sec 
)

Definition at line 185 of file inf.c.

186{
187 struct list *next_entry, *cur_position;
188
189 if (*sec)
190 cur_position = &(*sec)->entry;
191 else
192 cur_position = &inf->sections;
193
194 next_entry = list_next(&inf->sections, cur_position);
195 if (!next_entry) return FALSE;
196
197 *sec = CONTAINING_RECORD(next_entry, struct inf_section, entry);
198 return TRUE;
199}
Definition: list.h:37
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
Definition: list.h:115
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by inf_get_section(), and process_inf().

◆ inf_section_get_name()

char * inf_section_get_name ( struct inf_section section)

Definition at line 214 of file inf.c.

215{
216 return strdupA(section->name);
217}
static LPSTR strdupA(LPCSTR str)
Definition: mimeole.c:482
Definition: parser.c:56
const WCHAR * name
Definition: parser.c:57

Referenced by process_inf().

◆ inf_section_next_value()

BOOL inf_section_next_value ( struct inf_section sec,
struct inf_value **  value 
)

Definition at line 219 of file inf.c.

220{
221 struct list *next_entry, *cur_position;
222
223 if (*value)
224 cur_position = &(*value)->entry;
225 else
226 cur_position = &sec->values;
227
228 next_entry = list_next(&sec->values, cur_position);
229 if (!next_entry) return FALSE;
230
231 *value = CONTAINING_RECORD(next_entry, struct inf_value, entry);
232 return TRUE;
233}
struct list values
Definition: inf.c:43

Referenced by get_substitution(), inf_get_value(), and read_urls().

◆ inf_value_get_key()

char * inf_value_get_key ( struct inf_value value)

Definition at line 248 of file inf.c.

249{
250 return strdupA(value->key);
251}

Referenced by read_urls().

◆ inf_value_get_value()

char * inf_value_get_value ( struct inf_value value)

Definition at line 253 of file inf.c.

254{
255 return expand_variables(value->section->file, value->value);
256}
static char * expand_variables(struct inf_file *inf, const char *str)
Definition: inf.c:159

Referenced by section_get_dword(), section_get_str(), and value_get_str_field().

◆ strAtoW()

static LPWSTR strAtoW ( const char str)
inlinestatic

Definition at line 49 of file inseng_private.h.

50{
51 LPWSTR ret = NULL;
52
53 if (str)
54 {
55 DWORD len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
56 if ((ret = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))))
58 }
59
60 return ret;
61}
#define GetProcessHeap()
Definition: compat.h:736
#define CP_ACP
Definition: compat.h:109
#define HeapAlloc
Definition: compat.h:733
#define MultiByteToWideChar
Definition: compat.h:110
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * str
int ret
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by cldap_openA(), downloadcb_create(), generate_moniker(), ldap_add_ext_sA(), ldap_add_extA(), ldap_add_sA(), ldap_addA(), ldap_bind_sA(), ldap_bindA(), ldap_check_filterA(), ldap_compare_ext_sA(), ldap_compare_extA(), ldap_compare_sA(), ldap_compareA(), ldap_delete_ext_sA(), ldap_delete_extA(), ldap_delete_sA(), ldap_deleteA(), ldap_dn2ufnA(), ldap_explode_dnA(), ldap_extended_operation_sA(), ldap_extended_operationA(), ldap_get_optionA(), ldap_get_values_lenA(), ldap_get_valuesA(), ldap_initA(), ldap_modify_ext_sA(), ldap_modify_extA(), ldap_modify_sA(), ldap_modifyA(), ldap_modrdn2_sA(), ldap_modrdn2A(), ldap_modrdn_sA(), ldap_modrdnA(), ldap_openA(), ldap_rename_ext_sA(), ldap_rename_extA(), ldap_sasl_bind_sA(), ldap_sasl_bindA(), ldap_search_ext_sA(), ldap_search_extA(), ldap_search_sA(), ldap_search_stA(), ldap_searchA(), ldap_simple_bind_sA(), ldap_simple_bindA(), ldap_sslinitA(), and ldap_ufn2dnA().

◆ strdupA()

static char * strdupA ( const char src)
inlinestatic

Definition at line 33 of file inseng_private.h.

34{
35 char *dest = heap_alloc(strlen(src) + 1);
36 if (dest) strcpy(dest, src);
37 return dest;
38}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
GLenum src
Definition: glext.h:6340
static char * dest
Definition: rtl.c:135

◆ strdupW()

static WCHAR * strdupW ( const WCHAR src)
inlinestatic

Definition at line 40 of file inseng_private.h.

41{
42 WCHAR *dest;
43 if (!src) return NULL;
44 dest = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(src) + 1) * sizeof(WCHAR));
45 if (dest) lstrcpyW(dest, src);
46 return dest;
47}
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750

◆ trim()

char * trim ( char str,
char **  last_chr,
BOOL  strip_quotes 
)

Definition at line 258 of file inf.c.

259{
260 char *last;
261
262 for (; *str; str++)
263 {
264 if (*str != '\t' && *str != ' ')
265 break;
266 }
267
268 if (!*str)
269 {
270 if (last_chr) *last_chr = str;
271 return str;
272 }
273
274 last = str + strlen(str) - 1;
275
276 for (; last > str; last--)
277 {
278 if (*last != '\t' && *last != ' ')
279 break;
280 *last = 0;
281 }
282
283 if (strip_quotes && last != str)
284 {
285 if (*last == '"' && *str == '"')
286 {
287 str++;
288 *last = 0;
289 }
290 }
291
292 if (last_chr) *last_chr = last;
293 return str;
294}
static void strip_quotes(WCHAR *word, WCHAR **end)
Definition: xcopy.c:701
static UINT UINT last
Definition: font.c:45

Referenced by NurbsTessellator::do_endsurface(), get_next_line(), inf_section_parse(), inf_value_parse(), next_part(), and o_trim_to_DLineLoops().