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
68d61588
Commit
68d61588
authored
Apr 01, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Implement and test MsiEnumComponentCostsA/W.
parent
f2231f84
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
315 additions
and
15 deletions
+315
-15
action.c
dlls/msi/action.c
+2
-7
msi.c
dlls/msi/msi.c
+92
-7
msi.spec
dlls/msi/msi.spec
+1
-1
msipriv.h
dlls/msi/msipriv.h
+1
-0
package.c
dlls/msi/tests/package.c
+219
-0
No files found.
dlls/msi/action.c
View file @
68d61588
...
...
@@ -2007,10 +2007,7 @@ static UINT load_all_folders( MSIPACKAGE *package )
*/
static
UINT
ACTION_CostInitialize
(
MSIPACKAGE
*
package
)
{
static
const
WCHAR
szCosting
[]
=
{
'C'
,
'o'
,
's'
,
't'
,
'i'
,
'n'
,
'g'
,
'C'
,
'o'
,
'm'
,
'p'
,
'l'
,
'e'
,
't'
,
'e'
,
0
};
msi_set_property
(
package
->
db
,
szCosting
,
szZero
);
msi_set_property
(
package
->
db
,
szCostingComplete
,
szZero
);
msi_set_property
(
package
->
db
,
cszRootDrive
,
c_colon
);
load_all_folders
(
package
);
...
...
@@ -2639,8 +2636,6 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
static
const
WCHAR
ConditionQuery
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'C'
,
'o'
,
'n'
,
'd'
,
'i'
,
't'
,
'i'
,
'o'
,
'n'
,
'`'
,
0
};
static
const
WCHAR
szCosting
[]
=
{
'C'
,
'o'
,
's'
,
't'
,
'i'
,
'n'
,
'g'
,
'C'
,
'o'
,
'm'
,
'p'
,
'l'
,
'e'
,
't'
,
'e'
,
0
};
static
const
WCHAR
szlevel
[]
=
{
'I'
,
'N'
,
'S'
,
'T'
,
'A'
,
'L'
,
'L'
,
'L'
,
'E'
,
'V'
,
'E'
,
'L'
,
0
};
static
const
WCHAR
szOutOfDiskSpace
[]
=
...
...
@@ -2691,7 +2686,7 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
TRACE
(
"Calculating file cost
\n
"
);
calculate_file_cost
(
package
);
msi_set_property
(
package
->
db
,
szCosting
,
szOne
);
msi_set_property
(
package
->
db
,
szCosting
Complete
,
szOne
);
/* set default run level if not set */
level
=
msi_dup_property
(
package
->
db
,
szlevel
);
if
(
!
level
)
...
...
dlls/msi/msi.c
View file @
68d61588
...
...
@@ -1794,16 +1794,101 @@ UINT WINAPI MsiEnableLogW(DWORD dwLogMode, LPCWSTR szLogFile, DWORD attributes)
return
ERROR_SUCCESS
;
}
UINT
WINAPI
MsiEnumComponentCostsW
(
MSIHANDLE
hInstall
,
LPCWSTR
szComponent
,
DWORD
dwIndex
,
INSTALLSTATE
iState
,
LPWSTR
lpDriveBuf
,
DWORD
*
pcchDriveBuf
,
int
*
piCost
,
int
*
pTempCost
)
UINT
WINAPI
MsiEnumComponentCostsA
(
MSIHANDLE
handle
,
LPCSTR
component
,
DWORD
index
,
INSTALLSTATE
state
,
LPSTR
drive
,
DWORD
*
buflen
,
int
*
cost
,
int
*
temp
)
{
FIXME
(
"(%d, %s, %d, %d, %p, %p, %p %p): stub!
\n
"
,
hInstall
,
debugstr_w
(
szComponent
),
dwIndex
,
iState
,
lpDriveBuf
,
pcchDriveBuf
,
piCost
,
pTempCost
);
UINT
r
;
DWORD
len
;
WCHAR
*
driveW
,
*
componentW
=
NULL
;
TRACE
(
"%d, %s, %u, %d, %p, %p, %p %p
\n
"
,
handle
,
debugstr_a
(
component
),
index
,
state
,
drive
,
buflen
,
cost
,
temp
);
if
(
!
drive
||
!
buflen
)
return
ERROR_INVALID_PARAMETER
;
if
(
component
&&
!
(
componentW
=
strdupAtoW
(
component
)))
return
ERROR_OUTOFMEMORY
;
len
=
*
buflen
;
if
(
!
(
driveW
=
msi_alloc
(
len
*
sizeof
(
WCHAR
)
)))
{
msi_free
(
componentW
);
return
ERROR_OUTOFMEMORY
;
}
r
=
MsiEnumComponentCostsW
(
handle
,
componentW
,
index
,
state
,
driveW
,
buflen
,
cost
,
temp
);
if
(
!
r
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
driveW
,
-
1
,
drive
,
len
,
NULL
,
NULL
);
}
msi_free
(
componentW
);
msi_free
(
driveW
);
return
r
;
}
UINT
WINAPI
MsiEnumComponentCostsW
(
MSIHANDLE
handle
,
LPCWSTR
component
,
DWORD
index
,
INSTALLSTATE
state
,
LPWSTR
drive
,
DWORD
*
buflen
,
int
*
cost
,
int
*
temp
)
{
UINT
r
=
ERROR_NO_MORE_ITEMS
;
MSICOMPONENT
*
comp
=
NULL
;
MSIPACKAGE
*
package
;
MSIFILE
*
file
;
STATSTG
stat
=
{
0
};
WCHAR
path
[
MAX_PATH
];
TRACE
(
"%d, %s, %u, %d, %p, %p, %p %p
\n
"
,
handle
,
debugstr_w
(
component
),
index
,
state
,
drive
,
buflen
,
cost
,
temp
);
if
(
!
drive
||
!
buflen
||
!
cost
||
!
temp
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
(
package
=
msihandle2msiinfo
(
handle
,
MSIHANDLETYPE_PACKAGE
)))
return
ERROR_INVALID_HANDLE
;
if
(
!
msi_get_property_int
(
package
->
db
,
szCostingComplete
,
0
))
{
msiobj_release
(
&
package
->
hdr
);
return
ERROR_FUNCTION_NOT_CALLED
;
}
if
(
component
&&
component
[
0
]
&&
!
(
comp
=
get_loaded_component
(
package
,
component
)))
{
msiobj_release
(
&
package
->
hdr
);
return
ERROR_UNKNOWN_COMPONENT
;
}
if
(
*
buflen
<
3
)
{
*
buflen
=
2
;
msiobj_release
(
&
package
->
hdr
);
return
ERROR_MORE_DATA
;
}
if
(
index
)
{
msiobj_release
(
&
package
->
hdr
);
return
ERROR_NO_MORE_ITEMS
;
}
drive
[
0
]
=
0
;
*
cost
=
*
temp
=
0
;
if
(
component
&&
component
[
0
])
{
*
cost
=
max
(
8
,
comp
->
Cost
/
512
);
if
(
comp
->
assembly
&&
!
comp
->
assembly
->
application
)
*
temp
=
comp
->
Cost
;
if
((
file
=
get_loaded_file
(
package
,
comp
->
KeyPath
)))
{
drive
[
0
]
=
file
->
TargetPath
[
0
];
drive
[
1
]
=
':'
;
drive
[
2
]
=
0
;
*
buflen
=
2
;
r
=
ERROR_SUCCESS
;
}
}
else
if
(
IStorage_Stat
(
package
->
db
->
storage
,
&
stat
,
STATFLAG_NONAME
)
==
S_OK
)
{
*
temp
=
max
(
8
,
stat
.
cbSize
.
QuadPart
/
512
);
GetWindowsDirectoryW
(
path
,
MAX_PATH
);
drive
[
0
]
=
path
[
0
];
drive
[
1
]
=
':'
;
drive
[
2
]
=
0
;
*
buflen
=
2
;
r
=
ERROR_SUCCESS
;
}
msiobj_release
(
&
package
->
hdr
);
return
r
;
}
UINT
WINAPI
MsiQueryComponentStateA
(
LPCSTR
szProductCode
,
...
...
dlls/msi/msi.spec
View file @
68d61588
...
...
@@ -213,7 +213,7 @@
217 stdcall MsiGetShortcutTargetW(wstr ptr ptr ptr)
218 stdcall MsiGetFileHashA(str long ptr)
219 stdcall MsiGetFileHashW(wstr long ptr)
220 st
ub MsiEnumComponentCostsA
220 st
dcall MsiEnumComponentCostsA(long str long long ptr ptr ptr ptr)
221 stdcall MsiEnumComponentCostsW(long wstr long long ptr ptr ptr ptr)
222 stdcall MsiCreateAndVerifyInstallerDirectory(long)
223 stdcall MsiGetFileSignatureInformationA(str long ptr ptr ptr)
...
...
dlls/msi/msipriv.h
View file @
68d61588
...
...
@@ -1108,6 +1108,7 @@ static const WCHAR szWow6432Node[] = {'W','o','w','6','4','3','2','N','o','d','e
static
const
WCHAR
szStreams
[]
=
{
'_'
,
'S'
,
't'
,
'r'
,
'e'
,
'a'
,
'm'
,
's'
,
0
};
static
const
WCHAR
szStorages
[]
=
{
'_'
,
'S'
,
't'
,
'o'
,
'r'
,
'a'
,
'g'
,
'e'
,
's'
,
0
};
static
const
WCHAR
szMsiPublishAssemblies
[]
=
{
'M'
,
's'
,
'i'
,
'P'
,
'u'
,
'b'
,
'l'
,
'i'
,
's'
,
'h'
,
'A'
,
's'
,
's'
,
'e'
,
'm'
,
'b'
,
'l'
,
'i'
,
'e'
,
's'
,
0
};
static
const
WCHAR
szCostingComplete
[]
=
{
'C'
,
'o'
,
's'
,
't'
,
'i'
,
'n'
,
'g'
,
'C'
,
'o'
,
'm'
,
'p'
,
'l'
,
'e'
,
't'
,
'e'
,
0
};
/* memory allocation macro functions */
static
void
*
msi_alloc
(
size_t
len
)
__WINE_ALLOC_SIZE
(
1
);
...
...
dlls/msi/tests/package.c
View file @
68d61588
This diff is collapsed.
Click to expand it.
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