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
f12b9cea
Commit
f12b9cea
authored
Nov 03, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Nov 04, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Factor out the table insertion code.
parent
2abb8bba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
86 deletions
+35
-86
format.c
dlls/msi/tests/format.c
+35
-86
No files found.
dlls/msi/tests/format.c
View file @
f12b9cea
...
...
@@ -108,97 +108,46 @@ static UINT create_custom_action_table( MSIHANDLE hdb )
"PRIMARY KEY `Action`)"
);
}
static
UINT
add_feature_entry
(
MSIHANDLE
hdb
,
const
char
*
values
)
{
char
insert
[]
=
"INSERT INTO `Feature` (`Feature`, `Feature_Parent`, "
"`Title`, `Description`, `Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )"
;
char
*
query
;
UINT
sz
,
r
;
sz
=
strlen
(
values
)
+
sizeof
insert
;
query
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
);
sprintf
(
query
,
insert
,
values
);
r
=
run_query
(
hdb
,
query
);
HeapFree
(
GetProcessHeap
(),
0
,
query
);
return
r
;
}
#define make_add_entry(type, qtext) \
static UINT add##_##type##_##entry( MSIHANDLE hdb, const char *values ) \
{ \
char insert[] = qtext; \
char *query; \
UINT sz, r; \
sz = strlen(values) + sizeof insert; \
query = HeapAlloc(GetProcessHeap(),0,sz); \
sprintf(query,insert,values); \
r = run_query( hdb, query ); \
HeapFree(GetProcessHeap(), 0, query); \
return r; \
}
static
UINT
add_component_entry
(
MSIHANDLE
hdb
,
const
char
*
values
)
{
char
insert
[]
=
"INSERT INTO `Component` "
"(`Component`, `ComponentId`, `Directory_`, `Attributes`, `Condition`, `KeyPath`) "
"VALUES( %s )"
;
char
*
query
;
UINT
sz
,
r
;
sz
=
strlen
(
values
)
+
sizeof
insert
;
query
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
);
sprintf
(
query
,
insert
,
values
);
r
=
run_query
(
hdb
,
query
);
HeapFree
(
GetProcessHeap
(),
0
,
query
);
return
r
;
}
make_add_entry
(
feature
,
"INSERT INTO `Feature` "
"(`Feature`, `Feature_Parent`, `Title`, `Description`, "
"`Display`, `Level`, `Directory_`, `Attributes`) VALUES( %s )"
)
static
UINT
add_feature_components_entry
(
MSIHANDLE
hdb
,
const
char
*
values
)
{
char
insert
[]
=
"INSERT INTO `FeatureComponents` "
"(`Feature_`, `Component_`) "
"VALUES( %s )"
;
char
*
query
;
UINT
sz
,
r
;
sz
=
strlen
(
values
)
+
sizeof
insert
;
query
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
);
sprintf
(
query
,
insert
,
values
);
r
=
run_query
(
hdb
,
query
);
HeapFree
(
GetProcessHeap
(),
0
,
query
);
return
r
;
}
make_add_entry
(
component
,
"INSERT INTO `Component` "
"(`Component`, `ComponentId`, `Directory_`, "
"`Attributes`, `Condition`, `KeyPath`) VALUES( %s )"
)
static
UINT
add_file_entry
(
MSIHANDLE
hdb
,
const
char
*
values
)
{
char
insert
[]
=
"INSERT INTO `File` "
"(`File`, `Component_`, `FileName`, `FileSize`, `Version`, `Language`, `Attributes`, `Sequence`) "
"VALUES( %s )"
;
char
*
query
;
UINT
sz
,
r
;
sz
=
strlen
(
values
)
+
sizeof
insert
;
query
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
);
sprintf
(
query
,
insert
,
values
);
r
=
run_query
(
hdb
,
query
);
HeapFree
(
GetProcessHeap
(),
0
,
query
);
return
r
;
}
make_add_entry
(
feature_components
,
"INSERT INTO `FeatureComponents` "
"(`Feature_`, `Component_`) VALUES( %s )"
)
static
UINT
add_directory_entry
(
MSIHANDLE
hdb
,
const
char
*
values
)
{
char
insert
[]
=
"INSERT INTO `Directory` (`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )"
;
char
*
query
;
UINT
sz
,
r
;
sz
=
strlen
(
values
)
+
sizeof
insert
;
query
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
);
sprintf
(
query
,
insert
,
values
);
r
=
run_query
(
hdb
,
query
);
HeapFree
(
GetProcessHeap
(),
0
,
query
);
return
r
;
}
make_add_entry
(
file
,
"INSERT INTO `File` "
"(`File`, `Component_`, `FileName`, `FileSize`, "
"`Version`, `Language`, `Attributes`, `Sequence`) VALUES( %s )"
)
static
UINT
add_custom_action_entry
(
MSIHANDLE
hdb
,
const
char
*
values
)
{
char
insert
[]
=
"INSERT INTO `CustomAction` (`Action`, `Type`, `Source`, "
"`Target`) VALUES( %s )"
;
char
*
query
;
UINT
sz
,
r
;
sz
=
strlen
(
values
)
+
sizeof
insert
;
query
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
);
sprintf
(
query
,
insert
,
values
);
r
=
run_query
(
hdb
,
query
);
HeapFree
(
GetProcessHeap
(),
0
,
query
);
return
r
;
}
make_add_entry
(
directory
,
"INSERT INTO `Directory` "
"(`Directory`,`Directory_Parent`,`DefaultDir`) VALUES( %s )"
)
make_add_entry
(
custom_action
,
"INSERT INTO `CustomAction` "
"(`Action`, `Type`, `Source`, `Target`) VALUES( %s )"
)
static
UINT
set_summary_info
(
MSIHANDLE
hdb
)
{
...
...
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