mirror of
https://github.com/reactos/reactos.git
synced 2025-05-10 20:27:45 +00:00
- Fix some msvc issues in rostests
svn path=/trunk/; revision=42365
This commit is contained in:
parent
771b93f448
commit
c71617e216
12 changed files with 45 additions and 37 deletions
|
@ -4,6 +4,7 @@ Test_GetCurrentObject(PTESTINFO pti)
|
|||
{
|
||||
HWND hWnd;
|
||||
HDC hDC;
|
||||
HBITMAP hBmp;
|
||||
|
||||
/* Create a window */
|
||||
hWnd = CreateWindowW(L"BUTTON", L"TestWindow", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
||||
|
@ -70,7 +71,6 @@ Test_GetCurrentObject(PTESTINFO pti)
|
|||
|
||||
/* Default bitmap */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
HBITMAP hBmp;
|
||||
hBmp = GetCurrentObject(hDC, OBJ_BITMAP);
|
||||
RTEST(GDI_HANDLE_GET_TYPE(hBmp) == GDI_OBJECT_TYPE_BITMAP);
|
||||
RTEST(GetLastError() == ERROR_SUCCESS);
|
||||
|
|
|
@ -103,9 +103,10 @@ Test_Dibsection(PTESTINFO pti)
|
|||
BITMAP bitmap;
|
||||
DIBSECTION dibsection;
|
||||
PVOID pData;
|
||||
HDC hDC;
|
||||
|
||||
FillMemory(&dibsection, sizeof(DIBSECTION), 0x77);
|
||||
HDC hDC = GetDC(0);
|
||||
hDC = GetDC(0);
|
||||
hBitmap = CreateDIBSection(hDC, &bmi, DIB_RGB_COLORS, &pData, NULL, 0);
|
||||
ASSERT(hBitmap);
|
||||
|
||||
|
|
|
@ -46,6 +46,10 @@ Test_NtGdiCreateDIBSection(PTESTINFO pti)
|
|||
PBITMAPV4HEADER pbV4h = (PBITMAPV4HEADER)&bmi.bmiHeader;
|
||||
PBITMAPV5HEADER pbV5h = (PBITMAPV5HEADER)&bmi.bmiHeader;
|
||||
|
||||
HANDLE hSection;
|
||||
NTSTATUS Status;
|
||||
LARGE_INTEGER MaximumSize;
|
||||
|
||||
hDC = GetDC(0);
|
||||
pbih->biSize = sizeof(BITMAPINFOHEADER);
|
||||
pbih->biWidth = 2;
|
||||
|
@ -441,10 +445,6 @@ printf("dib with bitfileds: %p\n", hbmp);
|
|||
if (hbmp) DeleteObject(hbmp);
|
||||
|
||||
/* Test section */
|
||||
HANDLE hSection;
|
||||
NTSTATUS Status;
|
||||
LARGE_INTEGER MaximumSize;
|
||||
|
||||
MaximumSize.QuadPart = 4096;
|
||||
Status = ZwCreateSection(&hSection,
|
||||
SECTION_ALL_ACCESS,
|
||||
|
|
|
@ -66,6 +66,7 @@ Test_NtUserSystemParametersInfo_Params(PTESTINFO pti)
|
|||
// UINT uint;
|
||||
DWORD data[1000];
|
||||
UINT i, uint;
|
||||
ACCESSTIMEOUT ato;
|
||||
#if 1
|
||||
/* Test normal */
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
|
@ -78,7 +79,6 @@ Test_NtUserSystemParametersInfo_Params(PTESTINFO pti)
|
|||
TEST(GetLastError() == ERROR_INVALID_PARAMETER);
|
||||
|
||||
/* Test wrong cbSize member */
|
||||
ACCESSTIMEOUT ato;
|
||||
ato.cbSize = 1;
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
TEST(NtUserSystemParametersInfo(SPI_GETACCESSTIMEOUT, 0, &ato, 0) == FALSE);
|
||||
|
|
|
@ -30,6 +30,7 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
HDC hdc, hdcMem;
|
||||
BITMAP bitmap;
|
||||
HBRUSH brush, brush2;
|
||||
INT l;
|
||||
|
||||
hdc = BeginPaint(hWnd, &ps);
|
||||
hdcMem = CreateCompatibleDC(hdc);
|
||||
|
@ -42,7 +43,7 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
PatBlt(hdc, 30, 0, 4*bitmap.bmWidth*2, 4*bitmap.bmHeight, PATCOPY);
|
||||
|
||||
/* hatched brushes */
|
||||
INT l = 66;
|
||||
l = 66;
|
||||
brush = CreateHatchBrush(HS_DIAGCROSS, RGB(255,0,0));
|
||||
SelectObject(hdc, brush);
|
||||
PatBlt(hdc, 0, 0, 30, l, PATCOPY);
|
||||
|
|
|
@ -31,8 +31,8 @@
|
|||
|
||||
/* PRIVATE FUNCTIONS **********************************************************/
|
||||
|
||||
NTSTATUS NTAPI
|
||||
(*IoGetDeviceInterfaces_Func)(
|
||||
NTSTATUS
|
||||
(NTAPI *IoGetDeviceInterfaces_Func)(
|
||||
IN CONST GUID *InterfaceClassGuid,
|
||||
IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL,
|
||||
IN ULONG Flags,
|
||||
|
|
|
@ -39,8 +39,8 @@ TestTimerApcRoutine(IN PVOID TimerContext,
|
|||
IN LONG TimerHighValue)
|
||||
|
||||
{
|
||||
DPRINT("Timer Apc called!\n");
|
||||
ULONG *ApcCount = (ULONG *)TimerContext;
|
||||
DPRINT("Timer Apc called!\n");
|
||||
(*ApcCount)++;
|
||||
}
|
||||
|
||||
|
|
|
@ -70,14 +70,6 @@ typedef struct _DD_MISCELLANEOUSCALLBACKS {
|
|||
int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
|
||||
LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
/* get the functions we need */
|
||||
// DD_GETDRIVERINFODATA drv;
|
||||
HMODULE lib = LoadLibrary("gdi32.dll");
|
||||
DdCreateDirectDrawObject = (BOOL (APIENTRY*)(LPDDRAWI_DIRECTDRAW_GBL, HDC))GetProcAddress(lib, "GdiEntry1");
|
||||
DdQueryDirectDrawObject = (BOOL (APIENTRY*)(LPDDRAWI_DIRECTDRAW_GBL, LPDDHALINFO,LPDDHAL_DDCALLBACKS,LPDDHAL_DDSURFACECALLBACKS,LPDDHAL_DDPALETTECALLBACKS,LPD3DHAL_CALLBACKS,LPD3DHAL_GLOBALDRIVERDATA,LPDDHAL_DDEXEBUFCALLBACKS,LPDDSURFACEDESC,LPDWORD,LPVIDMEM))GetProcAddress(lib, "GdiEntry2");
|
||||
DdAttachSurface = (BOOL (APIENTRY*)(LPDDRAWI_DDRAWSURFACE_LCL, LPDDRAWI_DDRAWSURFACE_LCL))GetProcAddress(lib, "GdiEntry11");
|
||||
DdResetVisrgn = (BOOL (APIENTRY*)(LPDDRAWI_DDRAWSURFACE_LCL, HWND))GetProcAddress(lib, "GdiEntry6");
|
||||
|
||||
/* HAL Startup process */
|
||||
DEVMODE devmode;
|
||||
HBITMAP hbmp;
|
||||
|
@ -90,7 +82,21 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
|
|||
//DWORD Status; /* for create surface */
|
||||
UINT i;
|
||||
UINT j;
|
||||
UINT cSurfaces;
|
||||
|
||||
DDHAL_CANCREATESURFACEDATA mDdCanCreateSurface;
|
||||
DDHAL_UPDATEOVERLAYDATA mDdUpdateOverlay;
|
||||
DDRAWI_DDRAWSURFACE_LCL *pDDSurface;
|
||||
DDHAL_CREATESURFACEDATA mDdCreateSurface;
|
||||
|
||||
|
||||
/* get the functions we need */
|
||||
// DD_GETDRIVERINFODATA drv;
|
||||
HMODULE lib = LoadLibrary("gdi32.dll");
|
||||
DdCreateDirectDrawObject = (BOOL (APIENTRY*)(LPDDRAWI_DIRECTDRAW_GBL, HDC))GetProcAddress(lib, "GdiEntry1");
|
||||
DdQueryDirectDrawObject = (BOOL (APIENTRY*)(LPDDRAWI_DIRECTDRAW_GBL, LPDDHALINFO,LPDDHAL_DDCALLBACKS,LPDDHAL_DDSURFACECALLBACKS,LPDDHAL_DDPALETTECALLBACKS,LPD3DHAL_CALLBACKS,LPD3DHAL_GLOBALDRIVERDATA,LPDDHAL_DDEXEBUFCALLBACKS,LPDDSURFACEDESC,LPDWORD,LPVIDMEM))GetProcAddress(lib, "GdiEntry2");
|
||||
DdAttachSurface = (BOOL (APIENTRY*)(LPDDRAWI_DDRAWSURFACE_LCL, LPDDRAWI_DDRAWSURFACE_LCL))GetProcAddress(lib, "GdiEntry11");
|
||||
DdResetVisrgn = (BOOL (APIENTRY*)(LPDDRAWI_DDRAWSURFACE_LCL, HWND))GetProcAddress(lib, "GdiEntry6");
|
||||
|
||||
printf("This apps showing how to start up directx draw/d3d interface and some other as well\n");
|
||||
printf("This code have been releae to some close applactons with my premtions, if any company\n");
|
||||
|
@ -364,7 +370,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
|
|||
mddsdPrimary.dwFlags = DDSD_CAPS;
|
||||
mddsdPrimary.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_VIDEOMEMORY | DDSCAPS_VISIBLE;
|
||||
|
||||
DDHAL_CANCREATESURFACEDATA mDdCanCreateSurface;
|
||||
mDdCanCreateSurface;
|
||||
mDdCanCreateSurface.lpDD = &mDDrawGlobal;
|
||||
mDdCanCreateSurface.CanCreateSurface = mCallbacks.HALDD.CanCreateSurface;
|
||||
mDdCanCreateSurface.bIsDifferentPixelFormat = FALSE; //isDifferentPixelFormat;
|
||||
|
@ -405,7 +411,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
|
|||
|
||||
mpPrimaryLocals[0] = &mPrimaryLocal;
|
||||
|
||||
DDHAL_CREATESURFACEDATA mDdCreateSurface;
|
||||
mDdCreateSurface;
|
||||
mDdCreateSurface.lpDD = &mDDrawGlobal;
|
||||
mDdCreateSurface.CreateSurface = mCallbacks.HALDD.CreateSurface;
|
||||
mDdCreateSurface.lpDDSurfaceDesc = &mddsdPrimary;//pDDSD;
|
||||
|
@ -500,7 +506,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
|
|||
mOverlayGlobal.ddpfSurface = mddsdOverlay.ddpfPixelFormat;
|
||||
|
||||
// setup front- and backbuffer surfaces
|
||||
UINT cSurfaces = mddsdOverlay.dwBackBufferCount + 1;
|
||||
cSurfaces = mddsdOverlay.dwBackBufferCount + 1;
|
||||
for ( i = 0; i < cSurfaces; i++)
|
||||
{
|
||||
memset(&mOverlayMore[i], 0, sizeof(DDRAWI_DDRAWSURFACE_MORE));
|
||||
|
@ -565,7 +571,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
|
|||
}
|
||||
|
||||
|
||||
DDHAL_UPDATEOVERLAYDATA mDdUpdateOverlay;
|
||||
mDdUpdateOverlay;
|
||||
mDdUpdateOverlay.lpDD = &mDDrawGlobal;
|
||||
mDdUpdateOverlay.UpdateOverlay = mCallbacks.HALDDSurface.UpdateOverlay;
|
||||
mDdUpdateOverlay.lpDDDestSurface = mpPrimaryLocals[0];
|
||||
|
@ -607,7 +613,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
|
|||
/* blt */
|
||||
|
||||
|
||||
DDRAWI_DDRAWSURFACE_LCL *pDDSurface = mpPrimaryLocals[0];
|
||||
pDDSurface = mpPrimaryLocals[0];
|
||||
|
||||
if (!DdResetVisrgn(pDDSurface, NULL))
|
||||
{
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <windows.h>
|
||||
#include <setupapi.h>
|
||||
#include <tchar.h>
|
||||
#include <stdlib.h> // FIXME-DONTCOMMIT: Why is this needed?
|
||||
#include "resource.h"
|
||||
|
||||
typedef BOOL (WINAPI * SH_GIL_PROC)(HIMAGELIST *phLarge, HIMAGELIST *phSmall);
|
||||
|
|
|
@ -597,8 +597,8 @@ TEST_STATUS TestGlobalReAllocMovable()
|
|||
*/
|
||||
TEST_STATUS TestGlobalReAlloc()
|
||||
{
|
||||
OUTPUT_Banner("Testing GlobalReAlloc()");
|
||||
TEST_STATUS result = SKIPPED;
|
||||
OUTPUT_Banner("Testing GlobalReAlloc()");
|
||||
|
||||
result = TEST_CombineStatus(result, TestGlobalReAllocFixed());
|
||||
result = TEST_CombineStatus(result, TestGlobalReAllocMovable());
|
||||
|
@ -767,8 +767,8 @@ TEST_STATUS TestGlobalFlagsFixed()
|
|||
*/
|
||||
TEST_STATUS TestGlobalFlags()
|
||||
{
|
||||
OUTPUT_Banner("Testing GlobalFlags()");
|
||||
TEST_STATUS result = SKIPPED;
|
||||
OUTPUT_Banner("Testing GlobalFlags()");
|
||||
|
||||
result = TEST_CombineStatus(result, TestGlobalFlagsFixed());
|
||||
result = TEST_CombineStatus(result, TestGlobalFlagsMoveable());
|
||||
|
|
|
@ -22,6 +22,9 @@ int main()
|
|||
|
||||
int c;
|
||||
|
||||
HMIDIOUT Handle = NULL;
|
||||
UINT Result;
|
||||
|
||||
printf("MIDI output devices: %d\n", outs);
|
||||
|
||||
for (c = 0; c < outs; c ++)
|
||||
|
@ -32,8 +35,7 @@ int main()
|
|||
|
||||
printf("Opening MIDI output #0\n");
|
||||
|
||||
HMIDIOUT Handle = NULL;
|
||||
UINT Result = midiOutOpen(&Handle, 0, 0, 0, CALLBACK_NULL);
|
||||
Result = midiOutOpen(&Handle, 0, 0, 0, CALLBACK_NULL);
|
||||
printf("Result == %d Handle == %d\n", Result, (int)Handle);
|
||||
|
||||
// play something:
|
||||
|
|
|
@ -110,7 +110,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
{
|
||||
PAINTSTRUCT ps; /* Also used during window drawing */
|
||||
HDC hDC; /* A device context used for drawing */
|
||||
RECT rc, clr, wir; /* A rectangle used during drawing */
|
||||
RECT rc = {0,0,0,0}, clr, wir; /* A rectangle used during drawing */
|
||||
char spr[100], sir[100];
|
||||
static HBRUSH hbrWhite=NULL, hbrGray=NULL, hbrBlack=NULL, hbrRed=NULL, hbrBlue=NULL, hbrYellow=NULL;
|
||||
|
||||
|
@ -123,9 +123,8 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
case WM_CHAR:
|
||||
{
|
||||
|
||||
hDC = GetDC(hWnd);
|
||||
TCHAR text[2];
|
||||
hDC = GetDC(hWnd);
|
||||
text[0] = (TCHAR)wParam;
|
||||
text[1] = _T('\0');
|
||||
|
||||
|
@ -170,10 +169,9 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
case WM_KEYDOWN:
|
||||
{
|
||||
|
||||
hDC = GetDC(hWnd);
|
||||
RECT Rect;
|
||||
TCHAR text[2];
|
||||
hDC = GetDC(hWnd);
|
||||
text[0] = (TCHAR)wParam;
|
||||
text[1] = _T('\0');
|
||||
|
||||
|
@ -201,10 +199,9 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
case WM_KEYUP:
|
||||
{
|
||||
|
||||
hDC = GetDC(hWnd);
|
||||
RECT Rect;
|
||||
TCHAR text[2];
|
||||
hDC = GetDC(hWnd);
|
||||
text[0] = (TCHAR)wParam;
|
||||
text[1] = _T('\0');
|
||||
|
||||
|
@ -594,6 +591,8 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
case WM_CREATE:
|
||||
{
|
||||
SCROLLINFO si;
|
||||
TEXTMETRIC tm;
|
||||
/* Register a Ctrl+Alt+C hotkey*/
|
||||
RegisterHotKey(hWnd, CTRLC, MOD_CONTROL, VK_C);
|
||||
RegisterHotKey(hWnd, ALTF1, MOD_CONTROL | MOD_ALT, VK_F1);
|
||||
|
@ -605,7 +604,6 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
hbrBlue = CreateSolidBrush ( RGB(0x00, 0x00, 0xFF));
|
||||
hbrYellow = CreateSolidBrush ( RGB(0xFF, 0xFF, 0x00));
|
||||
|
||||
SCROLLINFO si;
|
||||
si.cbSize = sizeof(si);
|
||||
si.fMask = SIF_ALL;
|
||||
si.nMin = 0;
|
||||
|
@ -619,7 +617,6 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
/* The window is being created. Create our button
|
||||
* window now. */
|
||||
TEXTMETRIC tm;
|
||||
|
||||
/* First we use the system fixed font size to choose
|
||||
* a nice button size. */
|
||||
|
|
Loading…
Reference in a new issue