ReactOS  0.4.14-dev-41-g31d7680
infsupp.c File Reference
#include "reactos.h"
#include <winnls.h>
#include <debug.h>
Include dependency graph for infsupp.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

PCWSTR WINAPI pSetupGetField (IN PINFCONTEXT Context, IN ULONG FieldIndex)
 
HINF WINAPI SetupOpenInfFileExW (IN PCWSTR FileName, IN PCWSTR InfClass, IN DWORD InfStyle, IN LCID LocaleId, OUT PUINT ErrorLine)
 

Variables

pSpInfCloseInfFile SpInfCloseInfFile = SetupCloseInfFile
 
pSpInfFindFirstLine SpInfFindFirstLine = SetupFindFirstLineW
 
pSpInfFindNextLine SpInfFindNextLine = SetupFindNextLine
 
pSpInfGetFieldCount SpInfGetFieldCount = SetupGetFieldCount
 
pSpInfGetBinaryField SpInfGetBinaryField = SetupGetBinaryField
 
pSpInfGetIntField SpInfGetIntField = SetupGetIntField
 
pSpInfGetMultiSzField SpInfGetMultiSzField = SetupGetMultiSzFieldW
 
pSpInfGetStringField SpInfGetStringField = SetupGetStringFieldW
 
pSpInfGetField SpInfGetField = pSetupGetField
 
pSpInfOpenInfFile SpInfOpenInfFile = SetupOpenInfFileExW
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 15 of file infsupp.c.

Function Documentation

◆ pSetupGetField()

PCWSTR WINAPI pSetupGetField ( IN PINFCONTEXT  Context,
IN ULONG  FieldIndex 
)

Definition at line 108 of file infsupp.c.

111 {
112  PWCHAR Data = NULL;
114  return NULL;
115  return Data;
116 }
uint16_t * PWCHAR
Definition: typedefs.h:54
BOOLEAN InfGetDataField(PINFCONTEXT Context, ULONG FieldIndex, PWCHAR *Data)
Definition: infrosget.c:127
smooth NULL
Definition: ftsmooth.c:416
_In_ LPGUID _In_ PVOID Data
Definition: classpnp.h:778
_In_ DWORD FieldIndex
Definition: setupapi.h:1890

◆ SetupOpenInfFileExW()

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

Definition at line 35 of file infsupp.c.

41 {
42  HINF InfHandle;
43  LCID OldLocaleId;
44  WCHAR Win32FileName[MAX_PATH];
45 
46  /*
47  * SetupOpenInfFileExW is called within setuplib with NT paths, however
48  * the Win32 SetupOpenInfFileW API only takes Win32 paths. We therefore
49  * map the NT path to Win32 path and then call the Win32 API.
50  */
52  Win32FileName,
53  _countof(Win32FileName),
54  FileName))
55  {
56  return INVALID_HANDLE_VALUE;
57  }
58 
59  /*
60  * Because SetupAPI's SetupOpenInfFileW() function does not allow the user
61  * to specify a given LCID to use to load localized string substitutions,
62  * we temporarily change the current thread locale before calling
63  * SetupOpenInfFileW(). When we have finished we restore the original
64  * thread locale.
65  */
66  OldLocaleId = GetThreadLocale();
67  if (OldLocaleId != LocaleId)
68  SetThreadLocale(LocaleId);
69 
70  /* Load the INF file */
71  InfHandle = SetupOpenInfFileW(Win32FileName,
72  InfClass,
73  InfStyle,
74  ErrorLine);
75 
76  /* Restore the original thread locale */
77  if (OldLocaleId != LocaleId)
78  SetThreadLocale(OldLocaleId);
79 
80  return InfHandle;
81 }
#define _countof(array)
Definition: fontsub.cpp:30
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD LCID
Definition: nls.h:13
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
BOOL WINAPI SetThreadLocale(LCID lcid)
Definition: lang.c:1468
BOOL ConvertNtPathToWin32Path(IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList, OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
Definition: reactos.c:1498
NT_WIN32_PATH_MAPPING_LIST MappingList
Definition: reactos.h:126
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
SETUPDATA SetupData
Definition: reactos.c:41
LCID WINAPI GetThreadLocale(void)
Definition: lang.c:1449

Variable Documentation

◆ SpInfCloseInfFile

Definition at line 86 of file infsupp.c.

◆ SpInfFindFirstLine

Definition at line 87 of file infsupp.c.

◆ SpInfFindNextLine

Definition at line 88 of file infsupp.c.

◆ SpInfGetBinaryField

Definition at line 90 of file infsupp.c.

◆ SpInfGetField

pSpInfGetField SpInfGetField = pSetupGetField

Definition at line 94 of file infsupp.c.

Referenced by INF_GetDataField().

◆ SpInfGetFieldCount

Definition at line 89 of file infsupp.c.

Referenced by INF_GetData().

◆ SpInfGetIntField

pSpInfGetIntField SpInfGetIntField = SetupGetIntField

Definition at line 91 of file infsupp.c.

◆ SpInfGetMultiSzField

Definition at line 92 of file infsupp.c.

◆ SpInfGetStringField

Definition at line 93 of file infsupp.c.

Referenced by INF_GetDataField().

◆ SpInfOpenInfFile

Definition at line 95 of file infsupp.c.