ReactOS  0.4.13-dev-100-gc8611ae
infsupp.h File Reference
#include "spapisup.h"
Include dependency graph for infsupp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _INFCONTEXT
 

Macros

#define MAX_INF_STRING_LENGTH   1024
 
#define INF_STYLE_OLDNT   0x00000001
 
#define INF_STYLE_WIN4   0x00000002
 

Typedefs

typedef PVOID HINF
 
typedef struct _INFCONTEXT INFCONTEXT
 
typedef struct _INFCONTEXTPINFCONTEXT
 
typedef VOID(WINAPIpSpInfCloseInfFile) (IN HINF InfHandle)
 
typedef BOOL(WINAPIpSpInfFindFirstLine) (IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
 
typedef BOOL(WINAPIpSpInfFindNextLine) (IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
 
typedef ULONG(WINAPIpSpInfGetFieldCount) (IN PINFCONTEXT Context)
 
typedef BOOL(WINAPIpSpInfGetBinaryField) (IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PUCHAR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
 
typedef BOOL(WINAPIpSpInfGetIntField) (IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue)
 
typedef BOOL(WINAPIpSpInfGetMultiSzField) (IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
 
typedef BOOL(WINAPIpSpInfGetStringField) (IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
 
typedef PCWSTR(WINAPIpSpInfGetField) (IN PINFCONTEXT Context, IN ULONG FieldIndex)
 
typedef HINF(WINAPIpSpInfOpenInfFile) (IN PCWSTR FileName, IN PCWSTR InfClass, IN DWORD InfStyle, IN LCID LocaleId, OUT PUINT ErrorLine)
 

Functions

 C_ASSERT (sizeof(INFCONTEXT)==2 *sizeof(HINF)+2 *sizeof(UINT))
 
FORCEINLINE VOID INF_FreeData (IN PCWSTR InfData)
 
BOOLEAN INF_GetDataField (IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PCWSTR *Data)
 
BOOLEAN INF_GetData (IN PINFCONTEXT Context, OUT PCWSTR *Key, OUT PCWSTR *Data)
 

Variables

pSpInfCloseInfFile SpInfCloseInfFile
 
pSpInfFindFirstLine SpInfFindFirstLine
 
pSpInfFindNextLine SpInfFindNextLine
 
pSpInfGetFieldCount SpInfGetFieldCount
 
pSpInfGetBinaryField SpInfGetBinaryField
 
pSpInfGetIntField SpInfGetIntField
 
pSpInfGetMultiSzField SpInfGetMultiSzField
 
pSpInfGetStringField SpInfGetStringField
 
pSpInfGetField SpInfGetField
 
pSpInfOpenInfFile SpInfOpenInfFile
 

Macro Definition Documentation

◆ INF_STYLE_OLDNT

#define INF_STYLE_OLDNT   0x00000001

Definition at line 37 of file infsupp.h.

◆ INF_STYLE_WIN4

#define INF_STYLE_WIN4   0x00000002

Definition at line 41 of file infsupp.h.

◆ MAX_INF_STRING_LENGTH

#define MAX_INF_STRING_LENGTH   1024

Definition at line 34 of file infsupp.h.

Typedef Documentation

◆ HINF

typedef PVOID HINF

Definition at line 21 of file infsupp.h.

◆ INFCONTEXT

◆ PINFCONTEXT

◆ pSpInfCloseInfFile

typedef VOID(WINAPI* pSpInfCloseInfFile) (IN HINF InfHandle)

Definition at line 60 of file infsupp.h.

◆ pSpInfFindFirstLine

typedef BOOL(WINAPI* pSpInfFindFirstLine) (IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)

Definition at line 67 of file infsupp.h.

◆ pSpInfFindNextLine

typedef BOOL(WINAPI* pSpInfFindNextLine) (IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)

Definition at line 77 of file infsupp.h.

◆ pSpInfGetBinaryField

typedef BOOL(WINAPI* pSpInfGetBinaryField) (IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PUCHAR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)

Definition at line 92 of file infsupp.h.

◆ pSpInfGetField

typedef PCWSTR(WINAPI* pSpInfGetField) (IN PINFCONTEXT Context, IN ULONG FieldIndex)

Definition at line 134 of file infsupp.h.

◆ pSpInfGetFieldCount

typedef ULONG(WINAPI* pSpInfGetFieldCount) (IN PINFCONTEXT Context)

Definition at line 85 of file infsupp.h.

◆ pSpInfGetIntField

typedef BOOL(WINAPI* pSpInfGetIntField) (IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue)

Definition at line 103 of file infsupp.h.

◆ pSpInfGetMultiSzField

typedef BOOL(WINAPI* pSpInfGetMultiSzField) (IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)

Definition at line 112 of file infsupp.h.

◆ pSpInfGetStringField

typedef BOOL(WINAPI* pSpInfGetStringField) (IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)

Definition at line 123 of file infsupp.h.

◆ pSpInfOpenInfFile

typedef HINF(WINAPI* pSpInfOpenInfFile) (IN PCWSTR FileName, IN PCWSTR InfClass, IN DWORD InfStyle, IN LCID LocaleId, OUT PUINT ErrorLine)

Definition at line 143 of file infsupp.h.

Function Documentation

◆ C_ASSERT()

C_ASSERT ( sizeof(INFCONTEXT = =2 *sizeof(HINF)+2 *sizeof(UINT))

◆ INF_FreeData()

FORCEINLINE VOID INF_FreeData ( IN PCWSTR  InfData)

Definition at line 157 of file infsupp.h.

159 {
160 #if 0
161  if (InfData)
162  RtlFreeHeap(ProcessHeap, 0, InfData);
163 #else
164  UNREFERENCED_PARAMETER(InfData);
165 #endif
166 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:603
HANDLE ProcessHeap
Definition: servman.c:15

Referenced by AddEntriesFromInfSection(), AddSectionToCopyQueue(), AddSectionToCopyQueueCab(), CheckUnattendedSetup(), CreateComputerTypeList(), CreateDisplayDriverList(), GetSourceFileAndTargetLocation(), INF_GetData(), InstallDriver(), LoadSetupInf(), PrepareCopyInfFile(), PrepareFileCopy(), and UpdateRegistry().

◆ INF_GetData()

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

Definition at line 90 of file infsupp.c.

94 {
95  BOOL Success;
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 }
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define TRUE
Definition: types.h:120
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOLEAN INF_GetDataField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PCWSTR *Data)
Definition: infsupp.c:42
smooth NULL
Definition: ftsmooth.c:416
pSpInfGetFieldCount SpInfGetFieldCount
Definition: infsupp.c:89
FORCEINLINE VOID INF_FreeData(IN PCWSTR InfData)
Definition: infsupp.h:157
#define DPRINT1
Definition: precomp.h:8

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 
49  BOOL Success;
50  PWCHAR InfData;
51  DWORD dwSize;
52 
53  *Data = NULL;
54 
56  FieldIndex,
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 
68  FieldIndex,
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 }
#define TRUE
Definition: types.h:120
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:603
uint16_t * PWCHAR
Definition: typedefs.h:54
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
_In_ LPGUID _In_ PVOID Data
Definition: classpnp.h:778
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:585
__wchar_t WCHAR
Definition: xmlstorage.h:180
_In_ DWORD FieldIndex
Definition: setupapi.h:1889
pSpInfGetStringField SpInfGetStringField
Definition: infsupp.c:93
unsigned long DWORD
Definition: ntddk_ex.h:95
pSpInfGetField SpInfGetField
Definition: infsupp.c:94
HANDLE ProcessHeap
Definition: servman.c:15
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

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

Variable Documentation

◆ SpInfCloseInfFile

pSpInfCloseInfFile SpInfCloseInfFile

Definition at line 86 of file infsupp.c.

Referenced by CheckUnattendedSetup(), FinishSetup(), ImportRegistryFile(), and PrepareFileCopy().

◆ SpInfFindFirstLine

◆ SpInfFindNextLine

◆ SpInfGetBinaryField

pSpInfGetBinaryField SpInfGetBinaryField

Definition at line 90 of file infsupp.c.

Referenced by do_reg_operation().

◆ SpInfGetField

pSpInfGetField SpInfGetField

Definition at line 94 of file infsupp.c.

Referenced by INF_GetDataField().

◆ SpInfGetFieldCount

pSpInfGetFieldCount SpInfGetFieldCount

Definition at line 89 of file infsupp.c.

Referenced by do_reg_operation(), and INF_GetData().

◆ SpInfGetIntField

pSpInfGetIntField SpInfGetIntField

Definition at line 91 of file infsupp.c.

Referenced by CheckUnattendedSetup(), LoadSetupInf(), and registry_callback().

◆ SpInfGetMultiSzField

pSpInfGetMultiSzField SpInfGetMultiSzField

Definition at line 92 of file infsupp.c.

Referenced by do_reg_operation().

◆ SpInfGetStringField

pSpInfGetStringField SpInfGetStringField

Definition at line 93 of file infsupp.c.

Referenced by do_reg_operation(), INF_GetDataField(), and registry_callback().

◆ SpInfOpenInfFile

pSpInfOpenInfFile SpInfOpenInfFile

Definition at line 95 of file infsupp.c.

Referenced by CheckUnattendedSetup(), ImportRegistryFile(), LoadSetupInf(), and PrepareFileCopy().