Commit b6317a9b authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

activex: Remove deprecated VLCControl

parent 24bfac7d
......@@ -59,8 +59,6 @@ axvlc_la_SOURCES = \
viewobject.h \
supporterrorinfo.cpp \
supporterrorinfo.h \
vlccontrol.cpp \
vlccontrol.h \
vlccontrol2.cpp \
vlccontrol2.h \
plugin.cpp \
......
......@@ -37,7 +37,6 @@ import "ocidl.idl";
library AXVLC
{
// Forward declare all types defined in this typelib
interface IVLCControl;
interface IVLCAudio;
interface IVLCInput;
interface IVLCLogo;
......@@ -83,89 +82,6 @@ library AXVLC
const int DISPID_FSEnabled = 112;
const int DISPID_Version = 113;
[
odl,
uuid(C2FA41D0-B113-476e-AC8C-9BD14999C1C1),
helpstring("VLC Control (deprecated)"),
dual,
oleautomation
]
interface IVLCControl : IDispatch
{
[id(DISPID_Visible), propget, bindable, helpstring("Returns/sets a value that determines whether viewing area is visible or hidden.")]
HRESULT Visible([out, retval] VARIANT_BOOL* visible);
[id(DISPID_Visible), propput, bindable, helpstring("Returns/sets a value that determines whether viewing area is visible or hidden.")]
HRESULT Visible([in] VARIANT_BOOL visible);
[helpstring("Play current target in playlist.")]
HRESULT play();
[helpstring("Pause playback.")]
HRESULT pause();
[helpstring("Stop playback.")]
HRESULT stop();
[id(DISPID_Playing), hidden, propget, helpstring("Returns a value that determines whether VLC is currently playing.")]
HRESULT Playing([out, retval] VARIANT_BOOL* isPlaying);
[id(DISPID_Position), propget, helpstring("Returns/sets playback position within the current item. Position is a relative value ranging from 0.0 to 1.0.")]
HRESULT Position([out, retval] float* position);
[id(DISPID_Position), propput, helpstring("Returns/sets playback position within the current item. Position is a relative value ranging from 0.0 to 1.0.")]
HRESULT Position([in] float position);
[id(DISPID_Time), propget, helpstring("Returns/sets playback time relative to the start of the current item.")]
HRESULT Time([out, retval] int* seconds);
[id(DISPID_Time), propput, helpstring("Returns/sets playback time relative to the start of the current item.")]
HRESULT Time([in] int seconds);
[helpstring("Advance or backtrack playback time, relative to current time.")] //possibly find a better word to replace 'backtrack' [t]
HRESULT shuttle([in] int seconds);
[helpstring("Switch video between normal and fullscreen view modes.")]
HRESULT fullscreen();
[id(DISPID_Length), propget, hidden, helpstring("Returns the total length, in seconds, of the current item, may be unknown.")]
HRESULT Length([out, retval] int* seconds);
[helpstring("Increases playback speed. Possible speeds are: 1x, 2x, 4x, 8x.")]
HRESULT playFaster();
[helpstring("Decreases playback speed. Possible speeds are: 1x, 2x, 4x, 8x.")]
HRESULT playSlower();
[id(DISPID_Volume), propget, helpstring("Returns/sets playback volume, ranges from 0 to 200%.")] //possibly remove % from 'ranges', change to 'values', and specify that 200 is equivilant to 200% (remember, 200% == 2.0, but this gets an int not a float) [t]
HRESULT Volume([out, retval] int* volume);
[id(DISPID_Volume), propput, helpstring("Returns/sets playback volume, ranges from 0 to 200%.")]
HRESULT Volume([in] int volume);
[helpstring("Mute/unmute playback audio.")]
HRESULT toggleMute();
[helpstring("Sets the value of a VLC variable.")]
HRESULT setVariable([in] BSTR name, [in] VARIANT value);
[helpstring("Returns the value of a VLC variable.")]
HRESULT getVariable([in] BSTR name, [out, retval] VARIANT *value);
/*
** use VARIANT rather than a SAFEARRAY as argument type
** for compatibility with some scripting language (JScript)
*/
[helpstring("Add an item to the playlist.")]
HRESULT addTarget([in] BSTR uri, [in] VARIANT options, [in] enum VLCPlaylistMode mode, [in] int position);
[propget, helpstring("Returns index of current item in playlist.")]
HRESULT PlaylistIndex([out, retval] int* index);
[propget, helpstring("Returns number of items in playlist.")]
HRESULT PlaylistCount([out, retval] int* index);
[helpstring("Advance to next item in playlist.")]
HRESULT playlistNext();
[helpstring("Advance to previous item in playlist.")]
HRESULT playlistPrev();
[helpstring("Remove all items from playlist.")]
HRESULT playlistClear();
[propget, hidden, helpstring("Returns VLC Version.")]
HRESULT VersionInfo([out, retval] BSTR* version);
[id(DISPID_MRL), propget, helpstring("Returns/sets the first MRL in playlist, used for AutoPlay")]
HRESULT MRL([out, retval] BSTR* mrl);
[id(DISPID_MRL), propput, helpstring("Returns/sets the first MRL in playlist, used for AutoPlay")]
HRESULT MRL([in] BSTR mrl);
[id(DISPID_AutoPlay), propget, helpstring("Returns/sets a value that determines whether the playlist is played on startup")]
HRESULT AutoPlay([out, retval] VARIANT_BOOL* autoplay);
[id(DISPID_AutoPlay), propput, helpstring("Returns/Sets a value that determines whether the playlist is played on startup")]
HRESULT AutoPlay([in] VARIANT_BOOL autoplay);
[id(DISPID_AutoLoop), propget, helpstring("Returns/sets a value that determines whether the playlist is looped")]
HRESULT AutoLoop([out, retval] VARIANT_BOOL* autoloop);
[id(DISPID_AutoLoop), propput, helpstring("Returns/sets a value that determines whether the playlist is looped")]
HRESULT AutoLoop([in] VARIANT_BOOL autoloop);
};
const int DISPID_PlayEvent = 100;
const int DISPID_PauseEvent = 101;
const int DISPID_StopEvent = 102;
......@@ -719,18 +635,6 @@ library AXVLC
HRESULT mediaDescription([out, retval] IVLCMediaDescription** obj);
};
[
uuid(E23FE9C6-778E-49D4-B537-38FCDE4887D8),
helpstring("VLC control (deprecated)"),
control
]
coclass VLCPlugin
{
[default] interface IVLCControl;
interface IVLCControl2;
[default, source] dispinterface DVLCEvents;
};
[
uuid(9BE31822-FDAD-461B-AD51-BE1D1C159921),
helpstring("VLC control"),
......@@ -739,7 +643,6 @@ library AXVLC
coclass VLCPlugin2
{
[default] interface IVLCControl2;
interface IVLCControl;
[default, source] dispinterface DVLCEvents;
};
};
......@@ -72,7 +72,7 @@ STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
*ppv = NULL;
if( (CLSID_VLCPlugin == rclsid) || (CLSID_VLCPlugin2 == rclsid) )
if( CLSID_VLCPlugin2 == rclsid )
{
VLCPluginClass *plugin =
new VLCPluginClass(&i_class_ref, h_instance, rclsid);
......@@ -170,8 +170,6 @@ STDAPI DllUnregisterServer(VOID)
CATID_SafeForScripting,
};
pcr->UnRegisterClassImplCategories(CLSID_VLCPlugin,
sizeof(implCategories)/sizeof(CATID), implCategories);
pcr->UnRegisterClassImplCategories(CLSID_VLCPlugin2,
sizeof(implCategories)/sizeof(CATID), implCategories);
pcr->Release();
......@@ -181,7 +179,6 @@ STDAPI DllUnregisterServer(VOID)
SHDeleteKey(HKEY_CLASSES_ROOT, TEXT("MIME\\Database\\Content Type\\application/x-vlc-plugin"));
UnregisterProgID(CLSID_VLCPlugin, 2);
UnregisterProgID(CLSID_VLCPlugin2, 1);
return S_OK;
......@@ -347,7 +344,6 @@ STDAPI DllRegisterServer(VOID)
0, KEY_CREATE_SUB_KEY, &hBaseKey) )
return SELFREG_E_CLASS;
RegisterClassID(hBaseKey, CLSID_VLCPlugin, 1, FALSE, DllPath, DllPathLen);
RegisterClassID(hBaseKey, CLSID_VLCPlugin2, 2, TRUE, DllPath, DllPathLen);
RegCloseKey(hBaseKey);
......@@ -364,8 +360,6 @@ STDAPI DllRegisterServer(VOID)
CATID_SafeForScripting,
};
pcr->RegisterClassImplCategories(CLSID_VLCPlugin,
sizeof(implCategories)/sizeof(CATID), implCategories);
pcr->RegisterClassImplCategories(CLSID_VLCPlugin2,
sizeof(implCategories)/sizeof(CATID), implCategories);
pcr->Release();
......
......@@ -42,7 +42,6 @@ STDMETHODIMP VLCObjectSafety::GetInterfaceSafetyOptions(
*pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACESAFE_FOR_UNTRUSTED_CALLER;
if( (IID_IDispatch == riid)
|| (IID_IVLCControl == riid)
|| (IID_IVLCControl2 == riid) )
{
*pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER;
......@@ -67,7 +66,6 @@ STDMETHODIMP VLCObjectSafety::SetInterfaceSafetyOptions(
)
{
if( (IID_IDispatch == riid)
|| (IID_IVLCControl == riid)
|| (IID_IVLCControl2 == riid) )
{
if( (INTERFACESAFE_FOR_UNTRUSTED_CALLER == dwOptionSetMask)
......
......@@ -35,7 +35,6 @@
#include "provideclassinfo.h"
#include "connectioncontainer.h"
#include "objectsafety.h"
#include "vlccontrol.h"
#include "vlccontrol2.h"
#include "viewobject.h"
#include "dataobject.h"
......@@ -263,7 +262,6 @@ VLCPlugin::VLCPlugin(VLCPluginClass *p_class, LPUNKNOWN pUnkOuter) :
vlcProvideClassInfo = new VLCProvideClassInfo(this);
vlcConnectionPointContainer = new VLCConnectionPointContainer(this);
vlcObjectSafety = new VLCObjectSafety(this);
vlcControl = new VLCControl(this);
vlcControl2 = new VLCControl2(this);
vlcViewObject = new VLCViewObject(this);
vlcDataObject = new VLCDataObject(this);
......@@ -289,7 +287,6 @@ VLCPlugin::~VLCPlugin()
delete vlcDataObject;
delete vlcViewObject;
delete vlcControl2;
delete vlcControl;
delete vlcConnectionPointContainer;
delete vlcProvideClassInfo;
delete vlcPersistPropertyBag;
......@@ -340,15 +337,9 @@ STDMETHODIMP VLCPlugin::QueryInterface(REFIID riid, void **ppv)
*ppv = reinterpret_cast<LPVOID>(vlcProvideClassInfo);
else if( IID_IConnectionPointContainer == riid )
*ppv = reinterpret_cast<LPVOID>(vlcConnectionPointContainer);
else if( IID_IObjectSafety == riid )
else if (IID_IObjectSafety == riid)
*ppv = reinterpret_cast<LPVOID>(vlcObjectSafety);
else if( IID_IDispatch == riid )
*ppv = (CLSID_VLCPlugin2 == getClassID()) ?
reinterpret_cast<LPVOID>(vlcControl2) :
reinterpret_cast<LPVOID>(vlcControl);
else if( IID_IVLCControl == riid )
*ppv = reinterpret_cast<LPVOID>(vlcControl);
else if( IID_IVLCControl2 == riid )
else if( IID_IVLCControl2 == riid || IID_IDispatch == riid)
*ppv = reinterpret_cast<LPVOID>(vlcControl2);
else if( IID_IViewObject == riid )
*ppv = reinterpret_cast<LPVOID>(vlcViewObject);
......
......@@ -33,7 +33,6 @@
#include "../common/win32_fullscreen.h"
#include "../common/vlc_player.h"
extern "C" const GUID CLSID_VLCPlugin;
extern "C" const GUID CLSID_VLCPlugin2;
extern "C" const GUID LIBID_AXVLC;
extern "C" const GUID DIID_DVLCEvents;
......@@ -286,7 +285,6 @@ private:
class VLCProvideClassInfo *vlcProvideClassInfo;
class VLCConnectionPointContainer *vlcConnectionPointContainer;
class VLCObjectSafety *vlcObjectSafety;
class VLCControl *vlcControl;
class VLCControl2 *vlcControl2;
class VLCViewObject *vlcViewObject;
class VLCDataObject *vlcDataObject;
......
/*****************************************************************************
* vlccontrol.cpp: ActiveX control for VLC
*****************************************************************************
* Copyright (C) 2005-2010 the VideoLAN team
*
* Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "plugin.h"
#include "vlccontrol.h"
#include "utils.h"
using namespace std;
VLCControl::~VLCControl()
{
if( _p_typeinfo )
_p_typeinfo->Release();
};
HRESULT VLCControl::getTypeInfo(void)
{
HRESULT hr = NOERROR;
if( NULL == _p_typeinfo )
{
ITypeLib *p_typelib;
hr = _p_instance->getTypeLib(LOCALE_USER_DEFAULT, &p_typelib);
if( SUCCEEDED(hr) )
{
hr = p_typelib->GetTypeInfoOfGuid(IID_IVLCControl, &_p_typeinfo);
if( FAILED(hr) )
{
_p_typeinfo = NULL;
}
p_typelib->Release();
}
}
return hr;
};
STDMETHODIMP VLCControl::GetTypeInfoCount(UINT* pctInfo)
{
if( NULL == pctInfo )
return E_INVALIDARG;
if( SUCCEEDED(getTypeInfo()) )
*pctInfo = 1;
else
*pctInfo = 0;
return NOERROR;
};
STDMETHODIMP VLCControl::GetTypeInfo(UINT, LCID, LPTYPEINFO* ppTInfo)
{
if( NULL == ppTInfo )
return E_INVALIDARG;
if( SUCCEEDED(getTypeInfo()) )
{
_p_typeinfo->AddRef();
*ppTInfo = _p_typeinfo;
return NOERROR;
}
*ppTInfo = NULL;
return E_NOTIMPL;
};
STDMETHODIMP VLCControl::GetIDsOfNames(REFIID, LPOLESTR* rgszNames,
UINT cNames, LCID, DISPID* rgDispID)
{
if( SUCCEEDED(getTypeInfo()) )
{
return DispGetIDsOfNames(_p_typeinfo, rgszNames, cNames, rgDispID);
}
return E_NOTIMPL;
};
STDMETHODIMP VLCControl::Invoke(DISPID dispIdMember, REFIID,
LCID, WORD wFlags, DISPPARAMS* pDispParams,
VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr)
{
if( SUCCEEDED(getTypeInfo()) )
{
return DispInvoke(this, _p_typeinfo, dispIdMember, wFlags, pDispParams,
pVarResult, pExcepInfo, puArgErr);
}
return E_NOTIMPL;
};
STDMETHODIMP VLCControl::get_Visible(VARIANT_BOOL *isVisible)
{
if( NULL == isVisible )
return E_POINTER;
*isVisible = _p_instance->getVisible() ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
};
STDMETHODIMP VLCControl::put_Visible(VARIANT_BOOL isVisible)
{
_p_instance->setVisible(isVisible != VARIANT_FALSE);
return S_OK;
};
STDMETHODIMP VLCControl::play(void)
{
_p_instance->get_player().play();
return S_OK;
};
STDMETHODIMP VLCControl::pause(void)
{
_p_instance->get_player().mlp().pause();
return S_OK;
}
STDMETHODIMP VLCControl::stop(void)
{
_p_instance->get_player().mlp().stop();
return S_OK;
}
STDMETHODIMP VLCControl::get_Playing(VARIANT_BOOL *isPlaying)
{
if( NULL == isPlaying )
return E_POINTER;
vlc_player& p = _p_instance->get_player();
*isPlaying = p.mlp().isPlaying() ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
STDMETHODIMP VLCControl::get_Position(float *position)
{
if( NULL == position )
return E_POINTER;
*position = _p_instance->get_player().get_mp().position();
return S_OK;
}
STDMETHODIMP VLCControl::put_Position(float position)
{
_p_instance->get_player().get_mp().setPosition( position );
return S_OK;
}
STDMETHODIMP VLCControl::get_Time(int *seconds)
{
if( NULL == seconds )
return E_POINTER;
//FIXME: time is in microseconds, this looks fishy
*seconds = static_cast<int>( _p_instance->get_player().get_mp().time() );
return S_OK;
}
STDMETHODIMP VLCControl::put_Time(int seconds)
{
/* setTime function of the plugin sets the time. */
_p_instance->setTime(seconds);
return S_OK;
}
STDMETHODIMP VLCControl::shuttle(int seconds)
{
_p_instance->setTime( seconds );
return S_OK;
};
STDMETHODIMP VLCControl::fullscreen(void)
{
_p_instance->toggleFullscreen();
return S_OK;
};
STDMETHODIMP VLCControl::get_Length(int *seconds)
{
if( NULL == seconds )
return E_POINTER;
*seconds = _p_instance->get_player().get_mp().length();
return S_OK;
};
STDMETHODIMP VLCControl::playFaster(void)
{
_p_instance->get_player().get_mp().setRate(2.f);
return S_OK;
};
STDMETHODIMP VLCControl::playSlower(void)
{
_p_instance->get_player().get_mp().setRate(.5f);
return S_OK;
};
STDMETHODIMP VLCControl::get_Volume(int *volume)
{
if( NULL == volume )
return E_POINTER;
*volume = _p_instance->getVolume();
return S_OK;
}
STDMETHODIMP VLCControl::put_Volume(int volume)
{
_p_instance->setVolume(volume);
return S_OK;
}
STDMETHODIMP VLCControl::toggleMute(void)
{
_p_instance->get_player().get_mp().toggleMute();
return S_OK;
}
STDMETHODIMP VLCControl::setVariable(BSTR, VARIANT)
{
_p_instance->setErrorInfo(IID_IVLCControl,
"setVariable() is an unsafe interface to use. "
"It has been removed because of security implications." );
return E_FAIL;
}
STDMETHODIMP VLCControl::getVariable(BSTR, VARIANT *)
{
_p_instance->setErrorInfo(IID_IVLCControl,
"getVariable() is an unsafe interface to use. "
"It has been removed because of security implications." );
return E_FAIL;
}
void VLCControl::FreeTargetOptions(char **cOptions, int cOptionCount)
{
// clean up
if( NULL != cOptions )
{
for( int pos=0; pos<cOptionCount; ++pos )
{
char *cOption = cOptions[pos];
if( NULL != cOption )
CoTaskMemFree(cOption);
else
break;
}
CoTaskMemFree(cOptions);
}
};
static HRESULT parseStringOptions(int codePage, BSTR bstr, char*** cOptions, int *cOptionCount)
{
HRESULT hr = E_INVALIDARG;
if( SysStringLen(bstr) > 0 )
{
hr = E_OUTOFMEMORY;
char *s = CStrFromBSTR(codePage, bstr);
char *val = s;
if( val )
{
long capacity = 16;
char **options = (char **)CoTaskMemAlloc(capacity*sizeof(char *));
if( options )
{
int nOptions = 0;
char *end = val + strlen(val);
while( val < end )
{
// skip leading blanks
while( (val < end)
&& ((*val == ' ' ) || (*val == '\t')) )
++val;
char *start = val;
// skip till we get a blank character
while( (val < end)
&& (*val != ' ' )
&& (*val != '\t') )
{
char c = *(val++);
if( ('\'' == c) || ('"' == c) )
{
// skip till end of string
while( (val < end) && (*(val++) != c ) );
}
}
if( val > start )
{
if( nOptions == capacity )
{
capacity += 16;
char **moreOptions = (char **)CoTaskMemRealloc(options, capacity*sizeof(char*));
if( ! moreOptions )
{
/* failed to allocate more memory */
CoTaskMemFree(s);
/* return what we got so far */
*cOptionCount = nOptions;
*cOptions = options;
return NOERROR;
}
options = moreOptions;
}
*(val++) = '\0';
options[nOptions] = (char *)CoTaskMemAlloc(val-start);
if( options[nOptions] )
{
memcpy(options[nOptions], start, val-start);
++nOptions;
}
else
{
/* failed to allocate memory */
CoTaskMemFree(s);
/* return what we got so far */
*cOptionCount = nOptions;
*cOptions = options;
return NOERROR;
}
}
else
// must be end of string
break;
}
*cOptionCount = nOptions;
*cOptions = options;
hr = NOERROR;
}
CoTaskMemFree(s);
}
}
return hr;
}
HRESULT VLCControl::CreateTargetOptions(int codePage, VARIANT *options, char ***cOptions, int *cOptionCount)
{
HRESULT hr = E_INVALIDARG;
if( VT_ERROR == V_VT(options) )
{
if( DISP_E_PARAMNOTFOUND == V_ERROR(options) )
{
// optional parameter not set
*cOptions = NULL;
*cOptionCount = 0;
return NOERROR;
}
}
else if( (VT_EMPTY == V_VT(options)) || (VT_NULL == V_VT(options)) )
{
// null parameter
*cOptions = NULL;
*cOptionCount = 0;
return NOERROR;
}
else if( VT_DISPATCH == V_VT(options) )
{
// if object is a collection, retrieve enumerator
VARIANT colEnum;
V_VT(&colEnum) = VT_UNKNOWN;
hr = GetObjectProperty(V_DISPATCH(options), DISPID_NEWENUM, colEnum);
if( SUCCEEDED(hr) )
{
IEnumVARIANT *enumVar;
hr = V_UNKNOWN(&colEnum)->QueryInterface(IID_IEnumVARIANT, (LPVOID *)&enumVar);
if( SUCCEEDED(hr) )
{
long pos = 0;
long capacity = 16;
VARIANT option;
*cOptions = (char **)CoTaskMemAlloc(capacity*sizeof(char *));
if( NULL != *cOptions )
{
ZeroMemory(*cOptions, sizeof(char *)*capacity);
while( SUCCEEDED(hr) && (S_OK == enumVar->Next(1, &option, NULL)) )
{
if( VT_BSTR == V_VT(&option) )
{
char *cOption = CStrFromBSTR(codePage, V_BSTR(&option));
(*cOptions)[pos] = cOption;
if( NULL != cOption )
{
++pos;
if( pos == capacity )
{
char **moreOptions = (char **)CoTaskMemRealloc(*cOptions, (capacity+16)*sizeof(char *));
if( NULL != moreOptions )
{
ZeroMemory(moreOptions+capacity, sizeof(char *)*16);
capacity += 16;
*cOptions = moreOptions;
}
else
hr = E_OUTOFMEMORY;
}
}
else
hr = ( SysStringLen(V_BSTR(&option)) > 0 ) ?
E_OUTOFMEMORY : E_INVALIDARG;
}
else
hr = E_INVALIDARG;
VariantClear(&option);
}
*cOptionCount = pos;
if( FAILED(hr) )
{
// free already processed elements
FreeTargetOptions(*cOptions, *cOptionCount);
}
}
else
hr = E_OUTOFMEMORY;
enumVar->Release();
}
}
else
{
// coerce object into a string and parse it
VARIANT v_name;
VariantInit(&v_name);
hr = VariantChangeType(&v_name, options, 0, VT_BSTR);
if( SUCCEEDED(hr) )
{
hr = parseStringOptions(codePage, V_BSTR(&v_name), cOptions, cOptionCount);
VariantClear(&v_name);
}
}
}
else if( V_ISARRAY(options) )
{
// array parameter
SAFEARRAY *array = V_ISBYREF(options) ? *V_ARRAYREF(options) : V_ARRAY(options);
if( SafeArrayGetDim(array) != 1 )
return E_INVALIDARG;
long lBound = 0;
long uBound = 0;
SafeArrayGetLBound(array, 1, &lBound);
SafeArrayGetUBound(array, 1, &uBound);
// have we got any options
if( uBound >= lBound )
{
VARTYPE vType;
hr = SafeArrayGetVartype(array, &vType);