//WinQL-COM.cpp

// Copyright Querysoft Limited 2013, 2015, 2017
//
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the
// Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following:
// 
// The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer,
// must be included in all copies of the Software, in whole or in part, and
// all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by
// a source language processor.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

#include "WinQL/WinQL.h"
#include "WinQL/Application/Threading/WinQLCriticalSection.h"
#include "CodeQOR/DataTypes/GUID.h"
#include "CodeQOR.h"

//------------------------------------------------------------------------------
//Only for shared library builds as one of a network of DLLs
#if (!defined(QOR_MONOLITHIC) && defined _USRDLL)

__QCMP_STARTLINKAGE_C

	extern int _cdecl QORStaticInit(void);

	//------------------------------------------------------------------------------
	__QCMP_EXPORT int _cdecl QORinit(void)
	{
		QORStaticInit();
		return 1;
	}

	//------------------------------------------------------------------------------
	//This provides a unique identifier for the Windows COM QOR Library. 
	//The presence of this entry point identifies WinQL-COM as a QOR library with delayed
	//static initialization and an accessible Module Context
	__QCMP_EXPORT nsCodeQOR::mxGUID* QORidentity( void )
	{
		static nsCodeQOR::mxGUID WinQL_COM = { 0x559bde19, 0x75ed, 0x4ff9, { 0x92, 0x45, 0x86, 0x9a, 0xcc, 0xe4, 0xcd, 0xb6 } };
		return &WinQL_COM;
	}

__QCMP_ENDLINKAGE_C

//------------------------------------------------------------------------------
//Provide a Module Context that represents the WinQL-COM DLL
nsCodeQOR::CLoadableModuleBase& ThisModule( void )
{
	static nsCodeQOR::CLoadableModuleBase WinQLModule( "Querysoft Open Runtime COM class library for Microsoft Windows" );
	return WinQLModule;
}

//------------------------------------------------------------------------------
const char* __QCMP_LOCAL ThisModuleVersion(void)
{
	return QOR_PP_STRINGIZE( __DATE__:__TIME__);
}

#endif//QOR_MONOLITHIC
