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
ab24569b
Commit
ab24569b
authored
Jul 12, 2006
by
Juan Lang
Committed by
Alexandre Julliard
Jul 12, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Split up ACTION_AppSearchReg.
parent
39859971
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
43 deletions
+51
-43
appsearch.c
dlls/msi/appsearch.c
+51
-43
No files found.
dlls/msi/appsearch.c
View file @
ab24569b
...
...
@@ -236,6 +236,54 @@ end:
return
rc
;
}
static
void
ACTION_ConvertRegValue
(
DWORD
regType
,
const
BYTE
*
value
,
DWORD
sz
,
LPWSTR
*
appValue
)
{
static
const
WCHAR
dwordFmt
[]
=
{
'#'
,
'%'
,
'd'
,
'\0'
};
static
const
WCHAR
expandSzFmt
[]
=
{
'#'
,
'%'
,
'%'
,
'%'
,
's'
,
'\0'
};
static
const
WCHAR
binFmt
[]
=
{
'#'
,
'x'
,
'%'
,
'x'
,
'\0'
};
DWORD
i
;
switch
(
regType
)
{
case
REG_SZ
:
if
(
*
(
LPWSTR
)
value
==
'#'
)
{
/* escape leading pound with another */
*
appValue
=
msi_alloc
(
sz
+
sizeof
(
WCHAR
));
(
*
appValue
)[
0
]
=
'#'
;
strcpyW
(
*
appValue
+
1
,
(
LPCWSTR
)
value
);
}
else
{
*
appValue
=
msi_alloc
(
sz
);
strcpyW
(
*
appValue
,
(
LPCWSTR
)
value
);
}
break
;
case
REG_DWORD
:
/* 7 chars for digits, 1 for NULL, 1 for #, and 1 for sign
* char if needed
*/
*
appValue
=
msi_alloc
(
10
*
sizeof
(
WCHAR
));
sprintfW
(
*
appValue
,
dwordFmt
,
*
(
const
DWORD
*
)
value
);
break
;
case
REG_EXPAND_SZ
:
/* space for extra #% characters in front */
*
appValue
=
msi_alloc
(
sz
+
2
*
sizeof
(
WCHAR
));
sprintfW
(
*
appValue
,
expandSzFmt
,
(
LPCWSTR
)
value
);
break
;
case
REG_BINARY
:
/* 3 == length of "#x<nibble>" */
*
appValue
=
msi_alloc
((
sz
*
3
+
1
)
*
sizeof
(
WCHAR
));
for
(
i
=
0
;
i
<
sz
;
i
++
)
sprintfW
(
*
appValue
+
i
*
3
,
binFmt
,
value
[
i
]);
break
;
default:
WARN
(
"unimplemented for values of type %ld
\n
"
,
regType
);
*
appValue
=
NULL
;
}
}
static
UINT
ACTION_AppSearchReg
(
MSIPACKAGE
*
package
,
BOOL
*
appFound
,
MSISIGNATURE
*
sig
)
{
...
...
@@ -247,9 +295,6 @@ static UINT ACTION_AppSearchReg(MSIPACKAGE *package, BOOL *appFound,
'R'
,
'e'
,
'g'
,
'L'
,
'o'
,
'c'
,
'a'
,
't'
,
'o'
,
'r'
,
' '
,
'w'
,
'h'
,
'e'
,
'r'
,
'e'
,
' '
,
'S'
,
'i'
,
'g'
,
'n'
,
'a'
,
't'
,
'u'
,
'r'
,
'e'
,
'_'
,
' '
,
'='
,
' '
,
'\''
,
'%'
,
's'
,
'\''
,
0
};
static
const
WCHAR
dwordFmt
[]
=
{
'#'
,
'%'
,
'd'
,
'\0'
};
static
const
WCHAR
expandSzFmt
[]
=
{
'#'
,
'%'
,
'%'
,
'%'
,
's'
,
'\0'
};
static
const
WCHAR
binFmt
[]
=
{
'#'
,
'x'
,
'%'
,
'x'
,
'\0'
};
TRACE
(
"(package %p, appFound %p, sig %p)
\n
"
,
package
,
appFound
,
sig
);
*
appFound
=
FALSE
;
...
...
@@ -260,7 +305,7 @@ static UINT ACTION_AppSearchReg(MSIPACKAGE *package, BOOL *appFound,
LPWSTR
keyPath
=
NULL
,
valueName
=
NULL
,
propertyValue
=
NULL
;
int
root
,
type
;
HKEY
rootKey
,
key
=
NULL
;
DWORD
sz
=
0
,
regType
,
i
;
DWORD
sz
=
0
,
regType
;
LPBYTE
value
=
NULL
;
rc
=
MSI_ViewExecute
(
view
,
0
);
...
...
@@ -342,45 +387,8 @@ static UINT ACTION_AppSearchReg(MSIPACKAGE *package, BOOL *appFound,
rc
=
ERROR_SUCCESS
;
goto
end
;
}
switch
(
regType
)
{
case
REG_SZ
:
if
(
*
(
LPWSTR
)
value
==
'#'
)
{
/* escape leading pound with another */
propertyValue
=
msi_alloc
(
sz
+
sizeof
(
WCHAR
));
propertyValue
[
0
]
=
'#'
;
strcpyW
(
propertyValue
+
1
,
(
LPWSTR
)
value
);
}
else
{
propertyValue
=
msi_alloc
(
sz
);
strcpyW
(
propertyValue
,
(
LPWSTR
)
value
);
}
break
;
case
REG_DWORD
:
/* 7 chars for digits, 1 for NULL, 1 for #, and 1 for sign
* char if needed
*/
propertyValue
=
msi_alloc
(
10
*
sizeof
(
WCHAR
));
sprintfW
(
propertyValue
,
dwordFmt
,
*
(
DWORD
*
)
value
);
break
;
case
REG_EXPAND_SZ
:
/* space for extra #% characters in front */
propertyValue
=
msi_alloc
(
sz
+
2
*
sizeof
(
WCHAR
));
sprintfW
(
propertyValue
,
expandSzFmt
,
(
LPWSTR
)
value
);
break
;
case
REG_BINARY
:
/* 3 == length of "#x<nibble>" */
propertyValue
=
msi_alloc
(
(
sz
*
3
+
1
)
*
sizeof
(
WCHAR
));
for
(
i
=
0
;
i
<
sz
;
i
++
)
sprintfW
(
propertyValue
+
i
*
3
,
binFmt
,
value
[
i
]);
break
;
default:
WARN
(
"unimplemented for values of type %ld
\n
"
,
regType
);
goto
end
;
}
ACTION_ConvertRegValue
(
regType
,
value
,
sz
,
&
propertyValue
);
TRACE
(
"found registry value, setting %s to %s
\n
"
,
debugstr_w
(
sig
->
Property
),
debugstr_w
(
propertyValue
));
...
...
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