Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e4756347
Commit
e4756347
authored
Apr 03, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Apr 04, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advpack: Forward RegInstallA to its Unicode counterpart.
parent
39cedf0b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
22 deletions
+84
-22
advpack.spec
dlls/advpack/advpack.spec
+1
-1
reg.c
dlls/advpack/reg.c
+83
-21
No files found.
dlls/advpack/advpack.spec
View file @
e4756347
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
@ stdcall RebootCheckOnInstallW(long wstr wstr long)
@ stdcall RebootCheckOnInstallW(long wstr wstr long)
@ stdcall RebootCheckOnInstall(long str str long) RebootCheckOnInstallA
@ stdcall RebootCheckOnInstall(long str str long) RebootCheckOnInstallA
@ stdcall RegInstallA(ptr str ptr)
@ stdcall RegInstallA(ptr str ptr)
#
stdcall RegInstallW(ptr wstr ptr)
@
stdcall RegInstallW(ptr wstr ptr)
@ stdcall RegInstall(ptr str ptr) RegInstallA
@ stdcall RegInstall(ptr str ptr) RegInstallA
@ stdcall RegRestoreAllA(ptr str long)
@ stdcall RegRestoreAllA(ptr str long)
@ stdcall RegRestoreAllW(ptr wstr long)
@ stdcall RegRestoreAllW(ptr wstr long)
...
...
dlls/advpack/reg.c
View file @
e4756347
...
@@ -97,9 +97,82 @@ error:
...
@@ -97,9 +97,82 @@ error:
return
FALSE
;
return
FALSE
;
}
}
static
void
strentry_atow
(
STRENTRYA
*
aentry
,
STRENTRYW
*
wentry
)
{
DWORD
name_len
,
val_len
;
name_len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
aentry
->
pszName
,
-
1
,
NULL
,
0
);
val_len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
aentry
->
pszName
,
-
1
,
NULL
,
0
);
wentry
->
pszName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
name_len
*
sizeof
(
WCHAR
));
wentry
->
pszValue
=
HeapAlloc
(
GetProcessHeap
(),
0
,
val_len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
aentry
->
pszName
,
-
1
,
wentry
->
pszName
,
name_len
);
MultiByteToWideChar
(
CP_ACP
,
0
,
aentry
->
pszName
,
-
1
,
wentry
->
pszValue
,
val_len
);
}
static
STRTABLEW
*
strtable_atow
(
const
STRTABLEA
*
atable
)
{
STRTABLEW
*
wtable
;
DWORD
j
;
wtable
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
STRTABLEW
));
wtable
->
pse
=
HeapAlloc
(
GetProcessHeap
(),
0
,
atable
->
cEntries
*
sizeof
(
STRENTRYW
));
wtable
->
cEntries
=
atable
->
cEntries
;
for
(
j
=
0
;
j
<
wtable
->
cEntries
;
j
++
)
strentry_atow
(
&
atable
->
pse
[
j
],
&
wtable
->
pse
[
j
]);
return
wtable
;
}
static
void
free_strtable
(
STRTABLEW
*
wtable
)
{
DWORD
j
;
for
(
j
=
0
;
j
<
wtable
->
cEntries
;
j
++
)
{
HeapFree
(
GetProcessHeap
(),
0
,
wtable
->
pse
[
j
].
pszName
);
HeapFree
(
GetProcessHeap
(),
0
,
wtable
->
pse
[
j
].
pszValue
);
}
HeapFree
(
GetProcessHeap
(),
0
,
wtable
->
pse
);
HeapFree
(
GetProcessHeap
(),
0
,
wtable
);
}
/***********************************************************************
/***********************************************************************
* RegInstallA (advpack.@)
* RegInstallA (advpack.@)
*
*
* See RegInstallW.
*/
HRESULT
WINAPI
RegInstallA
(
HMODULE
hm
,
LPCSTR
pszSection
,
const
STRTABLEA
*
pstTable
)
{
UNICODE_STRING
section
;
STRTABLEW
*
wtable
;
HRESULT
hr
;
TRACE
(
"(%p, %s, %p)
\n
"
,
hm
,
debugstr_a
(
pszSection
),
pstTable
);
if
(
pstTable
)
wtable
=
strtable_atow
(
pstTable
);
else
wtable
=
NULL
;
RtlCreateUnicodeStringFromAsciiz
(
&
section
,
pszSection
);
hr
=
RegInstallW
(
hm
,
section
.
Buffer
,
wtable
);
if
(
pstTable
)
free_strtable
(
wtable
);
RtlFreeUnicodeString
(
&
section
);
return
hr
;
}
/***********************************************************************
* RegInstallW (advpack.@)
*
* Loads an INF from a string resource, adds entries to the string
* Loads an INF from a string resource, adds entries to the string
* substitution table, and executes the INF.
* substitution table, and executes the INF.
*
*
...
@@ -112,20 +185,15 @@ error:
...
@@ -112,20 +185,15 @@ error:
* Success: S_OK.
* Success: S_OK.
* Failure: E_FAIL.
* Failure: E_FAIL.
*/
*/
HRESULT
WINAPI
RegInstall
A
(
HMODULE
hm
,
LPCSTR
pszSection
,
const
STRTABLEA
*
pstTable
)
HRESULT
WINAPI
RegInstall
W
(
HMODULE
hm
,
LPCWSTR
pszSection
,
const
STRTABLEW
*
pstTable
)
{
{
int
i
;
int
i
;
WCHAR
tmp_ini_path
[
MAX_PATH
];
WCHAR
tmp_ini_path
[
MAX_PATH
];
WCHAR
mod_path
[
MAX_PATH
+
2
],
sys_mod_path
[
MAX_PATH
+
2
],
sys_root
[
MAX_PATH
];
WCHAR
mod_path
[
MAX_PATH
+
2
],
sys_mod_path
[
MAX_PATH
+
2
],
sys_root
[
MAX_PATH
];
HINF
hinf
;
HINF
hinf
;
WCHAR
quote
[]
=
{
'\"'
,
0
};
static
const
WCHAR
quote
[]
=
{
'\"'
,
0
};
UNICODE_STRING
section
;
TRACE
(
"(%p %s %p)
\n
"
,
hm
,
pszSection
,
pstTable
);
if
(
pstTable
)
for
(
i
=
0
;
i
<
pstTable
->
cEntries
;
i
++
)
TRACE
(
"(%p, %s, %p)
\n
"
,
hm
,
debugstr_w
(
pszSection
),
pstTable
);
TRACE
(
"%d: %s -> %s
\n
"
,
i
,
pstTable
->
pse
[
i
].
pszName
,
pstTable
->
pse
[
i
].
pszValue
);
if
(
!
create_tmp_ini_file
(
hm
,
tmp_ini_path
))
if
(
!
create_tmp_ini_file
(
hm
,
tmp_ini_path
))
return
E_FAIL
;
return
E_FAIL
;
...
@@ -150,16 +218,13 @@ HRESULT WINAPI RegInstallA(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTa
...
@@ -150,16 +218,13 @@ HRESULT WINAPI RegInstallA(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTa
/* Write the additional string table */
/* Write the additional string table */
if
(
pstTable
)
for
(
i
=
0
;
i
<
pstTable
->
cEntries
;
i
++
)
{
if
(
pstTable
)
for
(
i
=
0
;
i
<
pstTable
->
cEntries
;
i
++
)
{
char
tmp_value
[
MAX_PATH
+
2
];
WCHAR
tmp_value
[
MAX_PATH
+
2
];
UNICODE_STRING
name
,
value
;
tmp_value
[
0
]
=
'\"'
;
tmp_value
[
0
]
=
'\"'
;
strcpy
(
tmp_value
+
1
,
pstTable
->
pse
[
i
].
pszValue
);
lstrcpyW
(
tmp_value
+
1
,
pstTable
->
pse
[
i
].
pszValue
);
strcat
(
tmp_value
,
"
\"
"
);
lstrcatW
(
tmp_value
,
quote
);
RtlCreateUnicodeStringFromAsciiz
(
&
name
,
pstTable
->
pse
[
i
].
pszName
);
RtlCreateUnicodeStringFromAsciiz
(
&
value
,
tmp_value
);
WritePrivateProfileStringW
(
Strings
,
pstTable
->
pse
[
i
].
pszName
,
tmp_value
,
tmp_ini_path
);
WritePrivateProfileStringW
(
Strings
,
name
.
Buffer
,
value
.
Buffer
,
tmp_ini_path
);
RtlFreeUnicodeString
(
&
name
);
RtlFreeUnicodeString
(
&
value
);
}
}
/* flush cache */
/* flush cache */
WritePrivateProfileStringW
(
NULL
,
NULL
,
NULL
,
tmp_ini_path
);
WritePrivateProfileStringW
(
NULL
,
NULL
,
NULL
,
tmp_ini_path
);
...
@@ -175,12 +240,9 @@ HRESULT WINAPI RegInstallA(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTa
...
@@ -175,12 +240,9 @@ HRESULT WINAPI RegInstallA(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTa
SetupOpenAppendInfFileW
(
NULL
,
hinf
,
NULL
);
SetupOpenAppendInfFileW
(
NULL
,
hinf
,
NULL
);
/* Need to do a lot more here */
/* Need to do a lot more here */
RtlCreateUnicodeStringFromAsciiz
(
&
section
,
pszSection
);
SetupInstallFromInfSectionW
(
NULL
,
hinf
,
pszSection
,
SetupInstallFromInfSectionW
(
NULL
,
hinf
,
section
.
Buffer
,
SPINST_INIFILES
|
SPINST_REGISTRY
|
SPINST_PROFILEITEMS
,
SPINST_INIFILES
|
SPINST_REGISTRY
|
SPINST_PROFILEITEMS
,
HKEY_LOCAL_MACHINE
,
NULL
,
0
,
NULL
,
NULL
,
NULL
,
NULL
);
HKEY_LOCAL_MACHINE
,
NULL
,
0
,
NULL
,
NULL
,
NULL
,
NULL
);
RtlFreeUnicodeString
(
&
section
);
SetupCloseInfFile
(
hinf
);
SetupCloseInfFile
(
hinf
);
DeleteFileW
(
tmp_ini_path
);
DeleteFileW
(
tmp_ini_path
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment