Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
b877d84a
Commit
b877d84a
authored
19 years ago
by
James Hawkins
Committed by
Alexandre Julliard
19 years ago
Browse files
Options
Downloads
Patches
Plain Diff
advpack: Forward TranslateInfStringExA to its unicode counterpart.
parent
396242fa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/advpack/advpack.c
+69
-8
69 additions, 8 deletions
dlls/advpack/advpack.c
dlls/advpack/advpack.spec
+1
-1
1 addition, 1 deletion
dlls/advpack/advpack.spec
with
70 additions
and
9 deletions
dlls/advpack/advpack.c
+
69
−
8
View file @
b877d84a
...
...
@@ -541,6 +541,67 @@ HRESULT WINAPI TranslateInfStringW(LPCWSTR pszInfFilename, LPCWSTR pszInstallSec
/***********************************************************************
* TranslateInfStringExA (ADVPACK.@)
*
* See TranslateInfStringExW.
*/
HRESULT
WINAPI
TranslateInfStringExA
(
HINF
hInf
,
LPCSTR
pszInfFilename
,
LPCSTR
pszTranslateSection
,
LPCSTR
pszTranslateKey
,
LPSTR
pszBuffer
,
DWORD
dwBufferSize
,
PDWORD
pdwRequiredSize
,
PVOID
pvReserved
)
{
UNICODE_STRING
filenameW
,
sectionW
,
keyW
;
LPWSTR
bufferW
;
HRESULT
res
;
DWORD
len
=
0
;
TRACE
(
"(%p, %p, %p, %p, %p, %ld, %p, %p)
\n
"
,
hInf
,
debugstr_a
(
pszInfFilename
),
debugstr_a
(
pszTranslateSection
),
debugstr_a
(
pszTranslateKey
),
debugstr_a
(
pszBuffer
),
dwBufferSize
,
pdwRequiredSize
,
pvReserved
);
if
(
!
pszInfFilename
||
!
pszTranslateSection
||
!
pszTranslateKey
||
!
pdwRequiredSize
)
return
E_INVALIDARG
;
RtlCreateUnicodeStringFromAsciiz
(
&
filenameW
,
pszInfFilename
);
RtlCreateUnicodeStringFromAsciiz
(
&
sectionW
,
pszTranslateSection
);
RtlCreateUnicodeStringFromAsciiz
(
&
keyW
,
pszTranslateKey
);
res
=
TranslateInfStringExW
(
hInf
,
filenameW
.
Buffer
,
sectionW
.
Buffer
,
keyW
.
Buffer
,
NULL
,
0
,
&
len
,
NULL
);
if
(
res
==
S_OK
)
{
bufferW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
res
=
TranslateInfStringExW
(
hInf
,
filenameW
.
Buffer
,
sectionW
.
Buffer
,
keyW
.
Buffer
,
bufferW
,
len
,
&
len
,
NULL
);
if
(
res
==
S_OK
)
{
*
pdwRequiredSize
=
WideCharToMultiByte
(
CP_ACP
,
0
,
bufferW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
dwBufferSize
>=
*
pdwRequiredSize
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
bufferW
,
-
1
,
pszBuffer
,
dwBufferSize
,
NULL
,
NULL
);
}
else
res
=
HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
);
}
HeapFree
(
GetProcessHeap
(),
0
,
bufferW
);
}
RtlFreeUnicodeString
(
&
filenameW
);
RtlFreeUnicodeString
(
&
sectionW
);
RtlFreeUnicodeString
(
&
keyW
);
return
res
;
}
/***********************************************************************
* TranslateInfStringExW (ADVPACK.@)
*
* Using a handle to an INF file opened with OpenINFEngine, translates
* the value of a specified key in an inf file into the current locale
* by expanding string macros.
...
...
@@ -567,19 +628,19 @@ HRESULT WINAPI TranslateInfStringW(LPCWSTR pszInfFilename, LPCWSTR pszInstallSec
* than calling TranslateInfString, because the INF file is only
* opened once.
*/
HRESULT
WINAPI
TranslateInfStringEx
A
(
HINF
hInf
,
LPCSTR
pszInfFilename
,
LPCSTR
pszTranslateSection
,
LPCSTR
pszTranslateKey
,
LPSTR
pszBuffer
,
DWORD
dwBufferSize
,
PDWORD
pdwRequiredSize
,
PVOID
pvReserved
)
HRESULT
WINAPI
TranslateInfStringEx
W
(
HINF
hInf
,
LPC
W
STR
pszInfFilename
,
LPC
W
STR
pszTranslateSection
,
LPC
W
STR
pszTranslateKey
,
LP
W
STR
pszBuffer
,
DWORD
dwBufferSize
,
PDWORD
pdwRequiredSize
,
PVOID
pvReserved
)
{
TRACE
(
"(%p, %p, %p, %p, %p, %ld, %p, %p)
\n
"
,
hInf
,
pszInfFilename
,
pszTranslateSection
,
pszTranslateKey
,
pszBuffer
,
dwBufferSize
,
pdwRequiredSize
,
pvReserved
);
TRACE
(
"(%p, %p, %p, %p, %p, %ld, %p, %p)
\n
"
,
hInf
,
debugstr_w
(
pszInfFilename
)
,
debugstr_w
(
pszTranslateSection
)
,
debugstr_w
(
pszTranslateKey
)
,
debugstr_w
(
pszBuffer
),
dwBufferSize
,
pdwRequiredSize
,
pvReserved
);
if
(
!
hInf
||
!
pszInfFilename
||
!
pszTranslateSection
||
!
pszTranslateKey
)
return
E_INVALIDARG
;
if
(
!
SetupGetLineText
A
(
NULL
,
hInf
,
pszTranslateSection
,
pszTranslateKey
,
if
(
!
SetupGetLineText
W
(
NULL
,
hInf
,
pszTranslateSection
,
pszTranslateKey
,
pszBuffer
,
dwBufferSize
,
pdwRequiredSize
))
{
if
(
dwBufferSize
<
*
pdwRequiredSize
)
...
...
This diff is collapsed.
Click to expand it.
dlls/advpack/advpack.spec
+
1
−
1
View file @
b877d84a
...
...
@@ -72,7 +72,7 @@
@ stdcall TranslateInfStringW(wstr wstr wstr wstr ptr long ptr ptr)
@ stdcall TranslateInfString(str str str str ptr long ptr ptr) TranslateInfStringA
@ stdcall TranslateInfStringExA(long str str str str long ptr ptr)
#
stdcall TranslateInfStringExW(long wstr wstr wstr wstr long ptr ptr)
@
stdcall TranslateInfStringExW(long wstr wstr wstr wstr long ptr ptr)
@ stdcall TranslateInfStringEx(long str str str str long ptr ptr) TranslateInfStringExA
@ stdcall UserInstStubWrapperA(long long str long)
# stdcall UserInstStubWrapperW(long long wstr long)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment