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
8b3c6943
Commit
8b3c6943
authored
Jan 30, 2017
by
Bruno Jesus
Committed by
Alexandre Julliard
Jan 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wlanapi: Implement WlanOpenHandle.
Signed-off-by:
Bruno Jesus
<
00cpxxx@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
382755af
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
10 deletions
+58
-10
main.c
dlls/wlanapi/main.c
+43
-2
wlanapi.c
dlls/wlanapi/tests/wlanapi.c
+15
-8
No files found.
dlls/wlanapi/main.c
View file @
8b3c6943
...
...
@@ -28,6 +28,29 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wlanapi
);
#define WLAN_MAGIC 0x574c414e
/* WLAN */
static
struct
wine_wlan
{
DWORD
magic
,
cli_version
;
}
handle_table
[
16
];
static
HANDLE
handle_new
(
struct
wine_wlan
**
entry
)
{
ULONG_PTR
i
;
for
(
i
=
0
;
i
<
sizeof
(
handle_table
)
/
sizeof
(
handle_table
[
0
]);
i
++
)
{
if
(
handle_table
[
i
].
magic
==
0
)
{
*
entry
=
&
handle_table
[
i
];
return
(
HANDLE
)(
i
+
1
);
}
}
return
NULL
;
}
DWORD
WINAPI
WlanEnumInterfaces
(
HANDLE
handle
,
void
*
reserved
,
WLAN_INTERFACE_INFO_LIST
**
interface_list
)
{
FIXME
(
"(%p, %p, %p) stub
\n
"
,
handle
,
reserved
,
interface_list
);
...
...
@@ -42,8 +65,26 @@ DWORD WINAPI WlanCloseHandle(HANDLE handle, void *reserved)
DWORD
WINAPI
WlanOpenHandle
(
DWORD
client_version
,
void
*
reserved
,
DWORD
*
negotiated_version
,
HANDLE
*
handle
)
{
FIXME
(
"(%u, %p, %p, %p) stub
\n
"
,
client_version
,
reserved
,
negotiated_version
,
handle
);
return
ERROR_CALL_NOT_IMPLEMENTED
;
struct
wine_wlan
*
wlan
;
HANDLE
ret_handle
;
TRACE
(
"(%u, %p, %p, %p)
\n
"
,
client_version
,
reserved
,
negotiated_version
,
handle
);
if
(
reserved
||
!
negotiated_version
||
!
handle
)
return
ERROR_INVALID_PARAMETER
;
if
(
client_version
!=
1
&&
client_version
!=
2
)
return
ERROR_NOT_SUPPORTED
;
ret_handle
=
handle_new
(
&
wlan
);
if
(
!
ret_handle
)
return
ERROR_REMOTE_SESSION_LIMIT_EXCEEDED
;
wlan
->
magic
=
WLAN_MAGIC
;
wlan
->
cli_version
=
*
negotiated_version
=
client_version
;
*
handle
=
ret_handle
;
return
ERROR_SUCCESS
;
}
void
WINAPI
WlanFreeMemory
(
void
*
ptr
)
...
...
dlls/wlanapi/tests/wlanapi.c
View file @
8b3c6943
...
...
@@ -26,7 +26,7 @@
static
void
test_WlanOpenHandle
(
void
)
{
HANDLE
bad_handle
=
(
HANDLE
)
0xdeadcafe
,
handle
=
bad_handle
;
HANDLE
bad_handle
=
(
HANDLE
)
0xdeadcafe
,
handle
=
bad_handle
,
handle2
;
DWORD
ret
,
neg_version
=
0xdeadbeef
,
reserved
=
0xdead
;
BOOL
is_xp
;
...
...
@@ -35,30 +35,25 @@ static void test_WlanOpenHandle(void)
is_xp
=
ret
==
ERROR_SUCCESS
;
if
(
!
is_xp
)
/* the results in XP differ completely from all other versions */
{
todo_wine
ok
(
ret
==
ERROR_NOT_SUPPORTED
,
"Expected 50, got %d
\n
"
,
ret
);
ok
(
neg_version
==
0xdeadbeef
,
"neg_vesion changed
\n
"
);
ok
(
handle
==
bad_handle
,
"handle changed
\n
"
);
ret
=
WlanOpenHandle
(
10
,
NULL
,
&
neg_version
,
&
handle
);
todo_wine
ok
(
ret
==
ERROR_NOT_SUPPORTED
,
"Expected 50, got %d
\n
"
,
ret
);
ok
(
neg_version
==
0xdeadbeef
,
"neg_vesion changed
\n
"
);
ok
(
handle
==
bad_handle
,
"handle changed
\n
"
);
/* reserved parameter must not be used */
ret
=
WlanOpenHandle
(
1
,
&
reserved
,
&
neg_version
,
&
handle
);
todo_wine
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"Expected 87, got %d
\n
"
,
ret
);
ok
(
neg_version
==
0xdeadbeef
,
"neg_vesion changed
\n
"
);
ok
(
handle
==
bad_handle
,
"handle changed
\n
"
);
/* invalid parameters */
ret
=
WlanOpenHandle
(
1
,
NULL
,
NULL
,
&
handle
);
todo_wine
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"Expected 87, got %d
\n
"
,
ret
);
ok
(
handle
==
bad_handle
,
"bad handle
\n
"
);
ret
=
WlanOpenHandle
(
1
,
NULL
,
&
neg_version
,
NULL
);
todo_wine
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"Expected 87, got %d
\n
"
,
ret
);
ok
(
neg_version
==
0xdeadbeef
,
"neg_vesion changed
\n
"
);
}
...
...
@@ -71,12 +66,12 @@ todo_wine
}
/* good tests */
todo_wine
{
ret
=
WlanOpenHandle
(
1
,
NULL
,
&
neg_version
,
&
handle
);
ok
(
ret
==
ERROR_SUCCESS
,
"Expected 0, got %d
\n
"
,
ret
);
ok
(
neg_version
==
1
,
"Expected 1, got %d
\n
"
,
neg_version
);
ok
(
handle
!=
bad_handle
&&
handle
,
"handle changed
\n
"
);
ret
=
WlanCloseHandle
(
handle
,
NULL
);
todo_wine
ok
(
ret
==
0
,
"Expected 0, got %d
\n
"
,
ret
);
ret
=
WlanOpenHandle
(
2
,
NULL
,
&
neg_version
,
&
handle
);
...
...
@@ -87,8 +82,21 @@ todo_wine {
ok
(
neg_version
==
1
,
"Expected 1, got %d
\n
"
,
neg_version
);
ok
(
handle
!=
bad_handle
&&
handle
,
"bad handle
\n
"
);
ret
=
WlanCloseHandle
(
handle
,
NULL
);
todo_wine
ok
(
ret
==
0
,
"Expected 0, got %d
\n
"
,
ret
);
/* open twice */
ret
=
WlanOpenHandle
(
1
,
NULL
,
&
neg_version
,
&
handle
);
ok
(
ret
==
ERROR_SUCCESS
,
"Expected 0, got %d
\n
"
,
ret
);
ret
=
WlanOpenHandle
(
1
,
NULL
,
&
neg_version
,
&
handle2
);
ok
(
ret
==
ERROR_SUCCESS
,
"Expected 0, got %d
\n
"
,
ret
);
todo_wine
{
ret
=
WlanCloseHandle
(
handle
,
NULL
);
ok
(
ret
==
ERROR_SUCCESS
,
"Expected 0, got %d
\n
"
,
ret
);
ret
=
WlanCloseHandle
(
handle2
,
NULL
);
ok
(
ret
==
ERROR_SUCCESS
,
"Expected 0, got %d
\n
"
,
ret
);
ret
=
WlanCloseHandle
(
NULL
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"Expected 0, got %d
\n
"
,
ret
);
}
...
...
@@ -120,7 +128,6 @@ static void test_WlanEnumInterfaces(void)
WLAN_INTERFACE_INFO
*
info
;
ret
=
WlanOpenHandle
(
1
,
NULL
,
&
neg_version
,
&
handle
);
todo_wine
ok
(
ret
==
0
,
"Expected 0, got %d
\n
"
,
ret
);
/* invalid parameters */
...
...
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