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
fa5cbb5a
Commit
fa5cbb5a
authored
Feb 16, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Feb 16, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MsiGetComponentPath should allow null pointers for pcchBuf and
lpPathBuf.
parent
dc524986
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
12 deletions
+35
-12
msi.c
dlls/msi/msi.c
+35
-12
No files found.
dlls/msi/msi.c
View file @
fa5cbb5a
...
@@ -1340,41 +1340,64 @@ INSTALLSTATE WINAPI MsiGetComponentPathW(LPCWSTR szProduct, LPCWSTR szComponent,
...
@@ -1340,41 +1340,64 @@ INSTALLSTATE WINAPI MsiGetComponentPathW(LPCWSTR szProduct, LPCWSTR szComponent,
WCHAR
squished_pc
[
GUID_SIZE
];
WCHAR
squished_pc
[
GUID_SIZE
];
UINT
rc
;
UINT
rc
;
INSTALLSTATE
rrc
=
INSTALLSTATE_UNKNOWN
;
INSTALLSTATE
rrc
=
INSTALLSTATE_UNKNOWN
;
HKEY
hkey
=
0
;
HKEY
hkey
=
0
;
LPWSTR
path
=
NULL
;
DWORD
sz
,
type
;
TRACE
(
"%s %s %p %p
\n
"
,
debugstr_w
(
szProduct
),
TRACE
(
"%s %s %p %p
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
szComponent
),
lpPathBuf
,
pcchBuf
);
debugstr_w
(
szComponent
),
lpPathBuf
,
pcchBuf
);
if
(
lpPathBuf
&&
!
pcchBuf
)
return
INSTALLSTATE_INVALIDARG
;
squash_guid
(
szProduct
,
squished_pc
);
squash_guid
(
szProduct
,
squished_pc
);
rc
=
MSIREG_OpenProductsKey
(
szProduct
,
&
hkey
,
FALSE
);
rc
=
MSIREG_OpenProductsKey
(
szProduct
,
&
hkey
,
FALSE
);
if
(
rc
!=
ERROR_SUCCESS
)
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
goto
end
;
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
rc
=
MSIREG_OpenComponentsKey
(
szComponent
,
&
hkey
,
FALSE
);
rc
=
MSIREG_OpenComponentsKey
(
szComponent
,
&
hkey
,
FALSE
);
if
(
rc
!=
ERROR_SUCCESS
)
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
goto
end
;
*
pcchBuf
*=
sizeof
(
WCHAR
);
sz
=
0
;
rc
=
RegQueryValueExW
(
hkey
,
squished_pc
,
NULL
,
NULL
,(
LPVOID
)
lpPathBuf
,
type
=
0
;
pcchBuf
);
rc
=
RegQueryValueExW
(
hkey
,
squished_pc
,
NULL
,
&
type
,
NULL
,
&
sz
);
*
pcchBuf
/=
sizeof
(
WCHAR
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
if
(
type
!=
REG_SZ
)
goto
end
;
if
(
rc
!=
ERROR_SUCCESS
)
sz
+=
sizeof
(
WCHAR
);
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
);
if
(
!
path
)
goto
end
;
rc
=
RegQueryValueExW
(
hkey
,
squished_pc
,
NULL
,
NULL
,
(
LPVOID
)
path
,
&
sz
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
goto
end
;
TRACE
(
"found path of (%s:%s)(%s)
\n
"
,
debugstr_w
(
szComponent
),
TRACE
(
"found path of (%s:%s)(%s)
\n
"
,
debugstr_w
(
szComponent
),
debugstr_w
(
szProduct
),
debugstr_w
(
lpPathBuf
));
debugstr_w
(
szProduct
),
debugstr_w
(
path
));
FIXME
(
"Only working for installed files, not registry keys
\n
"
);
FIXME
(
"Only working for installed files, not registry keys
\n
"
);
if
(
GetFileAttributesW
(
lpPathBuf
)
!=
INVALID_FILE_ATTRIBUTES
)
if
(
GetFileAttributesW
(
path
)
!=
INVALID_FILE_ATTRIBUTES
)
rrc
=
INSTALLSTATE_LOCAL
;
rrc
=
INSTALLSTATE_LOCAL
;
else
else
rrc
=
INSTALLSTATE_ABSENT
;
rrc
=
INSTALLSTATE_ABSENT
;
if
(
pcchBuf
)
{
sz
=
sz
/
sizeof
(
WCHAR
);
if
(
*
pcchBuf
>=
sz
)
strcpyW
(
lpPathBuf
,
path
);
*
pcchBuf
=
sz
;
}
end:
end:
HeapFree
(
GetProcessHeap
(),
0
,
path
);
RegCloseKey
(
hkey
);
RegCloseKey
(
hkey
);
return
rrc
;
return
rrc
;
}
}
...
...
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