' ########################################################################################
' Microsoft Windows
' File: LMMsg.inc
' Contents: Structures, function prototypes, and definitions for the NetMessage API.
' 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_LMMsg_PBI)
#DEFINE PBX_LMMsg_PBI
%LMMSG_INC = 1
'//
'// Function Prototypes
'//
DECLARE FUNCTION NetMessageNameAdd LIB "netapi32.dll" ALIAS "NetMessageNameAdd" ( BYREF servername AS WSTRINGZ , BYREF msgname AS WSTRINGZ ) AS QUAD ' NET_API_STATUS
DECLARE FUNCTION NetMessageNameEnum LIB "netapi32.dll" ALIAS "NetMessageNameEnum" ( BYREF servername AS WSTRINGZ , BYVAL level AS QUAD , BYREF bufptr AS ANY , BYVAL prefmaxlen AS QUAD , BYREF entriesread AS QUAD , BYREF totalentries AS QUAD , BYREF resume_handle AS QUAD ) AS QUAD ' NET_API_STATUS
DECLARE FUNCTION NetMessageNameGetInfo LIB "netapi32.dll" ALIAS "NetMessageNameGetInfo" ( BYREF servername AS WSTRINGZ , BYREF msgname AS WSTRINGZ , BYVAL level AS QUAD , BYREF bufptr AS ANY ) AS QUAD ' NET_API_STATUS
DECLARE FUNCTION NetMessageNameDel LIB "netapi32.dll" ALIAS "NetMessageNameDel" ( BYREF servername AS WSTRINGZ , BYREF msgname AS WSTRINGZ ) AS QUAD ' NET_API_STATUS
DECLARE FUNCTION NetMessageBufferSend LIB "netapi32.dll" ALIAS "NetMessageBufferSend" ( BYREF servername AS WSTRINGZ , BYREF msgname AS WSTRINGZ , BYREF fromname AS WSTRINGZ , BYVAL buf AS BYTE PTR , BYVAL buflen AS QUAD ) AS QUAD ' NET_API_STATUS
'//
'// Data Structures
'//
' // Size = 4 bytes
TYPE MSG_INFO_0 DWORD
 msgi0_name AS WSTRINGZ PTR ' LPWSTR msgi0_name
END TYPE
' // Size = 12 bytes
TYPE MSG_INFO_1 DWORD
 msgi1_name AS WSTRINGZ PTR ' LPWSTR msgi1_name
 msgi1_forward_flag AS DWORD ' DWORD msgi1_forward_flag
 msgi1_forward AS WSTRINGZ PTR ' LPWSTR msgi1_forward
END TYPE
'//
'// Special Values and Constants
'//
'//
'// Values for msgi1_forward_flag.
'//
%MSGNAME_NOT_FORWARDED = 0 ' // Name not forwarded
%MSGNAME_FORWARDED_TO = &H04 ' // Name forward to remote station
%MSGNAME_FORWARDED_FROM = &H10 ' // Name forwarded from remote station