' ########################################################################################
' Microsoft Windows
' File: LMAPIbuf.inc
' Contents: This file contains information about NetApiBuffer APIs
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_LMAPIbuf_PBI)
#DEFINE PBX_LMAPIbuf_PBI
%EQUATE `LMAPIBUF_INC = 1
'//
'// Function Prototypes
'//
DECLARE FUNCTION NetApiBufferAllocate LIB "netapi32.dll" ALIAS "NetApiBufferAllocate" ( BYVAL ByteCount AS QUAD , BYREF Buffer AS ANY ) AS QUAD ' NET_API_STATUS
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION NetApiBufferFree LIB "NetApi32.dll" ALIAS "NetApiBufferFree" ( pBuffer AS ANY
 ) AS QUAD
#ELSE
DECLARE FUNCTION NetApiBufferFree LIB "netapi32.dll" ALIAS "NetApiBufferFree" ( BYVAL Buffer AS QUAD ) AS QUAD ' NET_API_STATUS
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION NetApiBufferReallocate LIB "NetApi32.dll" ALIAS "NetApiBufferReallocate" ( pOldBuffer AS ANY,
 BYVAL NewByteCount AS QUAD, pNewBuffer AS ANY ' LPVOID * ) AS QUAD
#ELSE
DECLARE FUNCTION NetApiBufferReallocate LIB "netapi32.dll" ALIAS "NetApiBufferReallocate" ( BYVAL OldBuffer AS QUAD , BYVAL NewByteCount AS QUAD , BYREF NewBuffer AS ANY ) AS QUAD ' NET_API_STATUS
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION NetApiBufferSize LIB "NetApi32.dll" ALIAS "NetApiBufferSize" ( pBuffer AS ANY,
 ByteCount AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION NetApiBufferSize LIB "netapi32.dll" ALIAS "NetApiBufferSize" ( BYVAL Buffer AS QUAD , BYREF ByteCount AS QUAD ) AS QUAD ' NET_API_STATUS
#ENDIF
'//
'// The following private function will go away eventually.
'// Call NetApiBufferAllocate instead.
'//
'NET_API_STATUS NET_API_FUNCTION
'NetapipBufferAllocate ( // Internal Function
' IN DWORD ByteCount,
' OUT LPVOID * Buffer
' );
#ENDIF
