ReactOS  0.4.13-dev-100-gc8611ae
apibuf.c File Reference
#include "netapi32.h"
Include dependency graph for apibuf.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (netapi32)
 
NET_API_STATUS WINAPI NetApiBufferAllocate (DWORD ByteCount, LPVOID *Buffer)
 
NET_API_STATUS WINAPI NetApiBufferFree (LPVOID Buffer)
 
NET_API_STATUS WINAPI NetApiBufferReallocate (LPVOID OldBuffer, DWORD NewByteCount, LPVOID *NewBuffer)
 
NET_API_STATUS WINAPI NetApiBufferSize (LPVOID Buffer, LPDWORD ByteCount)
 

Function Documentation

◆ NetApiBufferAllocate()

NET_API_STATUS WINAPI NetApiBufferAllocate ( DWORD  ByteCount,
LPVOID Buffer 
)

Definition at line 28 of file apibuf.c.

29 {
30  TRACE("(%d, %p)\n", ByteCount, Buffer);
31 
32  if (Buffer == NULL) return ERROR_INVALID_PARAMETER;
34  if (*Buffer)
35  return NERR_Success;
36  else
37  return GetLastError();
38 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define NERR_Success
Definition: lmerr.h:5
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _In_ LARGE_INTEGER ByteCount
Definition: iotypes.h:1060

Referenced by AllocateEnumContext(), BuildAliasInfoBuffer(), BuildGroupInfoBuffer(), BuildSidFromSidAndRid(), BuildSidListFromDomainAndName(), BuildUserInfoBuffer(), DsAddressToSiteNamesExW(), DsAddressToSiteNamesW(), DsGetDcSiteCoverageW(), GetUserPrivileges(), NetEnumerateComputerNames(), NetGroupEnum(), NetGroupGetUsers(), NetLocalGroupEnum(), NetLocalGroupGetMembers(), NetpGetComputerName(), NetUserChangePassword(), NetUserGetLocalGroups(), NetUserModalsGet(), NetWkstaGetInfo(), NetWkstaUserGetInfo(), and WkstaEnumAdaptersCallback().

◆ NetApiBufferFree()

NET_API_STATUS WINAPI NetApiBufferFree ( LPVOID  Buffer)

Definition at line 43 of file apibuf.c.

44 {
45  TRACE("(%p)\n", Buffer);
47  return NERR_Success;
48 }
#define NERR_Success
Definition: lmerr.h:5
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by _tmain(), AddGroupToUser(), AddUsersToGroup(), AllSysInfo(), BuildAliasInfoBuffer(), BuildGroupInfoBuffer(), BuildSidListFromDomainAndName(), BuildUserInfoBuffer(), cmdAccounts(), cmdConfig(), cmdUser(), DisplayGroup(), DisplayLocalGroup(), DisplayServerConfig(), DisplayServerStatistics(), DisplayUser(), DisplayWorkstationConfig(), DisplayWorkstationStatistics(), EnumerateGroups(), EnumerateLocalGroups(), EnumerateUsers(), FreeEnumContext(), GetGeneralGroupData(), GetUserGeneralData(), GetUserPrivileges(), GetUserProfileData(), InitGroupMembersList(), InitUserGroupsList(), NetGroupEnum(), NetGroupGetUsers(), NetIDPage_OnInitDialog(), NetLocalGroupAddMembers(), NetLocalGroupDelMembers(), NetLocalGroupEnum(), NetLocalGroupGetMembers(), NetpGetComputerName(), NetUserChangePassword(), NetUserGetLocalGroups(), NetWkstaUserGetInfo(), NetworkPropDlgProc(), ntlm_InitializeSecurityContextW(), PrintAllJobs(), PrintJobDetails(), SetUserGeneralData(), SetUserProfileData(), UpdateGroupProperties(), UpdateGroupsList(), UpdateUserProperties(), UpdateUsersList(), and UserMembershipPageProc().

◆ NetApiBufferReallocate()

NET_API_STATUS WINAPI NetApiBufferReallocate ( LPVOID  OldBuffer,
DWORD  NewByteCount,
LPVOID NewBuffer 
)

Definition at line 53 of file apibuf.c.

55 {
56  TRACE("(%p, %d, %p)\n", OldBuffer, NewByteCount, NewBuffer);
57  if (NewByteCount)
58  {
59  if (OldBuffer)
60  *NewBuffer = HeapReAlloc(GetProcessHeap(), 0, OldBuffer, NewByteCount);
61  else
62  *NewBuffer = HeapAlloc(GetProcessHeap(), 0, NewByteCount);
63  return *NewBuffer ? NERR_Success : GetLastError();
64  }
65  else
66  {
67  if (!HeapFree(GetProcessHeap(), 0, OldBuffer))
68  return GetLastError();
69  *NewBuffer = 0;
70  return NERR_Success;
71  }
72 }
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define NERR_Success
Definition: lmerr.h:5
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define HeapReAlloc
Definition: compat.h:393
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by NetpGetComputerName(), and NetWkstaUserGetInfo().

◆ NetApiBufferSize()

NET_API_STATUS WINAPI NetApiBufferSize ( LPVOID  Buffer,
LPDWORD  ByteCount 
)

Definition at line 77 of file apibuf.c.

78 {
79  DWORD dw;
80 
81  TRACE("(%p, %p)\n", Buffer, ByteCount);
82  if (Buffer == NULL)
85  TRACE("size: %d\n", dw);
86  if (dw != 0xFFFFFFFF)
87  *ByteCount = dw;
88  else
89  *ByteCount = 0;
90 
91  return NERR_Success;
92 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
SIZE_T WINAPI HeapSize(HANDLE, DWORD, LPCVOID)
#define NERR_Success
Definition: lmerr.h:5
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
unsigned long DWORD
Definition: ntddk_ex.h:95
REFIID LPVOID DWORD dw
Definition: atlbase.h:40
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _In_ LARGE_INTEGER ByteCount
Definition: iotypes.h:1060

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( netapi32  )