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

#include "idlmulti.h"
//

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


interface IColumnsInfo : IUnknown {

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

	[local]
	HRESULT GetColumnInfo(
		[in, out, annotation("__out_opt")] DBORDINAL * pcColumns,
		[out, size_is(,(ULONG)*pcColumns), annotation("__deref_out_ecount_opt(*pcColumns)")] DBCOLUMNINFO ** prgInfo,
		[out, annotation("__deref_out_z_opt")] OLECHAR ** ppStringsBuffer
	);

#ifndef NO_REMOTE
	[call_as(GetColumnInfo)]
	HRESULT RemoteGetColumnInfo(
		[in, out] DBORDINAL * pcColumns,
		[out, size_is(,(ULONG)*pcColumns)] DBCOLUMNINFO  ** prgInfo,
		[out, size_is(,(ULONG)*pcColumns)] DBBYTEOFFSET ** prgNameOffsets,
		[out, size_is(,(ULONG)*pcColumns)] DBBYTEOFFSET ** prgcolumnidOffsets,
		[in, out] DBLENGTH * pcbStringsBuffer,
		[in, out, unique, size_is(,(ULONG)*pcbStringsBuffer)] OLECHAR ** ppStringsBuffer,
		[out] IErrorInfo ** ppErrorInfoRem
	);
#endif

	[local]
	HRESULT MapColumnIDs(
		[in] DBORDINAL cColumnIDs,
		[in, size_is((ULONG)cColumnIDs), annotation("__in_ecount_opt(cColumnIDs)")] const DBID rgColumnIDs[],
		[out, size_is((ULONG)cColumnIDs), annotation("__out_ecount_opt(cColumnIDs)")] DBORDINAL rgColumns[]
	);

#ifndef NO_REMOTE

	[call_as(MapColumnIDs)]
	HRESULT RemoteMapColumnIDs(
		[in] DBORDINAL cColumnIDs,
		[in, size_is((ULONG)cColumnIDs)] const DBID *rgColumnIDs,
		[out, size_is((ULONG)cColumnIDs)] DBORDINAL *rgColumns,
		[out] IErrorInfo ** ppErrorInfoRem
	);

#endif

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

	[local]
	HRESULT GetColumnInfo(
		[in, out, annotation("__out")] DBORDINAL * pcColumns,
		[out, size_is(,*pcColumns), annotation("__deref_out_ecount_opt(*pcColumns)")] DBCOLUMNINFO ** prgInfo,
		[out, annotation("__deref_out_z_opt")] OLECHAR ** ppStringsBuffer
	);

#ifndef NO_REMOTE
	[call_as(GetColumnInfo)]
	HRESULT RemoteGetColumnInfo(
		[in, out] DBORDINAL * pcColumns,
		[out, size_is(,*pcColumns)] DBCOLUMNINFO  ** prgInfo,
		[out, size_is(,*pcColumns)] DBBYTEOFFSET ** prgNameOffsets,
		[out, size_is(,*pcColumns)] DBBYTEOFFSET ** prgcolumnidOffsets,
		[in, out] DBLENGTH * pcbStringsBuffer,
		[in, out, unique, size_is(,*pcbStringsBuffer)] OLECHAR ** ppStringsBuffer,
		[out] IErrorInfo ** ppErrorInfoRem
	);
#endif

	[local]
	HRESULT MapColumnIDs(
		[in] DBORDINAL cColumnIDs,
		[in, size_is(cColumnIDs), annotation("__in_ecount_opt(cColumnIDs)")] const DBID rgColumnIDs[],
		[out, size_is(cColumnIDs), annotation("__out_ecount_opt(cColumnIDs)")] DBORDINAL rgColumns[]
	);

#ifndef NO_REMOTE

	[call_as(MapColumnIDs)]
	HRESULT RemoteMapColumnIDs(
		[in] DBORDINAL cColumnIDs,
		[in, size_is(cColumnIDs)] const DBID *rgColumnIDs,
		[out, size_is(cColumnIDs)] DBORDINAL *rgColumns,
		[out] IErrorInfo ** ppErrorInfoRem
	);
#endif
	
#endif

}

