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
25a9e2c6
Commit
25a9e2c6
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 WlanAllocateMemory/WlanFreeMemory with tests.
Signed-off-by:
Bruno Jesus
<
00cpxxx@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4371e1c5
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
2 deletions
+47
-2
main.c
dlls/wlanapi/main.c
+25
-0
wlanapi.c
dlls/wlanapi/tests/wlanapi.c
+18
-0
wlanapi.spec
dlls/wlanapi/wlanapi.spec
+2
-2
wlanapi.h
include/wlanapi.h
+2
-0
No files found.
dlls/wlanapi/main.c
View file @
25a9e2c6
...
...
@@ -46,6 +46,31 @@ DWORD WINAPI WlanOpenHandle(DWORD client_version, void *reserved, DWORD *negotia
return
ERROR_CALL_NOT_IMPLEMENTED
;
}
void
WINAPI
WlanFreeMemory
(
void
*
ptr
)
{
TRACE
(
"(%p)
\n
"
,
ptr
);
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
}
void
*
WINAPI
WlanAllocateMemory
(
DWORD
size
)
{
void
*
ret
;
TRACE
(
"(%d)"
,
size
);
if
(
!
size
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
NULL
;
}
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
ret
)
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
ret
;
}
BOOL
WINAPI
DllMain
(
HINSTANCE
hinstDLL
,
DWORD
reason
,
void
*
reserved
)
{
...
...
dlls/wlanapi/tests/wlanapi.c
View file @
25a9e2c6
...
...
@@ -94,6 +94,23 @@ todo_wine {
}
}
static
void
test_WlanAllocateFreeMemory
(
void
)
{
void
*
ptr
;
SetLastError
(
0xdeadbeef
);
ptr
=
WlanAllocateMemory
(
0
);
ok
(
ptr
==
NULL
,
"Expected NULL, got %p
\n
"
,
ptr
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected 87, got %d
\n
"
,
GetLastError
());
ptr
=
WlanAllocateMemory
(
1024
);
ok
(
ptr
!=
NULL
,
"Expected non-NULL
\n
"
);
WlanFreeMemory
(
ptr
);
WlanFreeMemory
(
NULL
);
/* return is void, proves that won't crash */
}
START_TEST
(
wlanapi
)
{
HANDLE
handle
;
...
...
@@ -108,4 +125,5 @@ START_TEST(wlanapi)
}
test_WlanOpenHandle
();
test_WlanAllocateFreeMemory
();
}
dlls/wlanapi/wlanapi.spec
View file @
25a9e2c6
@ st
ub WlanAllocateMemory
@ st
dcall WlanAllocateMemory(long)
@ stdcall WlanCloseHandle(ptr ptr)
@ stub WlanConnect
@ stub WlanDeleteProfile
@ stub WlanDisconnect
@ stdcall WlanEnumInterfaces(long ptr ptr)
@ stub WlanExtractPsdIEDataList
@ st
ub WlanFreeMemory
@ st
dcall WlanFreeMemory(ptr)
@ stub WlanGetAvailableNetworkList
@ stub WlanGetFilterList
@ stub WlanGetInterfaceCapability
...
...
include/wlanapi.h
View file @
25a9e2c6
...
...
@@ -48,5 +48,7 @@ typedef struct _WLAN_INTERFACE_INFO_LIST
DWORD
WINAPI
WlanCloseHandle
(
HANDLE
,
void
*
);
DWORD
WINAPI
WlanEnumInterfaces
(
HANDLE
,
void
*
,
WLAN_INTERFACE_INFO_LIST
**
);
DWORD
WINAPI
WlanOpenHandle
(
DWORD
,
void
*
,
DWORD
*
,
HANDLE
*
);
void
*
WINAPI
WlanAllocateMemory
(
DWORD
);
void
WINAPI
WlanFreeMemory
(
void
*
);
#endif
/* _WLAN_WLANAPI_H */
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