' ########################################################################################
' Microsoft Windows
' File: LMRemUtl.inc
' Contents: Structures, function prototypes, and definitions for the NetRemote 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_LMRemUtl_PBI)
#DEFINE PBX_LMRemUtl_PBI
%EQUATE `LMREMUTL_INC = 1
'//
'// Type Definitions
'//
'#ifndef DESC_CHAR_UNICODE
'typedef CHAR DESC_CHAR;
'#else // DESC_CHAR_UNICODE is defined
'typedef WCHAR DESC_CHAR;
'#endif // DESC_CHAR_UNICODE is defined
'typedef DESC_CHAR * LPDESC;
'//
'// Function Prototypes
'//
DECLARE FUNCTION NetRemoteTOD LIB "netapi32.dll" ALIAS "NetRemoteTOD" ( BYREF UncServerName AS WSTRINGZ , BYREF BufferPtr AS ANY ) AS QUAD ' NET_API_STATUS
DECLARE FUNCTION NetRemoteComputerSupports LIB "netapi32.dll" ALIAS "NetRemoteComputerSupports" ( BYREF UncServerName AS WSTRINGZ , BYVAL OptionsWanted AS QUAD , BYREF OptionsSupported AS QUAD ) AS QUAD ' NET_API_STATUS
'NET_API_STATUS
'RxRemoteApi(
' IN DWORD ApiNumber,
' IN LPCWSTR UncServerName, // Required, with \\name.
' IN LPDESC ParmDescString,
' IN LPDESC DataDesc16 OPTIONAL,
' IN LPDESC DataDesc32 OPTIONAL,
' IN LPDESC DataDescSmb OPTIONAL,
' IN LPDESC AuxDesc16 OPTIONAL,
' IN LPDESC AuxDesc32 OPTIONAL,
' IN LPDESC AuxDescSmb OPTIONAL,
' IN DWORD Flags,
' ... // rest of API's arguments
' );
DECLARE FUNCTION RxRemoteApi CDECL LIB "netapi32.dll" ALIAS "RxRemoteApi" ( BYVAL ApiNumber AS QUAD , BYREF UncServerName AS WSTRINGZ , BYVAL ParmDescString AS QUAD , BYVAL DataDesc16 AS QUAD , BYVAL DataDesc32 AS QUAD , BYVAL DataDescSmb AS QUAD , BYVAL AuxDesc16 AS QUAD , BYVAL AuxDesc32 AS QUAD , BYVAL AuxDescSmb AS QUAD , BYVAL Flags AS QUAD , OPTIONAL BYVAL DWORD ' Optional parameters , BYVAL DWORD , BYVAL DWORD , BYVAL DWORD , BYVAL DWORD , BYVAL DWORD , BYVAL DWORD , BYVAL DWORD , BYVAL DWORD , BYVAL DWORD , BYVAL DWORD , BYVAL DWORD ) AS QUAD ' NET_API_STATUS
'//
'// Data Structures
'//
' // Size = 48 bytes
TYPE TIME_OF_DAY_INFO DWORD
 tod_elapsedt AS DWORD ' DWORD tod_elapsedt
 tod_msecs AS DWORD ' DWORD tod_msecs
 tod_hours AS DWORD ' DWORD tod_hours
 tod_mins AS DWORD ' DWORD tod_mins
 tod_secs AS DWORD ' DWORD tod_secs
 tod_hunds AS DWORD ' DWORD tod_hunds
 tod_timezone AS LONG ' LONG tod_timezone
 tod_tinterval AS DWORD ' DWORD tod_tinterval
 tod_day AS DWORD ' DWORD tod_day
 tod_month AS DWORD ' DWORD tod_month
 tod_year AS DWORD ' DWORD tod_year
 tod_weekday AS DWORD ' DWORD tod_weekday
END TYPE
'//
'// Special Values and Constants
'//
'//
'// Mask bits for use with NetRemoteComputerSupports:
'//
%EQUATE `SUPPORTS_REMOTE_ADMIN_PROTOCOL = &H00000002
%EQUATE `SUPPORTS_RPC = &H00000004
%EQUATE `SUPPORTS_SAM_PROTOCOL = &H00000008
%EQUATE `SUPPORTS_UNICODE = &H00000010
%EQUATE `SUPPORTS_LOCAL = &H00000020
%EQUATE `SUPPORTS_ANY = &HFFFFFFFF
'//
'// Flag bits for RxRemoteApi:
'//
%EQUATE `NO_PERMISSION_REQUIRED = &H00000001 ' // set if use NULL session
%EQUATE `ALLOCATE_RESPONSE = &H00000002 ' // set if RxRemoteApi allocates response buffer
%EQUATE `USE_SPECIFIC_TRANSPORT = &H80000000
#ENDIF
