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
73f0b3c3
Commit
73f0b3c3
authored
Mar 18, 2008
by
Francois Gouget
Committed by
Alexandre Julliard
Mar 19, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi/tests: Skip the tests if we are unable to identify the user SID. This fixes crashes on Win9x.
parent
8d38b1d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
9 deletions
+41
-9
source.c
dlls/msi/tests/source.c
+41
-9
No files found.
dlls/msi/tests/source.c
View file @
73f0b3c3
...
...
@@ -122,18 +122,22 @@ static void create_test_guid(LPSTR prodcode, LPSTR squashed)
WideCharToMultiByte
(
CP_ACP
,
0
,
squashedW
,
-
1
,
squashed
,
MAX_PATH
,
NULL
,
NULL
);
}
static
void
get_user_sid
(
LPSTR
*
usersid
)
static
int
get_user_sid
(
LPSTR
*
usersid
)
{
HANDLE
token
;
BYTE
buf
[
1024
];
DWORD
size
;
PTOKEN_USER
user
;
BOOL
rc
;
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_QUERY
,
&
token
);
rc
=
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_QUERY
,
&
token
);
if
(
!
rc
&&
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
)
return
0
;
size
=
sizeof
(
buf
);
GetTokenInformation
(
token
,
TokenUser
,
(
void
*
)
buf
,
size
,
&
size
);
user
=
(
PTOKEN_USER
)
buf
;
pConvertSidToStringSidA
(
user
->
User
.
Sid
,
usersid
);
return
1
;
}
static
void
check_reg_str
(
HKEY
prodkey
,
LPCSTR
name
,
LPCSTR
expected
,
BOOL
bcase
,
DWORD
line
)
...
...
@@ -186,7 +190,11 @@ static void test_MsiSourceListGetInfo(void)
}
create_test_guid
(
prodcode
,
prod_squashed
);
get_user_sid
(
&
usersid
);
if
(
!
get_user_sid
(
&
usersid
))
{
skip
(
"User SID not available -> skipping MsiSourceListGetInfoA tests
\n
"
);
return
;
}
/* NULL szProductCodeOrPatchCode */
r
=
pMsiSourceListGetInfoA
(
NULL
,
usersid
,
MSIINSTALLCONTEXT_USERUNMANAGED
,
...
...
@@ -613,7 +621,11 @@ static void test_MsiSourceListAddSourceEx(void)
}
create_test_guid
(
prodcode
,
prod_squashed
);
get_user_sid
(
&
usersid
);
if
(
!
get_user_sid
(
&
usersid
))
{
skip
(
"User SID not available -> skipping MsiSourceListAddSourceExA tests
\n
"
);
return
;
}
/* GetLastError is not set by the function */
...
...
@@ -982,7 +994,11 @@ static void test_MsiSourceListEnumSources(void)
}
create_test_guid
(
prodcode
,
prod_squashed
);
get_user_sid
(
&
usersid
);
if
(
!
get_user_sid
(
&
usersid
))
{
skip
(
"User SID not available -> skipping MsiSourceListEnumSourcesA tests
\n
"
);
return
;
}
/* GetLastError is not set by the function */
...
...
@@ -1580,7 +1596,11 @@ static void test_MsiSourceListSetInfo(void)
}
create_test_guid
(
prodcode
,
prod_squashed
);
get_user_sid
(
&
usersid
);
if
(
!
get_user_sid
(
&
usersid
))
{
skip
(
"User SID not available -> skipping MsiSourceListSetInfoA tests
\n
"
);
return
;
}
/* GetLastError is not set by the function */
...
...
@@ -1986,7 +2006,11 @@ static void test_MsiSourceListAddMediaDisk(void)
}
create_test_guid
(
prodcode
,
prod_squashed
);
get_user_sid
(
&
usersid
);
if
(
!
get_user_sid
(
&
usersid
))
{
skip
(
"User SID not available -> skipping MsiSourceListAddMediaDiskA tests
\n
"
);
return
;
}
/* GetLastError is not set by the function */
...
...
@@ -2284,7 +2308,11 @@ static void test_MsiSourceListEnumMediaDisks(void)
}
create_test_guid
(
prodcode
,
prod_squashed
);
get_user_sid
(
&
usersid
);
if
(
!
get_user_sid
(
&
usersid
))
{
skip
(
"User SID not available -> skipping MsiSourceListEnumMediaDisksA tests
\n
"
);
return
;
}
/* GetLastError is not set by the function */
...
...
@@ -3038,7 +3066,11 @@ static void test_MsiSourceListAddSource(void)
}
create_test_guid
(
prodcode
,
prod_squashed
);
get_user_sid
(
&
usersid
);
if
(
!
get_user_sid
(
&
usersid
))
{
skip
(
"User SID not available -> skipping MsiSourceListAddSourceA tests
\n
"
);
return
;
}
/* MACHINENAME\username */
size
=
MAX_PATH
;
...
...
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