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
63098924
Commit
63098924
authored
Jun 02, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Jun 02, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create a helper function to fetch a single record from a query.
parent
9ffac609
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
25 deletions
+42
-25
dialog.c
dlls/msi/dialog.c
+3
-20
msipriv.h
dlls/msi/msipriv.h
+1
-0
msiquery.c
dlls/msi/msiquery.c
+38
-5
No files found.
dlls/msi/dialog.c
View file @
63098924
...
...
@@ -341,20 +341,12 @@ static LPWSTR msi_get_checkbox_value( msi_dialog *dialog, LPCWSTR prop )
'`'
,
'P'
,
'r'
,
'o'
,
'p'
,
'e'
,
'r'
,
't'
,
'y'
,
'`'
,
' '
,
'='
,
' '
,
'\''
,
'%'
,
's'
,
'\''
,
0
};
MSIQUERY
*
view
=
NULL
;
MSIRECORD
*
rec
=
NULL
;
LPCWSTR
val
=
NULL
;
LPWSTR
ret
=
NULL
;
UINT
r
;
/* find if there is a value associated with the checkbox */
r
=
MSI_OpenQuery
(
dialog
->
package
->
db
,
&
view
,
query
,
prop
);
if
(
r
!=
ERROR_SUCCESS
)
return
ret
;
MSI_ViewExecute
(
view
,
NULL
);
MSI_ViewFetch
(
view
,
&
rec
);
MSI_ViewClose
(
view
);
msiobj_release
(
&
view
->
hdr
);
rec
=
MSI_QueryGetRecord
(
dialog
->
package
->
db
,
query
,
prop
);
if
(
!
rec
)
return
ret
;
...
...
@@ -802,22 +794,13 @@ static MSIRECORD *msi_get_dialog_record( msi_dialog *dialog )
'W'
,
'H'
,
'E'
,
'R'
,
'E'
,
' '
,
'`'
,
'D'
,
'i'
,
'a'
,
'l'
,
'o'
,
'g'
,
'`'
,
' '
,
'='
,
' '
,
'\''
,
'%'
,
's'
,
'\''
,
0
};
MSIPACKAGE
*
package
=
dialog
->
package
;
MSIQUERY
*
view
=
NULL
;
MSIRECORD
*
rec
=
NULL
;
UINT
r
;
TRACE
(
"%p %s
\n
"
,
dialog
,
debugstr_w
(
dialog
->
name
)
);
r
=
MSI_OpenQuery
(
package
->
db
,
&
view
,
query
,
dialog
->
name
);
if
(
r
!=
ERROR_SUCCESS
)
{
rec
=
MSI_QueryGetRecord
(
package
->
db
,
query
,
dialog
->
name
);
if
(
!
rec
)
ERR
(
"query failed for dialog %s
\n
"
,
debugstr_w
(
dialog
->
name
));
return
NULL
;
}
MSI_ViewExecute
(
view
,
NULL
);
MSI_ViewFetch
(
view
,
&
rec
);
MSI_ViewClose
(
view
);
msiobj_release
(
&
view
->
hdr
);
return
rec
;
}
...
...
dlls/msi/msipriv.h
View file @
63098924
...
...
@@ -340,6 +340,7 @@ extern UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY ** );
extern
UINT
MSI_OpenQuery
(
MSIDATABASE
*
,
MSIQUERY
**
,
LPCWSTR
,
...
);
typedef
UINT
(
*
record_func
)(
MSIRECORD
*
,
LPVOID
);
extern
UINT
MSI_IterateRecords
(
MSIQUERY
*
,
DWORD
*
,
record_func
,
LPVOID
);
extern
MSIRECORD
*
MSI_QueryGetRecord
(
MSIDATABASE
*
db
,
LPCWSTR
query
,
...
);
extern
UINT
MSI_DatabaseImport
(
MSIDATABASE
*
,
LPCWSTR
,
LPCWSTR
);
extern
UINT
MSI_DatabaseExport
(
MSIDATABASE
*
,
LPCWSTR
,
LPCWSTR
,
LPCWSTR
);
extern
UINT
MSI_DatabaseGetPrimaryKeys
(
MSIDATABASE
*
,
LPCWSTR
,
MSIRECORD
**
);
...
...
dlls/msi/msiquery.c
View file @
63098924
...
...
@@ -139,7 +139,8 @@ UINT MSI_DatabaseOpenViewW(MSIDATABASE *db,
return
r
;
}
UINT
MSI_OpenQuery
(
MSIDATABASE
*
db
,
MSIQUERY
**
view
,
LPCWSTR
fmt
,
...
)
static
UINT
MSI_OpenQueryV
(
MSIDATABASE
*
db
,
MSIQUERY
**
view
,
LPCWSTR
fmt
,
va_list
args
)
{
LPWSTR
szQuery
;
LPCWSTR
p
;
...
...
@@ -147,7 +148,7 @@ UINT MSI_OpenQuery( MSIDATABASE *db, MSIQUERY **view, LPCWSTR fmt, ... )
va_list
va
;
/* figure out how much space we need to allocate */
va
_start
(
va
,
fmt
)
;
va
=
args
;
sz
=
lstrlenW
(
fmt
)
+
1
;
p
=
fmt
;
while
(
*
p
)
...
...
@@ -173,13 +174,11 @@ UINT MSI_OpenQuery( MSIDATABASE *db, MSIQUERY **view, LPCWSTR fmt, ... )
}
p
++
;
}
va_end
(
va
);
/* construct the string */
szQuery
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
*
sizeof
(
WCHAR
));
va
_start
(
va
,
fmt
)
;
va
=
args
;
vsnprintfW
(
szQuery
,
sz
,
fmt
,
va
);
va_end
(
va
);
/* perform the query */
rc
=
MSI_DatabaseOpenViewW
(
db
,
szQuery
,
view
);
...
...
@@ -187,6 +186,18 @@ UINT MSI_OpenQuery( MSIDATABASE *db, MSIQUERY **view, LPCWSTR fmt, ... )
return
rc
;
}
UINT
MSI_OpenQuery
(
MSIDATABASE
*
db
,
MSIQUERY
**
view
,
LPCWSTR
fmt
,
...
)
{
UINT
r
;
va_list
va
;
va_start
(
va
,
fmt
);
r
=
MSI_OpenQueryV
(
db
,
view
,
fmt
,
va
);
va_end
(
va
);
return
r
;
}
UINT
MSI_IterateRecords
(
MSIQUERY
*
view
,
DWORD
*
count
,
record_func
func
,
LPVOID
param
)
{
...
...
@@ -223,6 +234,28 @@ UINT MSI_IterateRecords( MSIQUERY *view, DWORD *count,
return
r
;
}
/* return a single record from a query */
MSIRECORD
*
MSI_QueryGetRecord
(
MSIDATABASE
*
db
,
LPCWSTR
fmt
,
...
)
{
MSIRECORD
*
rec
=
NULL
;
MSIQUERY
*
view
=
NULL
;
UINT
r
;
va_list
va
;
va_start
(
va
,
fmt
);
r
=
MSI_OpenQueryV
(
db
,
&
view
,
fmt
,
va
);
va_end
(
va
);
if
(
r
==
ERROR_SUCCESS
)
{
MSI_ViewExecute
(
view
,
NULL
);
MSI_ViewFetch
(
view
,
&
rec
);
MSI_ViewClose
(
view
);
msiobj_release
(
&
view
->
hdr
);
}
return
rec
;
}
UINT
WINAPI
MsiDatabaseOpenViewW
(
MSIHANDLE
hdb
,
LPCWSTR
szQuery
,
MSIHANDLE
*
phView
)
{
...
...
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