Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
54ab47ef
Commit
54ab47ef
authored
Nov 27, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Nov 27, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Use MSI_QueryGetRecord in ACTION_AppSearchReg.
parent
fa6bc9e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
118 deletions
+91
-118
appsearch.c
dlls/msi/appsearch.c
+91
-118
No files found.
dlls/msi/appsearch.c
View file @
54ab47ef
...
@@ -235,139 +235,112 @@ static void ACTION_ConvertRegValue(DWORD regType, const BYTE *value, DWORD sz,
...
@@ -235,139 +235,112 @@ static void ACTION_ConvertRegValue(DWORD regType, const BYTE *value, DWORD sz,
static
UINT
ACTION_SearchDirectory
(
MSIPACKAGE
*
package
,
MSISIGNATURE
*
sig
,
static
UINT
ACTION_SearchDirectory
(
MSIPACKAGE
*
package
,
MSISIGNATURE
*
sig
,
LPCWSTR
path
,
int
depth
,
LPWSTR
*
appValue
);
LPCWSTR
path
,
int
depth
,
LPWSTR
*
appValue
);
static
UINT
ACTION_AppSearchReg
(
MSIPACKAGE
*
package
,
LPWSTR
*
appValue
,
static
UINT
ACTION_AppSearchReg
(
MSIPACKAGE
*
package
,
LPWSTR
*
appValue
,
MSISIGNATURE
*
sig
)
MSISIGNATURE
*
sig
)
{
{
MSIQUERY
*
view
;
static
const
WCHAR
query
[]
=
{
's'
,
'e'
,
'l'
,
'e'
,
'c'
,
't'
,
' '
,
'*'
,
' '
,
'f'
,
'r'
,
'o'
,
'm'
,
' '
,
'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
};
LPWSTR
keyPath
=
NULL
,
valueName
=
NULL
;
int
root
,
type
;
HKEY
rootKey
,
key
=
NULL
;
DWORD
sz
=
0
,
regType
;
LPBYTE
value
=
NULL
;
MSIRECORD
*
row
;
UINT
rc
;
UINT
rc
;
static
const
WCHAR
ExecSeqQuery
[]
=
{
's'
,
'e'
,
'l'
,
'e'
,
'c'
,
't'
,
' '
,
'*'
,
' '
,
'f'
,
'r'
,
'o'
,
'm'
,
' '
,
'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
};
TRACE
(
"(package %p, appValue %p, sig %p)
\n
"
,
package
,
appValue
,
sig
);
TRACE
(
"%s
\n
"
,
debugstr_w
(
sig
->
Name
));
*
appValue
=
NULL
;
*
appValue
=
NULL
;
rc
=
MSI_OpenQuery
(
package
->
db
,
&
view
,
ExecSeqQuery
,
sig
->
Name
);
if
(
rc
==
ERROR_SUCCESS
)
row
=
MSI_QueryGetRecord
(
package
->
db
,
query
,
sig
->
Name
);
if
(
!
row
)
{
{
MSIRECORD
*
row
=
0
;
TRACE
(
"failed to query RegLocator for %s
\n
"
,
debugstr_w
(
sig
->
Name
));
LPWSTR
keyPath
=
NULL
,
valueName
=
NULL
;
return
ERROR_SUCCESS
;
int
root
,
type
;
}
HKEY
rootKey
,
key
=
NULL
;
DWORD
sz
=
0
,
regType
;
LPBYTE
value
=
NULL
;
rc
=
MSI_ViewExecute
(
view
,
0
);
root
=
MSI_RecordGetInteger
(
row
,
2
);
if
(
rc
!=
ERROR_SUCCESS
)
keyPath
=
msi_dup_record_field
(
row
,
3
);
{
/* FIXME: keyPath needs to be expanded for properties */
TRACE
(
"MSI_ViewExecute returned %d
\n
"
,
rc
);
valueName
=
msi_dup_record_field
(
row
,
4
);
goto
end
;
/* FIXME: valueName probably does too */
}
type
=
MSI_RecordGetInteger
(
row
,
5
);
rc
=
MSI_ViewFetch
(
view
,
&
row
);
if
(
rc
!=
ERROR_SUCCESS
)
{
TRACE
(
"MSI_ViewFetch returned %d
\n
"
,
rc
);
rc
=
ERROR_SUCCESS
;
goto
end
;
}
root
=
MSI_RecordGetInteger
(
row
,
2
);
switch
(
root
)
keyPath
=
msi_dup_record_field
(
row
,
3
);
{
/* FIXME: keyPath needs to be expanded for properties */
case
msidbRegistryRootClassesRoot
:
valueName
=
msi_dup_record_field
(
row
,
4
);
rootKey
=
HKEY_CLASSES_ROOT
;
/* FIXME: valueName probably does too */
break
;
type
=
MSI_RecordGetInteger
(
row
,
5
);
case
msidbRegistryRootCurrentUser
:
rootKey
=
HKEY_CURRENT_USER
;
break
;
case
msidbRegistryRootLocalMachine
:
rootKey
=
HKEY_LOCAL_MACHINE
;
break
;
case
msidbRegistryRootUsers
:
rootKey
=
HKEY_USERS
;
break
;
default:
WARN
(
"Unknown root key %d
\n
"
,
root
);
goto
end
;
}
switch
(
root
)
rc
=
RegOpenKeyW
(
rootKey
,
keyPath
,
&
key
);
{
if
(
rc
)
case
msidbRegistryRootClassesRoot
:
{
rootKey
=
HKEY_CLASSES_ROOT
;
TRACE
(
"RegOpenKeyW returned %d
\n
"
,
rc
);
break
;
goto
end
;
case
msidbRegistryRootCurrentUser
:
}
rootKey
=
HKEY_CURRENT_USER
;
break
;
case
msidbRegistryRootLocalMachine
:
rootKey
=
HKEY_LOCAL_MACHINE
;
break
;
case
msidbRegistryRootUsers
:
rootKey
=
HKEY_USERS
;
break
;
default:
WARN
(
"Unknown root key %d
\n
"
,
root
);
goto
end
;
}
rc
=
RegOpenKeyW
(
rootKey
,
keyPath
,
&
key
);
rc
=
RegQueryValueExW
(
key
,
valueName
,
NULL
,
NULL
,
NULL
,
&
sz
);
if
(
rc
)
if
(
rc
)
{
{
TRACE
(
"RegOpenKeyW returned %d
\n
"
,
rc
);
TRACE
(
"RegQueryValueExW returned %d
\n
"
,
rc
);
rc
=
ERROR_SUCCESS
;
goto
end
;
goto
end
;
}
}
/* FIXME: sanity-check sz before allocating (is there an upper-limit
rc
=
RegQueryValueExW
(
key
,
valueName
,
NULL
,
NULL
,
NULL
,
&
sz
);
* on the value of a property?)
if
(
rc
)
*/
{
value
=
msi_alloc
(
sz
);
TRACE
(
"RegQueryValueExW returned %d
\n
"
,
rc
);
rc
=
RegQueryValueExW
(
key
,
valueName
,
NULL
,
&
regType
,
value
,
&
sz
);
rc
=
ERROR_SUCCESS
;
if
(
rc
)
goto
end
;
{
}
TRACE
(
"RegQueryValueExW returned %d
\n
"
,
rc
);
/* FIXME: sanity-check sz before allocating (is there an upper-limit
goto
end
;
* on the value of a property?)
}
*/
value
=
msi_alloc
(
sz
);
rc
=
RegQueryValueExW
(
key
,
valueName
,
NULL
,
&
regType
,
value
,
&
sz
);
if
(
rc
)
{
TRACE
(
"RegQueryValueExW returned %d
\n
"
,
rc
);
rc
=
ERROR_SUCCESS
;
goto
end
;
}
/* bail out if the registry key is empty */
/* bail out if the registry key is empty */
if
(
sz
==
0
)
if
(
sz
==
0
)
{
goto
end
;
rc
=
ERROR_SUCCESS
;
goto
end
;
}
switch
(
type
&
0x0f
)
switch
(
type
&
0x0f
)
{
{
case
msidbLocatorTypeDirectory
:
case
msidbLocatorTypeDirectory
:
rc
=
ACTION_SearchDirectory
(
package
,
sig
,
(
LPCWSTR
)
value
,
0
,
rc
=
ACTION_SearchDirectory
(
package
,
sig
,
(
LPWSTR
)
value
,
0
,
appValue
);
appValue
);
break
;
break
;
case
msidbLocatorTypeFileName
:
case
msidbLocatorTypeFileName
:
*
appValue
=
strdupW
((
LPWSTR
)
value
);
*
appValue
=
strdupW
((
LPCWSTR
)
value
);
break
;
break
;
case
msidbLocatorTypeRawValue
:
case
msidbLocatorTypeRawValue
:
ACTION_ConvertRegValue
(
regType
,
value
,
sz
,
appValue
);
ACTION_ConvertRegValue
(
regType
,
value
,
sz
,
appValue
);
break
;
break
;
default:
default:
FIXME
(
"AppSearch unimplemented for type %d (key path %s, value %s)
\n
"
,
FIXME
(
"AppSearch unimplemented for type %d (key path %s, value %s)
\n
"
,
type
,
debugstr_w
(
keyPath
),
debugstr_w
(
valueName
));
type
,
debugstr_w
(
keyPath
),
debugstr_w
(
valueName
));
}
}
end:
end:
msi_free
(
value
);
msi_free
(
value
);
RegCloseKey
(
key
);
RegCloseKey
(
key
);
msi_free
(
keyPath
);
msi_free
(
keyPath
);
msi_free
(
valueName
);
msi_free
(
valueName
);
if
(
row
)
msiobj_release
(
&
row
->
hdr
);
msiobj_release
(
&
row
->
hdr
);
MSI_ViewClose
(
view
);
msiobj_release
(
&
view
->
hdr
);
}
else
{
TRACE
(
"MSI_OpenQuery returned %d
\n
"
,
rc
);
rc
=
ERROR_SUCCESS
;
}
TRACE
(
"returning %d
\n
"
,
rc
);
return
ERROR_SUCCESS
;
return
rc
;
}
}
static
UINT
ACTION_AppSearchIni
(
MSIPACKAGE
*
package
,
LPWSTR
*
appValue
,
static
UINT
ACTION_AppSearchIni
(
MSIPACKAGE
*
package
,
LPWSTR
*
appValue
,
...
...
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