ReactOS 0.4.16-dev-2528-g7139e57
main.c File Reference
#include <stdarg.h>
#include "ntstatus.h"
#include "windef.h"
#include "winbase.h"
#include "winternl.h"
#include "lm.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "initguid.h"
Include dependency graph for main.c:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (netutils)
 
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)
 

Macro Definition Documentation

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 28 of file main.c.

Function Documentation

◆ NetApiBufferAllocate()

NET_API_STATUS WINAPI NetApiBufferAllocate ( DWORD  ByteCount,
LPVOID Buffer 
)

Definition at line 44 of file main.c.

45 {
46 TRACE("(%ld, %p)\n", ByteCount, Buffer);
47
48 if (Buffer == NULL) return ERROR_INVALID_PARAMETER;
50 if (*Buffer)
51 return NERR_Success;
52 else
53 return GetLastError();
54 }
Definition: bufpool.h:45
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define HeapAlloc
Definition: compat.h:733
#define NERR_Success
Definition: lmerr.h:5
#define TRACE(s)
Definition: solgame.cpp:4
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _In_ LARGE_INTEGER ByteCount
Definition: iotypes.h:1099

◆ NetApiBufferFree()

NET_API_STATUS WINAPI NetApiBufferFree ( LPVOID  Buffer)

Definition at line 59 of file main.c.

60 {
61 TRACE("(%p)\n", Buffer);
63 return NERR_Success;
64 }
#define HeapFree(x, y, z)
Definition: compat.h:735

◆ NetApiBufferReallocate()

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

Definition at line 69 of file main.c.

71 {
72 TRACE("(%p, %ld, %p)\n", OldBuffer, NewByteCount, NewBuffer);
73 if (NewByteCount)
74 {
75 if (OldBuffer)
76 *NewBuffer = HeapReAlloc(GetProcessHeap(), 0, OldBuffer, NewByteCount);
77 else
78 *NewBuffer = HeapAlloc(GetProcessHeap(), 0, NewByteCount);
79 return *NewBuffer ? NERR_Success : GetLastError();
80 }
81 else
82 {
83 if (!HeapFree(GetProcessHeap(), 0, OldBuffer)) return GetLastError();
84 *NewBuffer = 0;
85 return NERR_Success;
86 }
87 }
#define HeapReAlloc
Definition: compat.h:734

◆ NetApiBufferSize()

NET_API_STATUS WINAPI NetApiBufferSize ( LPVOID  Buffer,
LPDWORD  ByteCount 
)

Definition at line 92 of file main.c.

93 {
94 DWORD dw;
95
96 TRACE("(%p, %p)\n", Buffer, ByteCount);
97 if (Buffer == NULL)
100 TRACE("size: %ld\n", dw);
101 if (dw != 0xFFFFFFFF)
102 *ByteCount = dw;
103 else
104 *ByteCount = 0;
105
106 return NERR_Success;
107 }
unsigned long DWORD
Definition: ntddk_ex.h:95
REFIID LPVOID DWORD_PTR dw
Definition: atlbase.h:40
SIZE_T WINAPI HeapSize(HANDLE, DWORD, LPCVOID)

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( netutils  )