Exemple #1
0
static RegionPtr
cwCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy,
	    int w, int h, int dstx, int dsty, unsigned long plane)
{
    int		odstx, odsty;
    RegionPtr	exposed = NULL;
    SETUP_BACKING_DST(pDst, pGC);
    SETUP_BACKING_SRC(pSrc, pGC);

    PROLOGUE(pGC);

    odstx = dstx;
    odsty = dsty;
    CW_OFFSET_XY_DST(dstx, dsty);
    CW_OFFSET_XY_SRC(srcx, srcy);

    exposed = (*pBackingGC->ops->CopyPlane)(pBackingSrc, pBackingDst,
					    pBackingGC, srcx, srcy, w, h,
					    dstx, dsty, plane);

    if (exposed != NULL)
	REGION_TRANSLATE(pDst->pScreen, exposed, odstx - dstx, odsty - dsty);

    EPILOGUE(pGC);

    return exposed;
}
Exemple #2
0
static int xmp_fgetattr(const char *path, struct stat *st,
                        struct fuse_file_info *fi)
{
    int res;

    LOAD_FUNC("fgetattr")
    lua_pushstring(L_VM, path);
    lua_rawgeti(L_VM, LUA_REGISTRYINDEX, fi->fh); 

    obj_pcall(2, 11, 0);
    err_pcall(res);

    res = lua_tointeger(L_VM, -11);

    st->st_mode = lua_tointeger(L_VM, -10);
    st->st_ino  = lua_tointeger(L_VM, -9);
    st->st_rdev = lua_tointeger(L_VM, -8);
    st->st_dev  = lua_tointeger(L_VM, -8);
    st->st_nlink= lua_tointeger(L_VM, -7);
    st->st_uid  = lua_tointeger(L_VM, -6);
    st->st_gid  = lua_tointeger(L_VM, -5);
    st->st_size = lua_tointeger(L_VM, -4);
    st->st_atime= lua_tointeger(L_VM, -3);
    st->st_mtime= lua_tointeger(L_VM, -2);
    st->st_ctime= lua_tointeger(L_VM, -1);

    /* Fill in fields not provided by Python lstat() */
    st->st_blksize= 4096;
    st->st_blocks= (st->st_size + 511)/512;

    EPILOGUE(11);

    return res;
}
Exemple #3
0
BOOL __stdcall DllEntryPoint( HINSTANCE hDll, DWORD dwReason, LPVOID lpvReserved )
{
	PROLOGUE;
	UNREFERENCED_PARAMETER( lpvReserved );
	switch(dwReason)
	{
	case DLL_PROCESS_ATTACH: 
		{
			InitializeCriticalSection(&cs);
			GetSystemInfo(&sSysInfo);	
			// load ddraw.dll from system32 dir
			char szPath[ MAX_PATH ];
			if( GetSystemDirectory( szPath, MAX_PATH - 10 ))
			{
				strcat( szPath, "\\ddraw.dll" );
				TRACE( szPath );
				hRealDDraw = LoadLibrary( szPath );
				if( hRealDDraw == hDll ) // this dll is NOT the real dll...
				{
					FreeLibrary( hRealDDraw );
				}
				else
				{
					pDirectDrawCreate				= (DirectDrawCreate_t)				GetProcAddress( hRealDDraw, "DirectDrawCreate");
					pDirectDrawCreateEx				= (DirectDrawCreateEx_t)			GetProcAddress( hRealDDraw, "DirectDrawCreateEx");
					pDirectDrawCreateClipper		= (DirectDrawCreateClipper_t)		GetProcAddress( hRealDDraw, "DirectDrawCreateClipper");
					pDirectDrawEnumerateA			= (DirectDrawEnumerateA_t)			GetProcAddress( hRealDDraw, "DirectDrawEnumerateA");
					pDirectDrawEnumerateExA			= (DirectDrawEnumerateExA_t)		GetProcAddress( hRealDDraw, "DirectDrawEnumerateExA");
					pDirectDrawEnumerateExW			= (DirectDrawEnumerateExW_t)		GetProcAddress( hRealDDraw, "DirectDrawEnumerateExW");
					pDirectDrawEnumerateW			= (DirectDrawEnumerateW_t)			GetProcAddress( hRealDDraw, "DirectDrawEnumerateW");
					pD3DParseUnknownCommand			= (D3DParseUnknownCommand_t)		GetProcAddress( hRealDDraw, "D3DParseUnknownCommand");
					pDllGetClassObject				= (DllGetClassObject_t)				GetProcAddress( hRealDDraw, "DllGetClassObject");
					pDllCanUnloadNow				= (DllCanUnloadNow_t)				GetProcAddress( hRealDDraw, "DllCanUnloadNow");
					pAcquireDDThreadLock			= (AcquireDDThreadLock_t)			GetProcAddress( hRealDDraw, "AcquireDDThreadLock");
					pReleaseDDThreadLock			= (ReleaseDDThreadLock_t)			GetProcAddress( hRealDDraw, "ReleaseDDThreadLock");
					pGetOLEThunkData				= (GetOLEThunkData_t)				GetProcAddress( hRealDDraw, "GetOLEThunkData");
					pSetAppCompatData				= (SetAppCompatData_t)				GetProcAddress( hRealDDraw, "SetAppCompatData");
					pCompleteCreateSysmemSurface	= (CompleteCreateSysmemSurface_t)	GetProcAddress( hRealDDraw, "CompleteCreateSysmemSurface");
					pDDGetAttachedSurfaceLcl		= (DDGetAttachedSurfaceLcl_t)		GetProcAddress( hRealDDraw, "DDGetAttachedSurfaceLcl");
					pDDInternalLock					= (DDInternalLock_t)				GetProcAddress( hRealDDraw, "DDInternalLock");
					pDDInternalUnlock				= (DDInternalUnlock_t)				GetProcAddress( hRealDDraw, "DDInternalUnlock");
					pDSoundHelp						= (DSoundHelp_t)					GetProcAddress( hRealDDraw, "DSoundHelp" );
					pGetDDSurfaceLocal				= (GetDDSurfaceLocal_t)				GetProcAddress( hRealDDraw, "GetDDSurfaceLocal" );
					pGetSurfaceFromDC				= (GetSurfaceFromDC_t)				GetProcAddress( hRealDDraw, "GetSurfaceFromDC" );
					pRegisterSpecialCase			= (RegisterSpecialCase_t)			GetProcAddress( hRealDDraw, "RegisterSpecialCase" );
				}
			}
			break;
		}
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
		break;
	case DLL_PROCESS_DETACH:
		TRACE( "DLL_PROCESS_DETACH" );
		FreeLibrary( hRealDDraw );
		break;
	}
	EPILOGUE( TRUE );
}
Exemple #4
0
// setup for HEL BLT ???
HRESULT __stdcall RegisterSpecialCase( DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4 )
{ 
	PROLOGUE;
	HRESULT hResult = E_NOTIMPL;
	if( pRegisterSpecialCase != NULL )
	{
		hResult = pRegisterSpecialCase( arg1, arg2, arg3, arg4 );
	}
	EPILOGUE( hResult );
}
Exemple #5
0
HRESULT __stdcall DirectDrawEnumerateW( LPDDENUMCALLBACK lpCallback, LPVOID lpContext )
{ 
	PROLOGUE;
	HRESULT hResult = E_NOTIMPL;
	if( pDirectDrawEnumerateW != NULL )
	{
		hResult = pDirectDrawEnumerateW( lpCallback, lpContext );
	}
	EPILOGUE( hResult );
}
Exemple #6
0
HRESULT __stdcall DirectDrawEnumerateExA( LPDDENUMCALLBACK lpCallback, LPVOID lpContext, DWORD dwFlags )
{ 
	PROLOGUE;
	HRESULT hResult = E_NOTIMPL;
	if( pDirectDrawEnumerateExA != NULL ) 
	{
		hResult = pDirectDrawEnumerateExA( lpCallback, lpContext, dwFlags );
	}
	EPILOGUE( hResult );
}
Exemple #7
0
HRESULT __stdcall DllCanUnloadNow()
{ 
	PROLOGUE;
	HRESULT hResult = S_FALSE;
	if( pDllCanUnloadNow != NULL )
	{
		hResult = pDllCanUnloadNow();
	}
	EPILOGUE( hResult );
}
Exemple #8
0
HRESULT __stdcall D3DParseUnknownCommand( LPVOID lpCmd, LPVOID *lpRetCmd )
{ 
	PROLOGUE;
	HRESULT hResult = D3DERR_COMMAND_UNPARSED;
	if( pD3DParseUnknownCommand != NULL )
	{
		hResult = pD3DParseUnknownCommand( lpCmd, lpRetCmd );
	}
	EPILOGUE( hResult );
}
Exemple #9
0
DWORD __stdcall CompleteCreateSysmemSurface( DWORD arg1 )
{ 
	PROLOGUE;
	DWORD dwResult = 0;
	if( pCompleteCreateSysmemSurface != NULL )
	{
		dwResult = pCompleteCreateSysmemSurface( arg1 );
	}
	EPILOGUE( dwResult );
}
Exemple #10
0
HRESULT __stdcall DDGetAttachedSurfaceLcl( DWORD arg1, DWORD arg2, DWORD arg3 )
{ 
	PROLOGUE;
	HRESULT hResult = E_NOTIMPL;
	if( pDDGetAttachedSurfaceLcl != NULL )
	{
		hResult = pDDGetAttachedSurfaceLcl( arg1, arg2, arg3 );
	}
	EPILOGUE( hResult );
}
Exemple #11
0
DWORD __stdcall DDInternalUnlock( DWORD arg1 )
{
	PROLOGUE;
	DWORD dwResult = 0xFFFFFFFF;
	if( pDDInternalUnlock != NULL )
	{
		dwResult = pDDInternalUnlock( arg1 );
	}
	EPILOGUE( dwResult );
} 
Exemple #12
0
// assume HRESULT...
HRESULT __stdcall GetDDSurfaceLocal(  DWORD arg1, DWORD arg2, DWORD arg3 )
{ 
	PROLOGUE;
	HRESULT hResult = E_NOTIMPL;
	if( pGetDDSurfaceLocal != NULL )
	{
		hResult = pGetDDSurfaceLocal( arg1, arg2, arg3 );
	}
	EPILOGUE( hResult );
}
Exemple #13
0
// assume HRESULT...
HRESULT __stdcall GetSurfaceFromDC_export(  DWORD arg1, DWORD arg2, DWORD arg3 )
{ 
	PROLOGUE;
	HRESULT hResult = E_NOTIMPL;
	if( pGetSurfaceFromDC != NULL )
	{
		hResult = pGetSurfaceFromDC( arg1, arg2, arg3 );
	}
	EPILOGUE( hResult );
} 
Exemple #14
0
/*
If SetCooperativeLevel is called once in a process, a binding is established between the process and the window. 
If it is called again in the same process with a different non-null window handle, it returns the DDERR_HWNDALREADYSET 
error value. Some applications may receive this error value when DirectSound(R) specifies a different window handle than
DirectDraw(R)—they should specify the same, top-level application window handle.
*/
HRESULT __stdcall DSoundHelp( DWORD arg1, DWORD arg2, DWORD arg3 )
{ 
	// _internalSetAppHWnd( 0, arg1, 0, 0, arg2, arg3 );
	PROLOGUE;
	HRESULT hResult = E_NOTIMPL;
	if( pDSoundHelp != NULL )
	{
		hResult = pDSoundHelp( arg1, arg2, arg3 );
	}
	EPILOGUE( hResult );
} 
Exemple #15
0
// returns void / no return value
DWORD __stdcall ReleaseDDThreadLock()
{	
	PROLOGUE;
	HRESULT hResult = E_NOTIMPL;
	if( pReleaseDDThreadLock != NULL )
	{
		pReleaseDDThreadLock();
		hResult = DD_OK;
	}
	EPILOGUE( hResult );
}
Exemple #16
0
static int xmp_rmdir(const char *path)
{
    int res;

    LOAD_FUNC("rmdir")
    lua_pushstring(L_VM, path);
    obj_pcall(1, 1, 0);
    err_pcall(res);
    res = lua_tointeger(L_VM, -1);
    EPILOGUE(1);
    
    return res;
}
Exemple #17
0
static void
cwPolySegment(DrawablePtr pDst, GCPtr pGC, int nseg, xSegment *pSegs)
{
    SETUP_BACKING_DST(pDst, pGC);

    PROLOGUE(pGC);

    CW_OFFSET_XYPOINTS(pSegs, nseg * 2);

    (*pBackingGC->ops->PolySegment)(pBackingDst, pBackingGC, nseg, pSegs);

    EPILOGUE(pGC);
}
Exemple #18
0
static void
cwPolyFillRect(DrawablePtr pDst, GCPtr pGC, int nrects, xRectangle *pRects)
{
    SETUP_BACKING_DST(pDst, pGC);

    PROLOGUE(pGC);

    CW_OFFSET_RECTS(pRects, nrects);

    (*pBackingGC->ops->PolyFillRect)(pBackingDst, pBackingGC, nrects, pRects);

    EPILOGUE(pGC);
}
Exemple #19
0
static void
cwPolyFillArc(DrawablePtr pDst, GCPtr pGC, int narcs, xArc *parcs)
{
    SETUP_BACKING_DST(pDst, pGC);

    PROLOGUE(pGC);

    CW_OFFSET_RECTS(parcs, narcs);

    (*pBackingGC->ops->PolyFillArc)(pBackingDst, pBackingGC, narcs, parcs);

    EPILOGUE(pGC);
}
Exemple #20
0
HRESULT __stdcall DirectDrawCreateEx( GUID* lpGUID, LPVOID* lplpDD, REFIID iid, IUnknown* pUnkOuter )
{	
	PROLOGUE;
	HRESULT hResult = E_NOTIMPL;
	if( pDirectDrawCreateEx != NULL )
	{
		hResult = pDirectDrawCreateEx( lpGUID, lplpDD, iid, pUnkOuter );
		if( SUCCEEDED( hResult) )
		{
			Wrap( NULL, iid_to_vtbl( iid ), (void**)lplpDD );
		}
	}
	EPILOGUE( hResult );
}
Exemple #21
0
static int xmp_truncate(const char *path, off_t size)
{
    int res;

    LOAD_FUNC("truncate")
    lua_pushstring(L_VM, path);
    lua_pushnumber(L_VM, size);
    obj_pcall(2, 1, 0);
    err_pcall(res);
    res = lua_tointeger(L_VM, -1);
    EPILOGUE(1);

    return res;
}
Exemple #22
0
static int xmp_flush(const char *path, struct fuse_file_info *fi)
{
    int res;

    LOAD_FUNC("flush")
    lua_pushstring(L_VM, path);
    lua_rawgeti(L_VM, LUA_REGISTRYINDEX, fi->fh); 
    obj_pcall(2, 1, 0);
    err_pcall(res);
    res = lua_tointeger(L_VM, -1);
    EPILOGUE(1);

    return res;
}
Exemple #23
0
static int xmp_removexattr(const char *path, const char *name)
{
    int res;

    LOAD_FUNC("removexattr")
    lua_pushstring(L_VM, path);
    lua_pushstring(L_VM, name);
    obj_pcall(2, 1, 0);
    err_pcall(res);
    res = lua_tointeger(L_VM, -1);
    EPILOGUE(1);

    return res;
}
Exemple #24
0
static int xmp_chmod(const char *path, mode_t mode)
{
    int res;

    LOAD_FUNC("chmod")
    lua_pushstring(L_VM, path);
    lua_pushnumber(L_VM, mode);
    obj_pcall(2, 1, 0);
    err_pcall(res);
    res = lua_tointeger(L_VM, -1);
    EPILOGUE(1);

    return res;
}
Exemple #25
0
static void
cwImageText8(DrawablePtr pDst, GCPtr pGC, int x, int y, int count, char *chars)
{
    SETUP_BACKING_DST(pDst, pGC);

    PROLOGUE(pGC);

    CW_OFFSET_XY_DST(x, y);

    (*pBackingGC->ops->ImageText8)(pBackingDst, pBackingGC, x, y, count,
				   chars);

    EPILOGUE(pGC);
}
Exemple #26
0
HRESULT __stdcall DirectDrawCreate( GUID* lpGUID, LPDIRECTDRAW* lplpDD, IUnknown* pUnkOuter )
{
	PROLOGUE;
	HRESULT hResult = E_NOTIMPL;
	if( pDirectDrawCreate != NULL )
	{
		hResult = pDirectDrawCreate( lpGUID, lplpDD, pUnkOuter );
		if( SUCCEEDED( hResult) )
		{
			Wrap( NULL, iid_to_vtbl( IID_IDirectDraw ), (void**)lplpDD );
		}
	}
	EPILOGUE( hResult );
}
Exemple #27
0
static int xmp_fsyncdir(const char *path, int isdatasync, struct fuse_file_info *fi)
{
    int res;

    LOAD_FUNC("syncdir")
    lua_pushstring(L_VM, path);
    lua_pushboolean(L_VM, isdatasync);
    lua_rawgeti(L_VM, LUA_REGISTRYINDEX, fi->fh); 
    obj_pcall(3, 1, 0);
    err_pcall(res);
    res = lua_tointeger(L_VM, -1);
    EPILOGUE(1);
    return res;
}
Exemple #28
0
// do we care what the CLSID is ?? or do we just look at riid...
// CLSID_DirectDraw, CLSID_DirectDraw7, CLSID_DirectDrawClipper
HRESULT __stdcall DllGetClassObject( REFCLSID rclsid, REFIID riid, LPVOID* ppvObject )
{
	PROLOGUE;
	HRESULT hResult = E_NOTIMPL;
	if( pDllGetClassObject != NULL )
	{
		hResult = pDllGetClassObject( rclsid, riid, ppvObject );
		if( SUCCEEDED( hResult) )
		{ 
			Wrap( NULL, iid_to_vtbl( riid ), ppvObject );
		}
	}
	EPILOGUE( hResult );
}
Exemple #29
0
HRESULT __stdcall DirectDrawCreateClipper( DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper,  IUnknown FAR *pUnkOuter )
{	
	PROLOGUE;
	HRESULT hResult = E_NOTIMPL;
	if( pDirectDrawCreateClipper != NULL )
	{
		hResult = pDirectDrawCreateClipper( dwFlags, lplpDDClipper, pUnkOuter );
		if( SUCCEEDED( hResult) )
		{ 
			Wrap( NULL, iid_to_vtbl( IID_IDirectDrawClipper ), (void**)lplpDDClipper );
		}
	}
	EPILOGUE( hResult );
}
Exemple #30
0
static int xmp_link(const char *from, const char *to)
{
    int res;

    LOAD_FUNC("link")
    lua_pushstring(L_VM, from);
    lua_pushstring(L_VM, to);
    obj_pcall(2, 1, 0);
    err_pcall(res);
    res = lua_tointeger(L_VM, -1);
    EPILOGUE(1);

    return res;
}