📄 pvr_bridge_u.c
字号:
/*!****************************************************************************
@File pvr_bridge_u.c
@Title WinCE bridging code
@Author Imagination Technologies
@date 16 September 2003
@Copyright Copyright 2003-2004 by Imagination Technologies Limited.
All rights reserved. No part of this software, either
material or conceptual may be copied or distributed,
transmitted, transcribed, stored in a retrieval system
or translated into any human or computer language in any
form by any means, electronic, mechanical, manual or
other-wise, or disclosed to third parties without the
express written permission of Imagination Technologies
Limited, Unit 8, HomePark Industrial Estate,
King's Langley, Hertfordshire, WD4 8LZ, U.K.
@Platform WinCE
@Description WinCE bridging code
@DoxygenVer
******************************************************************************/
/******************************************************************************
Modifications :-
$Log: pvr_bridge_u.c $
*****************************************************************************/
#include <windows.h>
#include "img_defs.h"
#include "services.h"
#include "pvr_bridge.h"
#include "pvr_debug.h"
/*!
*****************************************************************************
@Function : OpenServices
@Description : opens a services connection
@Input : szDevicePath - Specifies the device driver to open
@Output : phServices - handle for connection
@Return : PVRSRV_ERROR
*****************************************************************************/
PVRSRV_ERROR OpenServices(IMG_CHAR* szDevicePath, IMG_HANDLE *phServices)
{
IMG_HANDLE hPVRServices;
hPVRServices = (IMG_HANDLE) GetDC(NULL);
if((IMG_INT32)hPVRServices > 0)
{
IMG_BOOL bConnecting = IMG_TRUE;
*phServices = hPVRServices;
PVRSRVBridgeCall( hPVRServices,
PVRSRV_BRIDGE_CONNECT_SERVICES,
IMG_NULL,
0,
&bConnecting,
sizeof(bConnecting));
return(PVRSRV_OK);
}
else
{
PVR_DPF((PVR_DBG_ERROR, "Cannot open device driver %s.\n", szDevicePath));
}
return PVRSRV_ERROR_INIT_FAILURE;
}
/*!
*****************************************************************************
@Function : CloseServices
@Description : closes a services connection
@Input : hServices - handle for connection
@Return : PVRSRV_ERROR
*****************************************************************************/
PVRSRV_ERROR CloseServices(IMG_HANDLE hServices)
{
if(hServices)
{
IMG_BOOL bConnecting = IMG_FALSE;
PVRSRVBridgeCall( hServices,
PVRSRV_BRIDGE_CONNECT_SERVICES,
IMG_NULL,
0,
&bConnecting,
sizeof(bConnecting));
if(ReleaseDC(NULL, (HDC)hServices) == 0)
{
return PVRSRV_ERROR_GENERIC;
}
}
else
{
return PVRSRV_ERROR_INVALID_PARAMS;
}
return PVRSRV_OK;
}
/*!
*****************************************************************************
@Function : PVRSRVBridgeCall
@Description : To call a kernel-resident function from user space
@Input : hServices - handle for connection
@Input : ui32FunctionID - function index
@Input : pvParamIn
@Input : ui32InBufferSize
@Input : pvParamOut
@Input : ui32OutBufferSize
@Return : IMG_RESULT
*****************************************************************************/
IMG_RESULT PVRSRVBridgeCall(IMG_HANDLE hServices,
IMG_UINT32 ui32FunctionID,
IMG_VOID *pvParamIn,
IMG_UINT32 ui32InBufferSize,
IMG_VOID *pvParamOut,
IMG_UINT32 ui32OutBufferSize)
{
IMG_UINT32 ui32RetVal;
ui32RetVal = ExtEscape (hServices,
ui32FunctionID,
ui32InBufferSize,
pvParamIn,
ui32OutBufferSize,
pvParamOut);
if (ui32RetVal < 0)
{
PVR_DPF((PVR_DBG_ERROR, "ExtEscape failed.\n"));
}
return ui32RetVal;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -