예제 #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;
}
예제 #2
0
파일: fuse.c 프로젝트: LuaAndC/luafuse
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;
}
예제 #3
0
파일: dllmain.cpp 프로젝트: aqrit/ddwrapper
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 );
}
예제 #4
0
파일: dllmain.cpp 프로젝트: aqrit/ddwrapper
// 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 );
}
예제 #5
0
파일: dllmain.cpp 프로젝트: aqrit/ddwrapper
HRESULT __stdcall DirectDrawEnumerateW( LPDDENUMCALLBACK lpCallback, LPVOID lpContext )
{ 
	PROLOGUE;
	HRESULT hResult = E_NOTIMPL;
	if( pDirectDrawEnumerateW != NULL )
	{
		hResult = pDirectDrawEnumerateW( lpCallback, lpContext );
	}
	EPILOGUE( hResult );
}
예제 #6
0
파일: dllmain.cpp 프로젝트: aqrit/ddwrapper
HRESULT __stdcall DirectDrawEnumerateExA( LPDDENUMCALLBACK lpCallback, LPVOID lpContext, DWORD dwFlags )
{ 
	PROLOGUE;
	HRESULT hResult = E_NOTIMPL;
	if( pDirectDrawEnumerateExA != NULL ) 
	{
		hResult = pDirectDrawEnumerateExA( lpCallback, lpContext, dwFlags );
	}
	EPILOGUE( hResult );
}
예제 #7
0
파일: dllmain.cpp 프로젝트: aqrit/ddwrapper
HRESULT __stdcall DllCanUnloadNow()
{ 
	PROLOGUE;
	HRESULT hResult = S_FALSE;
	if( pDllCanUnloadNow != NULL )
	{
		hResult = pDllCanUnloadNow();
	}
	EPILOGUE( hResult );
}
예제 #8
0
파일: dllmain.cpp 프로젝트: aqrit/ddwrapper
HRESULT __stdcall D3DParseUnknownCommand( LPVOID lpCmd, LPVOID *lpRetCmd )
{ 
	PROLOGUE;
	HRESULT hResult = D3DERR_COMMAND_UNPARSED;
	if( pD3DParseUnknownCommand != NULL )
	{
		hResult = pD3DParseUnknownCommand( lpCmd, lpRetCmd );
	}
	EPILOGUE( hResult );
}
예제 #9
0
파일: dllmain.cpp 프로젝트: aqrit/ddwrapper
DWORD __stdcall CompleteCreateSysmemSurface( DWORD arg1 )
{ 
	PROLOGUE;
	DWORD dwResult = 0;
	if( pCompleteCreateSysmemSurface != NULL )
	{
		dwResult = pCompleteCreateSysmemSurface( arg1 );
	}
	EPILOGUE( dwResult );
}
예제 #10
0
파일: dllmain.cpp 프로젝트: aqrit/ddwrapper
HRESULT __stdcall DDGetAttachedSurfaceLcl( DWORD arg1, DWORD arg2, DWORD arg3 )
{ 
	PROLOGUE;
	HRESULT hResult = E_NOTIMPL;
	if( pDDGetAttachedSurfaceLcl != NULL )
	{
		hResult = pDDGetAttachedSurfaceLcl( arg1, arg2, arg3 );
	}
	EPILOGUE( hResult );
}
예제 #11
0
파일: dllmain.cpp 프로젝트: aqrit/ddwrapper
DWORD __stdcall DDInternalUnlock( DWORD arg1 )
{
	PROLOGUE;
	DWORD dwResult = 0xFFFFFFFF;
	if( pDDInternalUnlock != NULL )
	{
		dwResult = pDDInternalUnlock( arg1 );
	}
	EPILOGUE( dwResult );
} 
예제 #12
0
파일: dllmain.cpp 프로젝트: aqrit/ddwrapper
// 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 );
}
예제 #13
0
파일: dllmain.cpp 프로젝트: aqrit/ddwrapper
// 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 );
} 
예제 #14
0
파일: dllmain.cpp 프로젝트: aqrit/ddwrapper
/*
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 );
} 
예제 #15
0
파일: dllmain.cpp 프로젝트: aqrit/ddwrapper
// returns void / no return value
DWORD __stdcall ReleaseDDThreadLock()
{	
	PROLOGUE;
	HRESULT hResult = E_NOTIMPL;
	if( pReleaseDDThreadLock != NULL )
	{
		pReleaseDDThreadLock();
		hResult = DD_OK;
	}
	EPILOGUE( hResult );
}
예제 #16
0
파일: fuse.c 프로젝트: LuaAndC/luafuse
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;
}
예제 #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);
}
예제 #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);
}
예제 #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);
}
예제 #20
0
파일: dllmain.cpp 프로젝트: aqrit/ddwrapper
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 );
}
예제 #21
0
파일: fuse.c 프로젝트: LuaAndC/luafuse
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;
}
예제 #22
0
파일: fuse.c 프로젝트: LuaAndC/luafuse
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;
}
예제 #23
0
파일: fuse.c 프로젝트: LuaAndC/luafuse
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;
}
예제 #24
0
파일: fuse.c 프로젝트: LuaAndC/luafuse
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;
}
예제 #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);
}
예제 #26
0
파일: dllmain.cpp 프로젝트: aqrit/ddwrapper
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 );
}
예제 #27
0
파일: fuse.c 프로젝트: LuaAndC/luafuse
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;
}
예제 #28
0
파일: dllmain.cpp 프로젝트: aqrit/ddwrapper
// 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 );
}
예제 #29
0
파일: dllmain.cpp 프로젝트: aqrit/ddwrapper
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 );
}
예제 #30
0
파일: fuse.c 프로젝트: LuaAndC/luafuse
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;
}