Commit b88b4808 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

advpack: Implement the Open/CloseINFEngine and TranslateINFStringEx

trio of functions.
parent dd5ae20d
...@@ -118,15 +118,13 @@ static void set_ldids(HINF hInf, PCSTR pszInstallSection) ...@@ -118,15 +118,13 @@ static void set_ldids(HINF hInf, PCSTR pszInstallSection)
* RETURNS * RETURNS
* Success: S_OK. * Success: S_OK.
* Failure: E_FAIL. * Failure: E_FAIL.
*
* BUGS
* Unimplemented.
*/ */
HRESULT WINAPI CloseINFEngine(HINF hInf) HRESULT WINAPI CloseINFEngine(HINF hInf)
{ {
FIXME("(%p) stub\n", hInf); TRACE("(%p)\n", hInf);
return E_FAIL; SetupCloseInfFile(hInf);
return S_OK;
} }
/*********************************************************************** /***********************************************************************
...@@ -405,17 +403,23 @@ BOOL WINAPI NeedReboot(DWORD dwRebootCheck) ...@@ -405,17 +403,23 @@ BOOL WINAPI NeedReboot(DWORD dwRebootCheck)
* RETURNS * RETURNS
* Success: S_OK. * Success: S_OK.
* Failure: E_FAIL. * Failure: E_FAIL.
*
* BUGS
* Unimplemented.
*/ */
HRESULT WINAPI OpenINFEngine(PCSTR pszInfFilename, PCSTR pszInstallSection, HRESULT WINAPI OpenINFEngine(PCSTR pszInfFilename, PCSTR pszInstallSection,
DWORD dwFlags, HINF *phInf, PVOID pvReserved) DWORD dwFlags, HINF *phInf, PVOID pvReserved)
{ {
FIXME("(%p, %p, %ld, %p, %p) stub\n", pszInfFilename, pszInstallSection, TRACE("(%p, %p, %ld, %p, %p)\n", pszInfFilename, pszInstallSection,
dwFlags, phInf, pvReserved); dwFlags, phInf, pvReserved);
return E_FAIL; if (!phInf)
return E_INVALIDARG;
*phInf = SetupOpenInfFileA(pszInfFilename, NULL, INF_STYLE_WIN4, NULL);
if (*phInf == INVALID_HANDLE_VALUE)
return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
set_ldids(*phInf, pszInstallSection);
return S_OK;
} }
/*********************************************************************** /***********************************************************************
...@@ -621,19 +625,25 @@ HRESULT WINAPI TranslateInfString(PCSTR pszInfFilename, PCSTR pszInstallSection, ...@@ -621,19 +625,25 @@ HRESULT WINAPI TranslateInfString(PCSTR pszInfFilename, PCSTR pszInstallSection,
* When translating more than one keys, this method is more efficient * When translating more than one keys, this method is more efficient
* than calling TranslateInfString, because the INF file is only * than calling TranslateInfString, because the INF file is only
* opened once. * opened once.
*
* BUGS
* Unimplemented.
*/ */
HRESULT WINAPI TranslateInfStringEx(HINF hInf, PCSTR pszInfFilename, HRESULT WINAPI TranslateInfStringEx(HINF hInf, PCSTR pszInfFilename,
PCSTR pszTranslateSection, PCSTR pszTranslateKey, PCSTR pszTranslateSection, PCSTR pszTranslateKey,
PSTR pszBuffer, DWORD dwBufferSize, PSTR pszBuffer, DWORD dwBufferSize,
PDWORD pdwRequiredSize, PVOID pvReserved) PDWORD pdwRequiredSize, PVOID pvReserved)
{ {
FIXME("(%p, %p, %p, %p, %p, %ld, %p, %p) stub\n", hInf, pszInfFilename, TRACE("(%p, %p, %p, %p, %p, %ld, %p, %p)\n", hInf, pszInfFilename,
pszTranslateSection, pszTranslateKey, pszBuffer, dwBufferSize, pszTranslateSection, pszTranslateKey, pszBuffer, dwBufferSize,
pdwRequiredSize, pvReserved); pdwRequiredSize, pvReserved);
if (!SetupGetLineTextA(NULL, hInf, pszTranslateSection, pszTranslateKey,
pszBuffer, dwBufferSize, pdwRequiredSize))
{
if (dwBufferSize < *pdwRequiredSize)
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
return SPAPI_E_LINE_NOT_FOUND;
}
return E_FAIL; return E_FAIL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment