' ########################################################################################
' Microsoft Windows
' File: prnasnot.inc
' Contents: Header file for Print 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_prnasnot_PBI)
#DEFINE PBX_prnasnot_PBI
%EQUATE `PRNASNOT_INC = 1
'#if (NTDDI_VERSION >= NTDDI_VISTA)
#INCLUDE ONCE "Legacy/UI/InitGuid.inc"
#INCLUDE ONCE "Legacy/System/ObjBase.inc"
$IID_IPrintAsyncNotifyChannel = GUID$("{4A5031B1-1F3F-4DB0-A462-4530ED8B0451}")
$IID_IPrintAsyncNotifyCallback = GUID$("{7DEF34C1-9D92-4C99-B3B3-DB94A9D4191B}")
$IID_IPrintAsyncNotifyDataObject = GUID$("{77CF513E-5D49-4789-9F30-D0822B335C0D}")
$NOTIFICATION_RELEASE = GUID$("{BA9A5027-A70E-4AE7-9B7D-EB3E06AD4157}")
'//
'// Global Application Bidi Notification Channel
'// All Apps interested in Bidi Notifications from the Print subsystem should register for
'// notifications on this Channel GUID
'//
'// {2ABAD223-B994-4ACA-82FC-4571B1B585AC}
$PRINT_APP_BIDI_NOTIFY_CHANNEL = GUID$("{2ABAD223-B994-4ACA-82FC-4571B1B585AC}")
'//
'// Global Port Monitor Bidi Notification Channel
'// This is the Global Channel GUID that all Bidi enabled Port Monitor should open to send
'// Bidi Schema notifications up
'//
'// {25DF3B0E-74A9-47F5-80CE-79B4B1EB5C58}
$PRINT_PORT_MONITOR_NOTIFY_CHANNEL = GUID$("{25DF3B0E-74A9-47F5-80CE-79B4B1EB5C58}")
' enum PrintAsyncNotifyUserFilter
%EQUATE `kPerUser = 0
%EQUATE `kAllUsers = 1
' enum PrintAsyncNotifyConversationStyle
%EQUATE `kBiDirectional = 0
%EQUATE `kUniDirectional = 1
'typedef GUID PrintAsyncNotificationType;
' ########################################################################################
' IPrintAsyncNotifyDataObject interface
' IID = 77CF513E-5D49-4789-9F30-D0822B335C0D
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IPrintAsyncNotifyDataObject_INTERFACE_DEFINED)
 %IPrintAsyncNotifyDataObject_INTERFACE_DEFINED = 1
INTERFACE IPrintAsyncNotifyDataObject $IID_IPrintAsyncNotifyDataObject
 INHERIT IUnknown
 ' =====================================================================================
 METHOD AcquireData ( ' VTable offset = 12
 BYREF ppNotificationData AS DWORD
 , BYREF pSize AS DWORD
 , BYREF ppSchema AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD ReleaseData ( ' VTable offset = 16
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IPrintAsyncNotifyDataObject_INTERFACE_DEFINED__ */
' ########################################################################################
' IPrintAsyncNotifyChannel interface
' IID = 4A5031B1-1F3F-4DB0-A462-4530ED8B0451
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IPrintAsyncNotifyChannel_INTERFACE_DEFINED)
 %IPrintAsyncNotifyChannel_INTERFACE_DEFINED = 1
INTERFACE IPrintAsyncNotifyChannel $IID_IPrintAsyncNotifyChannel
 INHERIT IUnknown
 ' =====================================================================================
 METHOD SendNotification ( ' VTable offset = 12
 BYVAL pData AS IPrintAsyncNotifyDataObject
 ) AS LONG
 ' =====================================================================================
 METHOD CloseChannel ( ' VTable offset = 16
 BYVAL pData AS IPrintAsyncNotifyDataObject
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IPrintAsyncNotifyChannel_INTERFACE_DEFINED__ */
' ########################################################################################
' IPrintAsyncNotifyCallback interface
' IID = 7DEF34C1-9D92-4C99-B3B3-DB94A9D4191B
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IPrintAsyncNotifyCallback_INTERFACE_DEFINED)
 %IPrintAsyncNotifyCallback_INTERFACE_DEFINED = 1
INTERFACE IPrintAsyncNotifyCallback $IID_IPrintAsyncNotifyCallback
 INHERIT IUnknown
 ' =====================================================================================
 METHOD OnEventNotify ( ' VTable offset = 12
 BYVAL pChannel AS IPrintAsyncNotifyChannel
 , BYVAL pData AS IPrintAsyncNotifyDataObject
 ) AS LONG
 ' =====================================================================================
 METHOD ChannelClosed ( ' VTable offset = 16
 BYVAL pChannel AS IPrintAsyncNotifyChannel
 , BYVAL pData AS IPrintAsyncNotifyDataObject
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IPrintAsyncNotifyCallback_INTERFACE_DEFINED__ */
DECLARE FUNCTION RegisterForPrintAsyncNotifications LIB "winspool.drv" ALIAS "RegisterForPrintAsyncNotifications" ( BYREF pszName AS WSTRINGZ , BYREF pNotificationType AS GUID , BYVAL eUserFilter AS QUAD , BYVAL eConversationStyle AS QUAD , BYVAL pCallback AS IPrintAsyncNotifyCallback , BYREF phNotify AS QUAD ) AS LONG
DECLARE FUNCTION UnRegisterForPrintAsyncNotifications LIB "winspool.drv" ALIAS "UnRegisterForPrintAsyncNotifications" ( BYVAL pszName AS QUAD
 ) AS LONG
DECLARE FUNCTION CreatePrintAsyncNotifyChannel LIB "winspool.drv" ALIAS "CreatePrintAsyncNotifyChannel" ( BYREF pszName AS WSTRINGZ
 , BYREF pNotificationType AS GUID
 , BYVAL eUserFilter AS DWORD
 , BYVAL eConversationStyle AS DWORD
 , BYVAL pCallback AS IPrintAsyncNotifyCallback
 , BYREF ppIAsynchNotification AS IPrintAsyncNotifyChannel
 ) AS LONG
' enum PrintAsyncNotifyError
%EQUATE `CHANNEL_CLOSED_BY_SERVER = &H01
%EQUATE `CHANNEL_CLOSED_BY_ANOTHER_LISTENER = &H02
%EQUATE `CHANNEL_CLOSED_BY_SAME_LISTENER = &H03
%EQUATE `CHANNEL_RELEASED_BY_LISTENER = &H04
%EQUATE `UNIRECTIONAL_NOTIFICATION_LOST = &H05
%EQUATE `ASYNC_NOTIFICATION_FAILURE = &H06
%EQUATE `NO_LISTENERS = &H07
%EQUATE `CHANNEL_ALREADY_CLOSED = &H08
%EQUATE `CHANNEL_ALREADY_OPENED = &H09
%EQUATE `CHANNEL_WAITING_FOR_CLIENT_NOTIFICATION = &H0a
%EQUATE `CHANNEL_NOT_OPENED = &H0b
%EQUATE `ASYNC_CALL_ALREADY_PARKED = &H0c
%EQUATE `NOT_REGISTERED = &H0d
%EQUATE `ALREADY_UNREGISTERED = &H0e
%EQUATE `ALREADY_REGISTERED = &H0f
%EQUATE `CHANNEL_ACQUIRED = &H10
%EQUATE `ASYNC_CALL_IN_PROGRESS = &H11
%EQUATE `MAX_NOTIFICATION_SIZE_EXCEEDED = &H12
%EQUATE `INTERNAL_NOTIFICATION_QUEUE_IS_FULL = &H13
%EQUATE `INVALID_NOTIFICATION_TYPE = &H14
%EQUATE `MAX_REGISTRATION_COUNT_EXCEEDED = &H15
%EQUATE `MAX_CHANNEL_COUNT_EXCEEDED = &H16
%EQUATE `LOCAL_ONLY_REGISTRATION = &H17
%EQUATE `REMOTE_ONLY_REGISTRATION = &H18
'#endif // (NTDDI_VERSION >= NTDDI_VISTA)
#ENDIF
