Esempio n. 1
0
void CAniPropertySet::SetInteger (const CString &sName, int iValue, int *retiIndex)

//	SetInteger
//
//	Add an integer property

	{
	SProperty *pProp = FindOrAdd(sName, retiIndex);
	pProp->InitialValue.Set(CAniProperty::typeInteger, iValue);
	pProp->CurrentValue.Set(CAniProperty::typeInteger, iValue);
	}
Esempio n. 2
0
void CAniPropertySet::SetFont (const CString &sName, const CG16bitFont *pFont, int *retiIndex)

//	SetFont
//
//	Sets a font property

	{
	SProperty *pProp = FindOrAdd(sName, retiIndex);
	pProp->InitialValue.Set(CAniProperty::typeFont, pFont);
	pProp->CurrentValue.Set(CAniProperty::typeFont, pFont);
	}
Esempio n. 3
0
void CAniPropertySet::SetColor (const CString &sName, WORD wValue, int *retiIndex)

//	SetColor
//
//	Add an opacity property

	{
	SProperty *pProp = FindOrAdd(sName, retiIndex);
	pProp->InitialValue.Set(CAniProperty::typeColor, (DWORD)wValue);
	pProp->CurrentValue.Set(CAniProperty::typeColor, (DWORD)wValue);
	}
Esempio n. 4
0
void CAniPropertySet::SetBool (const CString &sName, bool bValue, int *retiIndex)

//	SetBool
//
//	Sets boolean property

	{
	SProperty *pProp = FindOrAdd(sName, retiIndex);
	pProp->InitialValue.Set(CAniProperty::typeBool, bValue);
	pProp->CurrentValue.Set(CAniProperty::typeBool, bValue);
	}
Esempio n. 5
0
void CAniPropertySet::Set (const CString &sName, const CAniProperty &Value, int *retiIndex)

//	Set
//
//	Sets a value

	{
	SProperty *pProp = FindOrAdd(sName, retiIndex);
	pProp->InitialValue = Value;
	pProp->CurrentValue = Value;
	}
Esempio n. 6
0
void RAS_ListRasterizer::IndexPrimitives(RAS_MeshSlot& ms)
{
	RAS_ListSlot* localSlot =0;

	if (ms.m_bDisplayList) {
		localSlot = FindOrAdd(ms);
		localSlot->DrawList();
		if (localSlot->End()) {
			// save slot here too, needed for replicas and object using same mesh
			// => they have the same vertexarray but different mesh slot
			ms.m_DisplayList = localSlot;
			return;
		}
	}
	
	RAS_OpenGLRasterizer::IndexPrimitives(ms);

	if (ms.m_bDisplayList) {
		localSlot->EndList();
		ms.m_DisplayList = localSlot;
	}
}
Esempio n. 7
0
//---------------------------------------------------------
// Returns the equivalent hashed Stub, creating a new hash
// entry if necessary. If the latter, will call out to CompileMLStub.
//
// Refcounting:
//    The caller is responsible for DecRef'ing the returned stub in
//    order to avoid leaks.
//
//
// On successful exit, *pMode is set to describe
// the compiled nature of the MLStub.
//
// callerContext can be used by the caller to push some context through
// to the compilation routine.
//
// Returns NULL for out of memory or other fatal error.
//---------------------------------------------------------
Stub *MLStubCache::Canonicalize(const BYTE * pRawMLStub, MLStubCompilationMode *pMode,
                                void *callerContext)
{
    m_crst.Enter();

    MLCHASHENTRY *phe = (MLCHASHENTRY*)Find((LPVOID)pRawMLStub);
    if (phe) {
        Stub *pstub = phe->m_pMLStub;
        pstub->IncRef();
        *pMode = (MLStubCompilationMode) (phe->m_compilationMode);
        m_crst.Leave();
        return pstub;
    }
    m_crst.Leave();

    {
        CPUSTUBLINKER sl;
        CPUSTUBLINKER slempty;
        CPUSTUBLINKER *psl = &sl;
        MLStubCompilationMode mode;
        mode = CompileMLStub(pRawMLStub, psl, callerContext);
        if (mode == INTERPRETED) {
            // CompileMLStub returns INTERPRETED for error cases:
            // in this case, redirect to the empty stublinker so
            // we don't accidentally pick up any crud that
            // CompileMLStub threw into the stublinker before
            // it ran into the error condition.
            psl = &slempty;
        }

        *pMode = mode;

        UINT32 offset;
        Stub   *pstub;
        if (NULL == (pstub = FinishLinking(psl, pRawMLStub, &offset))) {
            return NULL;
        }

        if (offset > 0xffff) {
            return NULL;
        }

        m_crst.Enter();

        bool bNew;
        phe = (MLCHASHENTRY*)FindOrAdd((LPVOID)pRawMLStub, /*modifies*/bNew);
        if (phe) {
            if (bNew) {
                // Note: FinishLinking already does the IncRef.
                phe->m_pMLStub = pstub;
                phe->m_offsetOfRawMLStub = (UINT16)offset;
                phe->m_compilationMode   = mode;

            } else {

                // If we got here, some other thread got in
                // and enregistered an identical stub during
                // the window in which we were out of the m_crst.

                //Under DEBUG, two identical ML streams can actually compile
                // to different compiled stubs due to the checked build's
                // toggling between inlined TLSGetValue and api TLSGetValue.
                //_ASSERTE(phe->m_offsetOfRawMLStub == (UINT16)offset);
                _ASSERTE(phe->m_compilationMode == mode);
                pstub->DecRef(); // Destroy the stub we just created
                pstub = phe->m_pMLStub; //Use the previously created stub

            }

            // IncRef so that caller has firm ownership of stub.
            pstub->IncRef();
        }

        m_crst.Leave();

        if (phe) {
            return pstub;
        } else {
            // Couldn't grow hash table due to lack of memory.
            // Destroy the stub and return NULL.
            pstub->DecRef();
        }

    }

    return NULL;
}
Esempio n. 8
0
int _cdecl main(
    int     argc,
    char    *argv[]
) {
    HKEY    WowKey;
    long    l;
    DWORD   dwRegValueType;
    CHAR    sz[2048];
    ULONG   ulSize;

    l = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
                      "SYSTEM\\CurrentControlSet\\Control\\WOW",
                      0,
                      KEY_QUERY_VALUE | KEY_SET_VALUE,
                      &WowKey );

    if ( l != 0 ) {
        printf("Failed to open HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\WOW\n");
        printf("Do you have administrator privleges?\n");
        exit(1);
    }

    ulSize = sizeof(sz);

    l = RegQueryValueEx( WowKey,
                         "KnownDLLs",
                         NULL,
                         &dwRegValueType,
                         sz,
                         &ulSize );

    if ( l != ERROR_SUCCESS )
    {
        printf("Failed reading [WOWKEY]\\KnownDLLs\n");
        printf("Do you have administrator privleges?\n");
        exit(1);
    }

    if ( dwRegValueType != REG_SZ ) {
        printf("Internal error, [WOWKEY]\\KnownDLLs is not a REG_SZ (string)\n");
        exit(1);
    }

    printf("\nKey was: \"%s\"\n\n", sz );

    switch (argc)
    {
    case 1:
	FindOrAdd( sz, "compobj.dll" );
	FindOrAdd( sz, "storage.dll" );
	FindOrAdd( sz, "ole2.dll" );
	FindOrAdd( sz, "ole2disp.dll" );
	FindOrAdd( sz, "typelib.dll" );
	FindOrAdd( sz, "ole2nls.dll" );
	break;
    case 2:
	if( (strcmp(argv[1],"-r") == 0) ||
            (strcmp(argv[1],"/r") == 0))
	{
	    FindAndDelete( sz, "compobj.dll" );
	    FindAndDelete( sz, "storage.dll" );
	    FindAndDelete( sz, "ole2.dll" );
	    FindAndDelete( sz, "ole2disp.dll" );
	    FindAndDelete( sz, "typelib.dll" );
	    FindAndDelete( sz, "ole2nls.dll" );
	}
	else
	{
	    printf("Unknown parameters\n");
	    exit(1);
	}

	break;
    default:
	printf("Too many parameters\n");
	exit(1);

    }


    printf("Key is now: \"%s\"\n\n", sz );

    ulSize = strlen( sz );

    l = RegSetValueEx( WowKey,
                         "KnownDLLs",
                         0,
                         dwRegValueType,
                         sz,
                         ulSize+1 );

    if ( l != ERROR_SUCCESS ) {
        printf("Error setting value (l=%ld,0x%08lX)\n",l,l);
        printf("Do you have administrator privleges?\n");
        exit(1);
    }


    l = RegCloseKey( WowKey );

    return(0);
}