ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
October 2013
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
14 participants
325 discussions
Start a n
N
ew thread
[hbelusca] 60781: [NTVDM] - DOS: the DOS file attributes are one byte. - BIOS: don't use hardcoded values; use the SEG_OFF_TO_PTR macro introduced earlier; use get/setAX instead of EmulatorGet/SetR...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Oct 27 23:39:52 2013 New Revision: 60781 URL:
http://svn.reactos.org/svn/reactos?rev=60781&view=rev
Log: [NTVDM] - DOS: the DOS file attributes are one byte. - BIOS: don't use hardcoded values; use the SEG_OFF_TO_PTR macro introduced earlier; use get/setAX instead of EmulatorGet/SetRegister. Modified: branches/ntvdm/subsystems/ntvdm/bios.c branches/ntvdm/subsystems/ntvdm/dos.c Modified: branches/ntvdm/subsystems/ntvdm/bios.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios.c?r…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] Sun Oct 27 23:39:52 2013 @@ -270,7 +270,7 @@ static BOOLEAN BiosKbdBufferPush(WORD Data) { /* Get the location of the element after the tail */ - WORD NextElement = Bda->KeybdBufferTail + 2; + WORD NextElement = Bda->KeybdBufferTail + sizeof(WORD); /* Wrap it around if it's at or beyond the end */ if (NextElement >= Bda->KeybdBufferEnd) NextElement = Bda->KeybdBufferStart; @@ -455,11 +455,11 @@ { INT i; WORD Offset = 0; - LPWORD IntVecTable = (LPWORD)((ULONG_PTR)BaseAddress); - LPBYTE BiosCode = (LPBYTE)((ULONG_PTR)BaseAddress + TO_LINEAR(BIOS_SEGMENT, 0)); + LPWORD IntVecTable = (LPWORD)BaseAddress; + LPBYTE BiosCode = (LPBYTE)SEG_OFF_TO_PTR(BIOS_SEGMENT, 0); /* Initialize the BDA */ - Bda = (PBIOS_DATA_AREA)((ULONG_PTR)BaseAddress + TO_LINEAR(BDA_SEGMENT, 0)); + Bda = (PBIOS_DATA_AREA)SEG_OFF_TO_PTR(BDA_SEGMENT, 0); Bda->EquipmentList = BIOS_EQUIPMENT_LIST; Bda->KeybdBufferStart = FIELD_OFFSET(BIOS_DATA_AREA, KeybdBuffer); Bda->KeybdBufferEnd = Bda->KeybdBufferStart + BIOS_KBD_BUFFER_SIZE * sizeof(WORD); @@ -594,8 +594,8 @@ WORD BiosPeekCharacter(VOID) { - WORD CharacterData; - + WORD CharacterData = 0; + /* Get the key from the queue, but don't remove it */ if (BiosKbdBufferTop(&CharacterData)) return CharacterData; else return 0xFFFF; @@ -777,17 +777,12 @@ VOID BiosVideoService(LPWORD Stack) { - DWORD Eax = EmulatorGetRegister(EMULATOR_REG_AX); - DWORD Ecx = EmulatorGetRegister(EMULATOR_REG_CX); - DWORD Edx = EmulatorGetRegister(EMULATOR_REG_DX); - DWORD Ebx = EmulatorGetRegister(EMULATOR_REG_BX); - - switch (HIBYTE(Eax)) + switch (getAH()) { /* Set Video Mode */ case 0x00: { - BiosSetVideoMode(LOBYTE(Eax)); + BiosSetVideoMode(getAL()); VgaClearMemory(); break; } @@ -796,8 +791,8 @@ case 0x01: { /* Update the BDA */ - Bda->CursorStartLine = HIBYTE(Ecx); - Bda->CursorEndLine = LOBYTE(Ecx); + Bda->CursorStartLine = getCH(); + Bda->CursorEndLine = getCL(); /* Modify the CRTC registers */ VgaWritePort(VGA_CRTC_INDEX, VGA_CRTC_CURSOR_START_REG); @@ -811,7 +806,7 @@ /* Set Cursor Position */ case 0x02: { - BiosSetCursorPosition(HIBYTE(Edx), LOBYTE(Edx), HIBYTE(Ebx)); + BiosSetCursorPosition(getDH(), getDL(), getBH()); break; } @@ -819,14 +814,12 @@ case 0x03: { /* Make sure the selected video page exists */ - if (HIBYTE(Ebx) >= BIOS_MAX_PAGES) break; + if (getBH() >= BIOS_MAX_PAGES) break; /* Return the result */ - EmulatorSetRegister(EMULATOR_REG_AX, 0); - EmulatorSetRegister(EMULATOR_REG_CX, - (Bda->CursorStartLine << 8) | Bda->CursorEndLine); - EmulatorSetRegister(EMULATOR_REG_DX, Bda->CursorPosition[HIBYTE(Ebx)]); - + setAX(0); + setCX(MAKEWORD(Bda->CursorEndLine, Bda->CursorStartLine)); + setDX(Bda->CursorPosition[getBH()]); break; } @@ -837,14 +830,14 @@ * On modern BIOSes, this function returns 0 * so that we can ignore the other registers. */ - EmulatorSetRegister(EMULATOR_REG_AX, 0); + setAX(0); break; } /* Select Active Display Page */ case 0x05: { - BiosSetVideoPage(LOBYTE(Eax)); + BiosSetVideoPage(getAL()); break; } @@ -852,21 +845,15 @@ case 0x06: case 0x07: { - SMALL_RECT Rectangle = - { - LOBYTE(Ecx), - HIBYTE(Ecx), - LOBYTE(Edx), - HIBYTE(Edx) - }; + SMALL_RECT Rectangle = { getCL(), getCH(), getDL(), getDH() }; /* Call the internal function */ - BiosScrollWindow((HIBYTE(Eax) == 0x06) ? SCROLL_DIRECTION_UP - : SCROLL_DIRECTION_DOWN, - LOBYTE(Eax), + BiosScrollWindow((getAH() == 0x06) ? SCROLL_DIRECTION_UP + : SCROLL_DIRECTION_DOWN, + getAL(), Rectangle, Bda->VideoPage, - HIBYTE(Ebx)); + getBH()); break; } @@ -876,19 +863,19 @@ case 0x09: case 0x0A: { - WORD CharacterData = MAKEWORD(LOBYTE(Eax), LOBYTE(Ebx)); - BYTE Page = HIBYTE(Ebx); + WORD CharacterData = MAKEWORD(getAL(), getBL()); + BYTE Page = getBH(); DWORD Offset; /* Check if the page exists */ if (Page >= BIOS_MAX_PAGES) break; /* Find the offset of the character */ - Offset = Page * Bda->VideoPageSize - + (HIBYTE(Bda->CursorPosition[Page]) * Bda->ScreenColumns - + LOBYTE(Bda->CursorPosition[Page])) * 2; - - if (HIBYTE(Eax) == 0x08) + Offset = Page * Bda->VideoPageSize + + (HIBYTE(Bda->CursorPosition[Page]) * Bda->ScreenColumns + + LOBYTE(Bda->CursorPosition[Page])) * 2; + + if (getAH() == 0x08) { /* Read from the video memory */ VgaReadMemory(TO_LINEAR(TEXT_VIDEO_SEG, Offset), @@ -896,14 +883,14 @@ sizeof(WORD)); /* Return the character in AX */ - EmulatorSetRegister(EMULATOR_REG_AX, CharacterData); + setAX(CharacterData); } else { /* Write to video memory */ VgaWriteMemory(TO_LINEAR(TEXT_VIDEO_SEG, Offset), (LPVOID)&CharacterData, - (HIBYTE(Ebx) == 0x09) ? sizeof(WORD) : sizeof(BYTE)); + (getBH() == 0x09) ? sizeof(WORD) : sizeof(BYTE)); } break; @@ -912,35 +899,26 @@ /* Teletype Output */ case 0x0E: { - BiosPrintCharacter(LOBYTE(Eax), LOBYTE(Ebx), HIBYTE(Ebx)); + BiosPrintCharacter(getAL(), getBL(), getBH()); break; } /* Get Current Video Mode */ case 0x0F: { - EmulatorSetRegister(EMULATOR_REG_AX, - MAKEWORD(Bda->VideoMode, Bda->ScreenColumns)); - EmulatorSetRegister(EMULATOR_REG_BX, - MAKEWORD(LOBYTE(Ebx), Bda->VideoPage)); - + setAX(MAKEWORD(Bda->VideoMode, Bda->ScreenColumns)); + setBX(MAKEWORD(getBL(), Bda->VideoPage)); break; } /* Scroll Window */ case 0x12: { - SMALL_RECT Rectangle = - { - LOBYTE(Ecx), - HIBYTE(Ecx), - LOBYTE(Edx), - HIBYTE(Edx) - }; + SMALL_RECT Rectangle = { getCL(), getCH(), getDL(), getDH() }; /* Call the internal function */ - BiosScrollWindow(LOBYTE(Ebx), - LOBYTE(Eax), + BiosScrollWindow(getBL(), + getAL(), Rectangle, Bda->VideoPage, DEFAULT_ATTRIBUTE); @@ -951,11 +929,11 @@ /* Display combination code */ case 0x1A: { - switch(LOBYTE(Eax)) + switch(getAL()) { case 0x00: /* Get Display combiantion code */ - EmulatorSetRegister(EMULATOR_REG_AX, MAKEWORD(0x1A, 0x1A)); - EmulatorSetRegister(EMULATOR_REG_BX, MAKEWORD(0x08, 0x0)); /* VGA w/ color analog display */ + setAX(MAKEWORD(0x1A, 0x1A)); + setBX(MAKEWORD(0x08, 0x00)); /* VGA w/ color analog display */ break; case 0x01: /* Set Display combination code */ DPRINT1("Set Display combination code - Unsupported\n"); @@ -969,16 +947,14 @@ default: { DPRINT1("BIOS Function INT 10h, AH = 0x%02X NOT IMPLEMENTED\n", - HIBYTE(Eax)); + getAH()); } } } VOID BiosKeyboardService(LPWORD Stack) { - DWORD Eax = EmulatorGetRegister(EMULATOR_REG_AX); - - switch (HIBYTE(Eax)) + switch (getAH()) { /* Wait for keystroke and read */ case 0x00: @@ -986,7 +962,7 @@ case 0x10: // FIXME: Temporarily do the same as INT 16h, 00h { /* Read the character (and wait if necessary) */ - EmulatorSetRegister(EMULATOR_REG_AX, BiosGetCharacter()); + setAX(BiosGetCharacter()); break; } @@ -1000,8 +976,8 @@ if (Data != 0xFFFF) { /* There is a character, clear ZF and return it */ - EmulatorSetRegister(EMULATOR_REG_AX, Data); Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_ZF; + setAX(Data); } else { @@ -1053,29 +1029,23 @@ default: { DPRINT1("BIOS Function INT 16h, AH = 0x%02X NOT IMPLEMENTED\n", - HIBYTE(Eax)); + getAH()); } } } VOID BiosTimeService(LPWORD Stack) { - DWORD Eax = EmulatorGetRegister(EMULATOR_REG_AX); - DWORD Ecx = EmulatorGetRegister(EMULATOR_REG_CX); - DWORD Edx = EmulatorGetRegister(EMULATOR_REG_DX); - - switch (HIBYTE(Eax)) + switch (getAH()) { case 0x00: { /* Set AL to 1 if midnight had passed, 0 otherwise */ - Eax &= 0xFFFFFF00; - if (Bda->MidnightPassed) Eax |= 1; + setAL(Bda->MidnightPassed ? 0x01 : 0x00); /* Return the tick count in CX:DX */ - EmulatorSetRegister(EMULATOR_REG_AX, Eax); - EmulatorSetRegister(EMULATOR_REG_CX, HIWORD(Bda->TickCounter)); - EmulatorSetRegister(EMULATOR_REG_DX, LOWORD(Bda->TickCounter)); + setCX(HIWORD(Bda->TickCounter)); + setDX(LOWORD(Bda->TickCounter)); /* Reset the midnight flag */ Bda->MidnightPassed = FALSE; @@ -1086,7 +1056,7 @@ case 0x01: { /* Set the tick count to CX:DX */ - Bda->TickCounter = MAKELONG(LOWORD(Edx), LOWORD(Ecx)); + Bda->TickCounter = MAKELONG(getDX(), getCX()); /* Reset the midnight flag */ Bda->MidnightPassed = FALSE; @@ -1097,7 +1067,7 @@ default: { DPRINT1("BIOS Function INT 1Ah, AH = 0x%02X NOT IMPLEMENTED\n", - HIBYTE(Eax)); + getAH()); } } } @@ -1111,7 +1081,7 @@ VOID BiosEquipmentService(LPWORD Stack) { /* Return the equipment list */ - EmulatorSetRegister(EMULATOR_REG_AX, Bda->EquipmentList); + setAX(Bda->EquipmentList); } VOID BiosHandleIrq(BYTE IrqNumber, LPWORD Stack) @@ -1123,7 +1093,6 @@ { /* Perform the system timer interrupt */ EmulatorInterrupt(BIOS_SYS_TIMER_INTERRUPT); - break; } @@ -1144,15 +1113,15 @@ if (!(ScanCode & (1 << 7))) { /* Key press */ - if (VirtualKey == VK_NUMLOCK - || VirtualKey == VK_CAPITAL - || VirtualKey == VK_SCROLL - || VirtualKey == VK_INSERT) + if (VirtualKey == VK_NUMLOCK || + VirtualKey == VK_CAPITAL || + VirtualKey == VK_SCROLL || + VirtualKey == VK_INSERT) { /* For toggle keys, toggle the lowest bit in the keyboard map */ BiosKeyboardMap[VirtualKey] ^= ~(1 << 0); } - + /* Set the highest bit */ BiosKeyboardMap[VirtualKey] |= (1 << 7); Modified: branches/ntvdm/subsystems/ntvdm/dos.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/dos.c?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] Sun Oct 27 23:39:52 2013 @@ -1886,8 +1886,7 @@ /* Return the attributes that DOS can understand */ Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; - // setCL(LOBYTE(Attributes)); - setCX(LOWORD(Attributes)); + setCL(LOBYTE(Attributes)); } else if (getAL() == 0x01) {
11 years, 1 month
1
0
0
0
[jimtabor] 60780: - Sync wine to 1.7.5.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sun Oct 27 23:22:00 2013 New Revision: 60780 URL:
http://svn.reactos.org/svn/reactos?rev=60780&view=rev
Log: - Sync wine to 1.7.5. Modified: trunk/rostests/winetests/user32/listbox.c Modified: trunk/rostests/winetests/user32/listbox.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/listbox.…
============================================================================== --- trunk/rostests/winetests/user32/listbox.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/listbox.c [iso-8859-1] Sun Oct 27 23:22:00 2013 @@ -53,16 +53,16 @@ INT_PTR ctl_id=0; if (parent) ctl_id=1; - handle=CreateWindow ("LISTBOX", "TestList", + handle=CreateWindowA("LISTBOX", "TestList", (LBS_STANDARD & ~LBS_SORT) | add_style, 0, 0, 100, 100, parent, (HMENU)ctl_id, NULL, 0); assert (handle); - SendMessage (handle, LB_ADDSTRING, 0, (LPARAM) strings[0]); - SendMessage (handle, LB_ADDSTRING, 0, (LPARAM) strings[1]); - SendMessage (handle, LB_ADDSTRING, 0, (LPARAM) strings[2]); - SendMessage (handle, LB_ADDSTRING, 0, (LPARAM) strings[3]); + SendMessageA(handle, LB_ADDSTRING, 0, (LPARAM) strings[0]); + SendMessageA(handle, LB_ADDSTRING, 0, (LPARAM) strings[1]); + SendMessageA(handle, LB_ADDSTRING, 0, (LPARAM) strings[2]); + SendMessageA(handle, LB_ADDSTRING, 0, (LPARAM) strings[3]); #ifdef VISIBLE ShowWindow (handle, SW_SHOW); @@ -91,10 +91,10 @@ static void listbox_query (HWND handle, struct listbox_stat *results) { - results->selected = SendMessage (handle, LB_GETCURSEL, 0, 0); - results->anchor = SendMessage (handle, LB_GETANCHORINDEX, 0, 0); - results->caret = SendMessage (handle, LB_GETCARETINDEX, 0, 0); - results->selcount = SendMessage (handle, LB_GETSELCOUNT, 0, 0); + results->selected = SendMessageA(handle, LB_GETCURSEL, 0, 0); + results->anchor = SendMessageA(handle, LB_GETANCHORINDEX, 0, 0); + results->caret = SendMessageA(handle, LB_GETCARETINDEX, 0, 0); + results->selcount = SendMessageA(handle, LB_GETSELCOUNT, 0, 0); } static void @@ -103,8 +103,8 @@ LPARAM lp=x+(y<<16); WAIT; - SendMessage (handle, WM_LBUTTONDOWN, MK_LBUTTON, lp); - SendMessage (handle, WM_LBUTTONUP, 0, lp); + SendMessageA(handle, WM_LBUTTONDOWN, MK_LBUTTON, lp); + SendMessageA(handle, WM_LBUTTONUP, 0, lp); REDRAW; } @@ -114,8 +114,8 @@ LPARAM lp=1+(scancode<<16)+(extended?KEYEVENTF_EXTENDEDKEY:0); WAIT; - SendMessage (handle, WM_KEYDOWN, keycode, lp); - SendMessage (handle, WM_KEYUP , keycode, lp | 0xc000000); + SendMessageA(handle, WM_KEYDOWN, keycode, lp); + SendMessageA(handle, WM_KEYUP , keycode, lp | 0xc000000); REDRAW; } @@ -146,7 +146,7 @@ listbox_query (hLB, &answer); listbox_ok (test, init, answer); - SendMessage (hLB, LB_GETITEMRECT, 1, (LPARAM) &second_item); + SendMessageA(hLB, LB_GETITEMRECT, 1, (LPARAM) &second_item); buttonpress(hLB, (WORD)second_item.left, (WORD)second_item.top); listbox_query (hLB, &answer); @@ -160,12 +160,12 @@ DestroyWindow (hLB); hLB=create_listbox (test.prop.add_style, 0); - SendMessage (hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(1, 2)); + SendMessageA(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(1, 2)); listbox_query (hLB, &answer); listbox_ok (test, sel, answer); for (i=0;i<4;i++) { - DWORD size = SendMessage (hLB, LB_GETTEXTLEN, i, 0); + DWORD size = SendMessageA(hLB, LB_GETTEXTLEN, i, 0); CHAR *txt; WCHAR *txtw; int resA, resW; @@ -189,13 +189,13 @@ } /* Confirm the count of items, and that an invalid delete does not remove anything */ - res = SendMessage (hLB, LB_GETCOUNT, 0, 0); + res = SendMessageA(hLB, LB_GETCOUNT, 0, 0); ok((res==4), "Expected 4 items, got %d\n", res); - res = SendMessage (hLB, LB_DELETESTRING, -1, 0); + res = SendMessageA(hLB, LB_DELETESTRING, -1, 0); ok((res==LB_ERR), "Expected LB_ERR items, got %d\n", res); - res = SendMessage (hLB, LB_DELETESTRING, 4, 0); + res = SendMessageA(hLB, LB_DELETESTRING, 4, 0); ok((res==LB_ERR), "Expected LB_ERR items, got %d\n", res); - res = SendMessage (hLB, LB_GETCOUNT, 0, 0); + res = SendMessageA(hLB, LB_GETCOUNT, 0, 0); ok((res==4), "Expected 4 items, got %d\n", res); WAIT; @@ -207,29 +207,29 @@ HWND hLB; HDC hdc; HFONT font; - TEXTMETRIC tm; + TEXTMETRICA tm; INT itemHeight; hLB = create_listbox (0, 0); ok ((hdc = GetDCEx( hLB, 0, DCX_CACHE )) != 0, "Can't get hdc\n"); ok ((font = GetCurrentObject(hdc, OBJ_FONT)) != 0, "Can't get the current font\n"); - ok (GetTextMetrics( hdc, &tm ), "Can't read font metrics\n"); + ok (GetTextMetricsA( hdc, &tm ), "Can't read font metrics\n"); ReleaseDC( hLB, hdc); - ok (SendMessage(hLB, WM_SETFONT, (WPARAM)font, 0) == 0, "Can't set font\n"); - - itemHeight = SendMessage(hLB, LB_GETITEMHEIGHT, 0, 0); + ok (SendMessageA(hLB, WM_SETFONT, (WPARAM)font, 0) == 0, "Can't set font\n"); + + itemHeight = SendMessageA(hLB, LB_GETITEMHEIGHT, 0, 0); ok (itemHeight == tm.tmHeight, "Item height wrong, got %d, expecting %d\n", itemHeight, tm.tmHeight); DestroyWindow (hLB); - hLB = CreateWindow ("LISTBOX", "TestList", LBS_OWNERDRAWVARIABLE, + hLB = CreateWindowA("LISTBOX", "TestList", LBS_OWNERDRAWVARIABLE, 0, 0, 100, 100, NULL, NULL, NULL, 0); - itemHeight = SendMessage(hLB, LB_GETITEMHEIGHT, 0, 0); + itemHeight = SendMessageA(hLB, LB_GETITEMHEIGHT, 0, 0); ok(itemHeight == tm.tmHeight, "itemHeight %d\n", itemHeight); - itemHeight = SendMessage(hLB, LB_GETITEMHEIGHT, 5, 0); + itemHeight = SendMessageA(hLB, LB_GETITEMHEIGHT, 5, 0); ok(itemHeight == tm.tmHeight, "itemHeight %d\n", itemHeight); - itemHeight = SendMessage(hLB, LB_GETITEMHEIGHT, -5, 0); + itemHeight = SendMessageA(hLB, LB_GETITEMHEIGHT, -5, 0); ok(itemHeight == tm.tmHeight, "itemHeight %d\n", itemHeight); DestroyWindow (hLB); } @@ -260,7 +260,7 @@ trace("rcItem (%d,%d-%d,%d)\n", dis->rcItem.left, dis->rcItem.top, dis->rcItem.right, dis->rcItem.bottom); - SendMessage(dis->hwndItem, LB_GETITEMRECT, dis->itemID, (LPARAM)&rc_item); + SendMessageA(dis->hwndItem, LB_GETITEMRECT, dis->itemID, (LPARAM)&rc_item); trace("item rect (%d,%d-%d,%d)\n", rc_item.left, rc_item.top, rc_item.right, rc_item.bottom); ok(EqualRect(&dis->rcItem, &rc_item), "item rects are not equal\n"); @@ -271,12 +271,12 @@ break; } - return DefWindowProc(hwnd, msg, wparam, lparam); + return DefWindowProcA(hwnd, msg, wparam, lparam); } static HWND create_parent( void ) { - WNDCLASS cls; + WNDCLASSA cls; HWND parent; static ATOM class; @@ -286,20 +286,20 @@ cls.lpfnWndProc = main_window_proc; cls.cbClsExtra = 0; cls.cbWndExtra = 0; - cls.hInstance = GetModuleHandle(0); + cls.hInstance = GetModuleHandleA(NULL); cls.hIcon = 0; - cls.hCursor = LoadCursor(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "main_window_class"; - class = RegisterClass( &cls ); - } - - parent = CreateWindowEx(0, "main_window_class", NULL, + class = RegisterClassA( &cls ); + } + + parent = CreateWindowExA(0, "main_window_class", NULL, WS_POPUP | WS_VISIBLE, 100, 100, 400, 400, GetDesktopWindow(), 0, - GetModuleHandle(0), NULL); + GetModuleHandleA(NULL), NULL); return parent; } @@ -319,16 +319,16 @@ UpdateWindow(hLB); /* make height short enough */ - SendMessage(hLB, LB_GETITEMRECT, 0, (LPARAM)&rc); + SendMessageA(hLB, LB_GETITEMRECT, 0, (LPARAM)&rc); SetWindowPos(hLB, 0, 0, 0, 100, rc.bottom - rc.top + 1, SWP_NOZORDER | SWP_NOMOVE); /* make 0 item invisible */ - SendMessage(hLB, LB_SETTOPINDEX, 1, 0); - ret = SendMessage(hLB, LB_GETTOPINDEX, 0, 0); + SendMessageA(hLB, LB_SETTOPINDEX, 1, 0); + ret = SendMessageA(hLB, LB_GETTOPINDEX, 0, 0); ok(ret == 1, "wrong top index %d\n", ret); - SendMessage(hLB, LB_GETITEMRECT, 0, (LPARAM)&rc); + SendMessageA(hLB, LB_GETITEMRECT, 0, (LPARAM)&rc); trace("item 0 rect (%d,%d-%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom); ok(!IsRectEmpty(&rc), "empty item rect\n"); ok(rc.top < 0, "rc.top is not negative (%d)\n", rc.top); @@ -361,61 +361,61 @@ listbox_query(hLB, &answer); listbox_test_query(test_nosel, answer); - ret = SendMessage(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(1, 2)); + ret = SendMessageA(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(1, 2)); ok(ret == LB_OKAY, "LB_SELITEMRANGE returned %d instead of LB_OKAY\n", ret); listbox_query(hLB, &answer); listbox_test_query(test_1, answer); - SendMessage(hLB, LB_SETSEL, FALSE, -1); + SendMessageA(hLB, LB_SETSEL, FALSE, -1); listbox_query(hLB, &answer); listbox_test_query(test_nosel, answer); - ret = SendMessage(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(0, 4)); + ret = SendMessageA(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(0, 4)); ok(ret == LB_OKAY, "LB_SELITEMRANGE returned %d instead of LB_OKAY\n", ret); listbox_query(hLB, &answer); listbox_test_query(test_3, answer); - SendMessage(hLB, LB_SETSEL, FALSE, -1); + SendMessageA(hLB, LB_SETSEL, FALSE, -1); listbox_query(hLB, &answer); listbox_test_query(test_nosel, answer); - ret = SendMessage(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(-5, 5)); + ret = SendMessageA(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(-5, 5)); ok(ret == LB_OKAY, "LB_SELITEMRANGE returned %d instead of LB_OKAY\n", ret); listbox_query(hLB, &answer); listbox_test_query(test_nosel, answer); - SendMessage(hLB, LB_SETSEL, FALSE, -1); + SendMessageA(hLB, LB_SETSEL, FALSE, -1); listbox_query(hLB, &answer); listbox_test_query(test_nosel, answer); - ret = SendMessage(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(2, 10)); + ret = SendMessageA(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(2, 10)); ok(ret == LB_OKAY, "LB_SELITEMRANGE returned %d instead of LB_OKAY\n", ret); listbox_query(hLB, &answer); listbox_test_query(test_1, answer); - SendMessage(hLB, LB_SETSEL, FALSE, -1); + SendMessageA(hLB, LB_SETSEL, FALSE, -1); listbox_query(hLB, &answer); listbox_test_query(test_nosel, answer); - ret = SendMessage(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(4, 10)); + ret = SendMessageA(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(4, 10)); ok(ret == LB_OKAY, "LB_SELITEMRANGE returned %d instead of LB_OKAY\n", ret); listbox_query(hLB, &answer); listbox_test_query(test_nosel, answer); - SendMessage(hLB, LB_SETSEL, FALSE, -1); + SendMessageA(hLB, LB_SETSEL, FALSE, -1); listbox_query(hLB, &answer); listbox_test_query(test_nosel, answer); - ret = SendMessage(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(10, 1)); + ret = SendMessageA(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(10, 1)); ok(ret == LB_OKAY, "LB_SELITEMRANGE returned %d instead of LB_OKAY\n", ret); listbox_query(hLB, &answer); listbox_test_query(test_2, answer); - SendMessage(hLB, LB_SETSEL, FALSE, -1); + SendMessageA(hLB, LB_SETSEL, FALSE, -1); listbox_query(hLB, &answer); listbox_test_query(test_nosel, answer); - ret = SendMessage(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(1, -1)); + ret = SendMessageA(hLB, LB_SELITEMRANGE, TRUE, MAKELPARAM(1, -1)); ok(ret == LB_OKAY, "LB_SELITEMRANGE returned %d instead of LB_OKAY\n", ret); listbox_query(hLB, &answer); listbox_test_query(test_2, answer); @@ -428,35 +428,35 @@ HWND hList; int r, id; - hList = CreateWindow( "ListBox", "list test", 0, + hList = CreateWindowA( "ListBox", "list test", 0, 1, 1, 600, 100, NULL, NULL, NULL, NULL ); ok( hList != NULL, "failed to create listbox\n"); - id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi"); + id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi"); ok( id == 0, "item id wrong\n"); - r = SendMessage( hList, LB_SETITEMHEIGHT, 0, MAKELPARAM( 20, 0 )); + r = SendMessageA( hList, LB_SETITEMHEIGHT, 0, MAKELPARAM( 20, 0 )); ok( r == 0, "send message failed\n"); - r = SendMessage(hList, LB_GETITEMHEIGHT, 0, 0 ); + r = SendMessageA(hList, LB_GETITEMHEIGHT, 0, 0 ); ok( r == 20, "height wrong\n"); - r = SendMessage( hList, LB_SETITEMHEIGHT, 0, MAKELPARAM( 0, 30 )); + r = SendMessageA( hList, LB_SETITEMHEIGHT, 0, MAKELPARAM( 0, 30 )); ok( r == -1, "send message failed\n"); - r = SendMessage(hList, LB_GETITEMHEIGHT, 0, 0 ); + r = SendMessageA(hList, LB_GETITEMHEIGHT, 0, 0 ); ok( r == 20, "height wrong\n"); - r = SendMessage( hList, LB_SETITEMHEIGHT, 0, MAKELPARAM( 0x100, 0 )); + r = SendMessageA( hList, LB_SETITEMHEIGHT, 0, MAKELPARAM( 0x100, 0 )); ok( r == -1, "send message failed\n"); - r = SendMessage(hList, LB_GETITEMHEIGHT, 0, 0 ); + r = SendMessageA(hList, LB_GETITEMHEIGHT, 0, 0 ); ok( r == 20, "height wrong\n"); - r = SendMessage( hList, LB_SETITEMHEIGHT, 0, MAKELPARAM( 0xff, 0 )); + r = SendMessageA( hList, LB_SETITEMHEIGHT, 0, MAKELPARAM( 0xff, 0 )); ok( r == 0, "send message failed\n"); - r = SendMessage(hList, LB_GETITEMHEIGHT, 0, 0 ); + r = SendMessageA(hList, LB_GETITEMHEIGHT, 0, 0 ); ok( r == 0xff, "height wrong\n"); DestroyWindow( hList ); @@ -468,81 +468,81 @@ without caption). LBS_NOINTEGRALHEIGHT is required in order to test behavior of partially-displayed item. */ - HWND hList = CreateWindow( "ListBox", "list test", + HWND hList = CreateWindowA( "ListBox", "list test", WS_VISIBLE|WS_POPUP|LBS_NOINTEGRALHEIGHT, 1, 1, 600, 100, NULL, NULL, NULL, NULL ); ULONG r, id; RECT rc; /* For an empty listbox win2k returns 0x1ffff, win98 returns 0x10000, nt4 returns 0xffffffff */ - r = SendMessage(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 30 )); + r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 30 )); ok( r == 0x1ffff || r == 0x10000 || r == 0xffffffff, "ret %x\n", r ); - r = SendMessage(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( 700, 30 )); + r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( 700, 30 )); ok( r == 0x1ffff || r == 0x10000 || r == 0xffffffff, "ret %x\n", r ); - r = SendMessage(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( 30, 300 )); + r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( 30, 300 )); ok( r == 0x1ffff || r == 0x10000 || r == 0xffffffff, "ret %x\n", r ); - id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi"); + id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi"); ok( id == 0, "item id wrong\n"); - id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi1"); + id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi1"); ok( id == 1, "item id wrong\n"); - r = SendMessage(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 30 )); + r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 30 )); ok( r == 0x1, "ret %x\n", r ); - r = SendMessage(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 601 )); + r = SendMessageA(hList, LB_ITEMFROMPOINT, 0, MAKELPARAM( /* x */ 30, /* y */ 601 )); ok( r == 0x10001 || broken(r == 1), /* nt4 */ "ret %x\n", r ); /* Resize control so that below assertions about sizes are valid */ - r = SendMessage( hList, LB_GETITEMRECT, 0, (LPARAM)&rc); + r = SendMessageA( hList, LB_GETITEMRECT, 0, (LPARAM)&rc); ok( r == 1, "ret %x\n", r); r = MoveWindow(hList, 1, 1, 600, (rc.bottom - rc.top + 1) * 9 / 2, TRUE); ok( r != 0, "ret %x\n", r); - id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi2"); + id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi2"); ok( id == 2, "item id wrong\n"); - id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi3"); + id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi3"); ok( id == 3, "item id wrong\n"); - id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi4"); + id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi4"); ok( id == 4, "item id wrong\n"); - id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi5"); + id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi5"); ok( id == 5, "item id wrong\n"); - id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi6"); + id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi6"); ok( id == 6, "item id wrong\n"); - id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi7"); + id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi7"); ok( id == 7, "item id wrong\n"); /* Set the listbox up so that id 1 is at the top, this leaves 5 partially visible at the bottom and 6, 7 are invisible */ - SendMessage( hList, LB_SETTOPINDEX, 1, 0); - r = SendMessage( hList, LB_GETTOPINDEX, 0, 0); + SendMessageA( hList, LB_SETTOPINDEX, 1, 0); + r = SendMessageA( hList, LB_GETTOPINDEX, 0, 0); ok( r == 1, "top %d\n", r); - r = SendMessage( hList, LB_GETITEMRECT, 5, (LPARAM)&rc); + r = SendMessageA( hList, LB_GETITEMRECT, 5, (LPARAM)&rc); ok( r == 1, "ret %x\n", r); - r = SendMessage( hList, LB_GETITEMRECT, 6, (LPARAM)&rc); + r = SendMessageA( hList, LB_GETITEMRECT, 6, (LPARAM)&rc); ok( r == 0, "ret %x\n", r); - r = SendMessage( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(/* x */ 10, /* y */ 10) ); + r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(/* x */ 10, /* y */ 10) ); ok( r == 1, "ret %x\n", r); - r = SendMessage( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(1000, 10) ); + r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(1000, 10) ); ok( r == 0x10001 || broken(r == 1), /* nt4 */ "ret %x\n", r ); - r = SendMessage( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, -10) ); + r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, -10) ); ok( r == 0x10001 || broken(r == 1), /* nt4 */ "ret %x\n", r ); - r = SendMessage( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, 100) ); + r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, 100) ); ok( r == 0x10005 || broken(r == 5), /* nt4 */ "item %x\n", r ); - r = SendMessage( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, 200) ); + r = SendMessageA( hList, LB_ITEMFROMPOINT, 0, MAKELPARAM(10, 200) ); ok( r == 0x10005 || broken(r == 5), /* nt4 */ "item %x\n", r ); @@ -554,17 +554,17 @@ HWND hList; int r, id; - hList = CreateWindow( "ListBox", "list test", 0, + hList = CreateWindowA( "ListBox", "list test", 0, 1, 1, 600, 100, NULL, NULL, NULL, NULL ); ok( hList != NULL, "failed to create listbox\n"); - id = SendMessage( hList, LB_ADDSTRING, 0, (LPARAM) "hi"); + id = SendMessageA( hList, LB_ADDSTRING, 0, (LPARAM) "hi"); ok( id == 0, "item id wrong\n"); - r = SendMessage( hList, LB_SETITEMDATA, 0, MAKELPARAM( 20, 0 )); + r = SendMessageA( hList, LB_SETITEMDATA, 0, MAKELPARAM( 20, 0 )); ok(r == TRUE, "LB_SETITEMDATA returned %d instead of TRUE\n", r); - r = SendMessage( hList, LB_GETITEMDATA, 0, 0); + r = SendMessageA( hList, LB_GETITEMDATA, 0, 0); ok( r == 20, "get item data failed\n"); DestroyWindow( hList ); @@ -594,7 +594,7 @@ one file that fits the wildcard w*.c . Normally, the test directory itself satisfies both conditions. */ - hList = CreateWindow( "ListBox", "list test", WS_VISIBLE|WS_POPUP, + hList = CreateWindowA( "ListBox", "list test", WS_VISIBLE|WS_POPUP, 1, 1, 600, 100, NULL, NULL, NULL, NULL ); assert(hList); @@ -602,18 +602,18 @@ /* This should list all the files in the test directory. */ strcpy(pathBuffer, wildcard); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, 0, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, 0, (LPARAM)pathBuffer); if (res == -1) /* "*" wildcard doesn't work on win9x */ { wildcard = "*.*"; strcpy(pathBuffer, wildcard); - res = SendMessage(hList, LB_DIR, 0, (LPARAM)pathBuffer); + res = SendMessageA(hList, LB_DIR, 0, (LPARAM)pathBuffer); } ok (res >= 0, "SendMessage(LB_DIR, 0, *) failed - 0x%08x\n", GetLastError()); /* There should be some content in the listbox */ - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount > 0, "SendMessage(LB_DIR) did NOT fill the listbox!\n"); itemCount_allFiles = itemCount; ok(res + 1 == itemCount, @@ -622,12 +622,12 @@ /* This tests behavior when no files match the wildcard */ strcpy(pathBuffer, BAD_EXTENSION); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, 0, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, 0, (LPARAM)pathBuffer); ok (res == -1, "SendMessage(LB_DIR, 0, %s) returned %d, expected -1\n", BAD_EXTENSION, res); /* There should be NO content in the listbox */ - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount == 0, "SendMessage(LB_DIR) DID fill the listbox!\n"); @@ -635,8 +635,8 @@ * As of this writing, this includes win.c, winstation.c, wsprintf.c */ strcpy(pathBuffer, "w*.c"); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, 0, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, 0, (LPARAM)pathBuffer); ok (res >= 0, "SendMessage(LB_DIR, 0, w*.c) failed - 0x%08x\n", GetLastError()); /* Path specification does NOT converted to uppercase */ @@ -644,7 +644,7 @@ "expected no change to pathBuffer, got %s\n", pathBuffer); /* There should be some content in the listbox */ - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount > 0, "SendMessage(LB_DIR) did NOT fill the listbox!\n"); itemCount_justFiles = itemCount; ok(res + 1 == itemCount, @@ -654,7 +654,7 @@ /* Every single item in the control should start with a w and end in .c */ for (i = 0; i < itemCount; i++) { memset(pathBuffer, 0, MAX_PATH); - SendMessage(hList, LB_GETTEXT, i, (LPARAM)pathBuffer); + SendMessageA(hList, LB_GETTEXT, i, (LPARAM)pathBuffer); p = pathBuffer + strlen(pathBuffer); ok(((pathBuffer[0] == 'w' || pathBuffer[0] == 'W') && (*(p-1) == 'c' || *(p-1) == 'C') && @@ -663,14 +663,14 @@ /* Test DDL_DIRECTORY */ strcpy(pathBuffer, wildcard); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer); ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY, *) failed - 0x%08x\n", GetLastError()); /* There should be some content in the listbox. * All files plus "[..]" */ - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); itemCount_allDirs = itemCount - itemCount_allFiles; ok (itemCount > itemCount_allFiles, "SendMessage(LB_DIR, DDL_DIRECTORY, *) filled with %d entries, expected > %d\n", @@ -681,25 +681,25 @@ /* This tests behavior when no files match the wildcard */ strcpy(pathBuffer, BAD_EXTENSION); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer); ok (res == -1, "SendMessage(LB_DIR, DDL_DIRECTORY, %s) returned %d, expected -1\n", BAD_EXTENSION, res); /* There should be NO content in the listbox */ - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount == 0, "SendMessage(LB_DIR) DID fill the listbox!\n"); /* Test DDL_DIRECTORY */ strcpy(pathBuffer, "w*.c"); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer); ok (res >= 0, "SendMessage(LB_DIR, DDL_DIRECTORY, w*.c) failed - 0x%08x\n", GetLastError()); /* There should be some content in the listbox. Since the parent directory does not * fit w*.c, there should be exactly the same number of items as without DDL_DIRECTORY */ - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_justFiles, "SendMessage(LB_DIR, DDL_DIRECTORY, w*.c) filled with %d entries, expected %d\n", itemCount, itemCount_justFiles); @@ -710,7 +710,7 @@ /* Every single item in the control should start with a w and end in .c. */ for (i = 0; i < itemCount; i++) { memset(pathBuffer, 0, MAX_PATH); - SendMessage(hList, LB_GETTEXT, i, (LPARAM)pathBuffer); + SendMessageA(hList, LB_GETTEXT, i, (LPARAM)pathBuffer); p = pathBuffer + strlen(pathBuffer); ok( ((pathBuffer[0] == 'w' || pathBuffer[0] == 'W') && @@ -721,8 +721,8 @@ /* Test DDL_DRIVES|DDL_EXCLUSIVE */ strcpy(pathBuffer, wildcard); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer); ok (res >= 0, "SendMessage(LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, *) failed - 0x%08x\n", GetLastError()); /* There should be some content in the listbox. In particular, there should @@ -730,7 +730,7 @@ * have been added. Depending on the user setting, more drives might have * been added. */ - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount >= 1, "SendMessage(LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, *) filled with %d entries, expected at least %d\n", itemCount, 1); @@ -741,7 +741,7 @@ for (i = 0; i < itemCount; i++) { memset(pathBuffer, 0, MAX_PATH); driveletter = '\0'; - SendMessage(hList, LB_GETTEXT, i, (LPARAM)pathBuffer); + SendMessageA(hList, LB_GETTEXT, i, (LPARAM)pathBuffer); ok( strlen(pathBuffer) == 5, "Length of drive string is not 5\n" ); ok( sscanf(pathBuffer, "[-%c-]", &driveletter) == 1, "Element %d (%s) does not fit [-X-]\n", i, pathBuffer); ok( driveletter >= 'a' && driveletter <= 'z', "Drive letter not in range a..z, got ascii %d\n", driveletter); @@ -754,12 +754,12 @@ /* This tests behavior when no files match the wildcard */ strcpy(pathBuffer, BAD_EXTENSION); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer); ok (res == itemCount_justDrives -1, "SendMessage(LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, %s) returned %d, expected %d\n", BAD_EXTENSION, res, itemCount_justDrives -1); - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_justDrives, "SendMessage(LB_DIR) returned %d expected %d\n", itemCount, itemCount_justDrives); @@ -768,8 +768,8 @@ /* Test DDL_DRIVES. */ strcpy(pathBuffer, wildcard); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, DDL_DRIVES, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, DDL_DRIVES, (LPARAM)pathBuffer); ok (res > 0, "SendMessage(LB_DIR, DDL_DRIVES, *) failed - 0x%08x\n", GetLastError()); /* There should be some content in the listbox. In particular, there should @@ -777,7 +777,7 @@ * have been added. Depending on the user setting, more drives might have * been added. */ - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_justDrives + itemCount_allFiles, "SendMessage(LB_DIR, DDL_DRIVES, *) filled with %d entries, expected %d\n", itemCount, itemCount_justDrives + itemCount_allFiles); @@ -785,19 +785,19 @@ /* This tests behavior when no files match the wildcard */ strcpy(pathBuffer, BAD_EXTENSION); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, DDL_DRIVES, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, DDL_DRIVES, (LPARAM)pathBuffer); ok (res == itemCount_justDrives -1, "SendMessage(LB_DIR, DDL_DRIVES, %s) returned %d, expected %d\n", BAD_EXTENSION, res, itemCount_justDrives -1); - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount == res + 1, "SendMessage(LB_DIR) returned %d expected %d\n", itemCount, res + 1); /* Test DDL_DRIVES. */ strcpy(pathBuffer, "w*.c"); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, DDL_DRIVES, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, DDL_DRIVES, (LPARAM)pathBuffer); ok (res > 0, "SendMessage(LB_DIR, DDL_DRIVES, w*.c) failed - 0x%08x\n", GetLastError()); /* There should be some content in the listbox. In particular, there should @@ -805,7 +805,7 @@ * have been added. Depending on the user setting, more drives might have * been added. */ - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_justDrives + itemCount_justFiles, "SendMessage(LB_DIR, DDL_DRIVES, w*.c) filled with %d entries, expected %d\n", itemCount, itemCount_justDrives + itemCount_justFiles); @@ -815,7 +815,7 @@ for (i = 0; i < itemCount; i++) { memset(pathBuffer, 0, MAX_PATH); driveletter = '\0'; - SendMessage(hList, LB_GETTEXT, i, (LPARAM)pathBuffer); + SendMessageA(hList, LB_GETTEXT, i, (LPARAM)pathBuffer); p = pathBuffer + strlen(pathBuffer); if (sscanf(pathBuffer, "[-%c-]", &driveletter) == 1) { ok( strlen(pathBuffer) == 5, "Length of drive string is not 5\n" ); @@ -831,14 +831,14 @@ /* Test DDL_DIRECTORY|DDL_DRIVES. This does *not* imply DDL_EXCLUSIVE */ strcpy(pathBuffer, wildcard); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES, (LPARAM)pathBuffer); ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, *) failed - 0x%08x\n", GetLastError()); /* There should be some content in the listbox. In particular, there should * be exactly the number of plain files, plus the number of mapped drives. */ - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_allFiles + itemCount_justDrives + itemCount_allDirs, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES) filled with %d entries, expected %d\n", itemCount, itemCount_allFiles + itemCount_justDrives + itemCount_allDirs); @@ -851,7 +851,7 @@ for (i = 0; i < itemCount; i++) { memset(pathBuffer, 0, MAX_PATH); driveletter = '\0'; - SendMessage(hList, LB_GETTEXT, i, (LPARAM)pathBuffer); + SendMessageA(hList, LB_GETTEXT, i, (LPARAM)pathBuffer); if (sscanf(pathBuffer, "[-%c-]", &driveletter) == 1) { ok( driveletter >= 'a' && driveletter <= 'z', "Drive letter not in range a..z, got ascii %d\n", driveletter); } @@ -859,26 +859,26 @@ /* This tests behavior when no files match the wildcard */ strcpy(pathBuffer, BAD_EXTENSION); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES, (LPARAM)pathBuffer); ok (res == itemCount_justDrives -1, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, %s) returned %d, expected %d\n", BAD_EXTENSION, res, itemCount_justDrives -1); - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount == res + 1, "SendMessage(LB_DIR) returned %d expected %d\n", itemCount, res + 1); /* Test DDL_DIRECTORY|DDL_DRIVES. */ strcpy(pathBuffer, "w*.c"); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES, (LPARAM)pathBuffer); ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, w*.c) failed - 0x%08x\n", GetLastError()); /* There should be some content in the listbox. In particular, there should * be exactly the number of plain files, plus the number of mapped drives. */ - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_justFiles + itemCount_justDrives, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES) filled with %d entries, expected %d\n", itemCount, itemCount_justFiles + itemCount_justDrives); @@ -891,7 +891,7 @@ for (i = 0; i < itemCount; i++) { memset(pathBuffer, 0, MAX_PATH); driveletter = '\0'; - SendMessage(hList, LB_GETTEXT, i, (LPARAM)pathBuffer); + SendMessageA(hList, LB_GETTEXT, i, (LPARAM)pathBuffer); p = pathBuffer + strlen(pathBuffer); if (sscanf(pathBuffer, "[-%c-]", &driveletter) == 1) { ok( driveletter >= 'a' && driveletter <= 'z', "Drive letter not in range a..z, got ascii %d\n", driveletter); @@ -905,11 +905,11 @@ /* Test DDL_DIRECTORY|DDL_EXCLUSIVE. */ strcpy(pathBuffer, wildcard); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, (LPARAM)pathBuffer); ok (res != -1, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err %u\n", GetLastError()); - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_allDirs, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE) filled with %d entries, expected %d\n", itemCount, itemCount_allDirs); @@ -918,41 +918,41 @@ if (itemCount && GetCurrentDirectoryA( MAX_PATH, pathBuffer ) > 3) /* there's no [..] in drive root */ { memset(pathBuffer, 0, MAX_PATH); - SendMessage(hList, LB_GETTEXT, 0, (LPARAM)pathBuffer); + SendMessageA(hList, LB_GETTEXT, 0, (LPARAM)pathBuffer); ok( !strcmp(pathBuffer, "[..]"), "First element is not [..]\n"); } /* This tests behavior when no files match the wildcard */ strcpy(pathBuffer, BAD_EXTENSION); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, (LPARAM)pathBuffer); ok (res == -1, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, %s) returned %d, expected %d\n", BAD_EXTENSION, res, -1); - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount == res + 1, "SendMessage(LB_DIR) returned %d expected %d\n", itemCount, res + 1); /* Test DDL_DIRECTORY|DDL_EXCLUSIVE. */ strcpy(pathBuffer, "w*.c"); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, (LPARAM)pathBuffer); ok (res == LB_ERR, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, w*.c) returned %d expected %d\n", res, LB_ERR); /* There should be no elements, since "[..]" does not fit w*.c */ - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount == 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE) filled with %d entries, expected %d\n", itemCount, 0); /* Test DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE. */ strcpy(pathBuffer, wildcard); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer); ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, w*.c,) failed - 0x%08x\n", GetLastError()); /* There should be no plain files on the listbox */ - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_justDrives + itemCount_allDirs, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) filled with %d entries, expected %d\n", itemCount, itemCount_justDrives + itemCount_allDirs); @@ -961,7 +961,7 @@ for (i = 0; i < itemCount; i++) { memset(pathBuffer, 0, MAX_PATH); driveletter = '\0'; - SendMessage(hList, LB_GETTEXT, i, (LPARAM)pathBuffer); + SendMessageA(hList, LB_GETTEXT, i, (LPARAM)pathBuffer); if (sscanf(pathBuffer, "[-%c-]", &driveletter) == 1) { ok( driveletter >= 'a' && driveletter <= 'z', "Drive letter not in range a..z, got ascii %d\n", driveletter); } else { @@ -972,22 +972,22 @@ /* This tests behavior when no files match the wildcard */ strcpy(pathBuffer, BAD_EXTENSION); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer); ok (res == itemCount_justDrives -1, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, %s) returned %d, expected %d\n", BAD_EXTENSION, res, itemCount_justDrives -1); - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount == res + 1, "SendMessage(LB_DIR) returned %d expected %d\n", itemCount, res + 1); /* Test DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE. */ strcpy(pathBuffer, "w*.c"); - SendMessage(hList, LB_RESETCONTENT, 0, 0); - res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer); + SendMessageA(hList, LB_RESETCONTENT, 0, 0); + res = SendMessageA(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer); ok (res >= 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, w*.c,) failed - 0x%08x\n", GetLastError()); /* There should be no plain files on the listbox, and no [..], since it does not fit w*.c */ - itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(hList, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_justDrives, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) filled with %d entries, expected %d\n", itemCount, itemCount_justDrives); @@ -996,7 +996,7 @@ for (i = 0; i < itemCount; i++) { memset(pathBuffer, 0, MAX_PATH); driveletter = '\0'; - SendMessage(hList, LB_GETTEXT, i, (LPARAM)pathBuffer); + SendMessageA(hList, LB_GETTEXT, i, (LPARAM)pathBuffer); ok (sscanf(pathBuffer, "[-%c-]", &driveletter) == 1, "Element %d (%s) does not fit [-X-]\n", i, pathBuffer); ok( driveletter >= 'a' && driveletter <= 'z', "Drive letter not in range a..z, got ascii %d\n", driveletter); } @@ -1011,16 +1011,16 @@ #define ID_TEST_LABEL 1001 #define ID_TEST_LISTBOX 1002 -static BOOL on_listbox_container_create (HWND hwnd, LPCREATESTRUCT lpcs) -{ - g_label = CreateWindow( +static BOOL on_listbox_container_create (HWND hwnd, LPCREATESTRUCTA lpcs) +{ + g_label = CreateWindowA( "Static", "Contents of static control before DlgDirList.", WS_CHILD | WS_VISIBLE, 10, 10, 512, 32, hwnd, (HMENU)ID_TEST_LABEL, NULL, 0); if (!g_label) return FALSE; - g_listBox = CreateWindow( + g_listBox = CreateWindowA( "ListBox", "DlgDirList test", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER | WS_VSCROLL, @@ -1060,7 +1060,7 @@ cls.cbWndExtra = 0; cls.hInstance = hInst; cls.hIcon = NULL; - cls.hCursor = LoadCursorA (NULL, IDC_ARROW); + cls.hCursor = LoadCursorA (NULL, (LPCSTR)IDC_ARROW); cls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); cls.lpszMenuName = NULL; cls.lpfnWndProc = listbox_container_window_procA; @@ -1098,7 +1098,7 @@ hInst = GetModuleHandleA(0); if (!RegisterListboxWindowClass(hInst)) assert(0); - hWnd = CreateWindow("ListboxContainerClass", "ListboxContainerClass", + hWnd = CreateWindowA("ListboxContainerClass", "ListboxContainerClass", WS_OVERLAPPEDWINDOW | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInst, 0); @@ -1107,13 +1107,13 @@ /* Test for standard usage */ /* The following should be overwritten by the directory path */ - SendMessage(g_label, WM_SETTEXT, 0, (LPARAM)"default contents"); + SendMessageA(g_label, WM_SETTEXT, 0, (LPARAM)"default contents"); /* This should list all the w*.c files in the test directory * As of this writing, this includes win.c, winstation.c, wsprintf.c */ strcpy(pathBuffer, "w*.c"); - res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, 0); + res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, 0); ok (res == 1, "DlgDirList(*.c, 0) returned %d - expected 1 - 0x%08x\n", res, GetLastError()); /* Path specification gets converted to uppercase */ @@ -1121,19 +1121,19 @@ "expected conversion to uppercase, got %s\n", pathBuffer); /* Loaded path should have overwritten the label text */ - SendMessage(g_label, WM_GETTEXT, MAX_PATH, (LPARAM)pathBuffer); + SendMessageA(g_label, WM_GETTEXT, MAX_PATH, (LPARAM)pathBuffer); trace("Static control after DlgDirList: %s\n", pathBuffer); ok (strcmp("default contents", pathBuffer), "DlgDirList() did not modify static control!\n"); /* There should be some content in the listbox */ - itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0); ok (itemCount > 0, "DlgDirList() did NOT fill the listbox!\n"); itemCount_justFiles = itemCount; /* Every single item in the control should start with a w and end in .c */ for (i = 0; i < itemCount; i++) { memset(pathBuffer, 0, MAX_PATH); - SendMessage(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer); + SendMessageA(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer); p = pathBuffer + strlen(pathBuffer); ok(((pathBuffer[0] == 'w' || pathBuffer[0] == 'W') && (*(p-1) == 'c' || *(p-1) == 'C') && @@ -1142,15 +1142,15 @@ /* Test behavior when no files match the wildcard */ strcpy(pathBuffer, BAD_EXTENSION); - res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, 0); + res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, 0); ok (res == 1, "DlgDirList(%s, 0) returned %d expected 1\n", BAD_EXTENSION, res); - itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0); ok (itemCount == 0, "DlgDirList() DID fill the listbox!\n"); /* Test DDL_DIRECTORY */ strcpy(pathBuffer, "w*.c"); - res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, + res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY); ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY) failed - 0x%08x\n", GetLastError()); @@ -1158,7 +1158,7 @@ * be exactly more elements than before, since the directories should * have been added. */ - itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0); itemCount_allDirs = itemCount - itemCount_justFiles; ok (itemCount >= itemCount_justFiles, "DlgDirList(DDL_DIRECTORY) filled with %d entries, expected > %d\n", @@ -1169,7 +1169,7 @@ */ for (i = 0; i < itemCount; i++) { memset(pathBuffer, 0, MAX_PATH); - SendMessage(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer); + SendMessageA(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer); p = pathBuffer + strlen(pathBuffer); ok( (pathBuffer[0] == '[' && pathBuffer[strlen(pathBuffer)-1] == ']') || ((pathBuffer[0] == 'w' || pathBuffer[0] == 'W') && @@ -1179,17 +1179,17 @@ /* Test behavior when no files match the wildcard */ strcpy(pathBuffer, BAD_EXTENSION); - res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, + res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY); ok (res == 1, "DlgDirList(%s, DDL_DIRECTORY) returned %d expected 1\n", BAD_EXTENSION, res); - itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_allDirs, "DlgDirList() incorrectly filled the listbox! (expected %d got %d)\n", itemCount_allDirs, itemCount); for (i = 0; i < itemCount; i++) { memset(pathBuffer, 0, MAX_PATH); - SendMessage(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer); + SendMessageA(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer); ok( pathBuffer[0] == '[' && pathBuffer[strlen(pathBuffer)-1] == ']', "Element %d (%s) does not fit requested [...]\n", i, pathBuffer); } @@ -1197,7 +1197,7 @@ /* Test DDL_DRIVES. At least on WinXP-SP2, this implies DDL_EXCLUSIVE */ strcpy(pathBuffer, "w*.c"); - res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, + res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DRIVES); ok (res == 1, "DlgDirList(*.c, DDL_DRIVES) failed - 0x%08x\n", GetLastError()); @@ -1206,7 +1206,7 @@ * have been added. Depending on the user setting, more drives might have * been added. */ - itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0); ok (itemCount >= 1, "DlgDirList(DDL_DRIVES) filled with %d entries, expected at least %d\n", itemCount, 1); @@ -1216,7 +1216,7 @@ for (i = 0; i < itemCount; i++) { memset(pathBuffer, 0, MAX_PATH); driveletter = '\0'; - SendMessage(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer); + SendMessageA(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer); ok( strlen(pathBuffer) == 5, "Length of drive string is not 5\n" ); ok( sscanf(pathBuffer, "[-%c-]", &driveletter) == 1, "Element %d (%s) does not fit [-X-]\n", i, pathBuffer); ok( driveletter >= 'a' && driveletter <= 'z', "Drive letter not in range a..z, got ascii %d\n", driveletter); @@ -1229,17 +1229,17 @@ /* Test behavior when no files match the wildcard */ strcpy(pathBuffer, BAD_EXTENSION); - res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, + res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DRIVES); ok (res == 1, "DlgDirList(%s, DDL_DRIVES) returned %d expected 1\n", BAD_EXTENSION, res); - itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_justDrives, "DlgDirList() incorrectly filled the listbox!\n"); /* Test DDL_DIRECTORY|DDL_DRIVES. This does *not* imply DDL_EXCLUSIVE */ strcpy(pathBuffer, "w*.c"); - res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, + res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY|DDL_DRIVES); ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_DRIVES) failed - 0x%08x\n", GetLastError()); @@ -1247,7 +1247,7 @@ * be exactly the number of plain files, plus the number of mapped drives, * plus one "[..]" */ - itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_justFiles + itemCount_justDrives + itemCount_allDirs, "DlgDirList(DDL_DIRECTORY|DDL_DRIVES) filled with %d entries, expected %d\n", itemCount, itemCount_justFiles + itemCount_justDrives + itemCount_allDirs); @@ -1259,7 +1259,7 @@ for (i = 0; i < itemCount; i++) { memset(pathBuffer, 0, MAX_PATH); driveletter = '\0'; - SendMessage(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer); + SendMessageA(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer); p = pathBuffer + strlen(pathBuffer); if (sscanf(pathBuffer, "[-%c-]", &driveletter) == 1) { ok( driveletter >= 'a' && driveletter <= 'z', "Drive letter not in range a..z, got ascii %d\n", driveletter); @@ -1273,11 +1273,11 @@ /* Test behavior when no files match the wildcard */ strcpy(pathBuffer, BAD_EXTENSION); - res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, + res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY|DDL_DRIVES); ok (res == 1, "DlgDirList(%s, DDL_DIRECTORY|DDL_DRIVES) returned %d expected 1\n", BAD_EXTENSION, res); - itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_justDrives + itemCount_allDirs, "DlgDirList() incorrectly filled the listbox! (expected %d got %d)\n", itemCount_justDrives + itemCount_allDirs, itemCount); @@ -1286,12 +1286,12 @@ /* Test DDL_DIRECTORY|DDL_EXCLUSIVE. */ strcpy(pathBuffer, "w*.c"); - res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, + res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY|DDL_EXCLUSIVE); ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_EXCLUSIVE) failed - 0x%08x\n", GetLastError()); /* There should be exactly one element: "[..]" */ - itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_allDirs, "DlgDirList(DDL_DIRECTORY|DDL_EXCLUSIVE) filled with %d entries, expected %d\n", itemCount, itemCount_allDirs); @@ -1299,28 +1299,28 @@ if (itemCount && GetCurrentDirectoryA( MAX_PATH, pathBuffer ) > 3) /* there's no [..] in drive root */ { memset(pathBuffer, 0, MAX_PATH); - SendMessage(g_listBox, LB_GETTEXT, 0, (LPARAM)pathBuffer); + SendMessageA(g_listBox, LB_GETTEXT, 0, (LPARAM)pathBuffer); ok( !strcmp(pathBuffer, "[..]"), "First (and only) element is not [..]\n"); } /* Test behavior when no files match the wildcard */ strcpy(pathBuffer, BAD_EXTENSION); - res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, + res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY|DDL_EXCLUSIVE); ok (res == 1, "DlgDirList(%s, DDL_DIRECTORY|DDL_EXCLUSIVE) returned %d expected 1\n", BAD_EXTENSION, res); - itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_allDirs, "DlgDirList() incorrectly filled the listbox!\n"); /* Test DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE. */ strcpy(pathBuffer, "w*.c"); - res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, + res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE); ok (res == 1, "DlgDirList(*.c, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) failed - 0x%08x\n", GetLastError()); /* There should be no plain files on the listbox */ - itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_justDrives + itemCount_allDirs, "DlgDirList(DDL_DIRECTORY|DDL_EXCLUSIVE) filled with %d entries, expected %d\n", itemCount, itemCount_justDrives + itemCount_allDirs); @@ -1328,7 +1328,7 @@ for (i = 0; i < itemCount; i++) { memset(pathBuffer, 0, MAX_PATH); driveletter = '\0'; - SendMessage(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer); + SendMessageA(g_listBox, LB_GETTEXT, i, (LPARAM)pathBuffer); if (sscanf(pathBuffer, "[-%c-]", &driveletter) == 1) { ok( driveletter >= 'a' && driveletter <= 'z', "Drive letter not in range a..z, got ascii %d\n", driveletter); } else { @@ -1339,25 +1339,25 @@ /* Test behavior when no files match the wildcard */ strcpy(pathBuffer, BAD_EXTENSION); - res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, + res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE); ok (res == 1, "DlgDirList(%s, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE) returned %d expected 1\n", BAD_EXTENSION, res); - itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_justDrives + itemCount_allDirs, "DlgDirList() incorrectly filled the listbox!\n"); /* Now test DlgDirSelectEx() in normal operation */ /* Fill with everything - drives, directory and all plain files. */ strcpy(pathBuffer, "*"); - res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, + res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, ID_TEST_LABEL, DDL_DIRECTORY|DDL_DRIVES); ok (res != 0, "DlgDirList(*, DDL_DIRECTORY|DDL_DRIVES) failed - 0x%08x\n", GetLastError()); - SendMessage(g_listBox, LB_SETCURSEL, -1, 0); /* Unselect any current selection */ + SendMessageA(g_listBox, LB_SETCURSEL, -1, 0); /* Unselect any current selection */ memset(pathBuffer, 0, MAX_PATH); SetLastError(0xdeadbeef); - res = DlgDirSelectEx(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); + res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); ok (GetLastError() == 0xdeadbeef, "DlgDirSelectEx() with no selection modified last error code from 0xdeadbeef to 0x%08x\n", GetLastError()); @@ -1367,19 +1367,19 @@ ok (strlen(pathBuffer) == 0, "DlgDirSelectEx() with no selection filled buffer with %s\n", pathBuffer); */ /* Test proper drive/dir/file recognition */ - itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0); + itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0); for (i = 0; i < itemCount; i++) { memset(itemBuffer, 0, MAX_PATH); memset(pathBuffer, 0, MAX_PATH); memset(tempBuffer, 0, MAX_PATH); driveletter = '\0'; - SendMessage(g_listBox, LB_GETTEXT, i, (LPARAM)itemBuffer); - res = SendMessage(g_listBox, LB_SETCURSEL, i, 0); - ok (res == i, "SendMessage(LB_SETCURSEL, %d) failed\n", i); + SendMessageA(g_listBox, LB_GETTEXT, i, (LPARAM)itemBuffer); + res = SendMessageA(g_listBox, LB_SETCURSEL, i, 0); + ok (res == i, "SendMessageA(LB_SETCURSEL, %d) failed\n", i); if (sscanf(itemBuffer, "[-%c-]", &driveletter) == 1) { /* Current item is a drive letter */ SetLastError(0xdeadbeef); - res = DlgDirSelectEx(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); + res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); ok (GetLastError() == 0xdeadbeef, "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n", i, GetLastError()); @@ -1391,7 +1391,7 @@ } else if (itemBuffer[0] == '[') { /* Current item is the parent directory */ SetLastError(0xdeadbeef); - res = DlgDirSelectEx(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); + res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); ok (GetLastError() == 0xdeadbeef, "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n", i, GetLastError()); @@ -1402,13 +1402,13 @@ ok (*(p-1) == '\\', "DlgDirSelectEx did NOT tack on a backslash to dir, got %s\n", pathBuffer); tempBuffer[0] = '['; - strncpy(tempBuffer + 1, pathBuffer, strlen(pathBuffer) - 1); + lstrcpynA(tempBuffer + 1, pathBuffer, strlen(pathBuffer)); strcat(tempBuffer, "]"); ok (!strcmp(tempBuffer, itemBuffer), "Formatted directory should be %s, got %s\n", tempBuffer, itemBuffer); } else { /* Current item is a plain file */ SetLastError(0xdeadbeef); - res = DlgDirSelectEx(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); + res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); ok (GetLastError() == 0xdeadbeef, "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n", i, GetLastError()); @@ -1427,22 +1427,22 @@ /* Now test DlgDirSelectEx() in abnormal operation */ /* Fill list with bogus entries, that look somewhat valid */ - SendMessage(g_listBox, LB_RESETCONTENT, 0, 0); - SendMessage(g_listBox, LB_ADDSTRING, 0, (LPARAM)"[notexist.dir]"); - SendMessage(g_listBox, LB_ADDSTRING, 0, (LPARAM)"notexist.fil"); - itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0); + SendMessageA(g_listBox, LB_RESETCONTENT, 0, 0); + SendMessageA(g_listBox, LB_ADDSTRING, 0, (LPARAM)"[notexist.dir]"); + SendMessageA(g_listBox, LB_ADDSTRING, 0, (LPARAM)"notexist.fil"); + itemCount = SendMessageA(g_listBox, LB_GETCOUNT, 0, 0); for (i = 0; i < itemCount; i++) { memset(itemBuffer, 0, MAX_PATH); memset(pathBuffer, 0, MAX_PATH); memset(tempBuffer, 0, MAX_PATH); driveletter = '\0'; - SendMessage(g_listBox, LB_GETTEXT, i, (LPARAM)itemBuffer); - res = SendMessage(g_listBox, LB_SETCURSEL, i, 0); + SendMessageA(g_listBox, LB_GETTEXT, i, (LPARAM)itemBuffer); + res = SendMessageA(g_listBox, LB_SETCURSEL, i, 0); ok (res == i, "SendMessage(LB_SETCURSEL, %d) failed\n", i); if (sscanf(itemBuffer, "[-%c-]", &driveletter) == 1) { /* Current item is a drive letter */ SetLastError(0xdeadbeef); - res = DlgDirSelectEx(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); + res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); ok (GetLastError() == 0xdeadbeef, "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n", i, GetLastError()); @@ -1454,7 +1454,7 @@ } else if (itemBuffer[0] == '[') { /* Current item is the parent directory */ SetLastError(0xdeadbeef); - res = DlgDirSelectEx(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); + res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); ok (GetLastError() == 0xdeadbeef, "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n", i, GetLastError()); @@ -1465,13 +1465,13 @@ ok (*(p-1) == '\\', "DlgDirSelectEx did NOT tack on a backslash to dir, got %s\n", pathBuffer); tempBuffer[0] = '['; - strncpy(tempBuffer + 1, pathBuffer, strlen(pathBuffer) - 1); + lstrcpynA(tempBuffer + 1, pathBuffer, strlen(pathBuffer)); strcat(tempBuffer, "]"); ok (!strcmp(tempBuffer, itemBuffer), "Formatted directory should be %s, got %s\n", tempBuffer, itemBuffer); } else { /* Current item is a plain file */ SetLastError(0xdeadbeef); - res = DlgDirSelectEx(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); + res = DlgDirSelectExA(hWnd, pathBuffer, MAX_PATH, ID_TEST_LISTBOX); ok (GetLastError() == 0xdeadbeef, "DlgDirSelectEx() with selection at %d modified last error code from 0xdeadbeef to 0x%08x\n", i, GetLastError()); @@ -1488,13 +1488,13 @@ /* Test behavior when loading folders from root with and without wildcard */ strcpy(pathBuffer, "C:\\"); - res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY | DDL_EXCLUSIVE); + res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY | DDL_EXCLUSIVE); ok(res || broken(!res) /* NT4/W2K */, "DlgDirList failed to list C:\\ folders\n"); todo_wine ok(!strcmp(pathBuffer, "*") || broken(!res) /* NT4/W2K */, "DlgDirList set the invalid path spec '%s', expected '*'\n", pathBuffer); strcpy(pathBuffer, "C:\\*"); - res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY | DDL_EXCLUSIVE); + res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY | DDL_EXCLUSIVE); ok(res || broken(!res) /* NT4/W2K */, "DlgDirList failed to list C:\\* folders\n"); ok(!strcmp(pathBuffer, "*") || broken(!res) /* NT4/W2K */, "DlgDirList set the invalid path spec '%s', expected '*'\n", pathBuffer); @@ -1502,7 +1502,7 @@ /* Try loading files from an invalid folder */ SetLastError(0xdeadbeef); strcpy(pathBuffer, "C:\\INVALID$$DIR"); - res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY | DDL_EXCLUSIVE); + res = DlgDirListA(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY | DDL_EXCLUSIVE); todo_wine ok(!res, "DlgDirList should have failed with 0 but %d was returned\n", res); todo_wine ok(GetLastError() == ERROR_NO_WILDCARD_CHARACTERS, "GetLastError should return 0x589, got 0x%X\n",GetLastError()); @@ -1523,9 +1523,9 @@ GetUpdateRect( listbox, &r, TRUE ); ok( IsRectEmpty( &r ), "got non-empty rect\n"); - ret = SendMessage( listbox, LB_SETCOUNT, 100, 0 ); + ret = SendMessageA( listbox, LB_SETCOUNT, 100, 0 ); ok( ret == 0, "got %d\n", ret ); - ret = SendMessage( listbox, LB_GETCOUNT, 0, 0 ); + ret = SendMessageA( listbox, LB_GETCOUNT, 0, 0 ); ok( ret == 100, "got %d\n", ret ); GetUpdateRect( listbox, &r, TRUE ); @@ -1535,7 +1535,7 @@ GetUpdateRect( listbox, &r, TRUE ); ok( IsRectEmpty( &r ), "got non-empty rect\n"); - ret = SendMessage( listbox, LB_SETCOUNT, 99, 0 ); + ret = SendMessageA( listbox, LB_SETCOUNT, 99, 0 ); ok( ret == 0, "got %d\n", ret ); GetUpdateRect( listbox, &r, TRUE ); @@ -1564,7 +1564,7 @@ WNDPROC oldproc; DWORD ret; - pGetListBoxInfo = (void*)GetProcAddress(GetModuleHandle("user32"), "GetListBoxInfo"); + pGetListBoxInfo = (void*)GetProcAddress(GetModuleHandleA("user32.dll"), "GetListBoxInfo"); if (!pGetListBoxInfo) {
11 years, 1 month
1
0
0
0
[jimtabor] 60779: - Fix test. ATM AW and WA testing is going well.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sun Oct 27 22:34:44 2013 New Revision: 60779 URL:
http://svn.reactos.org/svn/reactos?rev=60779&view=rev
Log: - Fix test. ATM AW and WA testing is going well. Modified: trunk/rostests/winetests/user32/combo.c Modified: trunk/rostests/winetests/user32/combo.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/combo.c?…
============================================================================== --- trunk/rostests/winetests/user32/combo.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/combo.c [iso-8859-1] Sun Oct 27 22:34:44 2013 @@ -268,8 +268,8 @@ static const int sel_2[] = { 0, 1, 0, 0, 1 }; test_selection(CBS_SIMPLE, text, sel_1, sel_2); - //test_selection(CBS_DROPDOWN, text, sel_1, sel_2); - //test_selection(CBS_DROPDOWNLIST, text, sel_2, sel_2); + test_selection(CBS_DROPDOWN, text, sel_1, sel_2); + test_selection(CBS_DROPDOWNLIST, text, sel_2, sel_2); } static void test_WM_LBUTTONDOWN(void)
11 years, 1 month
1
0
0
0
[hbelusca] 60778: [NTVDM] DOS: Make use of get/setAX and consorts instead of EmulatorGet/SetRegister(EMULATOR_REG_AX, ...). Start to implement real (but undocumented?) behaviour according to http:/...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Oct 27 22:31:53 2013 New Revision: 60778 URL:
http://svn.reactos.org/svn/reactos?rev=60778&view=rev
Log: [NTVDM] DOS: Make use of get/setAX and consorts instead of EmulatorGet/SetRegister(EMULATOR_REG_AX, ...). Start to implement real (but undocumented?) behaviour according to
http://www.delorie.com/djgpp/doc/rbinter/
and
http://www.datadoctor.biz/fr/data_recovery_programming_book_chapter6-pageXX…
(change XX by a valid page number) and
http://spike.scu.edu.au/~barry/interrupts.html
Modified: branches/ntvdm/subsystems/ntvdm/dos.c branches/ntvdm/subsystems/ntvdm/dos.h branches/ntvdm/subsystems/ntvdm/ntvdm.h Modified: branches/ntvdm/subsystems/ntvdm/dos.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/dos.c?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] Sun Oct 27 22:31:53 2013 @@ -13,6 +13,8 @@ #include "dos.h" #include "bios.h" #include "emulator.h" + +#include "registers.h" /* PRIVATE VARIABLES **********************************************************/ @@ -87,7 +89,7 @@ ULONG TotalSize = 0; WORD DestSegment; - Ptr = SourceBuffer = (PCHAR)((ULONG_PTR)BaseAddress + TO_LINEAR(SourceSegment, 0)); + Ptr = SourceBuffer = (PCHAR)SEG_OFF_TO_PTR(SourceSegment, 0); /* Calculate the size of the environment block */ while (*Ptr) @@ -106,7 +108,7 @@ Ptr = SourceBuffer; - DestBuffer = (PCHAR)((ULONG_PTR)BaseAddress + TO_LINEAR(DestSegment, 0)); + DestBuffer = (PCHAR)SEG_OFF_TO_PTR(DestSegment, 0); while (*Ptr) { /* Copy the string */ @@ -1105,8 +1107,7 @@ DosChangeMemoryOwner(EnvBlock, Segment); /* Copy the program to Segment:0100 */ - RtlCopyMemory((PVOID)((ULONG_PTR)BaseAddress - + TO_LINEAR(Segment, 0x100)), + RtlCopyMemory(SEG_OFF_TO_PTR(Segment, 0x100), Address + (Header->e_cparhdr << 4), min(FileSize - (Header->e_cparhdr << 4), (ExeSize << 4) - sizeof(DOS_PSP))); @@ -1118,17 +1119,16 @@ for (i = 0; i < Header->e_crlc; i++) { /* Get a pointer to the word that needs to be patched */ - RelocWord = (PWORD)((ULONG_PTR)BaseAddress - + TO_LINEAR(Segment + HIWORD(RelocationTable[i]), - 0x100 + LOWORD(RelocationTable[i]))); + RelocWord = (PWORD)SEG_OFF_TO_PTR(Segment + HIWORD(RelocationTable[i]), + 0x100 + LOWORD(RelocationTable[i])); /* Add the number of the EXE segment to it */ *RelocWord += Segment + (sizeof(DOS_PSP) >> 4); } /* Set the initial segment registers */ - EmulatorSetRegister(EMULATOR_REG_DS, Segment); - EmulatorSetRegister(EMULATOR_REG_ES, Segment); + setDS(Segment); + setES(Segment); /* Set the stack to the location from the header */ EmulatorSetStack(Segment + (sizeof(DOS_PSP) >> 4) + Header->e_ss, @@ -1161,8 +1161,7 @@ DosChangeMemoryOwner(EnvBlock, Segment); /* Copy the program to Segment:0100 */ - RtlCopyMemory((PVOID)((ULONG_PTR)BaseAddress - + TO_LINEAR(Segment, 0x100)), + RtlCopyMemory(SEG_OFF_TO_PTR(Segment, 0x100), Address, FileSize); @@ -1173,8 +1172,8 @@ EnvBlock); /* Set the initial segment registers */ - EmulatorSetRegister(EMULATOR_REG_DS, Segment); - EmulatorSetRegister(EMULATOR_REG_ES, Segment); + setDS(Segment); + setES(Segment); /* Set the stack to the last word of the segment */ EmulatorSetStack(Segment, 0xFFFE); @@ -1345,8 +1344,7 @@ InfoWord |= 1 << 7; /* Return the device information word */ - EmulatorSetRegister(EMULATOR_REG_DX, InfoWord); - + setDX(InfoWord); return TRUE; } @@ -1373,15 +1371,9 @@ SYSTEMTIME SystemTime; PCHAR String; PDOS_INPUT_BUFFER InputBuffer; - DWORD Eax = EmulatorGetRegister(EMULATOR_REG_AX); - DWORD Ecx = EmulatorGetRegister(EMULATOR_REG_CX); - DWORD Edx = EmulatorGetRegister(EMULATOR_REG_DX); - DWORD Ebx = EmulatorGetRegister(EMULATOR_REG_BX); - WORD DataSegment = (WORD)EmulatorGetRegister(EMULATOR_REG_DS); - WORD ExtSegment = (WORD)EmulatorGetRegister(EMULATOR_REG_ES); /* Check the value in the AH register */ - switch (HIBYTE(Eax)) + switch (getAH()) { /* Terminate Program */ case 0x00: @@ -1396,45 +1388,58 @@ Character = DosReadCharacter(); DosPrintCharacter(Character); - if (!EmulatorGetFlag(EMULATOR_FLAG_CF)) - { - EmulatorSetRegister(EMULATOR_REG_AX, (Eax & 0xFFFFFF00) | Character); - } - + /* Let the BOP repeat if needed */ + if (EmulatorGetFlag(EMULATOR_FLAG_CF)) break; + + setAL(Character); break; } /* Print Character */ case 0x02: { - DosPrintCharacter(LOBYTE(Edx)); + BYTE Character = getDL(); + DosPrintCharacter(Character); + + /* + * We return the output character (DOS 2.1+), see: + *
http://www.delorie.com/djgpp/doc/rbinter/id/65/25.html
+ * for more information. + */ + setAL(Character); break; } /* Direct Console I/O */ case 0x06: { - BYTE Character = LOBYTE(Edx); + BYTE Character = getDL(); if (Character != 0xFF) { /* Output */ DosPrintCharacter(Character); + + /* + * We return the output character (DOS 2.1+), see: + *
http://www.delorie.com/djgpp/doc/rbinter/id/69/25.html
+ * for more information. + */ + setAL(Character); } else { /* Input */ - Eax &= 0xFFFFFF00; - if (DosCheckInput()) { - Eax |= DosReadCharacter(); Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_ZF; + setAL(DosReadCharacter()); } else { /* No character available */ Stack[STACK_FLAGS] |= EMULATOR_FLAG_ZF; + setAL(0); } } @@ -1447,35 +1452,37 @@ { Character = DosReadCharacter(); - if (!EmulatorGetFlag(EMULATOR_FLAG_CF)) - { - EmulatorSetRegister(EMULATOR_REG_AX, (Eax & 0xFFFFFF00) | Character); - } - + /* Let the BOP repeat if needed */ + if (EmulatorGetFlag(EMULATOR_FLAG_CF)) break; + + setAL(Character); break; } /* Print String */ case 0x09: { - String = (PCHAR)((ULONG_PTR)BaseAddress - + TO_LINEAR(DataSegment, LOWORD(Edx))); - - while ((*String) != '$') + String = (PCHAR)SEG_OFF_TO_PTR(getDS(), getDX()); + + while (*String != '$') { DosPrintCharacter(*String); String++; } + /* + * We return the output character (DOS 2.1+), see: + *
http://www.delorie.com/djgpp/doc/rbinter/id/73/25.html
+ * for more information. + */ + setAL('$'); break; } /* Read Buffered Input */ case 0x0A: { - InputBuffer = (PDOS_INPUT_BUFFER)((ULONG_PTR)BaseAddress - + TO_LINEAR(DataSegment, - LOWORD(Edx))); + InputBuffer = (PDOS_INPUT_BUFFER)SEG_OFF_TO_PTR(getDS(), getDX()); while (Stack[STACK_COUNTER] < InputBuffer->MaxLength) { @@ -1495,54 +1502,45 @@ /* Update the length */ InputBuffer->Length = Stack[STACK_COUNTER]; - break; } /* Get STDIN Status */ case 0x0B: { - if (DosCheckInput()) Eax |= 0xFF; - else Eax &= 0xFFFFFF00; - - EmulatorSetRegister(EMULATOR_REG_AX, Eax); - + setAL(DosCheckInput() ? 0xFF : 0x00); break; } /* Set Default Drive */ case 0x0E: { - DosChangeDrive(LOBYTE(Edx)); - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFFFF00) | (LastDrive - 'A' + 1)); - + DosChangeDrive(getDL()); + setAL(LastDrive - 'A' + 1); break; } /* Get Default Drive */ case 0x19: { - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFFFF00) | CurrentDrive); - + setAL(CurrentDrive); break; } /* Set Disk Transfer Area */ case 0x1A: { - DiskTransferArea = MAKELONG(LOWORD(Edx), DataSegment); + DiskTransferArea = MAKELONG(getDX(), getDS()); break; } /* Set Interrupt Vector */ case 0x25: { - DWORD FarPointer = MAKELONG(LOWORD(Edx), DataSegment); + DWORD FarPointer = MAKELONG(getDX(), getDS()); /* Write the new far pointer to the IDT */ - ((PDWORD)BaseAddress)[LOBYTE(Eax)] = FarPointer; + ((PDWORD)BaseAddress)[getAL()] = FarPointer; break; } @@ -1551,14 +1549,9 @@ case 0x2A: { GetLocalTime(&SystemTime); - EmulatorSetRegister(EMULATOR_REG_CX, - (Ecx & 0xFFFF0000) | SystemTime.wYear); - EmulatorSetRegister(EMULATOR_REG_DX, - (Edx & 0xFFFF0000) - | (SystemTime.wMonth << 8) - | SystemTime.wDay); - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFFFF00) | SystemTime.wDayOfWeek); + setCX(SystemTime.wYear); + setDX(MAKEWORD(SystemTime.wDay, SystemTime.wMonth)); + setAL(SystemTime.wDayOfWeek); break; } @@ -1566,21 +1559,12 @@ case 0x2B: { GetLocalTime(&SystemTime); - SystemTime.wYear = LOWORD(Ecx); - SystemTime.wMonth = HIBYTE(Edx); - SystemTime.wDay = LOBYTE(Edx); - - if (SetLocalTime(&SystemTime)) - { - /* Return success */ - EmulatorSetRegister(EMULATOR_REG_AX, Eax & 0xFFFFFF00); - } - else - { - /* Return failure */ - EmulatorSetRegister(EMULATOR_REG_AX, Eax | 0xFF); - } - + SystemTime.wYear = getCX(); + SystemTime.wMonth = getDH(); + SystemTime.wDay = getDL(); + + /* Return success or failure */ + setAL(SetLocalTime(&SystemTime) ? 0x00 : 0xFF); break; } @@ -1588,14 +1572,8 @@ case 0x2C: { GetLocalTime(&SystemTime); - EmulatorSetRegister(EMULATOR_REG_CX, - (Ecx & 0xFFFF0000) - | (SystemTime.wHour << 8) - | SystemTime.wMinute); - EmulatorSetRegister(EMULATOR_REG_DX, - (Edx & 0xFFFF0000) - | (SystemTime.wSecond << 8) - | (SystemTime.wMilliseconds / 10)); + setCX(MAKEWORD(SystemTime.wMinute, SystemTime.wHour)); + setDX(MAKEWORD(SystemTime.wMilliseconds / 10, SystemTime.wSecond)); break; } @@ -1603,31 +1581,21 @@ case 0x2D: { GetLocalTime(&SystemTime); - SystemTime.wHour = HIBYTE(Ecx); - SystemTime.wMinute = LOBYTE(Ecx); - SystemTime.wSecond = HIBYTE(Edx); - SystemTime.wMilliseconds = LOBYTE(Edx) * 10; - - if (SetLocalTime(&SystemTime)) - { - /* Return success */ - EmulatorSetRegister(EMULATOR_REG_AX, Eax & 0xFFFFFF00); - } - else - { - /* Return failure */ - EmulatorSetRegister(EMULATOR_REG_AX, Eax | 0xFF); - } - + SystemTime.wHour = getCH(); + SystemTime.wMinute = getCL(); + SystemTime.wSecond = getDH(); + SystemTime.wMilliseconds = getDL() * 10; // In hundredths of seconds + + /* Return success or failure */ + setAL(SetLocalTime(&SystemTime) ? 0x00 : 0xFF); break; } /* Get Disk Transfer Area */ case 0x2F: { - EmulatorSetRegister(EMULATOR_REG_ES, HIWORD(DiskTransferArea)); - EmulatorSetRegister(EMULATOR_REG_BX, LOWORD(DiskTransferArea)); - + setES(HIWORD(DiskTransferArea)); + setBX(LOWORD(DiskTransferArea)); break; } @@ -1636,27 +1604,44 @@ { PDOS_PSP PspBlock = SEGMENT_TO_PSP(CurrentPsp); - EmulatorSetRegister(EMULATOR_REG_AX, PspBlock->DosVersion); + if (LOBYTE(PspBlock->DosVersion) < 5 || getAL() == 0) + { + /* Return DOS 24-bit user serial number in BL:CX */ + setBL(0x00); + setCX(0x0000); + } + + if (LOBYTE(PspBlock->DosVersion) >= 5 && getAL() == 1) + { + /* + * Return DOS OEM number: + * 0x00 for IBM PC-DOS + * 0xFF for MS-DOS + */ + setBH(0xFF); + } + + /* Return DOS version: Minor:Major in AH:AL */ + setAX(PspBlock->DosVersion); + break; } /* Get Interrupt Vector */ case 0x35: { - DWORD FarPointer = ((PDWORD)BaseAddress)[LOBYTE(Eax)]; + DWORD FarPointer = ((PDWORD)BaseAddress)[getAL()]; /* Read the address from the IDT into ES:BX */ - EmulatorSetRegister(EMULATOR_REG_ES, HIWORD(FarPointer)); - EmulatorSetRegister(EMULATOR_REG_BX, LOWORD(FarPointer)); - + setES(HIWORD(FarPointer)); + setBX(LOWORD(FarPointer)); break; } /* Create Directory */ case 0x39: { - String = (PCHAR)((ULONG_PTR)BaseAddress - + TO_LINEAR(DataSegment, LOWORD(Edx))); + String = (PCHAR)SEG_OFF_TO_PTR(getDS(), getDX()); if (CreateDirectoryA(String, NULL)) { @@ -1665,8 +1650,7 @@ else { Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFF0000) | LOWORD(GetLastError())); + setAX(LOWORD(GetLastError())); } break; @@ -1675,8 +1659,7 @@ /* Remove Directory */ case 0x3A: { - String = (PCHAR)((ULONG_PTR)BaseAddress - + TO_LINEAR(DataSegment, LOWORD(Edx))); + String = (PCHAR)SEG_OFF_TO_PTR(getDS(), getDX()); if (RemoveDirectoryA(String)) { @@ -1685,10 +1668,8 @@ else { Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFF0000) | LOWORD(GetLastError())); - } - + setAX(LOWORD(GetLastError())); + } break; } @@ -1696,8 +1677,7 @@ /* Set Current Directory */ case 0x3B: { - String = (PCHAR)((ULONG_PTR)BaseAddress - + TO_LINEAR(DataSegment, LOWORD(Edx))); + String = (PCHAR)SEG_OFF_TO_PTR(getDS(), getDX()); if (DosChangeDirectory(String)) { @@ -1706,8 +1686,7 @@ else { Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFF0000) | DosLastError); + setAX(DosLastError); } break; @@ -1718,27 +1697,18 @@ { WORD FileHandle; WORD ErrorCode = DosCreateFile(&FileHandle, - (LPCSTR)(ULONG_PTR)BaseAddress - + TO_LINEAR(DataSegment, LOWORD(Edx)), - LOWORD(Ecx)); + (LPCSTR)SEG_OFF_TO_PTR(getDS(), getDX()), + getCX()); if (ErrorCode == 0) { - /* Clear CF */ Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; - - /* Return the handle in AX */ - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFF0000) | FileHandle); + setAX(FileHandle); } else { - /* Set CF */ Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - - /* Return the error code in AX */ - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFF0000) | ErrorCode); + setAX(ErrorCode); } break; @@ -1749,27 +1719,18 @@ { WORD FileHandle; WORD ErrorCode = DosOpenFile(&FileHandle, - (LPCSTR)(ULONG_PTR)BaseAddress - + TO_LINEAR(DataSegment, LOWORD(Edx)), - LOBYTE(Eax)); + (LPCSTR)SEG_OFF_TO_PTR(getDS(), getDX()), + getAL()); if (ErrorCode == 0) { - /* Clear CF */ Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; - - /* Return the handle in AX */ - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFF0000) | FileHandle); + setAX(FileHandle); } else { - /* Set CF */ Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - - /* Return the error code in AX */ - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFF0000) | ErrorCode); + setAX(ErrorCode); } break; @@ -1778,19 +1739,14 @@ /* Close File */ case 0x3E: { - if (DosCloseHandle(LOWORD(Ebx))) - { - /* Clear CF */ + if (DosCloseHandle(getBX())) + { Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; } else { - /* Set CF */ Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - - /* Return the error code in AX */ - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFF0000) | ERROR_INVALID_HANDLE); + setAX(ERROR_INVALID_HANDLE); } break; @@ -1799,9 +1755,9 @@ /* Read File */ case 0x3F: { - WORD Handle = LOWORD(Ebx); - LPBYTE Buffer = (LPBYTE)((ULONG_PTR)BaseAddress + TO_LINEAR(DataSegment, LOWORD(Edx))); - WORD Count = LOWORD(Ecx); + WORD Handle = getBX(); + LPBYTE Buffer = (LPBYTE)SEG_OFF_TO_PTR(getDS(), getDX()); + WORD Count = getCX(); WORD BytesRead = 0; WORD ErrorCode = ERROR_SUCCESS; @@ -1830,21 +1786,13 @@ if (ErrorCode == 0) { - /* Clear CF */ - Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; - - /* Return the number of bytes read in AX */ - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFF0000) | BytesRead); + Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; + setAX(BytesRead); } else if (ErrorCode != ERROR_NOT_READY) { - /* Set CF */ Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - - /* Return the error code in AX */ - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFF0000) | ErrorCode); + setAX(ErrorCode); } break; } @@ -1853,29 +1801,20 @@ case 0x40: { WORD BytesWritten = 0; - WORD ErrorCode = DosWriteFile(LOWORD(Ebx), - (LPVOID)((ULONG_PTR)BaseAddress - + TO_LINEAR(DataSegment, LOWORD(Edx))), - LOWORD(Ecx), + WORD ErrorCode = DosWriteFile(getBX(), + SEG_OFF_TO_PTR(getDS(), getDX()), + getCX(), &BytesWritten); if (ErrorCode == 0) { - /* Clear CF */ Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; - - /* Return the number of bytes written in AX */ - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFF0000) | BytesWritten); + setAX(BytesWritten); } else { - /* Set CF */ Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - - /* Return the error code in AX */ - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFF0000) | ErrorCode); + setAX(ErrorCode); } break; @@ -1884,14 +1823,17 @@ /* Delete File */ case 0x41: { - LPSTR FileName = (LPSTR)((ULONG_PTR)BaseAddress + TO_LINEAR(DataSegment, Edx)); + LPSTR FileName = (LPSTR)SEG_OFF_TO_PTR(getDS(), getDX()); /* Call the API function */ - if (DeleteFileA(FileName)) Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; + if (DeleteFileA(FileName)) + { + Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; + } else { Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - EmulatorSetRegister(EMULATOR_REG_AX, GetLastError()); + setAX(GetLastError()); } break; @@ -1901,30 +1843,23 @@ case 0x42: { DWORD NewLocation; - WORD ErrorCode = DosSeekFile(LOWORD(Ebx), - MAKELONG(LOWORD(Edx), LOWORD(Ecx)), - LOBYTE(Eax), + WORD ErrorCode = DosSeekFile(getBX(), + MAKELONG(getDX(), getCX()), + getAL(), &NewLocation); if (ErrorCode == 0) { - /* Clear CF */ Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; /* Return the new offset in DX:AX */ - EmulatorSetRegister(EMULATOR_REG_DX, - (Edx & 0xFFFF0000) | HIWORD(NewLocation)); - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFF0000) | LOWORD(NewLocation)); + setDX(HIWORD(NewLocation)); + setAX(LOWORD(NewLocation)); } else { - /* Set CF */ Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - - /* Return the error code in AX */ - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFF0000) | ErrorCode); + setAX(ErrorCode); } break; @@ -1934,9 +1869,9 @@ case 0x43: { DWORD Attributes; - LPSTR FileName = (LPSTR)((ULONG_PTR)BaseAddress + TO_LINEAR(DataSegment, Edx)); - - if (LOBYTE(Eax) == 0x00) + LPSTR FileName = (LPSTR)SEG_OFF_TO_PTR(getDS(), getDX()); + + if (getAL() == 0x00) { /* Get the attributes */ Attributes = GetFileAttributesA(FileName); @@ -1945,33 +1880,32 @@ if (Attributes == INVALID_FILE_ATTRIBUTES) { Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - EmulatorSetRegister(EMULATOR_REG_AX, GetLastError()); - + setAX(GetLastError()); break; } /* Return the attributes that DOS can understand */ Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; - EmulatorSetRegister(EMULATOR_REG_CX, - (Ecx & 0xFFFFFF00) | LOBYTE(Attributes)); - } - else if (LOBYTE(Eax) == 0x01) + // setCL(LOBYTE(Attributes)); + setCX(LOWORD(Attributes)); + } + else if (getAL() == 0x01) { /* Try to set the attributes */ - if (SetFileAttributesA(FileName, LOBYTE(Ecx))) + if (SetFileAttributesA(FileName, getCL())) { Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; } else { Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - EmulatorSetRegister(EMULATOR_REG_AX, GetLastError()); + setAX(GetLastError()); } } else { Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - EmulatorSetRegister(EMULATOR_REG_AX, ERROR_INVALID_FUNCTION); + setAX(ERROR_INVALID_FUNCTION); } break; @@ -1980,14 +1914,14 @@ /* IOCTL */ case 0x44: { - if (DosHandleIoctl(LOBYTE(Eax), LOWORD(Ebx))) + if (DosHandleIoctl(getAL(), getBX())) { Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; } else { Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - EmulatorSetRegister(EMULATOR_REG_AX, DosLastError); + setAX(DosLastError); } break; @@ -1997,14 +1931,13 @@ case 0x45: { WORD NewHandle; - HANDLE Handle = DosGetRealHandle(LOWORD(Ebx)); + HANDLE Handle = DosGetRealHandle(getBX()); if (Handle != INVALID_HANDLE_VALUE) { /* The handle is invalid */ Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - EmulatorSetRegister(EMULATOR_REG_AX, ERROR_INVALID_HANDLE); - + setAX(ERROR_INVALID_HANDLE); break; } @@ -2015,29 +1948,27 @@ { /* Too many files open */ Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - EmulatorSetRegister(EMULATOR_REG_AX, ERROR_TOO_MANY_OPEN_FILES); - + setAX(ERROR_TOO_MANY_OPEN_FILES); break; } /* Return the result */ Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; - EmulatorSetRegister(EMULATOR_REG_AX, NewHandle); - + setAX(NewHandle); break; } /* Force Duplicate Handle */ case 0x46: { - if (DosDuplicateHandle(LOWORD(Ebx), LOWORD(Ecx))) + if (DosDuplicateHandle(getBX(), getCX())) { Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; } else { Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - EmulatorSetRegister(EMULATOR_REG_AX, ERROR_INVALID_HANDLE); + setAX(ERROR_INVALID_HANDLE); } break; @@ -2047,18 +1978,18 @@ case 0x48: { WORD MaxAvailable = 0; - WORD Segment = DosAllocateMemory(LOWORD(Ebx), &MaxAvailable); + WORD Segment = DosAllocateMemory(getBX(), &MaxAvailable); if (Segment != 0) { - EmulatorSetRegister(EMULATOR_REG_AX, Segment); Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; + setAX(Segment); } else { - EmulatorSetRegister(EMULATOR_REG_AX, DosLastError); - EmulatorSetRegister(EMULATOR_REG_BX, MaxAvailable); Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; + setAX(DosLastError); + setBX(MaxAvailable); } break; @@ -2067,14 +1998,14 @@ /* Free Memory */ case 0x49: { - if (DosFreeMemory(ExtSegment)) + if (DosFreeMemory(getES())) { Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; } else { - EmulatorSetRegister(EMULATOR_REG_AX, ERROR_ARENA_TRASHED); Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; + setAX(ERROR_ARENA_TRASHED); } break; @@ -2085,15 +2016,15 @@ { WORD Size; - if (DosResizeMemory(ExtSegment, LOWORD(Ebx), &Size)) + if (DosResizeMemory(getES(), getBX(), &Size)) { Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; } else { - EmulatorSetRegister(EMULATOR_REG_AX, DosLastError); Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - EmulatorSetRegister(EMULATOR_REG_BX, Size); + setAX(DosLastError); + setBX(Size); } break; @@ -2102,75 +2033,68 @@ /* Terminate With Return Code */ case 0x4C: { - DosTerminateProcess(CurrentPsp, LOBYTE(Eax)); + DosTerminateProcess(CurrentPsp, getAL()); break; } /* Get Current Process */ case 0x51: { - EmulatorSetRegister(EMULATOR_REG_BX, CurrentPsp); - + setBX(CurrentPsp); break; } /* Get/Set Memory Management Options */ case 0x58: { - if (LOBYTE(Eax) == 0x00) + if (getAL() == 0x00) { /* Get allocation strategy */ - - EmulatorSetRegister(EMULATOR_REG_AX, DosAllocStrategy); Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; - } - else if (LOBYTE(Eax) == 0x01) + setAX(DosAllocStrategy); + } + else if (getAL() == 0x01) { /* Set allocation strategy */ - if ((LOBYTE(Ebx) & (DOS_ALLOC_HIGH | DOS_ALLOC_HIGH_LOW)) + if ((getBL() & (DOS_ALLOC_HIGH | DOS_ALLOC_HIGH_LOW)) == (DOS_ALLOC_HIGH | DOS_ALLOC_HIGH_LOW)) { /* Can't set both */ - EmulatorSetRegister(EMULATOR_REG_AX, ERROR_INVALID_PARAMETER); Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; + setAX(ERROR_INVALID_PARAMETER); break; } - if ((LOBYTE(Ebx) & 0x3F) > DOS_ALLOC_LAST_FIT) + if ((getBL() & 0x3F) > DOS_ALLOC_LAST_FIT) { /* Invalid allocation strategy */ - EmulatorSetRegister(EMULATOR_REG_AX, ERROR_INVALID_PARAMETER); Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; + setAX(ERROR_INVALID_PARAMETER); break; } - DosAllocStrategy = LOBYTE(Ebx); + DosAllocStrategy = getBL(); Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; } - else if (LOBYTE(Eax) == 0x02) + else if (getAL() == 0x02) { /* Get UMB link state */ - - Eax &= 0xFFFFFF00; - if (DosUmbLinked) Eax |= 1; - EmulatorSetRegister(EMULATOR_REG_AX, Eax); Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; - } - else if (LOBYTE(Eax) == 0x03) + setAL(DosUmbLinked ? 0x01 : 0x00); + } + else if (getAL() == 0x03) { /* Set UMB link state */ - - if (Ebx) DosLinkUmb(); + if (getBX()) DosLinkUmb(); else DosUnlinkUmb(); Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; } else { /* Invalid or unsupported function */ - Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - EmulatorSetRegister(EMULATOR_REG_AX, ERROR_INVALID_FUNCTION); + setAX(ERROR_INVALID_FUNCTION); } break; @@ -2179,7 +2103,7 @@ /* Unsupported */ default: { - DPRINT1("DOS Function INT 0x21, AH = 0x%02X NOT IMPLEMENTED!\n", HIBYTE(Eax)); + DPRINT1("DOS Function INT 0x21, AH = 0x%02X NOT IMPLEMENTED!\n", getAH()); Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; } } @@ -2200,7 +2124,7 @@ WCHAR Buffer[256]; LPWSTR SourcePtr, Environment; LPSTR AsciiString; - LPSTR DestPtr = (LPSTR)((ULONG_PTR)BaseAddress + TO_LINEAR(SYSTEM_ENV_BLOCK, 0)); + LPSTR DestPtr = (LPSTR)SEG_OFF_TO_PTR(SYSTEM_ENV_BLOCK, 0); DWORD AsciiSize; CHAR CurrentDirectory[MAX_PATH]; CHAR DosDirectory[DOS_DIR_LENGTH]; Modified: branches/ntvdm/subsystems/ntvdm/dos.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/dos.h?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/dos.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/dos.h [iso-8859-1] Sun Oct 27 22:31:53 2013 @@ -15,7 +15,11 @@ /* DEFINES ********************************************************************/ +// +// We are DOS 6.00 +// #define DOS_VERSION MAKEWORD(6, 0) + #define DOS_CONFIG_PATH L"%SystemRoot%\\system32\\CONFIG.NT" #define DOS_COMMAND_INTERPRETER L"%SystemRoot%\\system32\\COMMAND.COM /k %SystemRoot%\\system32\\AUTOEXEC.NT" #define FIRST_MCB_SEGMENT 0x1000 Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ntvdm.h?…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/ntvdm.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/ntvdm.h [iso-8859-1] Sun Oct 27 22:31:53 2013 @@ -23,11 +23,14 @@ #define TO_LINEAR(seg, off) (((seg) << 4) + (off)) #define MAX_SEGMENT 0xFFFF -#define MAX_OFFSET 0xFFFF +#define MAX_OFFSET 0xFFFF #define MAX_ADDRESS TO_LINEAR(MAX_SEGMENT, MAX_OFFSET) -#define FAR_POINTER(x) ((ULONG_PTR)BaseAddress + TO_LINEAR(HIWORD(x), LOWORD(x))) -#define SEG_OFF_TO_PTR(seg, off) ((ULONG_PTR)BaseAddress + TO_LINEAR((seg), (off))) +#define FAR_POINTER(x) \ + (PVOID)((ULONG_PTR)BaseAddress + TO_LINEAR(HIWORD(x), LOWORD(x))) + +#define SEG_OFF_TO_PTR(seg, off) \ + (PVOID)((ULONG_PTR)BaseAddress + TO_LINEAR((seg), (off))) #define STEPS_PER_CYCLE 256
11 years, 1 month
1
0
0
0
[jimtabor] 60777: - Sync wine to 1.7.5.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sun Oct 27 22:13:41 2013 New Revision: 60777 URL:
http://svn.reactos.org/svn/reactos?rev=60777&view=rev
Log: - Sync wine to 1.7.5. Modified: trunk/rostests/winetests/user32/combo.c Modified: trunk/rostests/winetests/user32/combo.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/combo.c?…
============================================================================== --- trunk/rostests/winetests/user32/combo.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/combo.c [iso-8859-1] Sun Oct 27 22:13:41 2013 @@ -37,25 +37,25 @@ static HWND build_combo(DWORD style) { - return CreateWindow("ComboBox", "Combo", WS_VISIBLE|WS_CHILD|style, 5, 5, 100, 100, hMainWnd, (HMENU)COMBO_ID, NULL, 0); + return CreateWindowA("ComboBox", "Combo", WS_VISIBLE|WS_CHILD|style, 5, 5, 100, 100, hMainWnd, (HMENU)COMBO_ID, NULL, 0); } static int font_height(HFONT hFont) { - TEXTMETRIC tm; + TEXTMETRICA tm; HFONT hFontOld; HDC hDC; hDC = CreateCompatibleDC(NULL); hFontOld = SelectObject(hDC, hFont); - GetTextMetrics(hDC, &tm); + GetTextMetricsA(hDC, &tm); SelectObject(hDC, hFontOld); DeleteDC(hDC); return tm.tmHeight; } -static INT CALLBACK is_font_installed_proc(const LOGFONT *elf, const TEXTMETRIC *tm, DWORD type, LPARAM lParam) +static INT CALLBACK is_font_installed_proc(const LOGFONTA *elf, const TEXTMETRICA *tm, DWORD type, LPARAM lParam) { return 0; } @@ -63,7 +63,7 @@ static int is_font_installed(const char *name) { HDC hdc = GetDC(NULL); - BOOL ret = !EnumFontFamilies(hdc, name, is_font_installed_proc, 0); + BOOL ret = !EnumFontFamiliesA(hdc, name, is_font_installed_proc, 0); ReleaseDC(NULL, hdc); return ret; } @@ -83,7 +83,7 @@ for (i = 1; i < 30; i++) { - SendMessage(hCombo, CB_SETITEMHEIGHT, -1, i); + SendMessageA(hCombo, CB_SETITEMHEIGHT, -1, i); GetClientRect(hCombo, &r); expect_eq(r.bottom - r.top, i + 6, int, "%d"); } @@ -107,8 +107,8 @@ trace("Style %x\n", style); hCombo = build_combo(style); - hFont1 = CreateFont(10, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, SYMBOL_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE, "Marlett"); - hFont2 = CreateFont(8, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, SYMBOL_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE, "Marlett"); + hFont1 = CreateFontA(10, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, SYMBOL_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE, "Marlett"); + hFont2 = CreateFontA(8, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, SYMBOL_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE, "Marlett"); GetClientRect(hCombo, &r); expect_rect(r, 0, 0, 100, font_height(GetStockObject(SYSTEM_FONT)) + 8); @@ -122,21 +122,21 @@ changes, not by how much the list area changes. */ if (font_height(hFont1) == 10 && font_height(hFont2) == 8) { - SendMessage(hCombo, WM_SETFONT, (WPARAM)hFont1, FALSE); + SendMessageA(hCombo, WM_SETFONT, (WPARAM)hFont1, FALSE); GetClientRect(hCombo, &r); expect_rect(r, 0, 0, 100, 18); SendMessageA(hCombo, CB_GETDROPPEDCONTROLRECT, 0, (LPARAM)&r); MapWindowPoints(HWND_DESKTOP, hMainWnd, (LPPOINT)&r, 2); todo_wine expect_rect(r, 5, 5, 105, 105 - (font_height(GetStockObject(SYSTEM_FONT)) - font_height(hFont1))); - SendMessage(hCombo, WM_SETFONT, (WPARAM)hFont2, FALSE); + SendMessageA(hCombo, WM_SETFONT, (WPARAM)hFont2, FALSE); GetClientRect(hCombo, &r); expect_rect(r, 0, 0, 100, 16); SendMessageA(hCombo, CB_GETDROPPEDCONTROLRECT, 0, (LPARAM)&r); MapWindowPoints(HWND_DESKTOP, hMainWnd, (LPPOINT)&r, 2); todo_wine expect_rect(r, 5, 5, 105, 105 - (font_height(GetStockObject(SYSTEM_FONT)) - font_height(hFont2))); - SendMessage(hCombo, WM_SETFONT, (WPARAM)hFont1, FALSE); + SendMessageA(hCombo, WM_SETFONT, (WPARAM)hFont1, FALSE); GetClientRect(hCombo, &r); expect_rect(r, 0, 0, 100, 18); SendMessageA(hCombo, CB_GETDROPPEDCONTROLRECT, 0, (LPARAM)&r); @@ -151,13 +151,13 @@ for (i = 1; i < 30; i++) { - HFONT hFont = CreateFont(i, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, SYMBOL_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE, "Marlett"); + HFONT hFont = CreateFontA(i, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, SYMBOL_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE, "Marlett"); int height = font_height(hFont); - SendMessage(hCombo, WM_SETFONT, (WPARAM)hFont, FALSE); + SendMessageA(hCombo, WM_SETFONT, (WPARAM)hFont, FALSE); GetClientRect(hCombo, &r); expect_eq(r.bottom - r.top, height + 8, int, "%d"); - SendMessage(hCombo, WM_SETFONT, 0, FALSE); + SendMessageA(hCombo, WM_SETFONT, 0, FALSE); DeleteObject(hFont); } @@ -187,9 +187,9 @@ memset(list, 0, sizeof(list)); memset(edit, 0, sizeof(edit)); - idx = SendMessage(hCombo, CB_GETCURSEL, 0, 0); - SendMessage(hCombo, CB_GETLBTEXT, idx, (LPARAM)list); - SendMessage(hCombo, WM_GETTEXT, sizeof(edit), (LPARAM)edit); + idx = SendMessageA(hCombo, CB_GETCURSEL, 0, 0); + SendMessageA(hCombo, CB_GETLBTEXT, idx, (LPARAM)list); + SendMessageA(hCombo, WM_GETTEXT, sizeof(edit), (LPARAM)edit); ok(!strcmp(edit, expected_edit_text), "edit: got %s, expected %s\n", edit, expected_edit_text); @@ -203,7 +203,7 @@ break; } - return CallWindowProc(old_parent_proc, hwnd, msg, wparam, lparam); + return CallWindowProcA(old_parent_proc, hwnd, msg, wparam, lparam); } static void test_selection(DWORD style, const char * const text[], @@ -214,13 +214,13 @@ hCombo = build_combo(style); - SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)text[0]); - SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)text[1]); - SendMessage(hCombo, CB_SETCURSEL, -1, 0); - - old_parent_proc = (void *)SetWindowLongPtr(hMainWnd, GWLP_WNDPROC, (ULONG_PTR)parent_wnd_proc); - - idx = SendMessage(hCombo, CB_GETCURSEL, 0, 0); + SendMessageA(hCombo, CB_ADDSTRING, 0, (LPARAM)text[0]); + SendMessageA(hCombo, CB_ADDSTRING, 0, (LPARAM)text[1]); + SendMessageA(hCombo, CB_SETCURSEL, -1, 0); + + old_parent_proc = (void *)SetWindowLongPtrA(hMainWnd, GWLP_WNDPROC, (ULONG_PTR)parent_wnd_proc); + + idx = SendMessageA(hCombo, CB_GETCURSEL, 0, 0); ok(idx == -1, "expected selection -1, got %d\n", idx); /* keyboard navigation */ @@ -228,19 +228,19 @@ expected_list_text = text[list[0]]; expected_edit_text = text[edit[0]]; selchange_fired = FALSE; - SendMessage(hCombo, WM_KEYDOWN, VK_DOWN, 0); + SendMessageA(hCombo, WM_KEYDOWN, VK_DOWN, 0); ok(selchange_fired, "CBN_SELCHANGE not sent!\n"); expected_list_text = text[list[1]]; expected_edit_text = text[edit[1]]; selchange_fired = FALSE; - SendMessage(hCombo, WM_KEYDOWN, VK_DOWN, 0); + SendMessageA(hCombo, WM_KEYDOWN, VK_DOWN, 0); ok(selchange_fired, "CBN_SELCHANGE not sent!\n"); expected_list_text = text[list[2]]; expected_edit_text = text[edit[2]]; selchange_fired = FALSE; - SendMessage(hCombo, WM_KEYDOWN, VK_UP, 0); + SendMessageA(hCombo, WM_KEYDOWN, VK_UP, 0); ok(selchange_fired, "CBN_SELCHANGE not sent!\n"); /* programmatic navigation */ @@ -248,16 +248,16 @@ expected_list_text = text[list[3]]; expected_edit_text = text[edit[3]]; selchange_fired = FALSE; - SendMessage(hCombo, CB_SETCURSEL, list[3], 0); + SendMessageA(hCombo, CB_SETCURSEL, list[3], 0); ok(!selchange_fired, "CBN_SELCHANGE sent!\n"); expected_list_text = text[list[4]]; expected_edit_text = text[edit[4]]; selchange_fired = FALSE; - SendMessage(hCombo, CB_SETCURSEL, list[4], 0); + SendMessageA(hCombo, CB_SETCURSEL, list[4], 0); ok(!selchange_fired, "CBN_SELCHANGE sent!\n"); - SetWindowLongPtr(hMainWnd, GWLP_WNDPROC, (ULONG_PTR)old_parent_proc); + SetWindowLongPtrA(hMainWnd, GWLP_WNDPROC, (ULONG_PTR)old_parent_proc); DestroyWindow(hCombo); } @@ -268,8 +268,8 @@ static const int sel_2[] = { 0, 1, 0, 0, 1 }; test_selection(CBS_SIMPLE, text, sel_1, sel_2); - test_selection(CBS_DROPDOWN, text, sel_1, sel_2); - test_selection(CBS_DROPDOWNLIST, text, sel_2, sel_2); + //test_selection(CBS_DROPDOWN, text, sel_1, sel_2); + //test_selection(CBS_DROPDOWNLIST, text, sel_2, sel_2); } static void test_WM_LBUTTONDOWN(void) @@ -292,7 +292,7 @@ return; } - hCombo = CreateWindow("ComboBox", "Combo", WS_VISIBLE|WS_CHILD|CBS_DROPDOWN, + hCombo = CreateWindowA("ComboBox", "Combo", WS_VISIBLE|WS_CHILD|CBS_DROPDOWN, 0, 0, 200, 150, hMainWnd, (HMENU)COMBO_ID, NULL, 0); for (i = 0; i < sizeof(choices)/sizeof(UINT); i++){ @@ -316,47 +316,47 @@ /* Click on the button to drop down the list */ x = cbInfo.rcButton.left + (cbInfo.rcButton.right-cbInfo.rcButton.left)/2; y = cbInfo.rcButton.top + (cbInfo.rcButton.bottom-cbInfo.rcButton.top)/2; - result = SendMessage(hCombo, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y)); + result = SendMessageA(hCombo, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y)); ok(result, "WM_LBUTTONDOWN was not processed. LastError=%d\n", GetLastError()); - ok(SendMessage(hCombo, CB_GETDROPPEDSTATE, 0, 0), + ok(SendMessageA(hCombo, CB_GETDROPPEDSTATE, 0, 0), "The dropdown list should have appeared after clicking the button.\n"); ok(GetFocus() == hEdit, "Focus not on ComboBox's Edit Control, instead on %p\n", GetFocus()); - result = SendMessage(hCombo, WM_LBUTTONUP, 0, MAKELPARAM(x, y)); + result = SendMessageA(hCombo, WM_LBUTTONUP, 0, MAKELPARAM(x, y)); ok(result, "WM_LBUTTONUP was not processed. LastError=%d\n", GetLastError()); ok(GetFocus() == hEdit, "Focus not on ComboBox's Edit Control, instead on %p\n", GetFocus()); /* Click on the 5th item in the list */ - item_height = SendMessage(hCombo, CB_GETITEMHEIGHT, 0, 0); + item_height = SendMessageA(hCombo, CB_GETITEMHEIGHT, 0, 0); ok(GetClientRect(hList, &rect), "Failed to get list's client rect.\n"); x = rect.left + (rect.right-rect.left)/2; y = item_height/2 + item_height*4; - result = SendMessage(hList, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y)); + result = SendMessageA(hList, WM_LBUTTONDOWN, 0, MAKELPARAM(x, y)); ok(!result, "WM_LBUTTONDOWN was not processed. LastError=%d\n", GetLastError()); ok(GetFocus() == hEdit, "Focus not on ComboBox's Edit Control, instead on %p\n", GetFocus()); - result = SendMessage(hList, WM_MOUSEMOVE, 0, MAKELPARAM(x, y)); + result = SendMessageA(hList, WM_MOUSEMOVE, 0, MAKELPARAM(x, y)); ok(!result, "WM_MOUSEMOVE was not processed. LastError=%d\n", GetLastError()); ok(GetFocus() == hEdit, "Focus not on ComboBox's Edit Control, instead on %p\n", GetFocus()); - ok(SendMessage(hCombo, CB_GETDROPPEDSTATE, 0, 0), + ok(SendMessageA(hCombo, CB_GETDROPPEDSTATE, 0, 0), "The dropdown list should still be visible.\n"); - result = SendMessage(hList, WM_LBUTTONUP, 0, MAKELPARAM(x, y)); + result = SendMessageA(hList, WM_LBUTTONUP, 0, MAKELPARAM(x, y)); ok(!result, "WM_LBUTTONUP was not processed. LastError=%d\n", GetLastError()); ok(GetFocus() == hEdit, "Focus not on ComboBox's Edit Control, instead on %p\n", GetFocus()); - ok(!SendMessage(hCombo, CB_GETDROPPEDSTATE, 0, 0), + ok(!SendMessageA(hCombo, CB_GETDROPPEDSTATE, 0, 0), "The dropdown list should have been rolled up.\n"); - idx = SendMessage(hCombo, CB_GETCURSEL, 0, 0); + idx = SendMessageA(hCombo, CB_GETCURSEL, 0, 0); ok(idx, "Current Selection: expected %d, got %d\n", 4, idx); DestroyWindow(hCombo); @@ -464,42 +464,42 @@ hEdit = cbInfo.hwndItem; /* Initially combo selection is empty*/ - len = SendMessage(hCombo, CB_GETEDITSEL, 0,0); + len = SendMessageA(hCombo, CB_GETEDITSEL, 0,0); ok(LOWORD(len)==0, "Unexpected start position for selection %d\n", LOWORD(len)); ok(HIWORD(len)==0, "Unexpected end position for selection %d\n", HIWORD(len)); /* Set some text, and press a key to replace it */ edit[0] = 0x00; - SendMessage(hCombo, WM_SETTEXT, 0, (LPARAM)"Jason1"); - SendMessage(hCombo, WM_GETTEXT, sizeof(edit), (LPARAM)edit); + SendMessageA(hCombo, WM_SETTEXT, 0, (LPARAM)"Jason1"); + SendMessageA(hCombo, WM_GETTEXT, sizeof(edit), (LPARAM)edit); ok(strcmp(edit, "Jason1")==0, "Unexpected text retrieved %s\n", edit); /* Now what is the selection - still empty */ - SendMessage(hCombo, CB_GETEDITSEL, (WPARAM)&start, (WPARAM)&end); - len = SendMessage(hCombo, CB_GETEDITSEL, 0,0); + SendMessageA(hCombo, CB_GETEDITSEL, (WPARAM)&start, (WPARAM)&end); + len = SendMessageA(hCombo, CB_GETEDITSEL, 0,0); ok(LOWORD(len)==0, "Unexpected start position for selection %d\n", LOWORD(len)); ok(HIWORD(len)==0, "Unexpected end position for selection %d\n", HIWORD(len)); /* Give it focus, and it gets selected */ - SendMessage(hCombo, WM_SETFOCUS, 0, (LPARAM)hEdit); - SendMessage(hCombo, CB_GETEDITSEL, (WPARAM)&start, (WPARAM)&end); - len = SendMessage(hCombo, CB_GETEDITSEL, 0,0); + SendMessageA(hCombo, WM_SETFOCUS, 0, (LPARAM)hEdit); + SendMessageA(hCombo, CB_GETEDITSEL, (WPARAM)&start, (WPARAM)&end); + len = SendMessageA(hCombo, CB_GETEDITSEL, 0,0); ok(LOWORD(len)==0, "Unexpected start position for selection %d\n", LOWORD(len)); ok(HIWORD(len)==6, "Unexpected end position for selection %d\n", HIWORD(len)); /* Now emulate a key press */ edit[0] = 0x00; - SendMessage(hCombo, WM_CHAR, 'A', 0x1c0001); - SendMessage(hCombo, WM_GETTEXT, sizeof(edit), (LPARAM)edit); + SendMessageA(hCombo, WM_CHAR, 'A', 0x1c0001); + SendMessageA(hCombo, WM_GETTEXT, sizeof(edit), (LPARAM)edit); ok(strcmp(edit, "A")==0, "Unexpected text retrieved %s\n", edit); - len = SendMessage(hCombo, CB_GETEDITSEL, 0,0); + len = SendMessageA(hCombo, CB_GETEDITSEL, 0,0); ok(LOWORD(len)==1, "Unexpected start position for selection %d\n", LOWORD(len)); ok(HIWORD(len)==1, "Unexpected end position for selection %d\n", HIWORD(len)); /* Now what happens when it gets more focus a second time - it doesn't reselect */ - SendMessage(hCombo, WM_SETFOCUS, 0, (LPARAM)hEdit); - len = SendMessage(hCombo, CB_GETEDITSEL, 0,0); + SendMessageA(hCombo, WM_SETFOCUS, 0, (LPARAM)hEdit); + len = SendMessageA(hCombo, CB_GETEDITSEL, 0,0); ok(LOWORD(len)==1, "Unexpected start position for selection %d\n", LOWORD(len)); ok(HIWORD(len)==1, "Unexpected end position for selection %d\n", HIWORD(len)); DestroyWindow(hCombo); @@ -515,31 +515,31 @@ /* Set some text and give focus so it gets selected */ edit[0] = 0x00; - SendMessage(hCombo, WM_SETTEXT, 0, (LPARAM)"Jason2"); - SendMessage(hCombo, WM_GETTEXT, sizeof(edit), (LPARAM)edit); + SendMessageA(hCombo, WM_SETTEXT, 0, (LPARAM)"Jason2"); + SendMessageA(hCombo, WM_GETTEXT, sizeof(edit), (LPARAM)edit); ok(strcmp(edit, "Jason2")==0, "Unexpected text retrieved %s\n", edit); - SendMessage(hCombo, WM_SETFOCUS, 0, (LPARAM)hEdit); + SendMessageA(hCombo, WM_SETFOCUS, 0, (LPARAM)hEdit); /* Now what is the selection */ - SendMessage(hCombo, CB_GETEDITSEL, (WPARAM)&start, (WPARAM)&end); - len = SendMessage(hCombo, CB_GETEDITSEL, 0,0); + SendMessageA(hCombo, CB_GETEDITSEL, (WPARAM)&start, (WPARAM)&end); + len = SendMessageA(hCombo, CB_GETEDITSEL, 0,0); ok(LOWORD(len)==0, "Unexpected start position for selection %d\n", LOWORD(len)); ok(HIWORD(len)==6, "Unexpected end position for selection %d\n", HIWORD(len)); /* Now change the selection to the apparently invalid start -1, end -1 and show it means no selection (ie start -1) but cursor at end */ - SendMessage(hCombo, CB_SETEDITSEL, 0, -1); + SendMessageA(hCombo, CB_SETEDITSEL, 0, -1); edit[0] = 0x00; - SendMessage(hCombo, WM_CHAR, 'A', 0x1c0001); - SendMessage(hCombo, WM_GETTEXT, sizeof(edit), (LPARAM)edit); + SendMessageA(hCombo, WM_CHAR, 'A', 0x1c0001); + SendMessageA(hCombo, WM_GETTEXT, sizeof(edit), (LPARAM)edit); ok(strcmp(edit, "Jason2A")==0, "Unexpected text retrieved %s\n", edit); DestroyWindow(hCombo); } START_TEST(combo) { - hMainWnd = CreateWindow("static", "Test", WS_OVERLAPPEDWINDOW, 10, 10, 300, 300, NULL, NULL, NULL, 0); + hMainWnd = CreateWindowA("static", "Test", WS_OVERLAPPEDWINDOW, 10, 10, 300, 300, NULL, NULL, NULL, 0); ShowWindow(hMainWnd, SW_SHOW); test_setfont(CBS_DROPDOWN);
11 years, 1 month
1
0
0
0
[hbelusca] 60776: [NTVDM]: Use SEG_OFF_TO_PTR ( $+ \epsilon * code _eorganization$ ).
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Oct 27 22:13:18 2013 New Revision: 60776 URL:
http://svn.reactos.org/svn/reactos?rev=60776&view=rev
Log: [NTVDM]: Use SEG_OFF_TO_PTR ( $+ \epsilon * code _eorganization$ ). Modified: branches/ntvdm/subsystems/ntvdm/emulator.c Modified: branches/ntvdm/subsystems/ntvdm/emulator.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] Sun Oct 27 22:13:18 2013 @@ -236,7 +236,7 @@ StackPointer = State->GeneralRegs[FAST486_REG_ESP].LowWord; /* Get the stack */ - Stack = (LPWORD)((ULONG_PTR)BaseAddress + TO_LINEAR(StackSegment, StackPointer)); + Stack = (LPWORD)SEG_OFF_TO_PTR(StackSegment, StackPointer); if (BopCode == EMULATOR_INT_BOP) { @@ -400,21 +400,21 @@ } } +VOID EmulatorSetRegister(ULONG Register, ULONG Value) +{ + if (Register < EMULATOR_REG_ES) + { + EmulatorContext.GeneralRegs[Register].Long = Value; + } + else + { + Fast486SetSegment(&EmulatorContext, Register - EMULATOR_REG_ES, (USHORT)Value); + } +} + ULONG EmulatorGetProgramCounter(VOID) { return EmulatorContext.InstPtr.Long; -} - -VOID EmulatorSetRegister(ULONG Register, ULONG Value) -{ - if (Register < EMULATOR_REG_ES) - { - EmulatorContext.GeneralRegs[Register].Long = Value; - } - else - { - Fast486SetSegment(&EmulatorContext, Register - EMULATOR_REG_ES, (USHORT)Value); - } } BOOLEAN EmulatorGetFlag(ULONG Flag)
11 years, 1 month
1
0
0
0
[hbelusca] 60775: [NTVDM]: DPRINT1 ReadConsoleInput failures (for debugging purposes) and remove an unneeded comment.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Oct 27 22:10:51 2013 New Revision: 60775 URL:
http://svn.reactos.org/svn/reactos?rev=60775&view=rev
Log: [NTVDM]: DPRINT1 ReadConsoleInput failures (for debugging purposes) and remove an unneeded comment. Modified: branches/ntvdm/subsystems/ntvdm/ps2.c Modified: branches/ntvdm/subsystems/ntvdm/ps2.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ps2.c?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/ps2.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/ps2.c [iso-8859-1] Sun Oct 27 22:10:51 2013 @@ -277,9 +277,9 @@ /* Wait for an input record */ if (!ReadConsoleInput(ConsoleInput, &InputRecord, 1, &Count)) { - DPRINT1("Error reading console input\n"); - return GetLastError(); - + DWORD LastError = GetLastError(); + DPRINT1("Error reading console input (0x%p, %lu) - Error %lu\n", ConsoleInput, Count, LastError); + return LastError; } ASSERT(Count != 0); @@ -300,8 +300,6 @@ KeyboardQueuePush(ScanCode); } - /* TODO: Update the keyboard shift status flags */ - /* Keyboard IRQ */ PicInterruptRequest(1);
11 years, 1 month
1
0
0
0
[hbelusca] 60774: [NTVDM]: Introduce the SEG_OFF_TO_PTR macro for code simplification purposes.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Oct 27 22:08:41 2013 New Revision: 60774 URL:
http://svn.reactos.org/svn/reactos?rev=60774&view=rev
Log: [NTVDM]: Introduce the SEG_OFF_TO_PTR macro for code simplification purposes. Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.h Modified: branches/ntvdm/subsystems/ntvdm/ntvdm.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ntvdm.h?…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/ntvdm.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/ntvdm.h [iso-8859-1] Sun Oct 27 22:08:41 2013 @@ -25,7 +25,10 @@ #define MAX_SEGMENT 0xFFFF #define MAX_OFFSET 0xFFFF #define MAX_ADDRESS TO_LINEAR(MAX_SEGMENT, MAX_OFFSET) -#define FAR_POINTER(x) ((ULONG_PTR)BaseAddress + TO_LINEAR(HIWORD(x), LOWORD(x))) + +#define FAR_POINTER(x) ((ULONG_PTR)BaseAddress + TO_LINEAR(HIWORD(x), LOWORD(x))) +#define SEG_OFF_TO_PTR(seg, off) ((ULONG_PTR)BaseAddress + TO_LINEAR((seg), (off))) + #define STEPS_PER_CYCLE 256 /* FUNCTIONS ******************************************************************/
11 years, 1 month
1
0
0
0
[aandrejevic] 60773: [NTVDM] The PS/2 should latch the last value that was read in the case of multiple reads. Modify the BIOS keyboard IRQ handler to support hooks.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Sun Oct 27 19:08:58 2013 New Revision: 60773 URL:
http://svn.reactos.org/svn/reactos?rev=60773&view=rev
Log: [NTVDM] The PS/2 should latch the last value that was read in the case of multiple reads. Modify the BIOS keyboard IRQ handler to support hooks. Modified: branches/ntvdm/subsystems/ntvdm/bios.c branches/ntvdm/subsystems/ntvdm/ps2.c Modified: branches/ntvdm/subsystems/ntvdm/bios.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios.c?r…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] Sun Oct 27 19:08:58 2013 @@ -1132,9 +1132,9 @@ { BYTE ScanCode, VirtualKey; WORD Character; - + /* Loop while there is a scancode available */ - while (KeyboardReadStatus() & 1) + do { /* Get the scan code and virtual key code */ ScanCode = KeyboardReadData(); @@ -1173,6 +1173,7 @@ BiosKeyboardMap[VirtualKey] &= ~(1 << 7); } } + while (KeyboardReadStatus() & 1); /* Clear the keyboard flags */ Bda->KeybdShiftFlags = 0; Modified: branches/ntvdm/subsystems/ntvdm/ps2.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ps2.c?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/ps2.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/ps2.c [iso-8859-1] Sun Oct 27 19:08:58 2013 @@ -20,7 +20,7 @@ static BOOLEAN KeyboardQueueEmpty = TRUE; static UINT KeyboardQueueStart = 0; static UINT KeyboardQueueEnd = 0; -static BYTE KeyboardResponse = 0; +static BYTE KeyboardData = 0, KeyboardResponse = 0; static BOOLEAN KeyboardReadResponse = FALSE, KeyboardWriteResponse = FALSE; static BYTE KeyboardConfig = PS2_DEFAULT_CONFIG; @@ -190,19 +190,19 @@ BYTE KeyboardReadData() { - BYTE Value = 0; - /* If there was a response byte from the controller, return it */ if (KeyboardReadResponse) { KeyboardReadResponse = FALSE; - return KeyboardResponse; - } - - /* Otherwise, read the data from the queue */ - KeyboardQueuePop(&Value); - - return Value; + KeyboardData = KeyboardResponse; + } + else + { + /* Otherwise, read the data from the queue */ + KeyboardQueuePop(&KeyboardData); + } + + return KeyboardData; } VOID KeyboardWriteData(BYTE Data)
11 years, 1 month
1
0
0
0
[aandrejevic] 60772: [NTVDM] Simplify BiosPeekCharacter. Implement DOS direct console I/O functions.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Sun Oct 27 16:34:27 2013 New Revision: 60772 URL:
http://svn.reactos.org/svn/reactos?rev=60772&view=rev
Log: [NTVDM] Simplify BiosPeekCharacter. Implement DOS direct console I/O functions. Modified: branches/ntvdm/subsystems/ntvdm/bios.c branches/ntvdm/subsystems/ntvdm/dos.c Modified: branches/ntvdm/subsystems/ntvdm/bios.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios.c?r…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] Sun Oct 27 16:34:27 2013 @@ -596,13 +596,9 @@ { WORD CharacterData; - /* Check if there is a key available */ - if (Bda->KeybdBufferHead == Bda->KeybdBufferTail) return 0xFFFF; - /* Get the key from the queue, but don't remove it */ - BiosKbdBufferTop(&CharacterData); - - return CharacterData; + if (BiosKbdBufferTop(&CharacterData)) return CharacterData; + else return 0xFFFF; } WORD BiosGetCharacter(VOID) @@ -1169,8 +1165,7 @@ } /* Push it onto the BIOS keyboard queue */ - BiosKbdBufferPush((ScanCode << 8) | (Character & 0xFF)); - + BiosKbdBufferPush(MAKEWORD(Character, ScanCode)); } else { Modified: branches/ntvdm/subsystems/ntvdm/dos.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/dos.c?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] Sun Oct 27 16:34:27 2013 @@ -1411,6 +1411,36 @@ break; } + /* Direct Console I/O */ + case 0x06: + { + BYTE Character = LOBYTE(Edx); + + if (Character != 0xFF) + { + /* Output */ + DosPrintCharacter(Character); + } + else + { + /* Input */ + Eax &= 0xFFFFFF00; + + if (DosCheckInput()) + { + Eax |= DosReadCharacter(); + Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_ZF; + } + else + { + /* No character available */ + Stack[STACK_FLAGS] |= EMULATOR_FLAG_ZF; + } + } + + break; + } + /* Read Character Without Echo */ case 0x07: case 0x08:
11 years, 1 month
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
33
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Results per page:
10
25
50
100
200