//-----------------------------------------------------------------------------
// File:			cmdwpr.idl
//
// Copyright:		Copyright (c) Microsoft Corporation
//
// Contents: 		OLE DB interface definition
//
// Comments:
//
//-----------------------------------------------------------------------------

#include "idlmulti.h"
//

	REMOTED_INTERFACE(0c733a64-2a1c-11ce-ade5-00aa0044773d)


interface ICommandWithParameters : IUnknown {

typedef struct tagDBPARAMBINDINFO {
	LPOLESTR pwszDataSourceType;
	LPOLESTR pwszName;
	DBLENGTH ulParamSize;
	DBPARAMFLAGS dwFlags;
	BYTE bPrecision;
	BYTE bScale;
} DBPARAMBINDINFO;

	[local]
	HRESULT GetParameterInfo(
		[in, out, annotation("__out")] DB_UPARAMS * pcParams,
		[out, size_is(,*pcParams), annotation("__deref_out_ecount_opt(*pcParams)")] DBPARAMINFO ** prgParamInfo,
		[out, annotation("__deref_opt_out_z")] OLECHAR ** ppNamesBuffer
	);

#ifdef _WIN64  //Use casting by ULONG in attribute size_is under 64-bit environment.

#ifndef NO_REMOTE
	[call_as(GetParameterInfo)]
	HRESULT RemoteGetParameterInfo(
		[in, out] DB_UPARAMS * pcParams,
		[out, size_is(,(ULONG)*pcParams)] DBPARAMINFO ** prgParamInfo,
		[out, size_is(,(ULONG)*pcParams)] DBBYTEOFFSET ** prgNameOffsets,
		[in, out] DBLENGTH * pcbNamesBuffer,
		[in, out, unique, size_is(,(ULONG)*pcbNamesBuffer)] OLECHAR ** ppNamesBuffer,
		[out] IErrorInfo ** ppErrorInfoRem
	);
#endif

	[local]
	HRESULT MapParameterNames(
		[in] DB_UPARAMS cParamNames,
		[in, size_is((ULONG)cParamNames), annotation("__in_ecount(cParamNames)")] const OLECHAR * rgParamNames[],
		[out, size_is((ULONG)cParamNames), annotation("__out_ecount(cParamNames)")] DB_LPARAMS rgParamOrdinals[]
	);

	[call_as(MapParameterNames)]
	HRESULT RemoteMapParameterNames(
		[in] DB_UPARAMS cParamNames,
		[in, size_is((ULONG)cParamNames)] LPCOLESTR *rgParamNames,
		[out, size_is((ULONG)cParamNames)] DB_LPARAMS * rgParamOrdinals,
		[out] IErrorInfo ** ppErrorInfoRem
	);

	[local]
	HRESULT SetParameterInfo(
		[in] DB_UPARAMS cParams,
		[in, unique, size_is((ULONG)cParams), annotation("__in_ecount_opt(cParams)")] const DB_UPARAMS rgParamOrdinals[],
		[in, unique, size_is((ULONG)cParams), annotation("__in_ecount_opt(cParams)")] const DBPARAMBINDINFO rgParamBindInfo[]
	);

	[call_as(SetParameterInfo)]
	HRESULT RemoteSetParameterInfo(
		[in] DB_UPARAMS cParams,
		[in, unique, size_is((ULONG)cParams)] const DB_UPARAMS * rgParamOrdinals,
		[in, unique, size_is((ULONG)cParams)] const DBPARAMBINDINFO * rgParamBindInfo,
		[out] IErrorInfo ** ppErrorInfoRem
	);

#else  //No casting by ULONG for 32-bit.

#ifndef NO_REMOTE
	[call_as(GetParameterInfo)]
	HRESULT RemoteGetParameterInfo(
		[in, out] DB_UPARAMS * pcParams,
		[out, size_is(,*pcParams)] DBPARAMINFO ** prgParamInfo,
		[out, size_is(,*pcParams)] DBBYTEOFFSET ** prgNameOffsets,
		[in, out] DBLENGTH * pcbNamesBuffer,
		[in, out, unique, size_is(,*pcbNamesBuffer)] OLECHAR ** ppNamesBuffer,
		[out] IErrorInfo ** ppErrorInfoRem
	);
#endif

	[local]
	HRESULT MapParameterNames(
		[in] DB_UPARAMS cParamNames,
		[in, size_is(cParamNames), annotation("__in_ecount(cParamNames)")] const OLECHAR * rgParamNames[],
		[out, size_is(cParamNames), annotation("__out_ecount(cParamNames)")] DB_LPARAMS rgParamOrdinals[]
	);

	[call_as(MapParameterNames)]
	HRESULT RemoteMapParameterNames(
		[in] DB_UPARAMS cParamNames,
		[in, size_is(cParamNames)] LPCOLESTR *rgParamNames,
		[out, size_is(cParamNames)] DB_LPARAMS * rgParamOrdinals,
		[out] IErrorInfo ** ppErrorInfoRem
	);

	[local]
	HRESULT SetParameterInfo(
		[in] DB_UPARAMS cParams,
		[in, unique, size_is(cParams), annotation("__in_ecount_opt(cParams)")] const DB_UPARAMS rgParamOrdinals[],
		[in, unique, size_is(cParams), annotation("__in_ecount_opt(cParams)")] const DBPARAMBINDINFO rgParamBindInfo[]
	);

	[call_as(SetParameterInfo)]
	HRESULT RemoteSetParameterInfo(
		[in] DB_UPARAMS cParams,
		[in, unique, size_is(cParams)] const DB_UPARAMS * rgParamOrdinals,
		[in, unique, size_is(cParams)] const DBPARAMBINDINFO * rgParamBindInfo,
		[out] IErrorInfo ** ppErrorInfoRem
	);

#endif
}

