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
65f99ed9
Commit
65f99ed9
authored
Mar 12, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Mar 13, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Test and fix MsiSourceListAddSource.
parent
52f6a33a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
288 additions
and
7 deletions
+288
-7
source.c
dlls/msi/source.c
+39
-7
source.c
dlls/msi/tests/source.c
+249
-0
No files found.
dlls/msi/source.c
View file @
65f99ed9
...
...
@@ -850,25 +850,57 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
UINT
WINAPI
MsiSourceListAddSourceW
(
LPCWSTR
szProduct
,
LPCWSTR
szUserName
,
DWORD
dwReserved
,
LPCWSTR
szSource
)
{
WCHAR
squished_pc
[
GUID_SIZE
];
INT
ret
;
LPWSTR
sidstr
=
NULL
;
DWORD
sidsize
=
0
;
DWORD
domsize
=
0
;
DWORD
context
;
HKEY
hkey
=
0
;
UINT
r
;
TRACE
(
"%s %s %s
\n
"
,
debugstr_w
(
szProduct
),
debugstr_w
(
szUserName
),
debugstr_w
(
szSource
));
if
(
LookupAccountNameW
(
NULL
,
szUserName
,
NULL
,
&
sidsize
,
NULL
,
&
domsize
,
NULL
))
if
(
!
szSource
||
!*
szSource
)
return
ERROR_INVALID_PARAMETER
;
if
(
dwReserved
!=
0
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
szProduct
||
!
squash_guid
(
szProduct
,
squished_pc
))
return
ERROR_INVALID_PARAMETER
;
if
(
!
szUserName
||
!*
szUserName
)
context
=
MSIINSTALLCONTEXT_MACHINE
;
else
{
PSID
psid
=
msi_alloc
(
sidsize
);
if
(
LookupAccountNameW
(
NULL
,
szUserName
,
NULL
,
&
sidsize
,
NULL
,
&
domsize
,
NULL
))
{
PSID
psid
=
msi_alloc
(
sidsize
);
if
(
LookupAccountNameW
(
NULL
,
szUserName
,
psid
,
&
sidsize
,
NULL
,
&
domsize
,
NULL
))
ConvertSidToStringSidW
(
psid
,
&
sidstr
);
msi_free
(
psid
);
}
if
(
LookupAccountNameW
(
NULL
,
szUserName
,
psid
,
&
sidsize
,
NULL
,
&
domsize
,
NULL
))
ConvertSidToStringSidW
(
psid
,
&
sidstr
);
r
=
MSIREG_OpenLocalManagedProductKey
(
szProduct
,
&
hkey
,
FALSE
);
if
(
r
==
ERROR_SUCCESS
)
context
=
MSIINSTALLCONTEXT_USERMANAGED
;
else
{
r
=
MSIREG_OpenUserProductsKey
(
szProduct
,
&
hkey
,
FALSE
);
if
(
r
!=
ERROR_SUCCESS
)
return
ERROR_UNKNOWN_PRODUCT
;
context
=
MSIINSTALLCONTEXT_USERUNMANAGED
;
}
msi_free
(
psid
);
RegCloseKey
(
hkey
);
}
ret
=
MsiSourceListAddSourceExW
(
szProduct
,
sidstr
,
MSIINSTALLCONTEXT_USERMANAGED
,
MSISOURCETYPE_NETWORK
,
szSource
,
0
);
context
,
MSISOURCETYPE_NETWORK
,
szSource
,
0
);
if
(
sidstr
)
LocalFree
(
sidstr
);
...
...
@@ -891,7 +923,7 @@ UINT WINAPI MsiSourceListAddSourceA( LPCSTR szProduct, LPCSTR szUserName,
szwusername
=
strdupAtoW
(
szUserName
);
szwsource
=
strdupAtoW
(
szSource
);
ret
=
MsiSourceListAddSourceW
(
szwproduct
,
szwusername
,
0
,
szwsource
);
ret
=
MsiSourceListAddSourceW
(
szwproduct
,
szwusername
,
dwReserved
,
szwsource
);
msi_free
(
szwproduct
);
msi_free
(
szwusername
);
...
...
dlls/msi/tests/source.c
View file @
65f99ed9
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