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
48801b6d
Commit
48801b6d
authored
Nov 02, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Nov 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wtsapi32: Use CRT allocation functions.
parent
b1d29765
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
wtsapi32.c
dlls/wtsapi32/wtsapi32.c
+12
-13
No files found.
dlls/wtsapi32/wtsapi32.c
View file @
48801b6d
...
@@ -26,7 +26,6 @@
...
@@ -26,7 +26,6 @@
#include "lmcons.h"
#include "lmcons.h"
#include "wtsapi32.h"
#include "wtsapi32.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wtsapi
);
WINE_DEFAULT_DEBUG_CHANNEL
(
wtsapi
);
...
@@ -149,7 +148,7 @@ BOOL WINAPI WTSEnumerateProcessesExW(HANDLE server, DWORD *level, DWORD session_
...
@@ -149,7 +148,7 @@ BOOL WINAPI WTSEnumerateProcessesExW(HANDLE server, DWORD *level, DWORD session_
nt_process
=
(
SYSTEM_PROCESS_INFORMATION
*
)((
char
*
)
nt_process
+
nt_process
->
NextEntryOffset
);
nt_process
=
(
SYSTEM_PROCESS_INFORMATION
*
)((
char
*
)
nt_process
+
nt_process
->
NextEntryOffset
);
}
}
if
(
!
(
info
=
heap_
alloc
(
size
)))
if
(
!
(
info
=
m
alloc
(
size
)))
{
{
free
(
nt_info
);
free
(
nt_info
);
SetLastError
(
ERROR_OUTOFMEMORY
);
SetLastError
(
ERROR_OUTOFMEMORY
);
...
@@ -315,7 +314,7 @@ BOOL WINAPI WTSEnumerateSessionsA(HANDLE server, DWORD reserved, DWORD version,
...
@@ -315,7 +314,7 @@ BOOL WINAPI WTSEnumerateSessionsA(HANDLE server, DWORD reserved, DWORD version,
size
+=
sizeof
(
**
session_info
)
+
len
;
size
+=
sizeof
(
**
session_info
)
+
len
;
}
}
if
(
!
(
*
session_info
=
heap_
alloc
(
size
)))
if
(
!
(
*
session_info
=
m
alloc
(
size
)))
{
{
WTSFreeMemory
(
infoW
);
WTSFreeMemory
(
infoW
);
SetLastError
(
ERROR_OUTOFMEMORY
);
SetLastError
(
ERROR_OUTOFMEMORY
);
...
@@ -355,7 +354,7 @@ BOOL WINAPI WTSEnumerateSessionsW(HANDLE server, DWORD reserved, DWORD version,
...
@@ -355,7 +354,7 @@ BOOL WINAPI WTSEnumerateSessionsW(HANDLE server, DWORD reserved, DWORD version,
if
(
!
session_info
||
!
count
)
return
FALSE
;
if
(
!
session_info
||
!
count
)
return
FALSE
;
if
(
!
(
*
session_info
=
heap_
alloc
(
sizeof
(
**
session_info
)
+
sizeof
(
session_name
))))
if
(
!
(
*
session_info
=
m
alloc
(
sizeof
(
**
session_info
)
+
sizeof
(
session_name
))))
{
{
SetLastError
(
ERROR_OUTOFMEMORY
);
SetLastError
(
ERROR_OUTOFMEMORY
);
return
FALSE
;
return
FALSE
;
...
@@ -378,7 +377,7 @@ BOOL WINAPI WTSEnumerateSessionsW(HANDLE server, DWORD reserved, DWORD version,
...
@@ -378,7 +377,7 @@ BOOL WINAPI WTSEnumerateSessionsW(HANDLE server, DWORD reserved, DWORD version,
*/
*/
void
WINAPI
WTSFreeMemory
(
PVOID
pMemory
)
void
WINAPI
WTSFreeMemory
(
PVOID
pMemory
)
{
{
heap_
free
(
pMemory
);
free
(
pMemory
);
}
}
/************************************************************
/************************************************************
...
@@ -387,7 +386,7 @@ void WINAPI WTSFreeMemory(PVOID pMemory)
...
@@ -387,7 +386,7 @@ void WINAPI WTSFreeMemory(PVOID pMemory)
BOOL
WINAPI
WTSFreeMemoryExA
(
WTS_TYPE_CLASS
type
,
void
*
ptr
,
ULONG
nmemb
)
BOOL
WINAPI
WTSFreeMemoryExA
(
WTS_TYPE_CLASS
type
,
void
*
ptr
,
ULONG
nmemb
)
{
{
TRACE
(
"%d %p %ld
\n
"
,
type
,
ptr
,
nmemb
);
TRACE
(
"%d %p %ld
\n
"
,
type
,
ptr
,
nmemb
);
heap_
free
(
ptr
);
free
(
ptr
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -397,7 +396,7 @@ BOOL WINAPI WTSFreeMemoryExA(WTS_TYPE_CLASS type, void *ptr, ULONG nmemb)
...
@@ -397,7 +396,7 @@ BOOL WINAPI WTSFreeMemoryExA(WTS_TYPE_CLASS type, void *ptr, ULONG nmemb)
BOOL
WINAPI
WTSFreeMemoryExW
(
WTS_TYPE_CLASS
type
,
void
*
ptr
,
ULONG
nmemb
)
BOOL
WINAPI
WTSFreeMemoryExW
(
WTS_TYPE_CLASS
type
,
void
*
ptr
,
ULONG
nmemb
)
{
{
TRACE
(
"%d %p %ld
\n
"
,
type
,
ptr
,
nmemb
);
TRACE
(
"%d %p %ld
\n
"
,
type
,
ptr
,
nmemb
);
heap_
free
(
ptr
);
free
(
ptr
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -481,7 +480,7 @@ BOOL WINAPI WTSQuerySessionInformationA(HANDLE server, DWORD session_id, WTS_INF
...
@@ -481,7 +480,7 @@ BOOL WINAPI WTSQuerySessionInformationA(HANDLE server, DWORD session_id, WTS_INF
return
FALSE
;
return
FALSE
;
}
}
if
(
!
(
*
buffer
=
heap_
alloc
(
*
count
)))
if
(
!
(
*
buffer
=
m
alloc
(
*
count
)))
{
{
WTSFreeMemory
(
bufferW
);
WTSFreeMemory
(
bufferW
);
return
FALSE
;
return
FALSE
;
...
@@ -490,7 +489,7 @@ BOOL WINAPI WTSQuerySessionInformationA(HANDLE server, DWORD session_id, WTS_INF
...
@@ -490,7 +489,7 @@ BOOL WINAPI WTSQuerySessionInformationA(HANDLE server, DWORD session_id, WTS_INF
if
(
!
(
*
count
=
WideCharToMultiByte
(
CP_ACP
,
0
,
bufferW
,
-
1
,
*
buffer
,
*
count
,
NULL
,
NULL
)))
if
(
!
(
*
count
=
WideCharToMultiByte
(
CP_ACP
,
0
,
bufferW
,
-
1
,
*
buffer
,
*
count
,
NULL
,
NULL
)))
{
{
WTSFreeMemory
(
bufferW
);
WTSFreeMemory
(
bufferW
);
heap_
free
(
*
buffer
);
free
(
*
buffer
);
return
FALSE
;
return
FALSE
;
}
}
...
@@ -515,7 +514,7 @@ BOOL WINAPI WTSQuerySessionInformationW(HANDLE server, DWORD session_id, WTS_INF
...
@@ -515,7 +514,7 @@ BOOL WINAPI WTSQuerySessionInformationW(HANDLE server, DWORD session_id, WTS_INF
{
{
WTS_CONNECTSTATE_CLASS
*
state
;
WTS_CONNECTSTATE_CLASS
*
state
;
if
(
!
(
state
=
heap_
alloc
(
sizeof
(
*
state
))))
return
FALSE
;
if
(
!
(
state
=
m
alloc
(
sizeof
(
*
state
))))
return
FALSE
;
*
state
=
WTSActive
;
*
state
=
WTSActive
;
*
buffer
=
(
WCHAR
*
)
state
;
*
buffer
=
(
WCHAR
*
)
state
;
*
count
=
sizeof
(
*
state
);
*
count
=
sizeof
(
*
state
);
...
@@ -526,7 +525,7 @@ BOOL WINAPI WTSQuerySessionInformationW(HANDLE server, DWORD session_id, WTS_INF
...
@@ -526,7 +525,7 @@ BOOL WINAPI WTSQuerySessionInformationW(HANDLE server, DWORD session_id, WTS_INF
{
{
USHORT
*
protocol
;
USHORT
*
protocol
;
if
(
!
(
protocol
=
heap_
alloc
(
sizeof
(
*
protocol
))))
return
FALSE
;
if
(
!
(
protocol
=
m
alloc
(
sizeof
(
*
protocol
))))
return
FALSE
;
FIXME
(
"returning 0 protocol type
\n
"
);
FIXME
(
"returning 0 protocol type
\n
"
);
*
protocol
=
0
;
*
protocol
=
0
;
*
buffer
=
(
WCHAR
*
)
protocol
;
*
buffer
=
(
WCHAR
*
)
protocol
;
...
@@ -539,7 +538,7 @@ BOOL WINAPI WTSQuerySessionInformationW(HANDLE server, DWORD session_id, WTS_INF
...
@@ -539,7 +538,7 @@ BOOL WINAPI WTSQuerySessionInformationW(HANDLE server, DWORD session_id, WTS_INF
DWORD
size
=
UNLEN
+
1
;
DWORD
size
=
UNLEN
+
1
;
WCHAR
*
username
;
WCHAR
*
username
;
if
(
!
(
username
=
heap_
alloc
(
size
*
sizeof
(
WCHAR
))))
return
FALSE
;
if
(
!
(
username
=
m
alloc
(
size
*
sizeof
(
WCHAR
))))
return
FALSE
;
GetUserNameW
(
username
,
&
size
);
GetUserNameW
(
username
,
&
size
);
*
buffer
=
username
;
*
buffer
=
username
;
*
count
=
size
*
sizeof
(
WCHAR
);
*
count
=
size
*
sizeof
(
WCHAR
);
...
@@ -551,7 +550,7 @@ BOOL WINAPI WTSQuerySessionInformationW(HANDLE server, DWORD session_id, WTS_INF
...
@@ -551,7 +550,7 @@ BOOL WINAPI WTSQuerySessionInformationW(HANDLE server, DWORD session_id, WTS_INF
DWORD
size
=
MAX_COMPUTERNAME_LENGTH
+
1
;
DWORD
size
=
MAX_COMPUTERNAME_LENGTH
+
1
;
WCHAR
*
computername
;
WCHAR
*
computername
;
if
(
!
(
computername
=
heap_
alloc
(
size
*
sizeof
(
WCHAR
))))
return
FALSE
;
if
(
!
(
computername
=
m
alloc
(
size
*
sizeof
(
WCHAR
))))
return
FALSE
;
GetComputerNameW
(
computername
,
&
size
);
GetComputerNameW
(
computername
,
&
size
);
*
buffer
=
computername
;
*
buffer
=
computername
;
/* GetComputerNameW() return size doesn't include terminator */
/* GetComputerNameW() return size doesn't include terminator */
...
...
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