/*** Autogenerated by WIDL 0.1 - Do not edit ***/

#ifndef __REDQ_RPCPROXY_H_VERSION__
#define __REQUIRED_RPCPROXY_H_VERSION__ 440
#endif /* __REDQ_RPCPROXY_H_VERSION__ */

#include "rpcproxy.h"
#ifndef __RPCPROXY_H_VERSION__
#error This code needs a newer version of rpcproxy.h
#endif /* __RPCPROXY_H_VERSION__ */

#include "sti.h"

#define TYPE_FORMAT_STRING_SIZE 1
#define PROC_FORMAT_STRING_SIZE 1

typedef struct _MIDL_TYPE_FORMAT_STRING
    {
    short Pad;
    unsigned char Format[TYPE_FORMAT_STRING_SIZE];
} MIDL_TYPE_FORMAT_STRING;

typedef struct _MIDL_PROC_FORMAT_STRING
    {
    short Pad;
    unsigned char Format[PROC_FORMAT_STRING_SIZE];
} MIDL_PROC_FORMAT_STRING;


extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;

extern const MIDL_STUB_DESC Object_StubDesc;

/*****************************************************************************
 * IStiDevice interface
 */
HRESULT STDMETHODCALLTYPE IStiDevice_Subscribe_Proxy(
    IStiDevice* This,
    LPSTISUBSCRIBE lpSubscribe)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 16);
        if(!lpSubscribe)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        RpcTryFinally
        {
            _StubMsg.BufferLength = 0U;
            NdrProxyGetBuffer(This, &_StubMsg);
            
            NdrProxySendReceive(This, &_StubMsg);

            if ((_Msg.DataRepresentation&0xffff) != NDR_LOCAL_DATA_REPRESENTATION)
                NdrConvert( &_StubMsg, &__MIDL_ProcFormatString.Format[0]);

            _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
            _RetVal = *(HRESULT *)_StubMsg.Buffer;
_StubMsg.Buffer += sizeof(HRESULT);
        }
        RpcFinally
        {
            NdrProxyFreeBuffer(This, &_StubMsg);
        }
        RpcEndFinally
    }
    RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
    {
        _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
    }
    RpcEndExcept
    return _RetVal;
}

void __RPC_STUB IStiDevice_Subscribe_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiDevice * _This = (IStiDevice*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    LPSTISUBSCRIBE lpSubscribe;

    NdrStubInitialize(_Msg, &_StubMsg, &Object_StubDesc, pRpcChannelBuffer);

    RpcTryFinally
    {
        if ((_Msg->DataRepresentation&0xffff) != NDR_LOCAL_DATA_REPRESENTATION)
            NdrConvert( &_StubMsg, &__MIDL_ProcFormatString.Format[0]);


        *_pdwStubPhase = STUB_CALL_SERVER;

        _RetVal = IStiDevice_Subscribe(_This, lpSubscribe);

        *_pdwStubPhase = STUB_MARSHAL;

        _StubMsg.BufferLength = 0U;
        NdrStubGetBuffer(This, pRpcChannelBuffer, &_StubMsg);

        _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
        *(HRESULT *)_StubMsg.Buffer = _RetVal;
_StubMsg.Buffer += sizeof(HRESULT);
    }
    RpcFinally
    {
    }
    RpcEndFinally
    _Msg->BufferLength = ((long)_StubMsg.Buffer - (long)_Msg->Buffer);
}

HRESULT STDMETHODCALLTYPE IStiDevice_GetLastNotificationData_Proxy(
    IStiDevice* This,
    LPSTINOTIFY lpNotify)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 17);
        if(!lpNotify)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        RpcTryFinally
        {
            _StubMsg.BufferLength = 0U;
            NdrProxyGetBuffer(This, &_StubMsg);
            
            NdrProxySendReceive(This, &_StubMsg);

            if ((_Msg.DataRepresentation&0xffff) != NDR_LOCAL_DATA_REPRESENTATION)
                NdrConvert( &_StubMsg, &__MIDL_ProcFormatString.Format[0]);

            _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
            _RetVal = *(HRESULT *)_StubMsg.Buffer;
_StubMsg.Buffer += sizeof(HRESULT);
        }
        RpcFinally
        {
            NdrProxyFreeBuffer(This, &_StubMsg);
        }
        RpcEndFinally
    }
    RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
    {
        _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
    }
    RpcEndExcept
    return _RetVal;
}

void __RPC_STUB IStiDevice_GetLastNotificationData_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiDevice * _This = (IStiDevice*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    LPSTINOTIFY lpNotify;

    NdrStubInitialize(_Msg, &_StubMsg, &Object_StubDesc, pRpcChannelBuffer);

    RpcTryFinally
    {
        if ((_Msg->DataRepresentation&0xffff) != NDR_LOCAL_DATA_REPRESENTATION)
            NdrConvert( &_StubMsg, &__MIDL_ProcFormatString.Format[0]);


        *_pdwStubPhase = STUB_CALL_SERVER;

        _RetVal = IStiDevice_GetLastNotificationData(_This, lpNotify);

        *_pdwStubPhase = STUB_MARSHAL;

        _StubMsg.BufferLength = 0U;
        NdrStubGetBuffer(This, pRpcChannelBuffer, &_StubMsg);

        _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
        *(HRESULT *)_StubMsg.Buffer = _RetVal;
_StubMsg.Buffer += sizeof(HRESULT);
    }
    RpcFinally
    {
    }
    RpcEndFinally
    _Msg->BufferLength = ((long)_StubMsg.Buffer - (long)_Msg->Buffer);
}

HRESULT STDMETHODCALLTYPE IStiDevice_UnSubscribe_Proxy(
    IStiDevice* This)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 18);
        RpcTryFinally
        {
            _StubMsg.BufferLength = 0U;
            NdrProxyGetBuffer(This, &_StubMsg);
            
            NdrProxySendReceive(This, &_StubMsg);

            if ((_Msg.DataRepresentation&0xffff) != NDR_LOCAL_DATA_REPRESENTATION)
                NdrConvert( &_StubMsg, &__MIDL_ProcFormatString.Format[0]);

            _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
            _RetVal = *(HRESULT *)_StubMsg.Buffer;
_StubMsg.Buffer += sizeof(HRESULT);
        }
        RpcFinally
        {
            NdrProxyFreeBuffer(This, &_StubMsg);
        }
        RpcEndFinally
    }
    RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
    {
        _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
    }
    RpcEndExcept
    return _RetVal;
}

void __RPC_STUB IStiDevice_UnSubscribe_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiDevice * _This = (IStiDevice*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;

    NdrStubInitialize(_Msg, &_StubMsg, &Object_StubDesc, pRpcChannelBuffer);

    RpcTryFinally
    {
        if ((_Msg->DataRepresentation&0xffff) != NDR_LOCAL_DATA_REPRESENTATION)
            NdrConvert( &_StubMsg, &__MIDL_ProcFormatString.Format[0]);


        *_pdwStubPhase = STUB_CALL_SERVER;

        _RetVal = IStiDevice_UnSubscribe(_This);

        *_pdwStubPhase = STUB_MARSHAL;

        _StubMsg.BufferLength = 0U;
        NdrStubGetBuffer(This, pRpcChannelBuffer, &_StubMsg);

        _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
        *(HRESULT *)_StubMsg.Buffer = _RetVal;
_StubMsg.Buffer += sizeof(HRESULT);
    }
    RpcFinally
    {
    }
    RpcEndFinally
    _Msg->BufferLength = ((long)_StubMsg.Buffer - (long)_Msg->Buffer);
}

const CINTERFACE_PROXY_VTABLE(19) _IStiDeviceProxyVtbl =
{
    {
        &IID_IStiDevice,
    },
    {
        IUnknown_QueryInterface_Proxy,
        IUnknown_AddRef_Proxy,
        IUnknown_Release_Proxy,
        IStiDevice_Initialize_Proxy,
        IStiDevice_GetCapabilities_Proxy,
        IStiDevice_GetStatus_Proxy,
        IStiDevice_DeviceReset_Proxy,
        IStiDevice_Diagnostic_Proxy,
        IStiDevice_Escape_Proxy,
        IStiDevice_GetLastError_Proxy,
        IStiDevice_LockDevice_Proxy,
        IStiDevice_UnLockDevice_Proxy,
        IStiDevice_RawReadData_Proxy,
        IStiDevice_RawWriteData_Proxy,
        IStiDevice_RawReadCommand_Proxy,
        IStiDevice_RawWriteCommand_Proxy,
        IStiDevice_Subscribe_Proxy,
        IStiDevice_GetLastNotificationData_Proxy,
        IStiDevice_UnSubscribe_Proxy,
        IStiDevice_GetLastErrorInfo_Proxy
    }
};


static const PRPC_STUB_FUNCTION IStiDevice_table[] =
{
    IStiDevice_Subscribe_Stub,
    IStiDevice_GetLastNotificationData_Stub,
    IStiDevice_UnSubscribe_Stub
};

const CInterfaceStubVtbl _IStiDeviceStubVtbl =
{
    {
        &IID_IStiDevice,
        0,
        6,
        &IStiDevice_table[-3],
    },
    {
        CStdStubBuffer_METHODS
    }
};

/*****************************************************************************
 * IStillImageW interface
 */
HRESULT STDMETHODCALLTYPE IStillImageW_CreateDevice_Proxy(
    IStillImageW* This,
    LPWSTR pwszDeviceName,
    DWORD dwMode,
    IStiDevice* pDevice,
    LPUNKNOWN* punkOuter)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 6);
        if(!pDevice)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!punkOuter)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        RpcTryFinally
        {
            _StubMsg.BufferLength = 0U;
            NdrProxyGetBuffer(This, &_StubMsg);
            
            NdrProxySendReceive(This, &_StubMsg);

            if ((_Msg.DataRepresentation&0xffff) != NDR_LOCAL_DATA_REPRESENTATION)
                NdrConvert( &_StubMsg, &__MIDL_ProcFormatString.Format[0]);

            _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
            _RetVal = *(HRESULT *)_StubMsg.Buffer;
_StubMsg.Buffer += sizeof(HRESULT);
        }
        RpcFinally
        {
            NdrProxyFreeBuffer(This, &_StubMsg);
        }
        RpcEndFinally
    }
    RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
    {
        _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
    }
    RpcEndExcept
    return _RetVal;
}

void __RPC_STUB IStillImageW_CreateDevice_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStillImageW * _This = (IStillImageW*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    LPUNKNOWN* punkOuter;
    IStiDevice* pDevice;
    DWORD dwMode;
    LPWSTR pwszDeviceName;

    NdrStubInitialize(_Msg, &_StubMsg, &Object_StubDesc, pRpcChannelBuffer);

    RpcTryFinally
    {
        if ((_Msg->DataRepresentation&0xffff) != NDR_LOCAL_DATA_REPRESENTATION)
            NdrConvert( &_StubMsg, &__MIDL_ProcFormatString.Format[0]);


        *_pdwStubPhase = STUB_CALL_SERVER;

        _RetVal = IStillImageW_CreateDevice(_This, pwszDeviceName, dwMode, pDevice, punkOuter);

        *_pdwStubPhase = STUB_MARSHAL;

        _StubMsg.BufferLength = 0U;
        NdrStubGetBuffer(This, pRpcChannelBuffer, &_StubMsg);

        _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
        *(HRESULT *)_StubMsg.Buffer = _RetVal;
_StubMsg.Buffer += sizeof(HRESULT);
    }
    RpcFinally
    {
    }
    RpcEndFinally
    _Msg->BufferLength = ((long)_StubMsg.Buffer - (long)_Msg->Buffer);
}

HRESULT STDMETHODCALLTYPE IStillImageW_EnableHwNotifications_Proxy(
    IStillImageW* This,
    LPCWSTR pwszDeviceName,
    BOOL bNewState)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 12);
        RpcTryFinally
        {
            _StubMsg.BufferLength = 0U;
            NdrProxyGetBuffer(This, &_StubMsg);
            
            NdrProxySendReceive(This, &_StubMsg);

            if ((_Msg.DataRepresentation&0xffff) != NDR_LOCAL_DATA_REPRESENTATION)
                NdrConvert( &_StubMsg, &__MIDL_ProcFormatString.Format[0]);

            _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
            _RetVal = *(HRESULT *)_StubMsg.Buffer;
_StubMsg.Buffer += sizeof(HRESULT);
        }
        RpcFinally
        {
            NdrProxyFreeBuffer(This, &_StubMsg);
        }
        RpcEndFinally
    }
    RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
    {
        _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
    }
    RpcEndExcept
    return _RetVal;
}

void __RPC_STUB IStillImageW_EnableHwNotifications_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStillImageW * _This = (IStillImageW*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    BOOL bNewState;
    LPCWSTR pwszDeviceName;

    NdrStubInitialize(_Msg, &_StubMsg, &Object_StubDesc, pRpcChannelBuffer);

    RpcTryFinally
    {
        if ((_Msg->DataRepresentation&0xffff) != NDR_LOCAL_DATA_REPRESENTATION)
            NdrConvert( &_StubMsg, &__MIDL_ProcFormatString.Format[0]);


        *_pdwStubPhase = STUB_CALL_SERVER;

        _RetVal = IStillImageW_EnableHwNotifications(_This, pwszDeviceName, bNewState);

        *_pdwStubPhase = STUB_MARSHAL;

        _StubMsg.BufferLength = 0U;
        NdrStubGetBuffer(This, pRpcChannelBuffer, &_StubMsg);

        _StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
        *(HRESULT *)_StubMsg.Buffer = _RetVal;
_StubMsg.Buffer += sizeof(HRESULT);
    }
    RpcFinally
    {
    }
    RpcEndFinally
    _Msg->BufferLength = ((long)_StubMsg.Buffer - (long)_Msg->Buffer);
}

