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
a746b826
Commit
a746b826
authored
Nov 12, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netapi32: Merge apibuf.c into netapi32.c.
parent
fe3669e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
100 deletions
+69
-100
Makefile.in
dlls/netapi32/Makefile.in
+0
-1
apibuf.c
dlls/netapi32/apibuf.c
+0
-99
netapi32.c
dlls/netapi32/netapi32.c
+69
-0
No files found.
dlls/netapi32/Makefile.in
View file @
a746b826
...
...
@@ -5,7 +5,6 @@ IMPORTS = iphlpapi ws2_32 advapi32
C_SRCS
=
\
access.c
\
apibuf.c
\
browsr.c
\
ds.c
\
local_group.c
\
...
...
dlls/netapi32/apibuf.c
deleted
100644 → 0
View file @
fe3669e8
/*
* Copyright 2002 Andriy Palamarchuk
*
* Net API buffer calls
*
* 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 "windef.h"
#include "winbase.h"
#include "lmcons.h"
#include "lmapibuf.h"
#include "lmerr.h"
#include "winerror.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
netapi32
);
/************************************************************
* NetApiBufferAllocate (NETAPI32.@)
*/
NET_API_STATUS
WINAPI
NetApiBufferAllocate
(
DWORD
ByteCount
,
LPVOID
*
Buffer
)
{
TRACE
(
"(%d, %p)
\n
"
,
ByteCount
,
Buffer
);
if
(
Buffer
==
NULL
)
return
ERROR_INVALID_PARAMETER
;
*
Buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
ByteCount
);
if
(
*
Buffer
)
return
NERR_Success
;
else
return
GetLastError
();
}
/************************************************************
* NetApiBufferFree (NETAPI32.@)
*/
NET_API_STATUS
WINAPI
NetApiBufferFree
(
LPVOID
Buffer
)
{
TRACE
(
"(%p)
\n
"
,
Buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
Buffer
);
return
NERR_Success
;
}
/************************************************************
* NetApiBufferReallocate (NETAPI32.@)
*/
NET_API_STATUS
WINAPI
NetApiBufferReallocate
(
LPVOID
OldBuffer
,
DWORD
NewByteCount
,
LPVOID
*
NewBuffer
)
{
TRACE
(
"(%p, %d, %p)
\n
"
,
OldBuffer
,
NewByteCount
,
NewBuffer
);
if
(
NewByteCount
)
{
if
(
OldBuffer
)
*
NewBuffer
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
OldBuffer
,
NewByteCount
);
else
*
NewBuffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
NewByteCount
);
return
*
NewBuffer
?
NERR_Success
:
GetLastError
();
}
else
{
if
(
!
HeapFree
(
GetProcessHeap
(),
0
,
OldBuffer
))
return
GetLastError
();
*
NewBuffer
=
0
;
return
NERR_Success
;
}
}
/************************************************************
* NetApiBufferSize (NETAPI32.@)
*/
NET_API_STATUS
WINAPI
NetApiBufferSize
(
LPVOID
Buffer
,
LPDWORD
ByteCount
)
{
DWORD
dw
;
TRACE
(
"(%p, %p)
\n
"
,
Buffer
,
ByteCount
);
if
(
Buffer
==
NULL
)
return
ERROR_INVALID_PARAMETER
;
dw
=
HeapSize
(
GetProcessHeap
(),
0
,
Buffer
);
TRACE
(
"size: %d
\n
"
,
dw
);
if
(
dw
!=
0xFFFFFFFF
)
*
ByteCount
=
dw
;
else
*
ByteCount
=
0
;
return
NERR_Success
;
}
dlls/netapi32/netapi32.c
View file @
a746b826
/* Copyright 2001 Mike McCormack
* Copyright 2002 Andriy Palamarchuk
* Copyright 2003 Juan Lang
*
* This library is free software; you can redistribute it and/or
...
...
@@ -208,3 +209,71 @@ NET_API_STATUS WINAPI NetUseGetInfo(LMSTR server, LMSTR name, DWORD level, LPBYT
return
ERROR_NOT_SUPPORTED
;
}
/************************************************************
* NetApiBufferAllocate (NETAPI32.@)
*/
NET_API_STATUS
WINAPI
NetApiBufferAllocate
(
DWORD
ByteCount
,
LPVOID
*
Buffer
)
{
TRACE
(
"(%d, %p)
\n
"
,
ByteCount
,
Buffer
);
if
(
Buffer
==
NULL
)
return
ERROR_INVALID_PARAMETER
;
*
Buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
ByteCount
);
if
(
*
Buffer
)
return
NERR_Success
;
else
return
GetLastError
();
}
/************************************************************
* NetApiBufferFree (NETAPI32.@)
*/
NET_API_STATUS
WINAPI
NetApiBufferFree
(
LPVOID
Buffer
)
{
TRACE
(
"(%p)
\n
"
,
Buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
Buffer
);
return
NERR_Success
;
}
/************************************************************
* NetApiBufferReallocate (NETAPI32.@)
*/
NET_API_STATUS
WINAPI
NetApiBufferReallocate
(
LPVOID
OldBuffer
,
DWORD
NewByteCount
,
LPVOID
*
NewBuffer
)
{
TRACE
(
"(%p, %d, %p)
\n
"
,
OldBuffer
,
NewByteCount
,
NewBuffer
);
if
(
NewByteCount
)
{
if
(
OldBuffer
)
*
NewBuffer
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
OldBuffer
,
NewByteCount
);
else
*
NewBuffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
NewByteCount
);
return
*
NewBuffer
?
NERR_Success
:
GetLastError
();
}
else
{
if
(
!
HeapFree
(
GetProcessHeap
(),
0
,
OldBuffer
))
return
GetLastError
();
*
NewBuffer
=
0
;
return
NERR_Success
;
}
}
/************************************************************
* NetApiBufferSize (NETAPI32.@)
*/
NET_API_STATUS
WINAPI
NetApiBufferSize
(
LPVOID
Buffer
,
LPDWORD
ByteCount
)
{
DWORD
dw
;
TRACE
(
"(%p, %p)
\n
"
,
Buffer
,
ByteCount
);
if
(
Buffer
==
NULL
)
return
ERROR_INVALID_PARAMETER
;
dw
=
HeapSize
(
GetProcessHeap
(),
0
,
Buffer
);
TRACE
(
"size: %d
\n
"
,
dw
);
if
(
dw
!=
0xFFFFFFFF
)
*
ByteCount
=
dw
;
else
*
ByteCount
=
0
;
return
NERR_Success
;
}
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