ReactOS 0.4.15-dev-5669-g09dde2c
infsupp.c File Reference
#include "precomp.h"
#include "infsupp.h"
#include <debug.h>
Include dependency graph for infsupp.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

BOOLEAN INF_GetDataField (IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PCWSTR *Data)
 
BOOLEAN INF_GetData (IN PINFCONTEXT Context, OUT PCWSTR *Key, OUT PCWSTR *Data)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 15 of file infsupp.c.

Function Documentation

◆ INF_GetData()

BOOLEAN INF_GetData ( IN PINFCONTEXT  Context,
OUT PCWSTR Key,
OUT PCWSTR Data 
)

Definition at line 90 of file infsupp.c.

94{
96 PCWSTR InfData[2] = {NULL, NULL};
97
98 if (Key)
99 *Key = NULL;
100
101 if (Data)
102 *Data = NULL;
103
104 /*
105 * Verify that the INF file has only one value field, in addition to its key name.
106 * Note that SpInfGetFieldCount() does not count the key name as a field.
107 */
108 if (SpInfGetFieldCount(Context) != 1)
109 {
110 DPRINT1("SpInfGetFieldCount != 1\n");
111 return FALSE;
112 }
113
114 if (Key)
115 {
116 Success = INF_GetDataField(Context, 0, &InfData[0]);
117 if (!Success)
118 return FALSE;
119 }
120
121 if (Data)
122 {
123 Success = INF_GetDataField(Context, 1, &InfData[1]);
124 if (!Success)
125 {
126 INF_FreeData(InfData[0]);
127 return FALSE;
128 }
129 }
130
131 if (Key)
132 *Key = InfData[0];
133
134 if (Data)
135 *Data = InfData[1];
136
137 return TRUE;
138}
#define DPRINT1
Definition: precomp.h:8
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
@ Success
Definition: eventcreate.c:712
unsigned int BOOL
Definition: ntddk_ex.h:94
pSpInfGetFieldCount SpInfGetFieldCount
Definition: infsupp.c:89
FORCEINLINE VOID INF_FreeData(IN PCWSTR InfData)
Definition: infsupp.h:157
BOOLEAN INF_GetDataField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PCWSTR *Data)
Definition: infsupp.c:42
const uint16_t * PCWSTR
Definition: typedefs.h:57

Referenced by AddSectionToCopyQueueCab(), CheckUnattendedSetup(), CreateKeyboardLayoutList(), CreateLanguageList(), LoadSetupInf(), LookupDirectoryById(), PrepareCopyInfFile(), and PrepareFileCopy().

◆ INF_GetDataField()

BOOLEAN INF_GetDataField ( IN PINFCONTEXT  Context,
IN ULONG  FieldIndex,
OUT PCWSTR Data 
)

Definition at line 42 of file infsupp.c.

46{
47#if 0
48
50 PWCHAR InfData;
52
53 *Data = NULL;
54
57 NULL,
58 0,
59 &dwSize);
60 if (!Success)
61 return FALSE;
62
63 InfData = RtlAllocateHeap(ProcessHeap, 0, dwSize * sizeof(WCHAR));
64 if (!InfData)
65 return FALSE;
66
69 InfData,
70 dwSize,
71 NULL);
72 if (!Success)
73 {
74 RtlFreeHeap(ProcessHeap, 0, InfData);
75 return FALSE;
76 }
77
78 *Data = InfData;
79 return TRUE;
80
81#else
82
84 return !!*Data;
85
86#endif
87}
HANDLE ProcessHeap
Definition: servman.c:15
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
unsigned long DWORD
Definition: ntddk_ex.h:95
pSpInfGetStringField SpInfGetStringField
Definition: infsupp.c:93
pSpInfGetField SpInfGetField
Definition: infsupp.c:94
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
_In_ DWORD FieldIndex
Definition: setupapi.h:1895
uint16_t * PWCHAR
Definition: typedefs.h:56
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by AddComputerTypeEntries(), AddEntriesFromInfSection(), AddSectionToCopyQueue(), AddSectionToCopyQueueCab(), CreateDisplayDriverList(), GetSourceFileAndTargetLocation(), INF_GetData(), InstallDriver(), ProcessDisplayRegistry(), and UpdateRegistry().