/*** 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 "stiusd.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;

/*****************************************************************************
 * IStiUSD interface
 */
HRESULT STDMETHODCALLTYPE IStiUSD_Initialize_Proxy(
    IStiUSD* This,
    PSTIDEVICECONTROL pDcb,
    DWORD dwStiVersion,
    HKEY hParametersKey)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 3);
        if(!pDcb)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!hParametersKey)
            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 IStiUSD_Initialize_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiUSD * _This = (IStiUSD*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    HKEY hParametersKey;
    DWORD dwStiVersion;
    PSTIDEVICECONTROL pDcb;

    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 = IStiUSD_Initialize(_This, pDcb, dwStiVersion, hParametersKey);

        *_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 IStiUSD_GetCapabilities_Proxy(
    IStiUSD* This,
    PSTI_USD_CAPS pUsdCaps)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 4);
        if(!pUsdCaps)
            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 IStiUSD_GetCapabilities_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiUSD * _This = (IStiUSD*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    PSTI_USD_CAPS pUsdCaps;

    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 = IStiUSD_GetCapabilities(_This, pUsdCaps);

        *_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 IStiUSD_GetStatus_Proxy(
    IStiUSD* This,
    PSTI_DEVICE_STATUS pDevStatus)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 5);
        if(!pDevStatus)
            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 IStiUSD_GetStatus_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiUSD * _This = (IStiUSD*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    PSTI_DEVICE_STATUS pDevStatus;

    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 = IStiUSD_GetStatus(_This, pDevStatus);

        *_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 IStiUSD_DeviceReset_Proxy(
    IStiUSD* This)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 6);
        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 IStiUSD_DeviceReset_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiUSD * _This = (IStiUSD*)((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 = IStiUSD_DeviceReset(_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);
}

HRESULT STDMETHODCALLTYPE IStiUSD_Diagnostic_Proxy(
    IStiUSD* This,
    LPSTI_DIAG pBuffer)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 7);
        if(!pBuffer)
            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 IStiUSD_Diagnostic_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiUSD * _This = (IStiUSD*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    LPSTI_DIAG pBuffer;

    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 = IStiUSD_Diagnostic(_This, pBuffer);

        *_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 IStiUSD_Escape_Proxy(
    IStiUSD* This,
    STI_RAW_CONTROL_CODE EscapeFunction,
    LPVOID lpInData,
    DWORD cbInDataSize,
    LPVOID pOutData,
    DWORD dwOutDataSize,
    LPDWORD pdwActualData)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 8);
        if(!lpInData)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!pOutData)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!pdwActualData)
            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 IStiUSD_Escape_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiUSD * _This = (IStiUSD*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    LPDWORD pdwActualData;
    DWORD dwOutDataSize;
    LPVOID pOutData;
    DWORD cbInDataSize;
    LPVOID lpInData;
    STI_RAW_CONTROL_CODE EscapeFunction;

    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 = IStiUSD_Escape(_This, EscapeFunction, lpInData, cbInDataSize, pOutData, dwOutDataSize, pdwActualData);

        *_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 IStiUSD_GetLastError_Proxy(
    IStiUSD* This,
    LPDWORD pdwLastDeviceError)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 9);
        if(!pdwLastDeviceError)
            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 IStiUSD_GetLastError_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiUSD * _This = (IStiUSD*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    LPDWORD pdwLastDeviceError;

    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 = IStiUSD_GetLastError(_This, pdwLastDeviceError);

        *_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 IStiUSD_LockDevice_Proxy(
    IStiUSD* This)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 10);
        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 IStiUSD_LockDevice_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiUSD * _This = (IStiUSD*)((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 = IStiUSD_LockDevice(_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);
}

HRESULT STDMETHODCALLTYPE IStiUSD_UnlockDevice_Proxy(
    IStiUSD* This)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 11);
        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 IStiUSD_UnlockDevice_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiUSD * _This = (IStiUSD*)((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 = IStiUSD_UnlockDevice(_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);
}

HRESULT STDMETHODCALLTYPE IStiUSD_RawReadData_Proxy(
    IStiUSD* This,
    LPVOID lpBuffer,
    LPDWORD lpdwNumberOfBytes,
    OVERLAPPED* lpOverlapped)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 12);
        if(!lpBuffer)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!lpdwNumberOfBytes)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!lpOverlapped)
            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 IStiUSD_RawReadData_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiUSD * _This = (IStiUSD*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    OVERLAPPED* lpOverlapped;
    LPDWORD lpdwNumberOfBytes;
    LPVOID lpBuffer;

    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 = IStiUSD_RawReadData(_This, lpBuffer, lpdwNumberOfBytes, lpOverlapped);

        *_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 IStiUSD_RawWriteData_Proxy(
    IStiUSD* This,
    LPVOID lpBuffer,
    DWORD nNumberOfBytes,
    OVERLAPPED* lpOverlapped)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 13);
        if(!lpBuffer)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!lpOverlapped)
            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 IStiUSD_RawWriteData_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiUSD * _This = (IStiUSD*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    OVERLAPPED* lpOverlapped;
    DWORD nNumberOfBytes;
    LPVOID lpBuffer;

    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 = IStiUSD_RawWriteData(_This, lpBuffer, nNumberOfBytes, lpOverlapped);

        *_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 IStiUSD_RawReadCommand_Proxy(
    IStiUSD* This,
    LPVOID lpBuffer,
    LPDWORD lpdwNumberOfBytes,
    OVERLAPPED* lpOverlapped)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 14);
        if(!lpBuffer)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!lpdwNumberOfBytes)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!lpOverlapped)
            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 IStiUSD_RawReadCommand_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiUSD * _This = (IStiUSD*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    OVERLAPPED* lpOverlapped;
    LPDWORD lpdwNumberOfBytes;
    LPVOID lpBuffer;

    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 = IStiUSD_RawReadCommand(_This, lpBuffer, lpdwNumberOfBytes, lpOverlapped);

        *_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 IStiUSD_RawWriteCommand_Proxy(
    IStiUSD* This,
    LPVOID lpBuffer,
    DWORD nNumberOfBytes,
    OVERLAPPED* lpOverlapped)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 15);
        if(!lpBuffer)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!lpOverlapped)
            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 IStiUSD_RawWriteCommand_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiUSD * _This = (IStiUSD*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    OVERLAPPED* lpOverlapped;
    DWORD nNumberOfBytes;
    LPVOID lpBuffer;

    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 = IStiUSD_RawWriteCommand(_This, lpBuffer, nNumberOfBytes, lpOverlapped);

        *_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 IStiUSD_SetNotificationHandle_Proxy(
    IStiUSD* This,
    HANDLE hEvent)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 16);
        if(!hEvent)
            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 IStiUSD_SetNotificationHandle_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiUSD * _This = (IStiUSD*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    HANDLE hEvent;

    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 = IStiUSD_SetNotificationHandle(_This, hEvent);

        *_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 IStiUSD_GetNotificationData_Proxy(
    IStiUSD* This,
    LPSTINOTIFY pBuffer)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 17);
        if(!pBuffer)
            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 IStiUSD_GetNotificationData_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiUSD * _This = (IStiUSD*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    LPSTINOTIFY pBuffer;

    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 = IStiUSD_GetNotificationData(_This, pBuffer);

        *_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 IStiUSD_GetLastErrorInfo_Proxy(
    IStiUSD* This,
    STI_ERROR_INFOW* pLastErrorInfo)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 18);
        if(!pLastErrorInfo)
            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 IStiUSD_GetLastErrorInfo_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiUSD * _This = (IStiUSD*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    STI_ERROR_INFOW* pLastErrorInfo;

    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 = IStiUSD_GetLastErrorInfo(_This, pLastErrorInfo);

        *_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) _IStiUSDProxyVtbl =
{
    {
        &IID_IStiUSD,
    },
    {
        IUnknown_QueryInterface_Proxy,
        IUnknown_AddRef_Proxy,
        IUnknown_Release_Proxy,
        IStiUSD_Initialize_Proxy,
        IStiUSD_GetCapabilities_Proxy,
        IStiUSD_GetStatus_Proxy,
        IStiUSD_DeviceReset_Proxy,
        IStiUSD_Diagnostic_Proxy,
        IStiUSD_Escape_Proxy,
        IStiUSD_GetLastError_Proxy,
        IStiUSD_LockDevice_Proxy,
        IStiUSD_UnlockDevice_Proxy,
        IStiUSD_RawReadData_Proxy,
        IStiUSD_RawWriteData_Proxy,
        IStiUSD_RawReadCommand_Proxy,
        IStiUSD_RawWriteCommand_Proxy,
        IStiUSD_SetNotificationHandle_Proxy,
        IStiUSD_GetNotificationData_Proxy,
        IStiUSD_GetLastErrorInfo_Proxy
    }
};


static const PRPC_STUB_FUNCTION IStiUSD_table[] =
{
    IStiUSD_Initialize_Stub,
    IStiUSD_GetCapabilities_Stub,
    IStiUSD_GetStatus_Stub,
    IStiUSD_DeviceReset_Stub,
    IStiUSD_Diagnostic_Stub,
    IStiUSD_Escape_Stub,
    IStiUSD_GetLastError_Stub,
    IStiUSD_LockDevice_Stub,
    IStiUSD_UnlockDevice_Stub,
    IStiUSD_RawReadData_Stub,
    IStiUSD_RawWriteData_Stub,
    IStiUSD_RawReadCommand_Stub,
    IStiUSD_RawWriteCommand_Stub,
    IStiUSD_SetNotificationHandle_Stub,
    IStiUSD_GetNotificationData_Stub,
    IStiUSD_GetLastErrorInfo_Stub
};

const CInterfaceStubVtbl _IStiUSDStubVtbl =
{
    {
        &IID_IStiUSD,
        0,
        19,
        &IStiUSD_table[-3],
    },
    {
        CStdStubBuffer_METHODS
    }
};

/*****************************************************************************
 * IStiDeviceControl interface
 */
HRESULT STDMETHODCALLTYPE IStiDeviceControl_Initialize_Proxy(
    IStiDeviceControl* This,
    DWORD dwDeviceType,
    DWORD dwMode,
    LPCWSTR pwszPortName,
    DWORD dwFlags)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 3);
        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 IStiDeviceControl_Initialize_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiDeviceControl * _This = (IStiDeviceControl*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    DWORD dwFlags;
    LPCWSTR pwszPortName;
    DWORD dwMode;
    DWORD dwDeviceType;

    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 = IStiDeviceControl_Initialize(_This, dwDeviceType, dwMode, pwszPortName, dwFlags);

        *_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 IStiDeviceControl_RawReadData_Proxy(
    IStiDeviceControl* This,
    LPVOID lpBuffer,
    LPDWORD lpdwNumberOfBytes,
    OVERLAPPED* lpOverlapped)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 4);
        if(!lpBuffer)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!lpdwNumberOfBytes)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!lpOverlapped)
            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 IStiDeviceControl_RawReadData_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiDeviceControl * _This = (IStiDeviceControl*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    OVERLAPPED* lpOverlapped;
    LPDWORD lpdwNumberOfBytes;
    LPVOID lpBuffer;

    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 = IStiDeviceControl_RawReadData(_This, lpBuffer, lpdwNumberOfBytes, lpOverlapped);

        *_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 IStiDeviceControl_RawWriteData_Proxy(
    IStiDeviceControl* This,
    LPVOID lpBuffer,
    DWORD nNumberOfBytes,
    OVERLAPPED* lpOverlapped)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 5);
        if(!lpBuffer)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!lpOverlapped)
            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 IStiDeviceControl_RawWriteData_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiDeviceControl * _This = (IStiDeviceControl*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    OVERLAPPED* lpOverlapped;
    DWORD nNumberOfBytes;
    LPVOID lpBuffer;

    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 = IStiDeviceControl_RawWriteData(_This, lpBuffer, nNumberOfBytes, lpOverlapped);

        *_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 IStiDeviceControl_RawReadCommand_Proxy(
    IStiDeviceControl* This,
    LPVOID lpBuffer,
    LPDWORD lpdwNumberOfBytes,
    OVERLAPPED* lpOverlapped)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 6);
        if(!lpBuffer)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!lpdwNumberOfBytes)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!lpOverlapped)
            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 IStiDeviceControl_RawReadCommand_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiDeviceControl * _This = (IStiDeviceControl*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    OVERLAPPED* lpOverlapped;
    LPDWORD lpdwNumberOfBytes;
    LPVOID lpBuffer;

    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 = IStiDeviceControl_RawReadCommand(_This, lpBuffer, lpdwNumberOfBytes, lpOverlapped);

        *_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 IStiDeviceControl_RawWriteCommand_Proxy(
    IStiDeviceControl* This,
    LPVOID lpBuffer,
    DWORD nNumberOfBytes,
    OVERLAPPED* lpOverlapped)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 7);
        if(!lpBuffer)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!lpOverlapped)
            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 IStiDeviceControl_RawWriteCommand_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiDeviceControl * _This = (IStiDeviceControl*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    OVERLAPPED* lpOverlapped;
    DWORD nNumberOfBytes;
    LPVOID lpBuffer;

    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 = IStiDeviceControl_RawWriteCommand(_This, lpBuffer, nNumberOfBytes, lpOverlapped);

        *_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 IStiDeviceControl_RawDeviceControl_Proxy(
    IStiDeviceControl* This,
    STI_RAW_CONTROL_CODE EscapeFunction,
    LPVOID lpInData,
    DWORD cbInDataSize,
    LPVOID pOutData,
    DWORD dwOutDataSize,
    LPDWORD pdwActualData)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 8);
        if(!lpInData)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!pOutData)
            RpcRaiseException(RPC_X_NULL_REF_POINTER);
        if(!pdwActualData)
            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 IStiDeviceControl_RawDeviceControl_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiDeviceControl * _This = (IStiDeviceControl*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    LPDWORD pdwActualData;
    DWORD dwOutDataSize;
    LPVOID pOutData;
    DWORD cbInDataSize;
    LPVOID lpInData;
    STI_RAW_CONTROL_CODE EscapeFunction;

    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 = IStiDeviceControl_RawDeviceControl(_This, EscapeFunction, lpInData, cbInDataSize, pOutData, dwOutDataSize, pdwActualData);

        *_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 IStiDeviceControl_GetLastError_Proxy(
    IStiDeviceControl* This,
    LPDWORD lpdwLastError)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 9);
        if(!lpdwLastError)
            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 IStiDeviceControl_GetLastError_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiDeviceControl * _This = (IStiDeviceControl*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    LPDWORD lpdwLastError;

    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 = IStiDeviceControl_GetLastError(_This, lpdwLastError);

        *_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 IStiDeviceControl_GetMyDevicePortName_Proxy(
    IStiDeviceControl* This,
    LPWSTR lpszDevicePath,
    DWORD cwDevicePathSize)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 10);
        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 IStiDeviceControl_GetMyDevicePortName_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiDeviceControl * _This = (IStiDeviceControl*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    DWORD cwDevicePathSize;
    LPWSTR lpszDevicePath;

    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 = IStiDeviceControl_GetMyDevicePortName(_This, lpszDevicePath, cwDevicePathSize);

        *_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 IStiDeviceControl_GetMyDeviceHandle_Proxy(
    IStiDeviceControl* This,
    HANDLE* lph)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 11);
        if(!lph)
            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 IStiDeviceControl_GetMyDeviceHandle_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiDeviceControl * _This = (IStiDeviceControl*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    HANDLE* lph;

    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 = IStiDeviceControl_GetMyDeviceHandle(_This, lph);

        *_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 IStiDeviceControl_GetMyDeviceOpenMode_Proxy(
    IStiDeviceControl* This,
    LPDWORD pdwOpenMode)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 12);
        if(!pdwOpenMode)
            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 IStiDeviceControl_GetMyDeviceOpenMode_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiDeviceControl * _This = (IStiDeviceControl*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    LPDWORD pdwOpenMode;

    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 = IStiDeviceControl_GetMyDeviceOpenMode(_This, pdwOpenMode);

        *_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 IStiDeviceControl_WriteToErrorLog_Proxy(
    IStiDeviceControl* This,
    DWORD dwMessageType,
    LPCWSTR pszMessage,
    DWORD dwErrorCode)
{
    HRESULT     _RetVal;
    RPC_MESSAGE _Msg;
    MIDL_STUB_MESSAGE _StubMsg;
    
    RpcTryExcept
    {
        NdrProxyInitialize(This, &_Msg, &_StubMsg, &Object_StubDesc, 13);
        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 IStiDeviceControl_WriteToErrorLog_Stub(
    IRpcStubBuffer* This,
    IRpcChannelBuffer* pRpcChannelBuffer,
    PRPC_MESSAGE _Msg,
    DWORD* _pdwStubPhase)
{
    HRESULT _RetVal;
    IStiDeviceControl * _This = (IStiDeviceControl*)((CStdStubBuffer*)This)->pvServerObject;
    MIDL_STUB_MESSAGE _StubMsg;
    DWORD dwErrorCode;
    LPCWSTR pszMessage;
    DWORD dwMessageType;

    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 = IStiDeviceControl_WriteToErrorLog(_This, dwMessageType, pszMessage, dwErrorCode);

        *_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(14) _IStiDeviceControlProxyVtbl =
{
    {
        &IID_IStiDeviceControl,
    },
    {
        IUnknown_QueryInterface_Proxy,
        IUnknown_AddRef_Proxy,
        IUnknown_Release_Proxy,
        IStiDeviceControl_Initialize_Proxy,
        IStiDeviceControl_RawReadData_Proxy,
        IStiDeviceControl_RawWriteData_Proxy,
        IStiDeviceControl_RawReadCommand_Proxy,
        IStiDeviceControl_RawWriteCommand_Proxy,
        IStiDeviceControl_RawDeviceControl_Proxy,
        IStiDeviceControl_GetLastError_Proxy,
        IStiDeviceControl_GetMyDevicePortName_Proxy,
        IStiDeviceControl_GetMyDeviceHandle_Proxy,
        IStiDeviceControl_GetMyDeviceOpenMode_Proxy,
        IStiDeviceControl_WriteToErrorLog_Proxy
    }
};


static const PRPC_STUB_FUNCTION IStiDeviceControl_table[] =
{
    IStiDeviceControl_Initialize_Stub,
    IStiDeviceControl_RawReadData_Stub,
    IStiDeviceControl_RawWriteData_Stub,
    IStiDeviceControl_RawReadCommand_Stub,
    IStiDeviceControl_RawWriteCommand_Stub,
    IStiDeviceControl_RawDeviceControl_Stub,
    IStiDeviceControl_GetLastError_Stub,
    IStiDeviceControl_GetMyDevicePortName_Stub,
    IStiDeviceControl_GetMyDeviceHandle_Stub,
    IStiDeviceControl_GetMyDeviceOpenMode_Stub,
    IStiDeviceControl_WriteToErrorLog_Stub
};

const CInterfaceStubVtbl _IStiDeviceControlStubVtbl =
{
    {
        &IID_IStiDeviceControl,
        0,
        14,
        &IStiDeviceControl_table[-3],
    },
    {
        CStdStubBuffer_METHODS
    }
};

const MIDL_STUB_DESC Object_StubDesc = {
    0,
    NdrOleAllocate,
    NdrOleFree,
    {0}, 0, 0, 0, 0,
    0 /* __MIDL_TypeFormatString.Format */
};

#if !defined(__RPC_WIN32__)
#error Currently only Wine and WIN32 are supported.
#endif

static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
{
    0,
    {
        0
    }
};

static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
{
    0,
    {
        0
    }
};

const CInterfaceProxyVtbl* _stiusd_ProxyVtblList[] =
{
    (CInterfaceProxyVtbl*)&_IStiUSDProxyVtbl,
    (CInterfaceProxyVtbl*)&_IStiDeviceControlProxyVtbl,
    0
};

const CInterfaceStubVtbl* _stiusd_StubVtblList[] =
{
    (CInterfaceStubVtbl*)&_IStiUSDStubVtbl,
    (CInterfaceStubVtbl*)&_IStiDeviceControlStubVtbl,
    0
};

PCInterfaceName const _stiusd_InterfaceNamesList[] =
{
    "IStiUSD",
    "IStiDeviceControl",
    0
};

#define _stiusd_CHECK_IID(n) IID_GENERIC_CHECK_IID(_stiusd, pIID, n)

int __stdcall _stiusd_IID_Lookup(const IID* pIID, int* pIndex)
{
    if (!_stiusd_CHECK_IID(0))
    {
        *pIndex = 0;
        return 1;
    }
    if (!_stiusd_CHECK_IID(1))
    {
        *pIndex = 1;
        return 1;
    }
    return 0;
}

const ExtendedProxyFileInfo stiusd_ProxyFileInfo =
{
    (PCInterfaceProxyVtblList*)&_stiusd_ProxyVtblList,
    (PCInterfaceStubVtblList*)&_stiusd_StubVtblList,
    (const PCInterfaceName*)&_stiusd_InterfaceNamesList,
    0,
    &_stiusd_IID_Lookup,
    2,
    1,
    0,
    0,
    0,
    0
};
