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
57092499
Commit
57092499
authored
Sep 01, 2014
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Return an error from MSI_GetComponentPath if the buffer is too small.
parent
04f9058a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
+24
-4
msi.c
dlls/msi/msi.c
+10
-4
msi.c
dlls/msi/tests/msi.c
+14
-0
No files found.
dlls/msi/msi.c
View file @
57092499
...
...
@@ -2865,7 +2865,9 @@ static INSTALLSTATE MSI_GetComponentPath(LPCWSTR szProduct, LPCWSTR szComponent,
if
(
state
==
INSTALLSTATE_LOCAL
&&
!*
path
)
state
=
INSTALLSTATE_NOTUSED
;
msi_strcpy_to_awstring
(
path
,
-
1
,
lpPathBuf
,
pcchBuf
);
if
(
msi_strcpy_to_awstring
(
path
,
-
1
,
lpPathBuf
,
pcchBuf
)
==
ERROR_MORE_DATA
)
state
=
INSTALLSTATE_MOREDATA
;
msi_free
(
path
);
return
state
;
}
...
...
@@ -3379,6 +3381,7 @@ static UINT MSI_ProvideQualifiedComponentEx(LPCWSTR szComponent,
HKEY
hkey
;
DWORD
sz
;
UINT
rc
;
INSTALLSTATE
state
;
rc
=
MSIREG_OpenUserComponentsKey
(
szComponent
,
&
hkey
,
FALSE
);
if
(
rc
!=
ERROR_SUCCESS
)
...
...
@@ -3393,13 +3396,16 @@ static UINT MSI_ProvideQualifiedComponentEx(LPCWSTR szComponent,
MsiDecomposeDescriptorW
(
info
,
product
,
feature
,
component
,
&
sz
);
if
(
!
szProduct
)
rc
=
MSI_GetComponentPath
(
product
,
component
,
lpPathBuf
,
pcchPathBuf
);
state
=
MSI_GetComponentPath
(
product
,
component
,
lpPathBuf
,
pcchPathBuf
);
else
rc
=
MSI_GetComponentPath
(
szProduct
,
component
,
lpPathBuf
,
pcchPathBuf
);
state
=
MSI_GetComponentPath
(
szProduct
,
component
,
lpPathBuf
,
pcchPathBuf
);
msi_free
(
info
);
if
(
rc
!=
INSTALLSTATE_LOCAL
)
if
(
state
==
INSTALLSTATE_MOREDATA
)
return
ERROR_MORE_DATA
;
if
(
state
!=
INSTALLSTATE_LOCAL
)
return
ERROR_FILE_NOT_FOUND
;
return
ERROR_SUCCESS
;
...
...
dlls/msi/tests/msi.c
View file @
57092499
...
...
@@ -3008,6 +3008,13 @@ static void test_MsiGetComponentPath(void)
create_file
(
"C:
\\
imapath"
,
"C:
\\
imapath"
,
11
);
/* file exists */
path
[
0
]
=
'a'
;
size
=
0
;
state
=
MsiGetComponentPathA
(
prodcode
,
component
,
path
,
&
size
);
ok
(
state
==
INSTALLSTATE_MOREDATA
,
"Expected INSTALLSTATE_MOREDATA, got %d
\n
"
,
state
);
ok
(
path
[
0
]
==
'a'
,
"got %s
\n
"
,
path
);
ok
(
size
==
10
,
"Expected 10, got %d
\n
"
,
size
);
path
[
0
]
=
0
;
size
=
MAX_PATH
;
state
=
MsiGetComponentPathA
(
prodcode
,
component
,
path
,
&
size
);
...
...
@@ -3015,6 +3022,13 @@ static void test_MsiGetComponentPath(void)
ok
(
!
lstrcmpA
(
path
,
"C:
\\
imapath"
),
"Expected C:
\\
imapath, got %s
\n
"
,
path
);
ok
(
size
==
10
,
"Expected 10, got %d
\n
"
,
size
);
size
=
0
;
path
[
0
]
=
'a'
;
state
=
MsiLocateComponentA
(
component
,
path
,
&
size
);
ok
(
state
==
INSTALLSTATE_MOREDATA
,
"Expected INSTALLSTATE_MOREDATA, got %d
\n
"
,
state
);
ok
(
path
[
0
]
==
'a'
,
"got %s
\n
"
,
path
);
ok
(
size
==
10
,
"Expected 10, got %d
\n
"
,
size
);
path
[
0
]
=
0
;
size
=
MAX_PATH
;
state
=
MsiLocateComponentA
(
component
,
path
,
&
size
);
...
...
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