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
26777a46
Commit
26777a46
authored
Feb 19, 2014
by
Stefan Leichter
Committed by
Alexandre Julliard
Feb 26, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wtsapi32/tests: Add some tests for WTSEnumerateProcessesW.
parent
bf681bff
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
115 additions
and
0 deletions
+115
-0
configure
configure
+1
-0
configure.ac
configure.ac
+1
-0
Makefile.in
dlls/wtsapi32/tests/Makefile.in
+5
-0
wtsapi.c
dlls/wtsapi32/tests/wtsapi.c
+106
-0
wtsapi32.h
include/wtsapi32.h
+2
-0
No files found.
configure
View file @
26777a46
...
...
@@ -17256,6 +17256,7 @@ wine_fn_config_dll wsnmp32 enable_wsnmp32 implib
wine_fn_config_test dlls/wsnmp32/tests wsnmp32_test
wine_fn_config_dll wsock32 enable_wsock32 implib
wine_fn_config_dll wtsapi32 enable_wtsapi32 implib
wine_fn_config_test dlls/wtsapi32/tests wtsapi32_test
wine_fn_config_dll wuapi enable_wuapi clean
wine_fn_config_dll wuaueng enable_wuaueng
wine_fn_config_dll xapofx1_1 enable_xapofx1_1
...
...
configure.ac
View file @
26777a46
...
...
@@ -3262,6 +3262,7 @@ WINE_CONFIG_DLL(wsnmp32,,[implib])
WINE_CONFIG_TEST(dlls/wsnmp32/tests)
WINE_CONFIG_DLL(wsock32,,[implib])
WINE_CONFIG_DLL(wtsapi32,,[implib])
WINE_CONFIG_TEST(dlls/wtsapi32/tests)
WINE_CONFIG_DLL(wuapi,,[clean])
WINE_CONFIG_DLL(wuaueng)
WINE_CONFIG_DLL(xapofx1_1)
...
...
dlls/wtsapi32/tests/Makefile.in
0 → 100644
View file @
26777a46
TESTDLL
=
wtsapi32.dll
IMPORTS
=
wtsapi32
C_SRCS
=
\
wtsapi.c
dlls/wtsapi32/tests/wtsapi.c
0 → 100644
View file @
26777a46
/*
* Copyright 2014 Stefan Leichter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include <stdlib.h>
#include <windef.h>
#include <winbase.h>
#include <winternl.h>
#include <wtsapi32.h>
#include "wine/test.h"
static
void
test_WTSEnumerateProcessesW
(
void
)
{
BOOL
found
=
FALSE
,
ret
;
DWORD
count
,
i
;
PWTS_PROCESS_INFOW
info
;
WCHAR
*
pname
,
nameW
[
MAX_PATH
];
GetModuleFileNameW
(
NULL
,
nameW
,
MAX_PATH
);
for
(
pname
=
nameW
+
lstrlenW
(
nameW
);
pname
>
nameW
;
pname
--
)
{
if
(
*
pname
==
'/'
||
*
pname
==
'\\'
)
{
pname
++
;
break
;
}
}
info
=
NULL
;
SetLastError
(
0xdeadbeef
);
ret
=
WTSEnumerateProcessesW
(
WTS_CURRENT_SERVER_HANDLE
,
1
,
1
,
&
info
,
&
count
);
todo_wine
ok
(
!
ret
,
"expected WTSEnumerateProcessesW to fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER got: %d
\n
"
,
GetLastError
());
if
(
info
)
WTSFreeMemory
(
info
);
info
=
NULL
;
SetLastError
(
0xdeadbeef
);
ret
=
WTSEnumerateProcessesW
(
WTS_CURRENT_SERVER_HANDLE
,
0
,
0
,
&
info
,
&
count
);
todo_wine
ok
(
!
ret
,
"expected WTSEnumerateProcessesW to fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER got: %d
\n
"
,
GetLastError
());
if
(
info
)
WTSFreeMemory
(
info
);
info
=
NULL
;
SetLastError
(
0xdeadbeef
);
ret
=
WTSEnumerateProcessesW
(
WTS_CURRENT_SERVER_HANDLE
,
0
,
2
,
&
info
,
&
count
);
todo_wine
ok
(
!
ret
,
"expected WTSEnumerateProcessesW to fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER got: %d
\n
"
,
GetLastError
());
if
(
info
)
WTSFreeMemory
(
info
);
info
=
NULL
;
SetLastError
(
0xdeadbeef
);
ret
=
WTSEnumerateProcessesW
(
WTS_CURRENT_SERVER_HANDLE
,
0
,
1
,
NULL
,
&
count
);
ok
(
!
ret
,
"expected WTSEnumerateProcessesW to fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER got: %d
\n
"
,
GetLastError
());
if
(
info
)
WTSFreeMemory
(
info
);
info
=
NULL
;
SetLastError
(
0xdeadbeef
);
ret
=
WTSEnumerateProcessesW
(
WTS_CURRENT_SERVER_HANDLE
,
0
,
1
,
&
info
,
NULL
);
ok
(
!
ret
,
"expected WTSEnumerateProcessesW to fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER got: %d
\n
"
,
GetLastError
());
if
(
info
)
WTSFreeMemory
(
info
);
count
=
0
;
info
=
NULL
;
SetLastError
(
0xdeadbeef
);
ret
=
WTSEnumerateProcessesW
(
WTS_CURRENT_SERVER_HANDLE
,
0
,
1
,
&
info
,
&
count
);
ok
(
ret
||
broken
(
!
ret
),
/* fails on Win2K with error ERROR_APP_WRONG_OS */
"expected WTSEnumerateProcessesW to succeed; failed with %d
\n
"
,
GetLastError
());
for
(
i
=
0
;
ret
&&
i
<
count
;
i
++
)
{
found
=
found
||
!
lstrcmpW
(
pname
,
info
[
i
].
pProcessName
);
}
todo_wine
ok
(
found
||
broken
(
!
ret
),
"process name %s not found
\n
"
,
wine_dbgstr_w
(
pname
));
if
(
info
)
WTSFreeMemory
(
info
);
}
START_TEST
(
wtsapi
)
{
test_WTSEnumerateProcessesW
();
}
include/wtsapi32.h
View file @
26777a46
...
...
@@ -135,6 +135,8 @@ typedef struct _WTS_SERVER_INFOW
DECL_WINELIB_TYPE_AW
(
WTS_SERVER_INFO
)
DECL_WINELIB_TYPE_AW
(
PWTS_SERVER_INFO
)
#define WTS_CURRENT_SERVER_HANDLE ((HANDLE)NULL)
void
WINAPI
WTSCloseServer
(
HANDLE
);
BOOL
WINAPI
WTSConnectSessionA
(
ULONG
,
ULONG
,
PSTR
,
BOOL
);
BOOL
WINAPI
WTSConnectSessionW
(
ULONG
,
ULONG
,
PWSTR
,
BOOL
);
...
...
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