📄 engine.c
字号:
//
// Permedia3 Sample Display Driver
// engine.c
//
// Copyright (c) 2000 Microsoft Corporation. All rights reserved.
//
// This code wraps the "engine" callbacks provided by GDI. They allow the
// calls to be made as if they were local function calls. It will also handle
// engine version control, if it is ever necessary. Refered to as "GDI
// Engine Manager."
#include "pch.h" // Precompiled header support.
#include "debug.h"
#include "struct.h"
#include "proto.h"
// Expands out to GDI engine pointers. These are filled in and managed by this
// module. See winddi.h for details.
DEFINE_GDI_ENTRY_POINTS(EMPTYPARM,LEFTENTRY,RIGHTENTRY)
BOOL
InitializeEngineManager(
ULONG EngineVersion,
PENGCALLBACKS EngineCallbacks
)
{
// InitializeEngineManager
// Extract the function pointers from the array provided by GDI. Check the
// versioning and set up our exported function pointers.
// Local Variables.
BOOL FnRetVal = FALSE; // Return value for this function.
// Check parameters.
Assert(EngineVersion == GetEngineVersion());
AssertReadPtr(EngineCallbacks, sizeof(ENGCALLBACKS));
Enter(L"InitializeEngineManager");
// This is where you would check out the engine version ID and fill out
// the function pointers conditionally.
BRUSHOBJ_pvAllocRbrush = EngineCallbacks->BRUSHOBJ_pvAllocRbrush;
BRUSHOBJ_pvGetRbrush = EngineCallbacks->BRUSHOBJ_pvGetRbrush;
CLIPOBJ_cEnumStart = EngineCallbacks->CLIPOBJ_cEnumStart;
CLIPOBJ_bEnum = EngineCallbacks->CLIPOBJ_bEnum;
PALOBJ_cGetColors = EngineCallbacks->PALOBJ_cGetColors;
PATHOBJ_vEnumStart = EngineCallbacks->PATHOBJ_vEnumStart;
PATHOBJ_bEnum = EngineCallbacks->PATHOBJ_bEnum;
PATHOBJ_vGetBounds = EngineCallbacks->PATHOBJ_vGetBounds;
XLATEOBJ_cGetPalette = EngineCallbacks->XLATEOBJ_cGetPalette;
EngCreateDeviceSurface = EngineCallbacks->EngCreateDeviceSurface;
EngDeleteSurface = EngineCallbacks->EngDeleteSurface;
EngCreateDeviceBitmap = EngineCallbacks->EngCreateDeviceBitmap;
EngCreatePalette = EngineCallbacks->EngCreatePalette;
FnRetVal = TRUE;
Exit(L"InitializeEngineManager");
return FnRetVal;
}
ULONG
GetEngineVersion()
{
// GetEngineVersion
// Returns the version of the GDI "engine" that we are encapsulating. No
// Enter/Exit semantics. This is likely to be inlined.
return (DDI_DRIVER_VERSION);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -