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
January 2011
----- 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
20 participants
336 discussions
Start a n
N
ew thread
[tkreuzer] 50374: [PING] Polish translation of ping. Patch by Olaf Siejka.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jan 12 20:05:06 2011 New Revision: 50374 URL:
http://svn.reactos.org/svn/reactos?rev=50374&view=rev
Log: [PING] Polish translation of ping. Patch by Olaf Siejka. Added: trunk/reactos/base/applications/network/ping/lang/pl-PL.rc (with props) Modified: trunk/reactos/base/applications/network/ping/ping.rc Added: trunk/reactos/base/applications/network/ping/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/pl-PL.rc (added) +++ trunk/reactos/base/applications/network/ping/lang/pl-PL.rc [iso-8859-1] Wed Jan 12 20:05:06 2011 @@ -1,0 +1,42 @@ +/* + * translated by Caemyr (Olaf Siejka) + * caemyr(a)gmail.com + * Jan, 2011 + */ + + +LANGUAGE LANG_POLISH, SUBLANG_DEFAULT + +STRINGTABLE DISCARDABLE +BEGIN + IDS_USAGE "\nSposób u¿ycia: ping [-t] [-n iloæ] [-l bajtów] [-w czas] host-docelowy\n\n" \ + "Opcje:\n" \ + " -t Pinguj wskazanego hosta w sposób ci¹g³y.\n" \ + " Aby przerwaæ - wcinij Control C.\n" \ + " -n iloæ Iloæ prób pingowania.\n" \ + " -l bajtów Rozmiar pakietu echo w bajtach .\n" \ + " -w czas Opónienie oczekiwanej odpowiedzi, w milisekundach.\n\n\0" + + IDS_PING_WITH_BYTES "\nPingowanie %1 [%2] przy u¿yciu %3!d! bajtów danych:\n\n\0" + IDS_PING_STATISTICS "\nStatystyka wyników badania hosta %1:\n\0" + IDS_PACKETS_SENT_RECEIVED_LOST " Pakiety: Wys³ane = %1!d!, Odebrane = %2!d!, Utracone = %3!d! (%4!d!%% strat),\n\0" + IDS_APPROXIMATE_ROUND_TRIP "Ca³kowity, przybli¿ony czas podró¿y pakietu w millisekundach:\n\0" + IDS_MIN_MAX_AVERAGE " Minimum = %1, Maksimum = %2, Uredniony = %3\n\0" + IDS_NOT_ENOUGH_RESOURCES "Brak dostêpnych zasobów.\n\0" + IDS_UNKNOWN_HOST "Nieznany host %1.\n\0" + IDS_SETSOCKOPT_FAILED "B³¹d w setsockopt (%1!d!).\n\0" + IDS_COULD_NOT_CREATE_SOCKET "B³¹d podczas tworzenia gniazda (#%1!d!).\n\0" + IDS_COULD_NOT_INIT_WINSOCK "B³¹d podczas inicjalizacji winsock dll.\n\0" + IDS_DEST_MUST_BE_SPECIFIED "Brak nazwy hosta b¹d adresu IP.\n\0" + IDS_BAD_PARAMETER "Nieprawid³owy parametr %1.\n\0" + IDS_BAD_OPTION_FORMAT "Nieprawid³owy format opcji %1.\n\0" + IDS_BAD_OPTION "Nieprawid³owa opcja %1.\n\0" + IDS_BAD_VALUE_OPTION_L "Nieprawid³owa wartoæ dla opcji -l, wymagana liczba naturalna od 0 do %1!d!.\n\0" + IDS_REPLY_FROM "Odpowied z %1: bajtów=%2!d! czas%3%4 TTL=%5!d!\n\0" + IDS_DEST_UNREACHABLE "Host docelowy nieosi¹galny.\n\0" + IDS_COULD_NOT_TRANSMIT "B³¹d podczas transmisji danych (%1!d!).\n\0" + IDS_COULD_NOT_RECV "B³¹d podczas odbioru danych (%1!d!).\n\0" + IDS_REQUEST_TIMEOUT "Brak odpowiedzi.\n\0" + IDS_MS "ms\0" + IDS_1MS "1ms\0" +END Propchange: trunk/reactos/base/applications/network/ping/lang/pl-PL.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/network/ping/ping.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/ping.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/ping.rc [iso-8859-1] Wed Jan 12 20:05:06 2011 @@ -8,5 +8,6 @@ #define REACTOS_STR_ORIGINAL_COPYRIGHT "Casper S. Hornstrup (chorns(a)users.sourceforge.net)\0" #include <reactos/version.rc> +#include "lang/de-DE.rc" #include "lang/en-US.rc" -#include "lang/de-DE.rc" +#include "lang/pl-PL.rc"
13 years, 11 months
1
0
0
0
[tkreuzer] 50373: [PING] Add German translation.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jan 12 17:12:09 2011 New Revision: 50373 URL:
http://svn.reactos.org/svn/reactos?rev=50373&view=rev
Log: [PING] Add German translation. Added: trunk/reactos/base/applications/network/ping/lang/de-DE.rc (with props) Modified: trunk/reactos/base/applications/network/ping/ping.rc Added: trunk/reactos/base/applications/network/ping/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/de-DE.rc (added) +++ trunk/reactos/base/applications/network/ping/lang/de-DE.rc [iso-8859-1] Wed Jan 12 17:12:09 2011 @@ -1,0 +1,35 @@ +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN + +STRINGTABLE DISCARDABLE +BEGIN + IDS_USAGE "\nSyntax: ping [-t] [-n Anzahl] [-l Größe] [-w Zeitlimit] Zielhost\n\n" \ + "Optionen:\n" \ + " -t Sendet forlaufend Pings an den angegebenen Host.\n" \ + " Drücken Sie STRG-C, um den Vorgang abzubrechen.\n" \ + " -n Anzahl Anzahl der Echoanforderungen, die gesendet werden.\n" \ + " -l Größe Größe des Sendepuffers.\n" \ + " -w Zeitlimit Zeitlimit in Millisekunden für eine Antwort.\n\n\0" + + IDS_PING_WITH_BYTES "\nPinging %1 [%2] with %3!d! bytes Data:\n\n\0" + IDS_PING_STATISTICS "\nPing Statistik für %1:\n\0" + IDS_PACKETS_SENT_RECEIVED_LOST " Packets: Gesendet = %1!d!, Empfangen = %2!d!, Verloren = %3!d! (%4!d!%% Verlust),\n\0" + IDS_APPROXIMATE_ROUND_TRIP "Durchschnittliche Antwortzeit in Millisekunden:\n\0" + IDS_MIN_MAX_AVERAGE " Minimum = %1, Maximum = %2, Durchschnitt = %3\n\0" + IDS_NOT_ENOUGH_RESOURCES "Nicht genügend freie Resourcen verfügbar.\n\0" + IDS_UNKNOWN_HOST "Unbekannter Host %1.\n\0" + IDS_SETSOCKOPT_FAILED "setsockopt ist fehlgeschlagen (%1!d!).\n\0" + IDS_COULD_NOT_CREATE_SOCKET "Konnte keinen Socket erzeugen (#%1!d!).\n\0" + IDS_COULD_NOT_INIT_WINSOCK "Die Winsock DLL konnte nicht initialisiert werden.\n\0" + IDS_DEST_MUST_BE_SPECIFIED "Name oderr IP-Address des Zielhostes muss angegeben werden.\n\0" + IDS_BAD_PARAMETER "Ungültiger Parameter %1.\n\0" + IDS_BAD_OPTION_FORMAT "Ungültiges Options-Format %1.\n\0" + IDS_BAD_OPTION "Ungültige Option %1.\n\0" + IDS_BAD_VALUE_OPTION_L "Ungültiger Wert für Option -l, Erlaubter Bereich ist von 0 bis %1!d!.\n\0" + IDS_REPLY_FROM "Antwort von %1: bytes=%2!d! time%3%4 TTL=%5!d!\n\0" + IDS_DEST_UNREACHABLE "Zielhost nicht erreichbar.\n\0" + IDS_COULD_NOT_TRANSMIT "Es konnten keine Daten gesendet werden (%1!d!).\n\0" + IDS_COULD_NOT_RECV "Es konnten keine Daten empfangen werden (%1!d!).\n\0" + IDS_REQUEST_TIMEOUT "Zeitüberschreitung der Anforderung.\n\0" + IDS_MS "ms\0" + IDS_1MS "1ms\0" +END Propchange: trunk/reactos/base/applications/network/ping/lang/de-DE.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/network/ping/ping.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/ping.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/ping.rc [iso-8859-1] Wed Jan 12 17:12:09 2011 @@ -1,7 +1,7 @@ /* $Id$ */ #include <windows.h> #include "resource.h" - + #define REACTOS_STR_FILE_DESCRIPTION "ReactOS TCP/IPv4 Win32 Ping\0" #define REACTOS_STR_INTERNAL_NAME "ping\0" #define REACTOS_STR_ORIGINAL_FILENAME "ping.exe\0" @@ -9,4 +9,4 @@ #include <reactos/version.rc> #include "lang/en-US.rc" - +#include "lang/de-DE.rc"
13 years, 11 months
1
0
0
0
[tkreuzer] 50372: [PING] Implement small helper MyLoadString, using FindResource, LoadResource, LockResource and replacing LoadString, so we don't need to link to user32 anymore.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jan 12 15:31:20 2011 New Revision: 50372 URL:
http://svn.reactos.org/svn/reactos?rev=50372&view=rev
Log: [PING] Implement small helper MyLoadString, using FindResource, LoadResource, LockResource and replacing LoadString, so we don't need to link to user32 anymore. Modified: trunk/reactos/base/applications/network/ping/ping.c trunk/reactos/base/applications/network/ping/ping.rbuild Modified: trunk/reactos/base/applications/network/ping/ping.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/ping.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/ping.c [iso-8859-1] Wed Jan 12 15:31:20 2011 @@ -109,6 +109,24 @@ } #endif /* !NDEBUG */ +LPWSTR +MyLoadString(UINT uID) +{ + HRSRC hres; + HGLOBAL hResData; + LPWSTR pwsz; + + hres = FindResourceW(NULL, MAKEINTRESOURCEW((LOWORD(uID) >> 4) + 1), RT_STRING); + if (!hres) return NULL; + + hResData = LoadResource(NULL, hres); + if (!hResData) return NULL; + + pwsz = LockResource(hResData); + if (!pwsz) return NULL; + return pwsz + 1; +} + void FormatOutput(UINT uID, ...) { va_list valist; @@ -121,8 +139,8 @@ va_start(valist, uID); - if(!LoadString(NULL, uID, (LPWSTR)&Format, 0)) - return; + Format = MyLoadString(uID); + if (!Format) return; DataLength = FormatMessage(FORMAT_MESSAGE_FROM_STRING, Format, 0, 0, Buf,\ sizeof(Buf) / sizeof(WCHAR), &valist); @@ -459,7 +477,7 @@ _i64tow(LargeTime.QuadPart, Convstr, 10); wcscpy(String, Convstr); - LoadString(NULL, IDS_MS, (LPWSTR)&ms, 0); + ms = MyLoadString(IDS_MS); wcscat(String, ms); } @@ -523,7 +541,7 @@ LPWSTR ms1; wcscpy(Sign, L"<"); - LoadString(NULL, IDS_1MS, (LPWSTR)&ms1, 0); + ms1 = MyLoadString(IDS_1MS); wcscpy(Time, ms1); } else Modified: trunk/reactos/base/applications/network/ping/ping.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/ping.rbuild [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/ping.rbuild [iso-8859-1] Wed Jan 12 15:31:20 2011 @@ -4,7 +4,6 @@ <include base="ping">.</include> <define name="__USE_W32_SOCKETS" /> <library>ws2_32</library> - <library>user32</library> <file>ping.c</file> <file>ping.rc</file> </module>
13 years, 11 months
1
0
0
0
[tkreuzer] 50371: [PING] Add localization support to ping. Patch by "none" (menone7 at gmail dot com) See issue #5500 for more details.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jan 12 14:57:22 2011 New Revision: 50371 URL:
http://svn.reactos.org/svn/reactos?rev=50371&view=rev
Log: [PING] Add localization support to ping. Patch by "none" (menone7 at gmail dot com) See issue #5500 for more details. Added: trunk/reactos/base/applications/network/ping/lang/ trunk/reactos/base/applications/network/ping/lang/en-US.rc (with props) trunk/reactos/base/applications/network/ping/resource.h (with props) Modified: trunk/reactos/base/applications/network/ping/ping.c trunk/reactos/base/applications/network/ping/ping.rbuild trunk/reactos/base/applications/network/ping/ping.rc Added: trunk/reactos/base/applications/network/ping/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/lang/en-US.rc (added) +++ trunk/reactos/base/applications/network/ping/lang/en-US.rc [iso-8859-1] Wed Jan 12 14:57:22 2011 @@ -1,0 +1,35 @@ +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +STRINGTABLE DISCARDABLE +BEGIN + IDS_USAGE "\nUsage: ping [-t] [-n count] [-l size] [-w timeout] destination-host\n\n" \ + "Options:\n" \ + " -t Ping the specified host until stopped.\n" \ + " To stop - type Control-C.\n" \ + " -n count Number of echo requests to send.\n" \ + " -l size Send buffer size.\n" \ + " -w timeout Timeout in milliseconds to wait for each reply.\n\n\0" + + IDS_PING_WITH_BYTES "\nPinging %1 [%2] with %3!d! bytes of data:\n\n\0" + IDS_PING_STATISTICS "\nPing statistics for %1:\n\0" + IDS_PACKETS_SENT_RECEIVED_LOST " Packets: Sent = %1!d!, Received = %2!d!, Lost = %3!d! (%4!d!%% loss),\n\0" + IDS_APPROXIMATE_ROUND_TRIP "Approximate round trip times in milli-seconds:\n\0" + IDS_MIN_MAX_AVERAGE " Minimum = %1, Maximum = %2, Average = %3\n\0" + IDS_NOT_ENOUGH_RESOURCES "Not enough free resources available.\n\0" + IDS_UNKNOWN_HOST "Unknown host %1.\n\0" + IDS_SETSOCKOPT_FAILED "setsockopt failed (%1!d!).\n\0" + IDS_COULD_NOT_CREATE_SOCKET "Could not create socket (#%1!d!).\n\0" + IDS_COULD_NOT_INIT_WINSOCK "Could not initialize winsock dll.\n\0" + IDS_DEST_MUST_BE_SPECIFIED "Name or IP address of destination host must be specified.\n\0" + IDS_BAD_PARAMETER "Bad parameter %1.\n\0" + IDS_BAD_OPTION_FORMAT "Bad option format %1.\n\0" + IDS_BAD_OPTION "Bad option %1.\n\0" + IDS_BAD_VALUE_OPTION_L "Bad value for option -l, valid range is from 0 to %1!d!.\n\0" + IDS_REPLY_FROM "Reply from %1: bytes=%2!d! time%3%4 TTL=%5!d!\n\0" + IDS_DEST_UNREACHABLE "Destination host unreachable.\n\0" + IDS_COULD_NOT_TRANSMIT "Could not transmit data (%1!d!).\n\0" + IDS_COULD_NOT_RECV "Could not receive data (%1!d!).\n\0" + IDS_REQUEST_TIMEOUT "Request timed out.\n\0" + IDS_MS "ms\0" + IDS_1MS "1ms\0" +END Propchange: trunk/reactos/base/applications/network/ping/lang/en-US.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/network/ping/ping.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/ping.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/ping.c [iso-8859-1] Wed Jan 12 14:57:22 2011 @@ -12,6 +12,7 @@ #include <stdarg.h> #include <string.h> #include <stdio.h> +#include "resource.h" #define NDEBUG @@ -67,10 +68,10 @@ ULONG TTLValue; ULONG TOSValue; ULONG Timeout; -CHAR TargetName[256]; +WCHAR TargetName[256]; SOCKET IcmpSock; SOCKADDR_IN Target; -LPSTR TargetIP; +WCHAR TargetIP[16]; FD_SET Fds; TIMEVAL Timeval; UINT CurrentSeqNum; @@ -85,6 +86,7 @@ LARGE_INTEGER TicksPerUs; /* Ticks per microsecond */ LARGE_INTEGER SentTime; BOOL UsePerformanceCounter; +HANDLE hStdOutput; #ifndef NDEBUG /* Display the contents of a buffer */ @@ -107,16 +109,47 @@ } #endif /* !NDEBUG */ +void FormatOutput(UINT uID, ...) +{ + va_list valist; + + WCHAR Buf[1024]; + LPWSTR pBuf = Buf; + LPWSTR Format; + DWORD written; + UINT DataLength; + + va_start(valist, uID); + + if(!LoadString(NULL, uID, (LPWSTR)&Format, 0)) + return; + + DataLength = FormatMessage(FORMAT_MESSAGE_FROM_STRING, Format, 0, 0, Buf,\ + sizeof(Buf) / sizeof(WCHAR), &valist); + + if(!DataLength) + { + if(GetLastError() != ERROR_INSUFFICIENT_BUFFER) + return; + + DataLength = FormatMessage(FORMAT_MESSAGE_FROM_STRING |\ + FORMAT_MESSAGE_ALLOCATE_BUFFER,\ + Format, 0, 0, (LPWSTR)&pBuf, 0, &valist); + + if(!DataLength) + return; + } + + WriteConsole(hStdOutput, pBuf, DataLength, &written, NULL); + + if(pBuf != Buf) + LocalFree(pBuf); +} + /* Display usage information on screen */ static VOID Usage(VOID) { - printf("\nUsage: ping [-t] [-n count] [-l size] [-w timeout] destination-host\n\n"); - printf("Options:\n"); - printf(" -t Ping the specified host until stopped.\n"); - printf(" To stop - type Control-C.\n"); - printf(" -n count Number of echo requests to send.\n"); - printf(" -l size Send buffer size.\n"); - printf(" -w timeout Timeout in milliseconds to wait for each reply.\n\n"); + FormatOutput(IDS_USAGE); } /* Reset configuration to default values */ @@ -157,26 +190,26 @@ } /* Return ULONG in a string */ -static ULONG GetULONG(LPSTR String) +static ULONG GetULONG(LPWSTR String) { UINT i, Length; ULONG Value; - LPSTR StopString; + LPWSTR StopString; i = 0; - Length = (UINT)_tcslen(String); - while ((i < Length) && ((String[i] < '0') || (String[i] > '9'))) i++; - if ((i >= Length) || ((String[i] < '0') || (String[i] > '9'))) + Length = (UINT)wcslen(String); + while ((i < Length) && ((String[i] < L'0') || (String[i] > L'9'))) i++; + if ((i >= Length) || ((String[i] < L'0') || (String[i] > L'9'))) { InvalidOption = TRUE; return 0; } - Value = strtoul(&String[i], &StopString, 10); + Value = wcstoul(&String[i], &StopString, 10); return Value; } /* Return ULONG in a string. Try next paramter if not successful */ -static ULONG GetULONG2(LPSTR String1, LPSTR String2, PINT i) +static ULONG GetULONG2(LPWSTR String1, LPWSTR String2, PINT i) { ULONG Value; @@ -184,7 +217,7 @@ if (InvalidOption) { InvalidOption = FALSE; - if (String2[0] != '-') + if (String2[0] != L'-') { Value = GetULONG(String2); if (!InvalidOption) @@ -196,7 +229,7 @@ } /* Parse command line parameters */ -static BOOL ParseCmdline(int argc, char* argv[]) +static BOOL ParseCmdline(int argc, LPWSTR argv[]) { INT i; BOOL ShowUsage; @@ -210,34 +243,35 @@ for (i = 1; i < argc; i++) { - if (argv[i][0] == '-') + if (argv[i][0] == L'-') { switch (argv[i][1]) { - case 't': NeverStop = TRUE; break; - case 'a': ResolveAddresses = TRUE; break; - case 'n': PingCount = GetULONG2(&argv[i][2], argv[i + 1], &i); break; - case 'l': + case L't': NeverStop = TRUE; break; + case L'a': ResolveAddresses = TRUE; break; + case L'n': PingCount = GetULONG2(&argv[i][2], argv[i + 1], &i); break; + case L'l': DataSize = GetULONG2(&argv[i][2], argv[i + 1], &i); if (DataSize > ICMP_MAXSIZE - sizeof(ICMP_ECHO_PACKET) - sizeof(IPv4_HEADER)) { - printf("Bad value for option -l, valid range is from 0 to %d.\n", - ICMP_MAXSIZE - (int)sizeof(ICMP_ECHO_PACKET) - (int)sizeof(IPv4_HEADER)); + FormatOutput(IDS_BAD_VALUE_OPTION_L, ICMP_MAXSIZE - \ + (int)sizeof(ICMP_ECHO_PACKET) - \ + (int)sizeof(IPv4_HEADER)); return FALSE; } break; - case 'f': DontFragment = TRUE; break; - case 'i': TTLValue = GetULONG2(&argv[i][2], argv[i + 1], &i); break; - case 'v': TOSValue = GetULONG2(&argv[i][2], argv[i + 1], &i); break; - case 'w': Timeout = GetULONG2(&argv[i][2], argv[i + 1], &i); break; + case L'f': DontFragment = TRUE; break; + case L'i': TTLValue = GetULONG2(&argv[i][2], argv[i + 1], &i); break; + case L'v': TOSValue = GetULONG2(&argv[i][2], argv[i + 1], &i); break; + case L'w': Timeout = GetULONG2(&argv[i][2], argv[i + 1], &i); break; default: - printf("Bad option %s.\n", argv[i]); + FormatOutput(IDS_BAD_OPTION, argv[i]); Usage(); return FALSE; } if (InvalidOption) { - printf("Bad option format %s.\n", argv[i]); + FormatOutput(IDS_BAD_OPTION_FORMAT, argv[i]); return FALSE; } } @@ -245,12 +279,12 @@ { if (FoundTarget) { - printf("Bad parameter %s.\n", argv[i]); + FormatOutput(IDS_BAD_PARAMETER, argv[i]); return FALSE; } else { - lstrcpy(TargetName, argv[i]); + wcscpy(TargetName, argv[i]); FoundTarget = TRUE; } } @@ -258,7 +292,7 @@ if ((!ShowUsage) && (!FoundTarget)) { - printf("Name or IP address of destination host must be specified.\n"); + FormatOutput(IDS_DEST_MUST_BE_SPECIFIED); return FALSE; } @@ -298,20 +332,21 @@ INT Status; ULONG Addr; PHOSTENT phe; + CHAR aTargetName[256]; wVersionRequested = MAKEWORD(2, 2); Status = WSAStartup(wVersionRequested, &WsaData); if (Status != 0) { - printf("Could not initialize winsock dll.\n"); + FormatOutput(IDS_COULD_NOT_INIT_WINSOCK); return FALSE; } IcmpSock = WSASocket(AF_INET, SOCK_RAW, IPPROTO_ICMP, NULL, 0, 0); if (IcmpSock == INVALID_SOCKET) { - printf("Could not create socket (#%d).\n", WSAGetLastError()); + FormatOutput(IDS_COULD_NOT_CREATE_SOCKET, WSAGetLastError()); return FALSE; } @@ -321,8 +356,8 @@ (const char *)&DontFragment, sizeof(DontFragment)) == SOCKET_ERROR) { - printf("setsockopt failed (%d).\n", WSAGetLastError()); - return FALSE; + FormatOutput(IDS_SETSOCKOPT_FAILED, WSAGetLastError()); + return FALSE; } if (setsockopt(IcmpSock, @@ -331,35 +366,44 @@ (const char *)&TTLValue, sizeof(TTLValue)) == SOCKET_ERROR) { - printf("setsockopt failed (%d).\n", WSAGetLastError()); - return FALSE; - } - + FormatOutput(IDS_SETSOCKOPT_FAILED, WSAGetLastError()); + return FALSE; + } + + + if(!WideCharToMultiByte(CP_ACP, 0, TargetName, -1, aTargetName,\ + sizeof(aTargetName), NULL, NULL)) + { + FormatOutput(IDS_UNKNOWN_HOST, TargetName); + return FALSE; + } ZeroMemory(&Target, sizeof(Target)); phe = NULL; - Addr = inet_addr(TargetName); + Addr = inet_addr(aTargetName); if (Addr == INADDR_NONE) { - phe = gethostbyname(TargetName); + phe = gethostbyname(aTargetName); if (phe == NULL) { - printf("Unknown host %s.\n", TargetName); + FormatOutput(IDS_UNKNOWN_HOST, TargetName); return FALSE; } - } - - if (phe != NULL) + CopyMemory(&Target.sin_addr, phe->h_addr, phe->h_length); + Target.sin_family = phe->h_addrtype; + } else + { Target.sin_addr.s_addr = Addr; - - if (phe != NULL) - Target.sin_family = phe->h_addrtype; - else Target.sin_family = AF_INET; - - TargetIP = inet_ntoa(Target.sin_addr); + } + + + swprintf(TargetIP, L"%d.%d.%d.%d", Target.sin_addr.S_un.S_un_b.s_b1,\ + Target.sin_addr.S_un.S_un_b.s_b2,\ + Target.sin_addr.S_un.S_un_b.s_b3,\ + Target.sin_addr.S_un.S_un_b.s_b4); CurrentSeqNum = 1; SentCount = 0; LostCount = 0; @@ -405,16 +449,18 @@ } } -static VOID TimeToMsString(LPSTR String, LARGE_INTEGER Time) -{ - CHAR Convstr[40]; +static VOID TimeToMsString(LPWSTR String, LARGE_INTEGER Time) +{ + WCHAR Convstr[40]; LARGE_INTEGER LargeTime; + LPWSTR ms; LargeTime.QuadPart = Time.QuadPart / TicksPerMs.QuadPart; - _i64toa(LargeTime.QuadPart, Convstr, 10); - strcpy(String, Convstr); - strcat(String, "ms"); + _i64tow(LargeTime.QuadPart, Convstr, 10); + wcscpy(String, Convstr); + LoadString(NULL, IDS_MS, (LPWSTR)&ms, 0); + wcscat(String, ms); } /* Locate the ICMP data and print it. Returns TRUE if the packet was good, @@ -424,10 +470,11 @@ PIPv4_HEADER IpHeader; PICMP_ECHO_PACKET Icmp; UINT IphLength; - CHAR Time[100]; + WCHAR Time[100]; LARGE_INTEGER RelativeTime; LARGE_INTEGER LargeTime; - CHAR Sign[2]; + WCHAR Sign[2]; + WCHAR wfromIP[16]; IpHeader = (PIPv4_HEADER)buffer; @@ -473,18 +520,27 @@ if ((RelativeTime.QuadPart / TicksPerMs.QuadPart) < 1) { - strcpy(Sign, "<"); - strcpy(Time, "1ms"); + LPWSTR ms1; + + wcscpy(Sign, L"<"); + LoadString(NULL, IDS_1MS, (LPWSTR)&ms1, 0); + wcscpy(Time, ms1); } else { - strcpy(Sign, "="); + wcscpy(Sign, L"="); TimeToMsString(Time, RelativeTime); } - printf("Reply from %s: bytes=%d time%s%s TTL=%d\n", inet_ntoa(from->sin_addr), - size - IphLength - (int)sizeof(ICMP_ECHO_PACKET), Sign, Time, IpHeader->TTL); + swprintf(wfromIP, L"%d.%d.%d.%d", from->sin_addr.S_un.S_un_b.s_b1,\ + from->sin_addr.S_un.S_un_b.s_b2,\ + from->sin_addr.S_un.S_un_b.s_b3,\ + from->sin_addr.S_un.S_un_b.s_b4); + FormatOutput(IDS_REPLY_FROM, wfromIP,\ + size - IphLength - (int)sizeof(ICMP_ECHO_PACKET),\ + Sign, Time, IpHeader->TTL); + if (RelativeTime.QuadPart < MinRTT.QuadPart || !MinRTTSet) { MinRTT.QuadPart = RelativeTime.QuadPart; @@ -513,7 +569,7 @@ Buffer = GlobalAlloc(0, Size); if (!Buffer) { - printf("Not enough free resources available.\n"); + FormatOutput(IDS_NOT_ENOUGH_RESOURCES); return FALSE; } @@ -556,9 +612,9 @@ if (Status == SOCKET_ERROR) { if (WSAGetLastError() == WSAEHOSTUNREACH) - printf("Destination host unreachable.\n"); + FormatOutput(IDS_DEST_UNREACHABLE); else - printf("Could not transmit data (%d).\n", WSAGetLastError()); + FormatOutput(IDS_COULD_NOT_TRANSMIT, WSAGetLastError()); GlobalFree(Buffer); return FALSE; } @@ -588,7 +644,7 @@ { if (WSAGetLastError() != WSAETIMEDOUT) { - printf("Could not receive data (%d).\n", WSAGetLastError()); + FormatOutput(IDS_COULD_NOT_RECV, WSAGetLastError()); GlobalFree(Buffer); return FALSE; } @@ -597,7 +653,7 @@ if (Status == 0) { - printf("Request timed out.\n"); + FormatOutput(IDS_REQUEST_TIMEOUT); GlobalFree(Buffer); return TRUE; } @@ -610,20 +666,21 @@ /* Program entry point */ -int main(int argc, char* argv[]) +int wmain(int argc, LPWSTR argv[]) { UINT Count; - CHAR MinTime[20]; - CHAR MaxTime[20]; - CHAR AvgTime[20]; + WCHAR MinTime[20]; + WCHAR MaxTime[20]; + WCHAR AvgTime[20]; + + hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE); Reset(); if ((ParseCmdline(argc, argv)) && (Setup())) { - printf("\nPinging %s [%s] with %d bytes of data:\n\n", - TargetName, TargetIP, DataSize); + FormatOutput(IDS_PING_WITH_BYTES, TargetName, TargetIP, DataSize); Count = 0; while ((NeverStop) || (Count < PingCount)) @@ -653,15 +710,15 @@ TimeToMsString(AvgTime, AvgRTT); /* Print statistics */ - printf("\nPing statistics for %s:\n", TargetIP); - printf(" Packets: Sent = %d, Received = %d, Lost = %d (%d%% loss),\n", - SentCount, SentCount - LostCount, LostCount, Count); + FormatOutput(IDS_PING_STATISTICS, TargetIP); + FormatOutput(IDS_PACKETS_SENT_RECEIVED_LOST,\ + SentCount, SentCount - LostCount, LostCount, Count); + /* Print approximate times or NO approximate times if 100% loss */ if ((SentCount - LostCount) > 0) { - printf("Approximate round trip times in milli-seconds:\n"); - printf(" Minimum = %s, Maximum = %s, Average = %s\n", - MinTime, MaxTime, AvgTime); + FormatOutput(IDS_APPROXIMATE_ROUND_TRIP); + FormatOutput(IDS_MIN_MAX_AVERAGE, MinTime, MaxTime, AvgTime); } } return 0; Modified: trunk/reactos/base/applications/network/ping/ping.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/ping.rbuild [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/ping.rbuild [iso-8859-1] Wed Jan 12 14:57:22 2011 @@ -1,9 +1,10 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd"> -<module name="ping" type="win32cui" installbase="system32" installname="ping.exe"> +<module name="ping" type="win32cui" installbase="system32" installname="ping.exe" unicode="true"> <include base="ping">.</include> <define name="__USE_W32_SOCKETS" /> <library>ws2_32</library> + <library>user32</library> <file>ping.c</file> <file>ping.rc</file> </module> Modified: trunk/reactos/base/applications/network/ping/ping.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/ping.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/ping/ping.rc [iso-8859-1] Wed Jan 12 14:57:22 2011 @@ -1,7 +1,12 @@ /* $Id$ */ +#include <windows.h> +#include "resource.h" + +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS TCP/IPv4 Win32 Ping\0" +#define REACTOS_STR_INTERNAL_NAME "ping\0" +#define REACTOS_STR_ORIGINAL_FILENAME "ping.exe\0" +#define REACTOS_STR_ORIGINAL_COPYRIGHT "Casper S. Hornstrup (chorns(a)users.sourceforge.net)\0" +#include <reactos/version.rc> -#define REACTOS_STR_FILE_DESCRIPTION "ReactOS TCP/IPv4 Win32 Ping\0" -#define REACTOS_STR_INTERNAL_NAME "ping\0" -#define REACTOS_STR_ORIGINAL_FILENAME "ping.exe\0" -#define REACTOS_STR_ORIGINAL_COPYRIGHT "Casper S. Hornstrup (chorns(a)users.sourceforge.net)\0" -#include <reactos/version.rc> +#include "lang/en-US.rc" + Added: trunk/reactos/base/applications/network/ping/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/ping/resource.h (added) +++ trunk/reactos/base/applications/network/ping/resource.h [iso-8859-1] Wed Jan 12 14:57:22 2011 @@ -1,0 +1,24 @@ +#define IDS_USAGE 0 +#define IDS_PING_WITH_BYTES 1 +#define IDS_PING_STATISTICS 2 +#define IDS_PACKETS_SENT_RECEIVED_LOST 3 +#define IDS_APPROXIMATE_ROUND_TRIP 4 +#define IDS_MIN_MAX_AVERAGE 5 +#define IDS_NOT_ENOUGH_RESOURCES 6 +#define IDS_UNKNOWN_HOST 7 +#define IDS_SETSOCKOPT_FAILED 8 +#define IDS_COULD_NOT_CREATE_SOCKET 9 +#define IDS_COULD_NOT_INIT_WINSOCK 10 +#define IDS_DEST_MUST_BE_SPECIFIED 11 +#define IDS_BAD_PARAMETER 12 +#define IDS_BAD_OPTION_FORMAT 13 +#define IDS_BAD_OPTION 14 +#define IDS_BAD_VALUE_OPTION_L 15 +#define IDS_REPLY_FROM 16 +#define IDS_DEST_UNREACHABLE 17 +#define IDS_COULD_NOT_TRANSMIT 18 +#define IDS_COULD_NOT_RECV 19 +#define IDS_REQUEST_TIMEOUT 20 +#define IDS_MS 21 +#define IDS_1MS 22 + Propchange: trunk/reactos/base/applications/network/ping/resource.h ------------------------------------------------------------------------------ svn:eol-style = native
13 years, 11 months
1
0
0
0
[tkreuzer] 50370: [WIN32K] Reset monitor size after mode switch. patch by rafalh <rafalh1992 at o2 dor pl> See issue #5727 for more details.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jan 12 14:02:54 2011 New Revision: 50370 URL:
http://svn.reactos.org/svn/reactos?rev=50370&view=rev
Log: [WIN32K] Reset monitor size after mode switch. patch by rafalh <rafalh1992 at o2 dor pl> See issue #5727 for more details. Modified: trunk/reactos/subsystems/win32/win32k/include/monitor.h trunk/reactos/subsystems/win32/win32k/ntuser/display.c trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c Modified: trunk/reactos/subsystems/win32/win32k/include/monitor.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/monitor.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/monitor.h [iso-8859-1] Wed Jan 12 14:02:54 2011 @@ -40,6 +40,7 @@ NTSTATUS IntAttachMonitor(PDEVOBJ *pGdiDevice, ULONG DisplayNumber); NTSTATUS IntDetachMonitor(PDEVOBJ *pGdiDevice); +NTSTATUS IntResetMonitorSize(IN PDEVOBJ *pGdiDevice); PMONITOR FASTCALL UserGetMonitorObject(IN HMONITOR); PMONITOR FASTCALL IntGetPrimaryMonitor(VOID); Modified: trunk/reactos/subsystems/win32/win32k/ntuser/display.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] Wed Jan 12 14:02:54 2011 @@ -765,6 +765,9 @@ //IntvGetDeviceCaps(&PrimarySurface, &GdiHandleTable->DevCaps); + /* Set new size of the monitor */ + IntResetMonitorSize(ppdev); + /* Remove all cursor clipping */ UserClipCursor(NULL); Modified: trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c [iso-8859-1] Wed Jan 12 14:02:54 2011 @@ -246,6 +246,51 @@ return STATUS_SUCCESS; } +/* IntResetMonitorSize + * + * Reset size of the monitor using atached device + * + * Arguments + * + * PMONITOR + * pGdiDevice Pointer to the PDEVOBJ, which size has changed + * + * Return value + * Returns a NTSTATUS + */ +NTSTATUS +IntResetMonitorSize(IN PDEVOBJ *pGdiDevice) +{ + PMONITOR Monitor; + + for (Monitor = gMonitorList; Monitor != NULL; Monitor = Monitor->Next) + { + if (Monitor->GdiDevice == pGdiDevice) + break; + } + + if (Monitor == NULL) + { + /* no monitor for given device found */ + return STATUS_INVALID_PARAMETER; + } + + Monitor->rcMonitor.left = 0; + Monitor->rcMonitor.top = 0; + Monitor->rcMonitor.right = Monitor->rcMonitor.left + Monitor->GdiDevice->gdiinfo.ulHorzRes; + Monitor->rcMonitor.bottom = Monitor->rcMonitor.top + Monitor->GdiDevice->gdiinfo.ulVertRes; + Monitor->rcWork = Monitor->rcMonitor; + + if (Monitor->hrgnMonitor) + REGION_FreeRgnByHandle(Monitor->hrgnMonitor); + + Monitor->hrgnMonitor = IntSysCreateRectRgnIndirect( &Monitor->rcMonitor ); + + IntGdiSetRegionOwner(Monitor->hrgnMonitor, GDI_OBJ_HMGR_PUBLIC); + + return STATUS_SUCCESS; +} + /* IntGetPrimaryMonitor * * Returns a PMONITOR for the primary monitor
13 years, 11 months
1
0
0
0
[tkreuzer] 50369: [NTOSKRNL] Remove broken definition of SharedUserdata and use correct SharedUserData instead. Fixes a crash on real Hardware. Patch by Daniel Zimmermann (netzimme at googlemail do...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jan 12 13:40:34 2011 New Revision: 50369 URL:
http://svn.reactos.org/svn/reactos?rev=50369&view=rev
Log: [NTOSKRNL] Remove broken definition of SharedUserdata and use correct SharedUserData instead. Fixes a crash on real Hardware. Patch by Daniel Zimmermann (netzimme at googlemail dot com) See issue #5650 for more details. Modified: trunk/reactos/include/ndk/ketypes.h trunk/reactos/ntoskrnl/ps/psmgr.c Modified: trunk/reactos/include/ndk/ketypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/ketypes.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/ketypes.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/ketypes.h [iso-8859-1] Wed Jan 12 13:40:34 2011 @@ -118,7 +118,6 @@ #define DISPATCH_LENGTH 106 #endif -#define SharedUserdata ((KUSER_SHARED_DATA *CONST)(USER_SHARED_DATA|KSEG0_BASE)) #else // Modified: trunk/reactos/ntoskrnl/ps/psmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/psmgr.c?rev=50…
============================================================================== --- trunk/reactos/ntoskrnl/ps/psmgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ps/psmgr.c [iso-8859-1] Wed Jan 12 13:40:34 2011 @@ -212,7 +212,7 @@ if (KeFeatureBits & KF_FAST_SYSCALL) { /* Get user-mode sysenter stub */ - SharedUserdata->SystemCall = (PsNtosImageBase >> (PAGE_SHIFT + 1)); + SharedUserData->SystemCall = (PsNtosImageBase >> (PAGE_SHIFT + 1)); Status = PspLookupSystemDllEntryPoint("KiFastSystemCall", (PVOID)&SharedUserData-> SystemCall);
13 years, 11 months
1
0
0
0
[tkreuzer] 50368: [EXPLORER_NEW] Open a context menu, when a task is right clicked. Patch by greenie (greenie__ at hotmail dot com) See issue #4671 for more details.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jan 12 13:22:12 2011 New Revision: 50368 URL:
http://svn.reactos.org/svn/reactos?rev=50368&view=rev
Log: [EXPLORER_NEW] Open a context menu, when a task is right clicked. Patch by greenie (greenie__ at hotmail dot com) See issue #4671 for more details. Modified: trunk/reactos/base/shell/explorer-new/taskswnd.c Modified: trunk/reactos/base/shell/explorer-new/taskswnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/ta…
============================================================================== --- trunk/reactos/base/shell/explorer-new/taskswnd.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/taskswnd.c [iso-8859-1] Wed Jan 12 13:22:12 2011 @@ -1715,6 +1715,64 @@ return FALSE; } + +static VOID +TaskSwitchWnd_HandleTaskItemRightClick(IN OUT PTASK_SWITCH_WND This, + IN OUT PTASK_ITEM TaskItem) +{ + + HMENU hmenu = GetSystemMenu(TaskItem->hWnd, FALSE); + + if (hmenu) { + POINT pt; + GetCursorPos(&pt); + int cmd = TrackPopupMenu(hmenu, TPM_LEFTBUTTON|TPM_RIGHTBUTTON|TPM_RETURNCMD, pt.x, pt.y, 0, This->hWndToolbar, NULL); + if (cmd) { + SetForegroundWindow(TaskItem->hWnd); // reactivate window after the context menu has closed + PostMessage(TaskItem->hWnd, WM_SYSCOMMAND, cmd, 0); + } + } +} + +static VOID +TaskSwitchWnd_HandleTaskGroupRightClick(IN OUT PTASK_SWITCH_WND This, + IN OUT PTASK_GROUP TaskGroup) +{ + /* TODO: Show task group right click menu */ +} + +static BOOL +TaskSwitchWnd_HandleButtonRightClick(IN OUT PTASK_SWITCH_WND This, + IN WORD wIndex) +{ + PTASK_ITEM TaskItem; + PTASK_GROUP TaskGroup; + if (This->IsGroupingEnabled) + { + TaskGroup = FindTaskGroupByIndex(This, + (INT)wIndex); + if (TaskGroup != NULL && TaskGroup->IsCollapsed) + { + TaskSwitchWnd_HandleTaskGroupRightClick(This, + TaskGroup); + return TRUE; + } + } + + TaskItem = FindTaskItemByIndex(This, + (INT)wIndex); + + if (TaskItem != NULL) + { + TaskSwitchWnd_HandleTaskItemRightClick(This, + TaskItem); + return TRUE; + } + + return FALSE; +} + + static LRESULT TaskSwichWnd_HandleItemPaint(IN OUT PTASK_SWITCH_WND This, IN OUT NMTBCUSTOMDRAW *nmtbcd) @@ -2001,7 +2059,8 @@ (LPARAM)&pt); if (iBtn >= 0) { - /* FIXME: Display the system menu of the window */ + TaskSwitchWnd_HandleButtonRightClick(This, + iBtn); } else goto ForwardContextMenuMsg;
13 years, 11 months
1
0
0
0
[tkreuzer] 50367: [EXPLORER_NEW] Provide the ability to query version info (needed for task grouping). Patch by DavidErceg <dave_154@hotmail.com> See issue #4386 for more details.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jan 12 13:12:00 2011 New Revision: 50367 URL:
http://svn.reactos.org/svn/reactos?rev=50367&view=rev
Log: [EXPLORER_NEW] Provide the ability to query version info (needed for task grouping). Patch by DavidErceg <dave_154(a)hotmail.com> See issue #4386 for more details. Modified: trunk/reactos/base/shell/explorer-new/explorer.c trunk/reactos/base/shell/explorer-new/explorer.rbuild Modified: trunk/reactos/base/shell/explorer-new/explorer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/ex…
============================================================================== --- trunk/reactos/base/shell/explorer-new/explorer.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/explorer.c [iso-8859-1] Wed Jan 12 13:12:00 2011 @@ -26,6 +26,12 @@ HKEY hkExplorer = NULL; DRAWCAPTEMP DrawCapTemp = NULL; +typedef struct _LANGCODEPAGE +{ + WORD wLanguage; + WORD wCodePage; +} LANGCODEPAGE, *PLANGCODEPAGE; + /* undoc GUID */ DEFINE_GUID(CLSID_RebarBandSite, 0xECD4FC4D, 0x521C, 0x11D0, 0xB7, 0x92, 0x00, 0xA0, 0xC9, 0x03, 0x12, 0xE1); @@ -270,6 +276,80 @@ return FALSE; } +BOOL +GetVersionInfoString(IN TCHAR *szFileName, + IN TCHAR *szVersionInfo, + OUT TCHAR *szBuffer, + IN UINT cbBufLen) +{ + LPVOID lpData = NULL; + TCHAR szSubBlock[128]; + TCHAR *lpszLocalBuf = NULL; + LANGID UserLangId; + PLANGCODEPAGE lpTranslate = NULL; + DWORD dwLen; + DWORD dwHandle; + UINT cbTranslate; + UINT cbLen; + BOOL bRet = FALSE; + unsigned int i; + + dwLen = GetFileVersionInfoSize(szFileName,&dwHandle); + + if (dwLen > 0) + { + lpData = HeapAlloc(hProcessHeap,0,dwLen); + + if (lpData != NULL) + { + if (GetFileVersionInfo(szFileName, + 0, + dwLen, + lpData) != 0) + { + UserLangId = GetUserDefaultLangID(); + + VerQueryValue(lpData, + TEXT("\\VarFileInfo\\Translation"), + (LPVOID *)&lpTranslate, + &cbTranslate); + + for (i = 0;i < (cbTranslate / sizeof(LANGCODEPAGE));i++) + { + /* If the bottom eight bits of the language id's + match, use this version information (since this + means that the version information and the users + default language are the same). */ + if ((lpTranslate[i].wLanguage & 0xFF) == + (UserLangId & 0xFF)) + { + wnsprintf(szSubBlock, + sizeof(szSubBlock) / sizeof(szSubBlock[0]), + TEXT("\\StringFileInfo\\%04X%04X\\%s"), + lpTranslate[i].wLanguage, + lpTranslate[i].wCodePage,szVersionInfo); + + if (VerQueryValue(lpData, + szSubBlock, + (LPVOID *)&lpszLocalBuf, + &cbLen) != 0) + { + wcsncpy(szBuffer,lpszLocalBuf,cbBufLen); + + bRet = TRUE; + break; + } + } + } + } + HeapFree(hProcessHeap,0,lpData); + lpData = NULL; + } + } + + return bRet; +} + INT WINAPI _tWinMain(IN HINSTANCE hInstance, IN HINSTANCE hPrevInstance, Modified: trunk/reactos/base/shell/explorer-new/explorer.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/ex…
============================================================================== --- trunk/reactos/base/shell/explorer-new/explorer.rbuild [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/explorer.rbuild [iso-8859-1] Wed Jan 12 13:12:00 2011 @@ -12,6 +12,7 @@ <library>shell32</library> <library>shlwapi</library> <library>uuid</library> + <library>version</library> <pch>precomp.h</pch> <file>desktop.c</file> <file>dragdrop.c</file>
13 years, 11 months
1
0
0
0
[gadamopoulos] 50366: fix build... err, implement shared memory for dcs between win32k and winent
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Wed Jan 12 12:50:22 2011 New Revision: 50366 URL:
http://svn.reactos.org/svn/reactos?rev=50366&view=rev
Log: fix build... err, implement shared memory for dcs between win32k and winent Added: branches/arwinss/reactos/dll/win32/winent.drv/gdiobj.c (with props) Modified: branches/arwinss/reactos/dll/win32/winent.drv/bitblt.c branches/arwinss/reactos/dll/win32/winent.drv/dib.c branches/arwinss/reactos/dll/win32/winent.drv/font.c branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c branches/arwinss/reactos/dll/win32/winent.drv/graphics.c branches/arwinss/reactos/dll/win32/winent.drv/ogldrv.c branches/arwinss/reactos/dll/win32/winent.drv/winent.h branches/arwinss/reactos/dll/win32/winent.drv/winent.rbuild branches/arwinss/reactos/include/reactos/win32k/ntgdihdl.h branches/arwinss/reactos/include/reactos/wine/ntrosgdi.h branches/arwinss/reactos/subsystems/win32/win32k/eng/device.c branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c branches/arwinss/reactos/subsystems/win32/win32k/include/dc.h branches/arwinss/reactos/subsystems/win32/win32k/main/init.c branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild Modified: branches/arwinss/reactos/dll/win32/winent.drv/bitblt.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
============================================================================== --- branches/arwinss/reactos/dll/win32/winent.drv/bitblt.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winent.drv/bitblt.c [iso-8859-1] Wed Jan 12 12:50:22 2011 @@ -16,7 +16,7 @@ /* FUNCTIONS **************************************************************/ -BOOL CDECL RosDrv_PatBlt( NTDRV_PDEVICE *physDev, INT left, INT top, INT width, INT height, DWORD rop ) +BOOL CDECL RosDrv_PatBlt( PDC_ATTR pdcattr, INT left, INT top, INT width, INT height, DWORD rop ) { POINT pts[2], ptBrush; @@ -26,94 +26,94 @@ pts[1].x = left + width; pts[1].y = top + height; - LPtoDP(physDev->hdc, pts, 2); + LPtoDP(pdcattr->hdc, pts, 2); width = pts[1].x - pts[0].x; height = pts[1].y - pts[0].y; - left = pts[0].x + physDev->dc_rect.left; - top = pts[0].y + physDev->dc_rect.top; + left = pts[0].x + pdcattr->dc_rect.left; + top = pts[0].y + pdcattr->dc_rect.top; /* Update brush origin */ - GetBrushOrgEx(physDev->hdc, &ptBrush); - ptBrush.x += physDev->dc_rect.left; - ptBrush.y += physDev->dc_rect.top; - RosGdiSetBrushOrg(physDev->hKernelDC, ptBrush.x, ptBrush.y); + GetBrushOrgEx(pdcattr->hdc, &ptBrush); + ptBrush.x += pdcattr->dc_rect.left; + ptBrush.y += pdcattr->dc_rect.top; + RosGdiSetBrushOrg(pdcattr->hKernelDC, ptBrush.x, ptBrush.y); - return RosGdiPatBlt(physDev->hKernelDC, left, top, width, height, rop); + return RosGdiPatBlt(pdcattr->hKernelDC, left, top, width, height, rop); } -BOOL CDECL RosDrv_BitBlt( NTDRV_PDEVICE *physDevDst, INT xDst, INT yDst, - INT width, INT height, NTDRV_PDEVICE *physDevSrc, +BOOL CDECL RosDrv_BitBlt( PDC_ATTR pdcattrDst, INT xDst, INT yDst, + INT width, INT height, PDC_ATTR pdcattrSrc, INT xSrc, INT ySrc, DWORD rop ) { BOOL useSrc; POINT pts[2], ptBrush; useSrc = (((rop >> 2) & 0x330000) != (rop & 0x330000)); - if (!physDevSrc && useSrc) return FALSE; + if (!pdcattrSrc && useSrc) return FALSE; /* Forward to PatBlt if src dev is missing */ - if (!physDevSrc) - return RosDrv_PatBlt(physDevDst, xDst, yDst, width, height, rop); + if (!pdcattrSrc) + return RosDrv_PatBlt(pdcattrDst, xDst, yDst, width, height, rop); /* map source coordinates */ - if (physDevSrc) + if (pdcattrSrc) { pts[0].x = xSrc; pts[0].y = ySrc; pts[1].x = xSrc + width; pts[1].y = ySrc + height; - LPtoDP(physDevSrc->hdc, pts, 2); + LPtoDP(pdcattrSrc->hdc, pts, 2); width = pts[1].x - pts[0].x; height = pts[1].y - pts[0].y; - xSrc = pts[0].x + physDevSrc->dc_rect.left; - ySrc = pts[0].y + physDevSrc->dc_rect.top; + xSrc = pts[0].x + pdcattrSrc->dc_rect.left; + ySrc = pts[0].y + pdcattrSrc->dc_rect.top; } /* map dest coordinates */ pts[0].x = xDst; pts[0].y = yDst; - LPtoDP(physDevDst->hdc, pts, 1); - xDst = pts[0].x + physDevDst->dc_rect.left; - yDst = pts[0].y + physDevDst->dc_rect.top; + LPtoDP(pdcattrDst->hdc, pts, 1); + xDst = pts[0].x + pdcattrDst->dc_rect.left; + yDst = pts[0].y + pdcattrDst->dc_rect.top; /* Update brush origin */ - GetBrushOrgEx(physDevDst->hdc, &ptBrush); - ptBrush.x += physDevDst->dc_rect.left; - ptBrush.y += physDevDst->dc_rect.top; - RosGdiSetBrushOrg(physDevDst->hKernelDC, ptBrush.x, ptBrush.y); + GetBrushOrgEx(pdcattrDst->hdc, &ptBrush); + ptBrush.x += pdcattrDst->dc_rect.left; + ptBrush.y += pdcattrDst->dc_rect.top; + RosGdiSetBrushOrg(pdcattrDst->hKernelDC, ptBrush.x, ptBrush.y); //FIXME("xDst %d, yDst %d, widthDst %d, heightDst %d, src x %d y %d\n", // xDst, yDst, width, height, xSrc, ySrc); - return RosGdiBitBlt(physDevDst->hKernelDC, xDst, yDst, width, height, - physDevSrc->hKernelDC, xSrc, ySrc, rop); + return RosGdiBitBlt(pdcattrDst->hKernelDC, xDst, yDst, width, height, + pdcattrSrc->hKernelDC, xSrc, ySrc, rop); } -BOOL CDECL RosDrv_StretchBlt( NTDRV_PDEVICE *physDevDst, INT xDst, INT yDst, +BOOL CDECL RosDrv_StretchBlt( PDC_ATTR pdcattrDst, INT xDst, INT yDst, INT widthDst, INT heightDst, - NTDRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc, + PDC_ATTR pdcattrSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, DWORD rop ) { BOOL useSrc; POINT pts[2], ptBrush; useSrc = (((rop >> 2) & 0x330000) != (rop & 0x330000)); - if (!physDevSrc && useSrc) return FALSE; + if (!pdcattrSrc && useSrc) return FALSE; /* map source coordinates */ - if (physDevSrc) + if (pdcattrSrc) { pts[0].x = xSrc; pts[0].y = ySrc; pts[1].x = xSrc + widthSrc; pts[1].y = ySrc + heightSrc; - LPtoDP(physDevSrc->hdc, pts, 2); + LPtoDP(pdcattrSrc->hdc, pts, 2); widthSrc = pts[1].x - pts[0].x; heightSrc = pts[1].y - pts[0].y; - xSrc = pts[0].x + physDevSrc->dc_rect.left; - ySrc = pts[0].y + physDevSrc->dc_rect.top; + xSrc = pts[0].x + pdcattrSrc->dc_rect.left; + ySrc = pts[0].y + pdcattrSrc->dc_rect.top; } /* map dest coordinates */ @@ -121,41 +121,41 @@ pts[0].y = yDst; pts[1].x = xDst + widthDst; pts[1].y = yDst + heightDst; - LPtoDP(physDevDst->hdc, pts, 2); + LPtoDP(pdcattrDst->hdc, pts, 2); widthDst = pts[1].x - pts[0].x; heightDst = pts[1].y - pts[0].y; - xDst = pts[0].x + physDevDst->dc_rect.left; - yDst = pts[0].y + physDevDst->dc_rect.top; + xDst = pts[0].x + pdcattrDst->dc_rect.left; + yDst = pts[0].y + pdcattrDst->dc_rect.top; /* Update brush origin */ - GetBrushOrgEx(physDevDst->hdc, &ptBrush); - ptBrush.x += physDevDst->dc_rect.left; - ptBrush.y += physDevDst->dc_rect.top; - RosGdiSetBrushOrg(physDevDst->hKernelDC, ptBrush.x, ptBrush.y); + GetBrushOrgEx(pdcattrDst->hdc, &ptBrush); + ptBrush.x += pdcattrDst->dc_rect.left; + ptBrush.y += pdcattrDst->dc_rect.top; + RosGdiSetBrushOrg(pdcattrDst->hKernelDC, ptBrush.x, ptBrush.y); - return RosGdiStretchBlt(physDevDst->hKernelDC, xDst, yDst, widthDst, heightDst, - physDevSrc->hKernelDC, xSrc, ySrc, widthSrc, heightSrc, rop); + return RosGdiStretchBlt(pdcattrDst->hKernelDC, xDst, yDst, widthDst, heightDst, + pdcattrSrc->hKernelDC, xSrc, ySrc, widthSrc, heightSrc, rop); } -BOOL CDECL RosDrv_AlphaBlend(NTDRV_PDEVICE *physDevDst, INT xDst, INT yDst, INT widthDst, INT heightDst, - NTDRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, +BOOL CDECL RosDrv_AlphaBlend(PDC_ATTR pdcattrDst, INT xDst, INT yDst, INT widthDst, INT heightDst, + PDC_ATTR pdcattrSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, BLENDFUNCTION blendfn) { POINT pts[2], ptBrush; /* map source coordinates */ - if (physDevSrc) + if (pdcattrSrc) { pts[0].x = xSrc; pts[0].y = ySrc; pts[1].x = xSrc + widthSrc; pts[1].y = ySrc + heightSrc; - LPtoDP(physDevSrc->hdc, pts, 2); + LPtoDP(pdcattrSrc->hdc, pts, 2); widthSrc = pts[1].x - pts[0].x; heightSrc = pts[1].y - pts[0].y; - xSrc = pts[0].x + physDevSrc->dc_rect.left; - ySrc = pts[0].y + physDevSrc->dc_rect.top; + xSrc = pts[0].x + pdcattrSrc->dc_rect.left; + ySrc = pts[0].y + pdcattrSrc->dc_rect.top; } /* map dest coordinates */ @@ -164,20 +164,20 @@ pts[1].x = xDst + widthDst; pts[1].y = yDst + heightDst; - LPtoDP(physDevDst->hdc, pts, 2); + LPtoDP(pdcattrDst->hdc, pts, 2); widthDst = pts[1].x - pts[0].x; heightDst = pts[1].y - pts[0].y; - xDst = pts[0].x + physDevDst->dc_rect.left; - yDst = pts[0].y + physDevDst->dc_rect.top; + xDst = pts[0].x + pdcattrDst->dc_rect.left; + yDst = pts[0].y + pdcattrDst->dc_rect.top; /* Update brush origin */ - GetBrushOrgEx(physDevDst->hdc, &ptBrush); - ptBrush.x += physDevDst->dc_rect.left; - ptBrush.y += physDevDst->dc_rect.top; - RosGdiSetBrushOrg(physDevDst->hKernelDC, ptBrush.x, ptBrush.y); + GetBrushOrgEx(pdcattrDst->hdc, &ptBrush); + ptBrush.x += pdcattrDst->dc_rect.left; + ptBrush.y += pdcattrDst->dc_rect.top; + RosGdiSetBrushOrg(pdcattrDst->hKernelDC, ptBrush.x, ptBrush.y); - return RosGdiAlphaBlend(physDevDst->hKernelDC, xDst, yDst, widthDst, heightDst, - physDevSrc->hKernelDC, xSrc, ySrc, widthSrc, heightSrc, blendfn); + return RosGdiAlphaBlend(pdcattrDst->hKernelDC, xDst, yDst, widthDst, heightDst, + pdcattrSrc->hKernelDC, xSrc, ySrc, widthSrc, heightSrc, blendfn); } Modified: branches/arwinss/reactos/dll/win32/winent.drv/dib.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
============================================================================== --- branches/arwinss/reactos/dll/win32/winent.drv/dib.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winent.drv/dib.c [iso-8859-1] Wed Jan 12 12:50:22 2011 @@ -71,7 +71,7 @@ return ((width * depth + 31) & ~31) >> 3; } -INT CDECL RosDrv_SetDIBitsToDevice( NTDRV_PDEVICE *physDev, INT xDest, INT yDest, DWORD cx, +INT CDECL RosDrv_SetDIBitsToDevice( PDC_ATTR pdcattr, INT xDest, INT yDest, DWORD cx, DWORD cy, INT xSrc, INT ySrc, UINT startscan, UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse ) @@ -82,9 +82,9 @@ POINT pt; pt.x = xDest; pt.y = yDest; - LPtoDP(physDev->hdc, &pt, 1); - pt.x += physDev->dc_rect.left; - pt.y += physDev->dc_rect.top; + LPtoDP(pdcattr->hdc, &pt, 1); + pt.x += pdcattr->dc_rect.left; + pt.y += pdcattr->dc_rect.top; /* Perform extensive parameter checking */ if (DIB_GetBitmapInfo( &info->bmiHeader, &width, &height, @@ -129,11 +129,11 @@ if (xSrc + cx >= width) cx = width - xSrc; if (!cx || !cy) return lines; - return RosGdiSetDIBitsToDevice(physDev->hKernelDC, pt.x, pt.y, cx, cy, + return RosGdiSetDIBitsToDevice(pdcattr->hKernelDC, pt.x, pt.y, cx, cy, xSrc, ySrc, startscan, top_down ? -lines : lines, bits, info, coloruse); } -INT CDECL RosDrv_SetDIBits( NTDRV_PDEVICE *physDev, HBITMAP hbitmap, UINT startscan, +INT CDECL RosDrv_SetDIBits( PDC_ATTR pdcattr, HBITMAP hbitmap, UINT startscan, UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse ) { LONG height, width, tmpheight; @@ -175,7 +175,7 @@ hbitmap = (HBITMAP)MapUserHandle(hbitmap); - result = RosGdiSetDIBits(physDev->hKernelDC, hbitmap, startscan, + result = RosGdiSetDIBits(pdcattr->hKernelDC, hbitmap, startscan, lines, safeBits, info, coloruse); /* Free safe copy of bits */ @@ -185,7 +185,7 @@ return result; } -INT CDECL RosDrv_GetDIBits( NTDRV_PDEVICE *physDev, HBITMAP hbitmap, UINT startscan, UINT lines, +INT CDECL RosDrv_GetDIBits( PDC_ATTR pdcattr, HBITMAP hbitmap, UINT startscan, UINT lines, LPVOID bits, BITMAPINFO *info, UINT coloruse ) { size_t obj_size; @@ -197,10 +197,10 @@ hbitmap = (HBITMAP)MapUserHandle(hbitmap); /* Perform GetDIBits */ - return RosGdiGetDIBits(physDev->hKernelDC, hbitmap, startscan, lines, bits, info, coloruse, &dib); -} - -HBITMAP CDECL RosDrv_CreateDIBSection( NTDRV_PDEVICE *physDev, HBITMAP hbitmap, + return RosGdiGetDIBits(pdcattr->hKernelDC, hbitmap, startscan, lines, bits, info, coloruse, &dib); +} + +HBITMAP CDECL RosDrv_CreateDIBSection( PDC_ATTR pdcattr, HBITMAP hbitmap, const BITMAPINFO *bmi, UINT usage ) { DIBSECTION dib; @@ -217,16 +217,16 @@ // TODO: Should pass as a flag instead if (height < 0) dib.dsBmih.biHeight *= -1; - hKbitmap = RosGdiCreateDIBSection(physDev->hKernelDC, bmi, usage, &dib); + hKbitmap = RosGdiCreateDIBSection(pdcattr->hKernelDC, bmi, usage, &dib); AddHandleMapping(hKbitmap, hbitmap); return hbitmap; } -UINT CDECL RosDrv_SetDIBColorTable( NTDRV_PDEVICE *physDev, UINT start, UINT count, const RGBQUAD *colors ) -{ - return RosGdiSetDIBColorTable(physDev->hKernelDC, start, count, colors); +UINT CDECL RosDrv_SetDIBColorTable( PDC_ATTR pdcattr, UINT start, UINT count, const RGBQUAD *colors ) +{ + return RosGdiSetDIBColorTable(pdcattr->hKernelDC, start, count, colors); } Modified: branches/arwinss/reactos/dll/win32/winent.drv/font.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
============================================================================== --- branches/arwinss/reactos/dll/win32/winent.drv/font.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winent.drv/font.c [iso-8859-1] Wed Jan 12 12:50:22 2011 @@ -192,7 +192,7 @@ return mru; } -static BOOL get_gasp_flags(NTDRV_PDEVICE *physDev, WORD *flags) +static BOOL get_gasp_flags(PDC_ATTR pdcattr, WORD *flags) { DWORD size; WORD *gasp, *buffer; @@ -202,15 +202,15 @@ *flags = 0; - size = GetFontData(physDev->hdc, MS_GASP_TAG, 0, NULL, 0); + size = GetFontData(pdcattr->hdc, MS_GASP_TAG, 0, NULL, 0); if(size == GDI_ERROR) return FALSE; gasp = buffer = HeapAlloc(GetProcessHeap(), 0, size); - GetFontData(physDev->hdc, MS_GASP_TAG, 0, gasp, size); - - GetTextMetricsW(physDev->hdc, &tm); - ppem = abs(RosDrv_YWStoDS(physDev, tm.tmAscent + tm.tmDescent - tm.tmInternalLeading)); + GetFontData(pdcattr->hdc, MS_GASP_TAG, 0, gasp, size); + + GetTextMetricsW(pdcattr->hdc, &tm); + ppem = abs(RosDrv_YWStoDS(pdcattr, tm.tmAscent + tm.tmDescent - tm.tmInternalLeading)); gasp++; num_recs = get_be_word(*gasp); @@ -228,7 +228,7 @@ return TRUE; } -static AA_Type get_antialias_type( NTDRV_PDEVICE *physDev, BOOL subpixel, BOOL hinter) +static AA_Type get_antialias_type( PDC_ATTR pdcattr, BOOL subpixel, BOOL hinter) { AA_Type ret; WORD flags; @@ -250,7 +250,7 @@ But, Wine's subpixel rendering can support the portrait mode. */ } - else if (!hinter || !get_gasp_flags(physDev, &flags) || flags & GASP_DOGRAY) + else if (!hinter || !get_gasp_flags(pdcattr, &flags) || flags & GASP_DOGRAY) ret = AA_Grey; else ret = AA_None; @@ -258,7 +258,7 @@ return ret; } -static int GetCacheEntry(NTDRV_PDEVICE *physDev, LFANDSIZE *plfsz) +static int GetCacheEntry(PDC_ATTR pdcattr, LFANDSIZE *plfsz) { int ret; int format; @@ -289,11 +289,11 @@ switch (plfsz->lf.lfQuality) { case ANTIALIASED_QUALITY: - entry->aa_default = get_antialias_type( physDev, FALSE, hinter ); + entry->aa_default = get_antialias_type( pdcattr, FALSE, hinter ); break; case CLEARTYPE_QUALITY: case CLEARTYPE_NATURAL_QUALITY: - entry->aa_default = get_antialias_type( physDev, subpixel, hinter ); + entry->aa_default = get_antialias_type( pdcattr, subpixel, hinter ); break; case DEFAULT_QUALITY: case DRAFT_QUALITY: @@ -302,7 +302,7 @@ if ( SystemParametersInfoW( SPI_GETFONTSMOOTHING, 0, &font_smoothing, 0) && font_smoothing) { - entry->aa_default = get_antialias_type( physDev, subpixel, hinter ); + entry->aa_default = get_antialias_type( pdcattr, subpixel, hinter ); } else entry->aa_default = AA_None; @@ -354,14 +354,14 @@ * * Helper to ExtTextOut. Must be called inside xrender_cs */ -static BOOL UploadGlyph(NTDRV_PDEVICE *physDev, int glyph, AA_Type format) +static BOOL UploadGlyph(PDC_ATTR pdcattr, int glyph, AA_Type format) { unsigned int buflen; char *buf; //Glyph gid; GLYPHMETRICS gm; GlyphInfo gi; - gsCacheEntry *entry = glyphsetCache + physDev->cache_index; + gsCacheEntry *entry = glyphsetCache + pdcattr->cache_index; gsCacheEntryFormat *formatEntry; UINT ggo_format = GGO_GLYPH_INDEX; static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} }; @@ -390,13 +390,13 @@ break; } - buflen = GetGlyphOutlineW(physDev->hdc, glyph, ggo_format, &gm, 0, NULL, &identity); + buflen = GetGlyphOutlineW(pdcattr->hdc, glyph, ggo_format, &gm, 0, NULL, &identity); if(buflen == GDI_ERROR) { if(format != AA_None) { format = AA_None; entry->aa_default = AA_None; ggo_format = GGO_GLYPH_INDEX | GGO_BITMAP; - buflen = GetGlyphOutlineW(physDev->hdc, glyph, ggo_format, &gm, 0, NULL, &identity); + buflen = GetGlyphOutlineW(pdcattr->hdc, glyph, ggo_format, &gm, 0, NULL, &identity); } if(buflen == GDI_ERROR) { WARN("GetGlyphOutlineW failed\n"); @@ -447,7 +447,7 @@ } buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, buflen); - GetGlyphOutlineW(physDev->hdc, glyph, ggo_format, &gm, buflen, buf, &identity); + GetGlyphOutlineW(pdcattr->hdc, glyph, ggo_format, &gm, buflen, buf, &identity); formatEntry->realized[glyph] = TRUE; TRACE("buflen = %d. Got metrics: %dx%d adv=%d,%d origin=%d,%d\n", @@ -505,7 +505,7 @@ VOID -FeSelectFont(NTDRV_PDEVICE *physDev, HFONT hfont) +FeSelectFont(PDC_ATTR pdcattr, HFONT hfont) { LFANDSIZE lfsz; @@ -514,19 +514,19 @@ lfsz.lf.lfHeight, lfsz.lf.lfWidth, lfsz.lf.lfWeight, lfsz.lf.lfItalic, lfsz.lf.lfCharSet, debugstr_w(lfsz.lf.lfFaceName)); lfsz.lf.lfWidth = abs( lfsz.lf.lfWidth ); - lfsz.devsize.cx = RosDrv_XWStoDS( physDev, lfsz.lf.lfWidth ); - lfsz.devsize.cy = RosDrv_YWStoDS( physDev, lfsz.lf.lfHeight ); - GetWorldTransform( physDev->hdc, &lfsz.xform ); + lfsz.devsize.cx = RosDrv_XWStoDS( pdcattr, lfsz.lf.lfWidth ); + lfsz.devsize.cy = RosDrv_YWStoDS( pdcattr, lfsz.lf.lfHeight ); + GetWorldTransform( pdcattr->hdc, &lfsz.xform ); lfsz_calc_hash(&lfsz); /*EnterCriticalSection(&xrender_cs);*/ - if (physDev->cache_index != -1) - dec_ref_cache(physDev->cache_index); - physDev->cache_index = GetCacheEntry(physDev, &lfsz); + if (pdcattr->cache_index != -1) + dec_ref_cache(pdcattr->cache_index); + pdcattr->cache_index = GetCacheEntry(pdcattr, &lfsz); /*LeaveCriticalSection(&xrender_cs);*/ } -BOOL FeTextOut( NTDRV_PDEVICE *physDev, INT x, INT y, UINT flags, +BOOL FeTextOut( PDC_ATTR pdcattr, INT x, INT y, UINT flags, const RECT *lprect, LPCWSTR wstr, UINT count, const INT *lpDx ) { @@ -535,7 +535,7 @@ gsCacheEntry *entry; gsCacheEntryFormat *formatEntry; BOOL retv = FALSE; - //HDC hdc = physDev->hdc; + //HDC hdc = pdcattr->hdc; //int textPixel, backgroundPixel; HRGN saved_region = 0; BOOL disable_antialias = FALSE; @@ -543,12 +543,12 @@ //DIBSECTION bmp; unsigned int idx; RECT rect; - //enum drawable_depth_type depth_type = (physDev->depth == 1) ? mono_drawable : color_drawable; + //enum drawable_depth_type depth_type = (pdcattr->depth == 1) ? mono_drawable : color_drawable; //Picture tile_pict = 0; /* Do we need to disable antialiasing because of palette mode? */ #if 0 - if( !physDev->bitmap || GetObjectW( physDev->bitmap->hbitmap, sizeof(bmp), &bmp ) != sizeof(bmp) ) { + if( !pdcattr->bitmap || GetObjectW( pdcattr->bitmap->hbitmap, sizeof(bmp), &bmp ) != sizeof(bmp) ) { TRACE("bitmap is not a DIB\n"); } else if (bmp.dsBmih.biBitCount <= 8) { @@ -557,11 +557,11 @@ } #endif - //RosDrv_LockDIBSection( physDev, DIB_Status_GdiMod ); + //RosDrv_LockDIBSection( pdcattr, DIB_Status_GdiMod ); #if 0 - if(physDev->depth == 1) { - if((physDev->textPixel & 0xffffff) == 0) { + if(pdcattr->depth == 1) { + if((pdcattr->textPixel & 0xffffff) == 0) { textPixel = 0; backgroundPixel = 1; } else { @@ -569,8 +569,8 @@ backgroundPixel = 0; } } else { - textPixel = physDev->textPixel; - backgroundPixel = physDev->backgroundPixel; + textPixel = pdcattr->textPixel; + backgroundPixel = pdcattr->backgroundPixel; } #endif @@ -579,18 +579,18 @@ HBRUSH brush, oldBrush; HPEN pen, oldPen; - brush = CreateSolidBrush(GetBkColor(physDev->hdc)); - oldBrush = SelectObject(physDev->hdc, brush); + brush = CreateSolidBrush(GetBkColor(pdcattr->hdc)); + oldBrush = SelectObject(pdcattr->hdc, brush); pen = CreatePen(PS_NULL, 0, 0); - oldPen = SelectObject(physDev->hdc, pen); + oldPen = SelectObject(pdcattr->hdc, pen); CopyRect(&rect, lprect); - OffsetRect(&rect, physDev->dc_rect.left, physDev->dc_rect.top); - RosGdiRectangle(physDev->hKernelDC, &rect); - - DeleteObject(SelectObject(physDev->hdc, oldBrush)); - DeleteObject(SelectObject(physDev->hdc, oldPen)); + OffsetRect(&rect, pdcattr->dc_rect.left, pdcattr->dc_rect.top); + RosGdiRectangle(pdcattr->hKernelDC, &rect); + + DeleteObject(SelectObject(pdcattr->hdc, oldBrush)); + DeleteObject(SelectObject(pdcattr->hdc, oldPen)); } if(count == 0) @@ -606,27 +606,27 @@ clip_region = CreateRectRgnIndirect( lprect ); /* make a copy of the current device region */ saved_region = CreateRectRgn( 0, 0, 0, 0 ); - CombineRgn( saved_region, physDev->region, 0, RGN_COPY ); - RosDrv_SetDeviceClipping( physDev, saved_region, clip_region ); + CombineRgn( saved_region, pdcattr->region, 0, RGN_COPY ); + RosDrv_SetDeviceClipping( pdcattr, saved_region, clip_region ); DeleteObject( clip_region ); } //EnterCriticalSection(&xrender_cs); - entry = glyphsetCache + physDev->cache_index; + entry = glyphsetCache + pdcattr->cache_index; if( disable_antialias == FALSE ) aa_type = entry->aa_default; formatEntry = entry->format[aa_type]; for(idx = 0; idx < count; idx++) { if( !formatEntry ) { - UploadGlyph(physDev, wstr[idx], aa_type); + UploadGlyph(pdcattr, wstr[idx], aa_type); /* re-evaluate antialias since aa_default may have changed */ if( disable_antialias == FALSE ) aa_type = entry->aa_default; formatEntry = entry->format[aa_type]; } else if( wstr[idx] >= formatEntry->nrealized || formatEntry->realized[wstr[idx]] == FALSE) { - UploadGlyph(physDev, wstr[idx], aa_type); + UploadGlyph(pdcattr, wstr[idx], aa_type); } } if (!formatEntry) @@ -637,68 +637,68 @@ } TRACE("Writing %s at %d,%d\n", debugstr_wn(wstr,count), - physDev->dc_rect.left + x, physDev->dc_rect.top + y); - - RosGdiExtTextOut(physDev->hKernelDC, physDev->dc_rect.left + x, physDev->dc_rect.top + y, flags, lprect, wstr, count, lpDx, formatEntry, aa_type); + pdcattr->dc_rect.left + x, pdcattr->dc_rect.top + y); + + RosGdiExtTextOut(pdcattr->hKernelDC, pdcattr->dc_rect.left + x, pdcattr->dc_rect.top + y, flags, lprect, wstr, count, lpDx, formatEntry, aa_type); //LeaveCriticalSection(&xrender_cs); if (flags & ETO_CLIPPED) { /* restore the device region */ - RosDrv_SetDeviceClipping( physDev, saved_region, 0 ); + RosDrv_SetDeviceClipping( pdcattr, saved_region, 0 ); DeleteObject( saved_region ); } retv = TRUE; done_unlock: - //RosDrv_UnlockDIBSection( physDev, TRUE ); + //RosDrv_UnlockDIBSection( pdcattr, TRUE ); return retv; } -BOOL CDECL RosDrv_ExtTextOut( NTDRV_PDEVICE *physDev, INT x, INT y, UINT flags, +BOOL CDECL RosDrv_ExtTextOut( PDC_ATTR pdcattr, INT x, INT y, UINT flags, const RECT *lprect, LPCWSTR wstr, UINT count, const INT *lpDx ) { - //if (physDev->has_gdi_font) - return FeTextOut(physDev, x, y, flags, lprect, wstr, count, lpDx); + //if (pdcattr->has_gdi_font) + return FeTextOut(pdcattr, x, y, flags, lprect, wstr, count, lpDx); //UNIMPLEMENTED; //return FALSE; } -BOOL CDECL RosDrv_GetTextExtentExPoint( NTDRV_PDEVICE *physDev, LPCWSTR str, INT count, +BOOL CDECL RosDrv_GetTextExtentExPoint( PDC_ATTR pdcattr, LPCWSTR str, INT count, INT maxExt, LPINT lpnFit, LPINT alpDx, LPSIZE size ) { UNIMPLEMENTED; return FALSE; } -BOOL CDECL RosDrv_GetTextMetrics(NTDRV_PDEVICE *physDev, TEXTMETRICW *metrics) +BOOL CDECL RosDrv_GetTextMetrics(PDC_ATTR pdcattr, TEXTMETRICW *metrics) { /* Let GDI font engine do the work */ return FALSE; } -BOOL CDECL RosDrv_EnumDeviceFonts( NTDRV_PDEVICE *physDev, LPLOGFONTW plf, +BOOL CDECL RosDrv_EnumDeviceFonts( PDC_ATTR pdcattr, LPLOGFONTW plf, FONTENUMPROCW proc, LPARAM lp ) { /* We're always using client-side fonts. */ return FALSE; } -HFONT CDECL RosDrv_SelectFont( NTDRV_PDEVICE *physDev, HFONT hfont, HANDLE gdiFont ) +HFONT CDECL RosDrv_SelectFont( PDC_ATTR pdcattr, HFONT hfont, HANDLE gdiFont ) { /* We don't have a kernelmode font engine */ if (gdiFont == 0) { - /*RosGdiSelectFont(physDev->hKernelDC, hfont, gdiFont);*/ + /*RosGdiSelectFont(pdcattr->hKernelDC, hfont, gdiFont);*/ } else { /* Save information about the selected font */ - FeSelectFont(physDev, hfont); + FeSelectFont(pdcattr, hfont); } /* Indicate that gdiFont is good to use */ Modified: branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
============================================================================== --- branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c [iso-8859-1] Wed Jan 12 12:50:22 2011 @@ -13,104 +13,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(rosgdidrv); -/* GLOBALS ****************************************************************/ -static struct list handle_mapping_list = LIST_INIT( handle_mapping_list ); -static CRITICAL_SECTION handle_mapping_cs; -static BOOL StockObjectsInitialized = FALSE; - -typedef struct _HMAPPING -{ - HGDIOBJ hUser; - HGDIOBJ hKernel; - struct list entry; -} HMAPPING, *PHMAPPING; - /* FUNCTIONS **************************************************************/ -VOID InitHandleMapping() -{ - InitializeCriticalSection(&handle_mapping_cs); -} - -VOID AddHandleMapping(HGDIOBJ hKernel, HGDIOBJ hUser) -{ - PHMAPPING mapping = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(HMAPPING)); - if(!mapping) - return; - - mapping->hKernel = hKernel; - mapping->hUser = hUser; - - EnterCriticalSection(&handle_mapping_cs); - list_add_tail(&handle_mapping_list, &mapping->entry); - LeaveCriticalSection(&handle_mapping_cs); -} - -static PHMAPPING FindHandleMapping(HGDIOBJ hUser) -{ - PHMAPPING item; - - LIST_FOR_EACH_ENTRY( item, &handle_mapping_list, HMAPPING, entry ) - { - if (item->hUser == hUser) - { - return item; - } - } - - return NULL; -} - -HGDIOBJ MapUserHandle(HGDIOBJ hUser) -{ - PHMAPPING mapping; - - /* Map stock objects if not mapped yet */ - if(!StockObjectsInitialized) - { - HGDIOBJ hKernel, hUser; - - hKernel = NtGdiGetStockObject(DEFAULT_BITMAP); - hUser = GetStockObject( STOCK_LAST+1 ); - - /* Make sure that both kernel mode and user mode objects are initialized */ - if(hKernel && hUser) - { - AddHandleMapping(NtGdiGetStockObject(DEFAULT_BITMAP), GetStockObject( STOCK_LAST+1 )); - StockObjectsInitialized = TRUE; - } - } - - mapping = FindHandleMapping(hUser); - - return mapping ? mapping->hKernel : NULL; -} - -VOID RemoveHandleMapping(HGDIOBJ hUser) -{ - PHMAPPING mapping; - - mapping = FindHandleMapping(hUser); - if(mapping == NULL) - return; - - EnterCriticalSection(&handle_mapping_cs); - list_remove(&mapping->entry); - LeaveCriticalSection(&handle_mapping_cs); -} - -VOID CleanupHandleMapping() -{ - PHMAPPING mapping; - - while(!list_empty(&handle_mapping_list)) - { - mapping = LIST_ENTRY(list_head(&handle_mapping_list), HMAPPING, entry); - RemoveHandleMapping(mapping->hUser); - } -} - -BOOL CDECL RosDrv_CreateBitmap( NTDRV_PDEVICE *physDev, HBITMAP hbitmap, LPVOID bmBits ) +BOOL CDECL RosDrv_CreateBitmap( PDC_ATTR pdcattr, HBITMAP hbitmap, LPVOID bmBits ) { BITMAP bitmap; HBITMAP hKbitmap; @@ -122,7 +27,7 @@ if (bitmap.bmPlanes != 1) return FALSE; /* Create the kernelmode bitmap object */ - hKbitmap = RosGdiCreateBitmap(physDev->hKernelDC, &bitmap, bmBits); + hKbitmap = RosGdiCreateBitmap(pdcattr->hKernelDC, &bitmap, bmBits); if(!hKbitmap) return FALSE; @@ -131,37 +36,46 @@ return TRUE; } -BOOL CDECL RosDrv_CreateDC( HDC hdc, NTDRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR device, +BOOL CDECL RosDrv_CreateDC( HDC hdc, PDC_ATTR *ppdcattr, LPCWSTR driver, LPCWSTR device, LPCWSTR output, const DEVMODEW* initData ) { BOOL bRet; DWORD dcType; - NTDRV_PDEVICE *physDev; + PDC_ATTR pdcattr; HDC hKernelDC; - - /* Allocate memory for two handles */ - physDev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*physDev) ); - if (!physDev) return FALSE; /* Get DC type */ dcType = GetObjectType(hdc); /* Call the win32 kernel */ bRet = RosGdiCreateDC(&hKernelDC, driver, device, output, initData, dcType); + if(!bRet) + { + ERR("RosGdiCreateDC failed!!!\n"); + return FALSE; + } + + /* Retrieve the user mode part of the new handle */ + pdcattr = GdiGetDcAttr(hKernelDC); + if(!pdcattr) + { + ERR("RosGdiCreateDC failed!!!\n"); + return TRUE; + } /* Save newly created DC */ - physDev->hKernelDC = hKernelDC; - physDev->hdc = hdc; + pdcattr->hKernelDC = hKernelDC; + pdcattr->hdc = hdc; /* No font is selected */ - physDev->cache_index = -1; + pdcattr->cache_index = -1; /* Create a usermode clipping region (same as kernelmode one, just to reduce amount of syscalls) */ - physDev->region = CreateRectRgn( 0, 0, 0, 0 ); + pdcattr->region = CreateRectRgn( 0, 0, 0, 0 ); /* Return allocated physical DC to the caller */ - *pdev = physDev; + *ppdcattr = pdcattr; return bRet; } @@ -178,24 +92,16 @@ return RosGdiDeleteBitmap(hKbitmap); } -BOOL CDECL RosDrv_DeleteDC( NTDRV_PDEVICE *physDev ) -{ - BOOL res; - +BOOL CDECL RosDrv_DeleteDC( PDC_ATTR pdcattr ) +{ /* Delete usermode copy of a clipping region */ - DeleteObject( physDev->region ); + DeleteObject( pdcattr->region ); /* Delete kernel DC */ - res = RosGdiDeleteDC(physDev->hKernelDC); - - /* Free the um/km handle pair memory */ - HeapFree( GetProcessHeap(), 0, physDev ); - - /* Return result */ - return res; -} - -INT CDECL RosDrv_ExtEscape( NTDRV_PDEVICE *physDev, INT escape, INT in_count, LPCVOID in_data, + return RosGdiDeleteDC(pdcattr->hKernelDC); +} + +INT CDECL RosDrv_ExtEscape( PDC_ATTR pdcattr, INT escape, INT in_count, LPCVOID in_data, INT out_count, LPVOID out_data ) { switch(escape) @@ -210,13 +116,13 @@ { const struct ntdrv_escape_set_drawable *data = in_data; - physDev->dc_rect = data->dc_rect; - RosGdiSetDcRects(physDev->hKernelDC, NULL, (RECT*)&data->drawable_rect); - - RosGdiGetDC(physDev->hKernelDC, data->drawable, data->clip_children); + pdcattr->dc_rect = data->dc_rect; + RosGdiSetDcRects(pdcattr->hKernelDC, NULL, (RECT*)&data->drawable_rect); + + RosGdiGetDC(pdcattr->hKernelDC, data->drawable, data->clip_children); TRACE( "SET_DRAWABLE hdc %p dc_rect %s drawable_rect %s\n", - physDev->hdc, wine_dbgstr_rect(&data->dc_rect), wine_dbgstr_rect(&data->drawable_rect) ); + pdcattr->hdc, wine_dbgstr_rect(&data->dc_rect), wine_dbgstr_rect(&data->drawable_rect) ); return TRUE; } break; @@ -238,49 +144,49 @@ return RosGdiGetBitmapBits(hbitmap, buffer, count); } -BOOL CDECL RosDrv_GetCharWidth( NTDRV_PDEVICE *physDev, UINT firstChar, UINT lastChar, +BOOL CDECL RosDrv_GetCharWidth( PDC_ATTR pdcattr, UINT firstChar, UINT lastChar, LPINT buffer ) { UNIMPLEMENTED; return FALSE; } -INT CDECL RosDrv_GetDeviceCaps( NTDRV_PDEVICE *physDev, INT cap ) -{ - return RosGdiGetDeviceCaps(physDev->hKernelDC, cap); -} - -BOOL CDECL RosDrv_GetDeviceGammaRamp(NTDRV_PDEVICE *physDev, LPVOID ramp) -{ - UNIMPLEMENTED; - return FALSE; -} - -COLORREF CDECL RosDrv_GetNearestColor( NTDRV_PDEVICE *physDev, COLORREF color ) -{ - UNIMPLEMENTED; - return 0; -} - -UINT CDECL RosDrv_GetSystemPaletteEntries( NTDRV_PDEVICE *physDev, UINT start, UINT count, +INT CDECL RosDrv_GetDeviceCaps( PDC_ATTR pdcattr, INT cap ) +{ + return RosGdiGetDeviceCaps(pdcattr->hKernelDC, cap); +} + +BOOL CDECL RosDrv_GetDeviceGammaRamp(PDC_ATTR pdcattr, LPVOID ramp) +{ + UNIMPLEMENTED; + return FALSE; +} + +COLORREF CDECL RosDrv_GetNearestColor( PDC_ATTR pdcattr, COLORREF color ) +{ + UNIMPLEMENTED; + return 0; +} + +UINT CDECL RosDrv_GetSystemPaletteEntries( PDC_ATTR pdcattr, UINT start, UINT count, LPPALETTEENTRY entries ) { - return RosGdiGetSystemPaletteEntries(physDev->hKernelDC, start, count, entries); -} - -UINT CDECL RosDrv_RealizeDefaultPalette( NTDRV_PDEVICE *physDev ) + return RosGdiGetSystemPaletteEntries(pdcattr->hKernelDC, start, count, entries); +} + +UINT CDECL RosDrv_RealizeDefaultPalette( PDC_ATTR pdcattr ) { //UNIMPLEMENTED; return FALSE; } -UINT CDECL RosDrv_RealizePalette( NTDRV_PDEVICE *physDev, HPALETTE hpal, BOOL primary ) -{ - UNIMPLEMENTED; - return FALSE; -} - -HBITMAP CDECL RosDrv_SelectBitmap( NTDRV_PDEVICE *physDev, HBITMAP hbitmap ) +UINT CDECL RosDrv_RealizePalette( PDC_ATTR pdcattr, HPALETTE hpal, BOOL primary ) +{ + UNIMPLEMENTED; + return FALSE; +} + +HBITMAP CDECL RosDrv_SelectBitmap( PDC_ATTR pdcattr, HBITMAP hbitmap ) { BOOL bRes; @@ -288,7 +194,7 @@ hbitmap = (HBITMAP)MapUserHandle(hbitmap); /* Select the bitmap into the DC */ - bRes = RosGdiSelectBitmap(physDev->hKernelDC, hbitmap); + bRes = RosGdiSelectBitmap(pdcattr->hKernelDC, hbitmap); /* If there was an error, return 0 */ if (!bRes) return 0; @@ -297,7 +203,7 @@ return hbitmap; } -HBRUSH CDECL RosDrv_SelectBrush( NTDRV_PDEVICE *physDev, HBRUSH hbrush ) +HBRUSH CDECL RosDrv_SelectBrush( PDC_ATTR pdcattr, HBRUSH hbrush ) { LOGBRUSH logbrush; @@ -306,12 +212,12 @@ if(logbrush.lbStyle == BS_PATTERN) logbrush.lbHatch = (ULONG_PTR)MapUserHandle((HBITMAP)logbrush.lbHatch); - RosGdiSelectBrush(physDev->hKernelDC, &logbrush); + RosGdiSelectBrush(pdcattr->hKernelDC, &logbrush); return hbrush; } -HPEN CDECL RosDrv_SelectPen( NTDRV_PDEVICE *physDev, HPEN hpen ) +HPEN CDECL RosDrv_SelectPen( PDC_ATTR pdcattr, HPEN hpen ) { LOGPEN logpen; EXTLOGPEN *elogpen = NULL; @@ -331,10 +237,10 @@ /* If it's a stock object, then use DC's color */ if (hpen == GetStockObject( DC_PEN )) - logpen.lopnColor = GetDCPenColor(physDev->hdc); + logpen.lopnColor = GetDCPenColor(pdcattr->hdc); /* Call kernelmode */ - RosGdiSelectPen(physDev->hKernelDC, &logpen, elogpen); + RosGdiSelectPen(pdcattr->hKernelDC, &logpen, elogpen); /* Free ext logpen memory if it was allocated */ if (elogpen) HeapFree( GetProcessHeap(), 0, elogpen ); @@ -349,19 +255,19 @@ return 0; } -COLORREF CDECL RosDrv_SetDCBrushColor( NTDRV_PDEVICE *physDev, COLORREF crColor ) -{ - UNIMPLEMENTED; - return 0; -} - -COLORREF CDECL RosDrv_SetDCPenColor( NTDRV_PDEVICE *physDev, COLORREF crColor ) -{ - UNIMPLEMENTED; - return 0; -} - -BOOL CDECL RosDrv_SetDeviceGammaRamp(NTDRV_PDEVICE *physDev, LPVOID ramp) +COLORREF CDECL RosDrv_SetDCBrushColor( PDC_ATTR pdcattr, COLORREF crColor ) +{ + UNIMPLEMENTED; + return 0; +} + +COLORREF CDECL RosDrv_SetDCPenColor( PDC_ATTR pdcattr, COLORREF crColor ) +{ + UNIMPLEMENTED; + return 0; +} + +BOOL CDECL RosDrv_SetDeviceGammaRamp(PDC_ATTR pdcattr, LPVOID ramp) { UNIMPLEMENTED; return FALSE; Added: branches/arwinss/reactos/dll/win32/winent.drv/gdiobj.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
============================================================================== --- branches/arwinss/reactos/dll/win32/winent.drv/gdiobj.c (added) +++ branches/arwinss/reactos/dll/win32/winent.drv/gdiobj.c [iso-8859-1] Wed Jan 12 12:50:22 2011 @@ -1,0 +1,196 @@ +/* + * PROJECT: ReactOS + * LICENSE: GNU LGPL by FSF v2.1 or any later + * FILE: dll/win32/winent.drv/gdidrv.c + * PURPOSE: GDI driver stub for ReactOS/Windows + * PROGRAMMERS: Aleksey Bragin (aleksey(a)reactos.org) + */ + +/* INCLUDES ***************************************************************/ + +#include "winent.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(rosgdidrv); + +/* GLOBALS ****************************************************************/ +static struct list handle_mapping_list = LIST_INIT( handle_mapping_list ); +static CRITICAL_SECTION handle_mapping_cs; +static BOOL StockObjectsInitialized = FALSE; + +typedef struct _HMAPPING +{ + HGDIOBJ hUser; + HGDIOBJ hKernel; + struct list entry; +} HMAPPING, *PHMAPPING; + +PGDI_TABLE_ENTRY GdiHandleTable = NULL; +PGDI_SHARED_HANDLE_TABLE GdiSharedHandleTable = NULL; +HANDLE CurrentProcessId = NULL; + +/* FUNCTIONS **************************************************************/ + +VOID InitHandleMapping() +{ + InitializeCriticalSection(&handle_mapping_cs); +} + +VOID AddHandleMapping(HGDIOBJ hKernel, HGDIOBJ hUser) +{ + PHMAPPING mapping = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(HMAPPING)); + if(!mapping) + return; + + mapping->hKernel = hKernel; + mapping->hUser = hUser; + + EnterCriticalSection(&handle_mapping_cs); + list_add_tail(&handle_mapping_list, &mapping->entry); + LeaveCriticalSection(&handle_mapping_cs); +} + +static PHMAPPING FindHandleMapping(HGDIOBJ hUser) +{ + PHMAPPING item; + + LIST_FOR_EACH_ENTRY( item, &handle_mapping_list, HMAPPING, entry ) + { + if (item->hUser == hUser) + { + return item; + } + } + + return NULL; +} + +HGDIOBJ MapUserHandle(HGDIOBJ hUser) +{ + PHMAPPING mapping; + + /* Map stock objects if not mapped yet */ + if(!StockObjectsInitialized) + { + HGDIOBJ hKernel, hUser; + + hKernel = NtGdiGetStockObject(DEFAULT_BITMAP); + hUser = GetStockObject( STOCK_LAST+1 ); + + /* Make sure that both kernel mode and user mode objects are initialized */ + if(hKernel && hUser) + { + AddHandleMapping(NtGdiGetStockObject(DEFAULT_BITMAP), GetStockObject( STOCK_LAST+1 )); + StockObjectsInitialized = TRUE; + } + } + + mapping = FindHandleMapping(hUser); + + return mapping ? mapping->hKernel : NULL; +} + +VOID RemoveHandleMapping(HGDIOBJ hUser) +{ + PHMAPPING mapping; + + mapping = FindHandleMapping(hUser); + if(mapping == NULL) + return; + + EnterCriticalSection(&handle_mapping_cs); + list_remove(&mapping->entry); + LeaveCriticalSection(&handle_mapping_cs); +} + +VOID CleanupHandleMapping() +{ + PHMAPPING mapping; + + while(!list_empty(&handle_mapping_list)) + { + mapping = LIST_ENTRY(list_head(&handle_mapping_list), HMAPPING, entry); + RemoveHandleMapping(mapping->hUser); + } +} + +BOOL GdiInitHandleTable() +{ + if(GdiHandleTable) + return TRUE; + + GdiHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable; + GdiSharedHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable; + CurrentProcessId = NtCurrentTeb()->ClientId.UniqueProcess; + + if(!GdiHandleTable) + return FALSE; + + return TRUE; +} + +BOOL GdiGetHandleUserData(HGDIOBJ hGdiObj, DWORD ObjectType, PVOID *UserData) +{ + PGDI_TABLE_ENTRY Entry ; + + if(!GdiInitHandleTable()) + { + ERR("GdiInitHandleTable failed!\n"); + return FALSE; + } + + Entry = GdiHandleTable + GDI_HANDLE_GET_INDEX(hGdiObj); + + if((Entry->Type & GDI_ENTRY_BASETYPE_MASK) == ObjectType && + ( (Entry->Type << GDI_ENTRY_UPPER_SHIFT) & GDI_HANDLE_TYPE_MASK ) == + GDI_HANDLE_GET_TYPE(hGdiObj)) + { + HANDLE pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1); + if(pid == NULL || pid == CurrentProcessId) + { + // + // Need to test if we have Read & Write access to the VM address space. + // + BOOL Result = TRUE; + if(Entry->UserData) + { + volatile CHAR *Current = (volatile CHAR*)Entry->UserData; + _SEH2_TRY + { + *Current = *Current; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Result = FALSE; + } + _SEH2_END + } + else + { + Result = FALSE; // Can not be zero. + ERR("Objct doesn't have user data handle 0x%x!\n", hGdiObj); + } + if (Result) *UserData = Entry->UserData; + return Result; + } + else + { + ERR("Wrong user data pid handle 0x%x!\n", hGdiObj); + } + } + else + { + ERR("Wrong object type handle 0x%x!\n", hGdiObj); + } + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; +} + +PDC_ATTR +GdiGetDcAttr(HDC hdc) +{ + PDC_ATTR pdcattr; + + if (!GdiGetHandleUserData((HGDIOBJ)hdc, GDI_OBJECT_TYPE_DC, (PVOID*)&pdcattr)) return NULL; + return pdcattr; +} Propchange: branches/arwinss/reactos/dll/win32/winent.drv/gdiobj.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/arwinss/reactos/dll/win32/winent.drv/graphics.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
============================================================================== --- branches/arwinss/reactos/dll/win32/winent.drv/graphics.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winent.drv/graphics.c [iso-8859-1] Wed Jan 12 12:50:22 2011 @@ -48,19 +48,19 @@ return rect; } -void CDECL RosDrv_SetDeviceClipping( NTDRV_PDEVICE *physDev, HRGN vis_rgn, HRGN clip_rgn ) +void CDECL RosDrv_SetDeviceClipping( PDC_ATTR pdcattr, HRGN vis_rgn, HRGN clip_rgn ) { RGNDATA *data; DWORD size, i; RECT *pRects; - //FIXME("SetDeviceClipping hdc %x\n", physDev->hdc); + //FIXME("SetDeviceClipping hdc %x\n", pdcattr->hdc); /* Update dc region to become a combined region */ - CombineRgn( physDev->region, vis_rgn, clip_rgn, clip_rgn ? RGN_AND : RGN_COPY ); + CombineRgn( pdcattr->region, vis_rgn, clip_rgn, clip_rgn ? RGN_AND : RGN_COPY ); /* Get region data size */ - if (!(size = GetRegionData( physDev->region, 0, NULL ))) + if (!(size = GetRegionData( pdcattr->region, 0, NULL ))) return; /* Allocate memory for it */ @@ -68,7 +68,7 @@ return; /* Get region data */ - if (!GetRegionData( physDev->region, size, data )) + if (!GetRegionData( pdcattr->region, size, data )) { HeapFree( GetProcessHeap(), 0, data ); return; @@ -77,13 +77,13 @@ /* Offset all rects */ pRects = (RECT *)data->Buffer; for (i=0; i<data->rdh.nCount; i++) - OffsetRect(&pRects[i], physDev->dc_rect.left, physDev->dc_rect.top); + OffsetRect(&pRects[i], pdcattr->dc_rect.left, pdcattr->dc_rect.top); /* Offset bounding rect */ - OffsetRect(&data->rdh.rcBound, physDev->dc_rect.left, physDev->dc_rect.top); + OffsetRect(&data->rdh.rcBound, pdcattr->dc_rect.left, pdcattr->dc_rect.top); /* Set clipping */ - RosGdiSetDeviceClipping(physDev->hKernelDC, data->rdh.nCount, (RECTL *)data->Buffer, (RECTL *)&data->rdh.rcBound); + RosGdiSetDeviceClipping(pdcattr->hKernelDC, data->rdh.nCount, (RECTL *)data->Buffer, (RECTL *)&data->rdh.rcBound); /* Free memory and delete clipping region */ HeapFree( GetProcessHeap(), 0, data ); @@ -95,7 +95,7 @@ * * Performs a world-to-viewport transformation on the specified width. */ -INT RosDrv_XWStoDS( NTDRV_PDEVICE *physDev, INT width ) +INT RosDrv_XWStoDS( PDC_ATTR pdcattr, INT width ) { POINT pt[2]; @@ -103,7 +103,7 @@ pt[0].y = 0; pt[1].x = width; pt[1].y = 0; - LPtoDP( physDev->hdc, pt, 2 ); + LPtoDP( pdcattr->hdc, pt, 2 ); return pt[1].x - pt[0].x; } @@ -112,7 +112,7 @@ * * Performs a world-to-viewport transformation on the specified height. */ -INT RosDrv_YWStoDS( NTDRV_PDEVICE *physDev, INT height ) +INT RosDrv_YWStoDS( PDC_ATTR pdcattr, INT height ) { POINT pt[2]; @@ -120,28 +120,28 @@ pt[0].y = 0; pt[1].x = 0; pt[1].y = height; - LPtoDP( physDev->hdc, pt, 2 ); + LPtoDP( pdcattr->hdc, pt, 2 ); return pt[1].y - pt[0].y; } -BOOL CDECL RosDrv_LineTo( NTDRV_PDEVICE *physDev, INT x, INT y ) +BOOL CDECL RosDrv_LineTo( PDC_ATTR pdcattr, INT x, INT y ) { POINT pt[2]; /* Get current cursor position */ - GetCurrentPositionEx( physDev->hdc, &pt[0] ); + GetCurrentPositionEx( pdcattr->hdc, &pt[0] ); /* Convert both points coordinates to device */ pt[1].x = x; pt[1].y = y; - LPtoDP( physDev->hdc, pt, 2 ); + LPtoDP( pdcattr->hdc, pt, 2 ); /* Draw the line */ - return RosGdiLineTo(physDev->hKernelDC, physDev->dc_rect.left + pt[0].x, physDev->dc_rect.top + pt[0].y, - physDev->dc_rect.left + pt[1].x, physDev->dc_rect.top + pt[1].y); -} - -BOOL CDECL RosDrv_Arc( NTDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, + return RosGdiLineTo(pdcattr->hKernelDC, pdcattr->dc_rect.left + pt[0].x, pdcattr->dc_rect.top + pt[0].y, + pdcattr->dc_rect.left + pt[1].x, pdcattr->dc_rect.top + pt[1].y); +} + +BOOL CDECL RosDrv_Arc( PDC_ATTR pdcattr, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend ) { POINT pts[4]; @@ -157,19 +157,19 @@ pts[3].x = xend; pts[3].y = yend; - LPtoDP(physDev->hdc, pts, 4); + LPtoDP(pdcattr->hdc, pts, 4); for (i=0; i<4; i++) { - pts[i].x += physDev->dc_rect.left; - pts[i].y += physDev->dc_rect.top; - } - - return RosGdiArc(physDev->hKernelDC, pts[0].x, pts[0].y, pts[1].x, pts[1].y, + pts[i].x += pdcattr->dc_rect.left; + pts[i].y += pdcattr->dc_rect.top; + } + + return RosGdiArc(pdcattr->hKernelDC, pts[0].x, pts[0].y, pts[1].x, pts[1].y, pts[2].x, pts[2].y, pts[3].x, pts[3].y, GdiTypeArc); } -BOOL CDECL RosDrv_Pie( NTDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, +BOOL CDECL RosDrv_Pie( PDC_ATTR pdcattr, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend ) { POINT pts[4]; @@ -185,19 +185,19 @@ pts[3].x = xend; pts[3].y = yend; - LPtoDP(physDev->hdc, pts, 4); + LPtoDP(pdcattr->hdc, pts, 4); for (i=0; i<4; i++) { - pts[i].x += physDev->dc_rect.left; - pts[i].y += physDev->dc_rect.top; - } - - return RosGdiArc(physDev->hKernelDC, pts[0].x, pts[0].y, pts[1].x, pts[1].y, + pts[i].x += pdcattr->dc_rect.left; + pts[i].y += pdcattr->dc_rect.top; + } + + return RosGdiArc(pdcattr->hKernelDC, pts[0].x, pts[0].y, pts[1].x, pts[1].y, pts[2].x, pts[2].y, pts[3].x, pts[3].y, GdiTypePie); } -BOOL CDECL RosDrv_Chord( NTDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, +BOOL CDECL RosDrv_Chord( PDC_ATTR pdcattr, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend ) { POINT pts[4]; @@ -213,19 +213,19 @@ pts[3].x = xend; pts[3].y = yend; - LPtoDP(physDev->hdc, pts, 4); + LPtoDP(pdcattr->hdc, pts, 4); for (i=0; i<4; i++) { - pts[i].x += physDev->dc_rect.left; - pts[i].y += physDev->dc_rect.top; - } - - return RosGdiArc(physDev->hKernelDC, pts[0].x, pts[0].y, pts[1].x, pts[1].y, + pts[i].x += pdcattr->dc_rect.left; + pts[i].y += pdcattr->dc_rect.top; + } + + return RosGdiArc(pdcattr->hKernelDC, pts[0].x, pts[0].y, pts[1].x, pts[1].y, pts[2].x, pts[2].y, pts[3].x, pts[3].y, GdiTypeChord ); } -BOOL CDECL RosDrv_Ellipse( NTDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom ) +BOOL CDECL RosDrv_Ellipse( PDC_ATTR pdcattr, INT left, INT top, INT right, INT bottom ) { POINT pts[2]; DWORD i; @@ -236,21 +236,21 @@ pts[1].x = right; pts[1].y = bottom; - LPtoDP(physDev->hdc, pts, 2); + LPtoDP(pdcattr->hdc, pts, 2); for (i=0; i<2; i++) { - pts[i].x += physDev->dc_rect.left; - pts[i].y += physDev->dc_rect.top; - } - - return RosGdiEllipse(physDev->hKernelDC, pts[0].x, pts[0].y, pts[1].x, pts[1].y); -} - -BOOL CDECL RosDrv_Rectangle(NTDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom) + pts[i].x += pdcattr->dc_rect.left; + pts[i].y += pdcattr->dc_rect.top; + } + + return RosGdiEllipse(pdcattr->hKernelDC, pts[0].x, pts[0].y, pts[1].x, pts[1].y); +} + +BOOL CDECL RosDrv_Rectangle(PDC_ATTR pdcattr, INT left, INT top, INT right, INT bottom) { POINT ptBrush; - RECT rc = get_device_rect( physDev->hdc, left, top, right, bottom ); + RECT rc = get_device_rect( pdcattr->hdc, left, top, right, bottom ); if ((rc.left == rc.right) || (rc.top == rc.bottom)) return TRUE; @@ -258,53 +258,53 @@ if (rc.bottom < rc.top) { INT tmp = rc.bottom; rc.bottom = rc.top; rc.top = tmp; } /* Update brush origin */ - GetBrushOrgEx(physDev->hdc, &ptBrush); - ptBrush.x += physDev->dc_rect.left; - ptBrush.y += physDev->dc_rect.top; - RosGdiSetBrushOrg(physDev->hKernelDC, ptBrush.x, ptBrush.y); - - OffsetRect(&rc, physDev->dc_rect.left, physDev->dc_rect.top); - RosGdiRectangle(physDev->hKernelDC, &rc); + GetBrushOrgEx(pdcattr->hdc, &ptBrush); + ptBrush.x += pdcattr->dc_rect.left; + ptBrush.y += pdcattr->dc_rect.top; + RosGdiSetBrushOrg(pdcattr->hKernelDC, ptBrush.x, ptBrush.y); + + OffsetRect(&rc, pdcattr->dc_rect.left, pdcattr->dc_rect.top); + RosGdiRectangle(pdcattr->hKernelDC, &rc); return TRUE; } -BOOL CDECL RosDrv_RoundRect( NTDRV_PDEVICE *physDev, INT left, INT top, INT right, +BOOL CDECL RosDrv_RoundRect( PDC_ATTR pdcattr, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height ) { UNIMPLEMENTED; return FALSE; } -COLORREF CDECL RosDrv_SetPixel( NTDRV_PDEVICE *physDev, INT x, INT y, COLORREF color ) +COLORREF CDECL RosDrv_SetPixel( PDC_ATTR pdcattr, INT x, INT y, COLORREF color ) { POINT ptPixel; /* Transform to device coordinates */ ptPixel.x = x; ptPixel.y = y; - LPtoDP(physDev->hdc, &ptPixel, 1); - - return RosGdiSetPixel(physDev->hKernelDC, physDev->dc_rect.left + ptPixel.x, physDev->dc_rect.top + ptPixel.y, color); -} - -COLORREF CDECL RosDrv_GetPixel( NTDRV_PDEVICE *physDev, INT x, INT y ) + LPtoDP(pdcattr->hdc, &ptPixel, 1); + + return RosGdiSetPixel(pdcattr->hKernelDC, pdcattr->dc_rect.left + ptPixel.x, pdcattr->dc_rect.top + ptPixel.y, color); +} + +COLORREF CDECL RosDrv_GetPixel( PDC_ATTR pdcattr, INT x, INT y ) { POINT ptPixel; /* Transform to device coordinates */ ptPixel.x = x; ptPixel.y = y; - LPtoDP(physDev->hdc, &ptPixel, 1); - - return RosGdiGetPixel(physDev->hKernelDC, physDev->dc_rect.left + ptPixel.x, physDev->dc_rect.top + ptPixel.y); -} - -BOOL CDECL RosDrv_PaintRgn( NTDRV_PDEVICE *physDev, HRGN hrgn ) + LPtoDP(pdcattr->hdc, &ptPixel, 1); + + return RosGdiGetPixel(pdcattr->hKernelDC, pdcattr->dc_rect.left + ptPixel.x, pdcattr->dc_rect.top + ptPixel.y); +} + +BOOL CDECL RosDrv_PaintRgn( PDC_ATTR pdcattr, HRGN hrgn ) { UNIMPLEMENTED; return FALSE; } -BOOL CDECL RosDrv_Polyline( NTDRV_PDEVICE *physDev, const POINT* pt, INT count ) +BOOL CDECL RosDrv_Polyline( PDC_ATTR pdcattr, const POINT* pt, INT count ) { register int i; POINT *points; @@ -317,19 +317,19 @@ for (i = 0; i < count; i++) { POINT tmp = pt[i]; - LPtoDP(physDev->hdc, &tmp, 1); - points[i].x = physDev->dc_rect.left + tmp.x; - points[i].y = physDev->dc_rect.top + tmp.y; + LPtoDP(pdcattr->hdc, &tmp, 1); + points[i].x = pdcattr->dc_rect.left + tmp.x; + points[i].y = pdcattr->dc_rect.top + tmp.y; } /* Call kernel mode */ - RosGdiPolyline(physDev->hKernelDC, points, count); + RosGdiPolyline(pdcattr->hKernelDC, points, count); HeapFree( GetProcessHeap(), 0, points ); return TRUE; } -BOOL CDECL RosDrv_Polygon( NTDRV_PDEVICE *physDev, const POINT* pt, INT count ) +BOOL CDECL RosDrv_Polygon( PDC_ATTR pdcattr, const POINT* pt, INT count ) { register int i; POINT *points; @@ -343,38 +343,38 @@ for (i = 0; i < count; i++) { POINT tmp = pt[i]; - LPtoDP(physDev->hdc, &tmp, 1); - points[i].x = physDev->dc_rect.left + tmp.x; - points[i].y = physDev->dc_rect.top + tmp.y; + LPtoDP(pdcattr->hdc, &tmp, 1); + points[i].x = pdcattr->dc_rect.left + tmp.x; + points[i].y = pdcattr->dc_rect.top + tmp.y; } points[count] = points[0]; /* Update brush origin */ - GetBrushOrgEx(physDev->hdc, &ptBrush); - ptBrush.x += physDev->dc_rect.left; - ptBrush.y += physDev->dc_rect.top; - RosGdiSetBrushOrg(physDev->hKernelDC, ptBrush.x, ptBrush.y); + GetBrushOrgEx(pdcattr->hdc, &ptBrush); + ptBrush.x += pdcattr->dc_rect.left; + ptBrush.y += pdcattr->dc_rect.top; + RosGdiSetBrushOrg(pdcattr->hKernelDC, ptBrush.x, ptBrush.y); /* Call kernel mode */ - RosGdiPolygon(physDev->hKernelDC, points, count+1); + RosGdiPolygon(pdcattr->hKernelDC, points, count+1); HeapFree( GetProcessHeap(), 0, points ); return TRUE; } -BOOL CDECL RosDrv_PolyPolygon( NTDRV_PDEVICE *physDev, const POINT* pt, const INT* counts, UINT polygons) +BOOL CDECL RosDrv_PolyPolygon( PDC_ATTR pdcattr, const POINT* pt, const INT* counts, UINT polygons) { UNIMPLEMENTED; return FALSE; } -BOOL CDECL RosDrv_PolyPolyline( NTDRV_PDEVICE *physDev, const POINT* pt, const DWORD* counts, DWORD polylines ) +BOOL CDECL RosDrv_PolyPolyline( PDC_ATTR pdcattr, const POINT* pt, const DWORD* counts, DWORD polylines ) { UNIMPLEMENTED; return FALSE; } -BOOL CDECL RosDrv_ExtFloodFill( NTDRV_PDEVICE *physDev, INT x, INT y, COLORREF color, +BOOL CDECL RosDrv_ExtFloodFill( PDC_ATTR pdcattr, INT x, INT y, COLORREF color, UINT fillType ) { POINT ptPixel; @@ -382,28 +382,28 @@ /* Transform to device coordinates */ ptPixel.x = x; ptPixel.y = y; - LPtoDP(physDev->hdc, &ptPixel, 1); - - return RosGdiExtFloodFill(physDev->hKernelDC, physDev->dc_rect.left + ptPixel.x, physDev->dc_rect.top + ptPixel.y, color, fillType); -} - -COLORREF CDECL RosDrv_SetBkColor( NTDRV_PDEVICE *physDev, COLORREF color ) -{ - return RosGdiSetBkColor(physDev->hKernelDC, color); -} - -COLORREF CDECL RosDrv_SetTextColor( NTDRV_PDEVICE *physDev, COLORREF color ) -{ - return RosGdiSetTextColor(physDev->hKernelDC, color); -} - -BOOL CDECL RosDrv_GetICMProfile( NTDRV_PDEVICE *physDev, LPDWORD size, LPWSTR filename ) + LPtoDP(pdcattr->hdc, &ptPixel, 1); + + return RosGdiExtFloodFill(pdcattr->hKernelDC, pdcattr->dc_rect.left + ptPixel.x, pdcattr->dc_rect.top + ptPixel.y, color, fillType); +} + +COLORREF CDECL RosDrv_SetBkColor( PDC_ATTR pdcattr, COLORREF color ) +{ + return RosGdiSetBkColor(pdcattr->hKernelDC, color); +} + +COLORREF CDECL RosDrv_SetTextColor( PDC_ATTR pdcattr, COLORREF color ) +{ + return RosGdiSetTextColor(pdcattr->hKernelDC, color); +} + +BOOL CDECL RosDrv_GetICMProfile( PDC_ATTR pdcattr, LPDWORD size, LPWSTR filename ) { UNIMPLEMENTED; return FALSE; } -INT CDECL RosDrv_EnumICMProfiles( NTDRV_PDEVICE *physDev, ICMENUMPROCW proc, LPARAM lparam ) +INT CDECL RosDrv_EnumICMProfiles( PDC_ATTR pdcattr, ICMENUMPROCW proc, LPARAM lparam ) { UNIMPLEMENTED; return 0; Modified: branches/arwinss/reactos/dll/win32/winent.drv/ogldrv.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
============================================================================== --- branches/arwinss/reactos/dll/win32/winent.drv/ogldrv.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winent.drv/ogldrv.c [iso-8859-1] Wed Jan 12 12:50:22 2011 @@ -53,26 +53,26 @@ return TRUE; } -INT CDECL RosDrv_ChoosePixelFormat(NTDRV_PDEVICE *physDev, +INT CDECL RosDrv_ChoosePixelFormat(PDC_ATTR pdcattr, CONST PIXELFORMATDESCRIPTOR *ppfd) { if (!glChoosePixelFormat) if (!InitOGL()) return 0; - return glChoosePixelFormat(physDev->hdc, ppfd); + return glChoosePixelFormat(pdcattr->hdc, ppfd); } -INT CDECL RosDrv_GetPixelFormat(NTDRV_PDEVICE *physDev) +INT CDECL RosDrv_GetPixelFormat(PDC_ATTR pdcattr) { if (!glGetPixelFormat) if (!InitOGL()) return 0; - return glGetPixelFormat(physDev->hdc); + return glGetPixelFormat(pdcattr->hdc); } -INT CDECL RosDrv_DescribePixelFormat(NTDRV_PDEVICE *physDev, +INT CDECL RosDrv_DescribePixelFormat(PDC_ATTR pdcattr, INT iPixelFormat, UINT nBytes, PIXELFORMATDESCRIPTOR *ppfd) @@ -81,10 +81,10 @@ if (!InitOGL()) return 0; - return glDescribePixelFormat(physDev->hdc, iPixelFormat, nBytes, ppfd); + return glDescribePixelFormat(pdcattr->hdc, iPixelFormat, nBytes, ppfd); } -BOOL CDECL RosDrv_SetPixelFormat(NTDRV_PDEVICE *physDev, +BOOL CDECL RosDrv_SetPixelFormat(PDC_ATTR pdcattr, INT iPixelFormat, CONST PIXELFORMATDESCRIPTOR *ppfd) { @@ -92,17 +92,17 @@ if (!InitOGL()) return 0; - return glSetPixelFormat(physDev->hdc, iPixelFormat, ppfd); + return glSetPixelFormat(pdcattr->hdc, iPixelFormat, ppfd); } -BOOL CDECL RosDrv_SwapBuffers(NTDRV_PDEVICE *physDev) +BOOL CDECL RosDrv_SwapBuffers(PDC_ATTR pdcattr) { if (!glSwapBuffers) if (!InitOGL()) return 0; - return glSwapBuffers(physDev->hdc); + return glSwapBuffers(pdcattr->hdc); } /* EOF */ Modified: branches/arwinss/reactos/dll/win32/winent.drv/winent.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
============================================================================== --- branches/arwinss/reactos/dll/win32/winent.drv/winent.h [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winent.drv/winent.h [iso-8859-1] Wed Jan 12 12:50:22 2011 @@ -36,6 +36,7 @@ #include "wine/list.h" #include "wine/unicode.h" #include "wine/server.h" +#include "win32k/ntgdihdl.h" #include <pseh/pseh2.h> /* GDI escapes */ @@ -98,27 +99,31 @@ /* clipboard.c */ void NTDRV_InitClipboard(void); + +/* gdidrv.c */ +void CDECL RosDrv_SetDeviceClipping( PDC_ATTR pdcattr, HRGN vis_rgn, HRGN clip_rgn ); + +/* gdiobj.c */ VOID InitHandleMapping(); VOID AddHandleMapping(HGDIOBJ hKernel, HGDIOBJ hUser); HGDIOBJ MapUserHandle(HGDIOBJ hUser); VOID RemoveHandleMapping(HGDIOBJ hUser); VOID CleanupHandleMapping(); -/* gdidrv.c */ -void CDECL RosDrv_SetDeviceClipping( NTDRV_PDEVICE *physDev, HRGN vis_rgn, HRGN clip_rgn ); +PDC_ATTR GdiGetDcAttr(HDC hdc); /* graphics.c */ -INT RosDrv_XWStoDS( NTDRV_PDEVICE *physDev, INT width ); -INT RosDrv_YWStoDS( NTDRV_PDEVICE *physDev, INT height ); +INT RosDrv_XWStoDS( PDC_ATTR pdcattr, INT width ); +INT RosDrv_YWStoDS( PDC_ATTR pdcattr, INT height ); HGDIOBJ MapHandle(HGDIOBJ hUser); /* font.c */ VOID -FeSelectFont(NTDRV_PDEVICE *physDev, HFONT hFont); +FeSelectFont(PDC_ATTR pdcattr, HFONT hFont); BOOL -FeTextOut( NTDRV_PDEVICE *physDev, INT x, INT y, UINT flags, +FeTextOut( PDC_ATTR pdcattr, INT x, INT y, UINT flags, const RECT *lprect, LPCWSTR wstr, UINT count, const INT *lpDx ); Modified: branches/arwinss/reactos/dll/win32/winent.drv/winent.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
============================================================================== --- branches/arwinss/reactos/dll/win32/winent.drv/winent.rbuild [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winent.drv/winent.rbuild [iso-8859-1] Wed Jan 12 12:50:22 2011 @@ -12,6 +12,7 @@ <file>event.c</file> <file>font.c</file> <file>gdidrv.c</file> + <file>gdiobj.c</file> <file>graphics.c</file> <file>main.c</file> <file>userdrv.c</file> Modified: branches/arwinss/reactos/include/reactos/win32k/ntgdihdl.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/include/reactos…
============================================================================== --- branches/arwinss/reactos/include/reactos/win32k/ntgdihdl.h [iso-8859-1] (original) +++ branches/arwinss/reactos/include/reactos/win32k/ntgdihdl.h [iso-8859-1] Wed Jan 12 12:50:22 2011 @@ -242,6 +242,7 @@ DWORD dwCFCount; } GDI_SHARED_HANDLE_TABLE, *PGDI_SHARED_HANDLE_TABLE; +#if 0 typedef struct _RGN_ATTR { ULONG AttrFlags; @@ -329,6 +330,19 @@ RGN_ATTR VisRectRegion; } DC_ATTR, *PDC_ATTR; +#else + +typedef struct _DC_ATTR +{ + HDC hdc; + HDC hKernelDC; + RECT dc_rect; /* DC rectangle relative to drawable */ + HRGN region; /* Device region (visible region & clip region) */ + int cache_index; /* cache of a currently selected font */ +} DC_ATTR, *PDC_ATTR; + +#endif + typedef struct _BRUSH_ATTR /* Used with pen too. */ { FLONG AttrFlags; Modified: branches/arwinss/reactos/include/reactos/wine/ntrosgdi.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/include/reactos…
============================================================================== --- branches/arwinss/reactos/include/reactos/wine/ntrosgdi.h [iso-8859-1] (original) +++ branches/arwinss/reactos/include/reactos/wine/ntrosgdi.h [iso-8859-1] Wed Jan 12 12:50:22 2011 @@ -7,15 +7,6 @@ #ifndef W32KAPI #define W32KAPI DECLSPEC_ADDRSAFE #endif - -typedef struct _NTDRV_PDEVICE -{ - HDC hdc; - HDC hKernelDC; - RECT dc_rect; /* DC rectangle relative to drawable */ - HRGN region; /* Device region (visible region & clip region) */ - int cache_index; /* cache of a currently selected font */ -} NTDRV_PDEVICE, *PNTDRV_PDEVICE; typedef struct { Modified: branches/arwinss/reactos/subsystems/win32/win32k/eng/device.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/eng/device.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/eng/device.c [iso-8859-1] Wed Jan 12 12:50:22 2011 @@ -1224,7 +1224,7 @@ return (pGdiInfo->cBitsPixel > 8) ? -1 : (1 << pGdiInfo->cBitsPixel); //return pGdiInfo->ulNumColors; case PDEVICESIZE: - return sizeof(NTDRV_PDEVICE); + return 0; case CURVECAPS: return (CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES | CC_WIDE | CC_STYLED | CC_WIDESTYLED | CC_INTERIORS | CC_ROUNDRECT); Modified: branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gdi/dc.c [iso-8859-1] Wed Jan 12 12:50:22 2011 @@ -56,6 +56,45 @@ return TRUE; } +VOID +FASTCALL +DC_AllocateDcAttr(HDC hDC) +{ + PVOID NewMem = NULL; + PDC pDC; + HANDLE Pid = NtCurrentProcess(); + ULONG MemSize = sizeof(DC_ATTR); //PAGE_SIZE it will allocate that size + + NTSTATUS Status = ZwAllocateVirtualMemory(Pid, + &NewMem, + 0, + &MemSize, + MEM_COMMIT|MEM_RESERVE, + PAGE_READWRITE); + { + INT Index = GDI_HANDLE_GET_INDEX((HGDIOBJ)hDC); + PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index]; + // FIXME: dc could have been deleted!!! use GDIOBJ_InsertUserData + if (NT_SUCCESS(Status)) + { + RtlZeroMemory(NewMem, MemSize); + Entry->UserData = NewMem; + DPRINT("DC_ATTR allocated! 0x%x\n",NewMem); + } + else + { + DPRINT("DC_ATTR not allocated!\n"); + } + } + pDC = DC_LockDc(hDC); + + if(NewMem) + { + pDC->pdcattr = NewMem; // Store pointer + } + DC_UnlockDc(pDC); +} + BOOL APIENTRY RosGdiCreateDC( HDC *pdev, LPCWSTR driver, LPCWSTR device, LPCWSTR output, const DEVMODEW* initData, ULONG dcType ) { @@ -75,6 +114,9 @@ /* Set physical device pointer */ pNewDC->ppdev = (PVOID)&PrimarySurface; + + /* Allocate dc shared memory */ + DC_AllocateDcAttr(hNewDC); /* Set default fg/bg colors */ pNewDC->crBackgroundClr = RGB(255, 255, 255); Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/dc.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] Wed Jan 12 12:50:22 2011 @@ -19,6 +19,8 @@ BASEOBJECT BaseObject; PPDEVOBJ ppdev; + + PDC_ATTR pdcattr; DCLEVEL dclevel; ULONG type; Modified: branches/arwinss/reactos/subsystems/win32/win32k/main/init.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/main/init.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/main/init.c [iso-8859-1] Wed Jan 12 12:50:22 2011 @@ -77,6 +77,13 @@ list_init(&Win32Process->Classes); Win32Process->handles = alloc_handle_table(Win32Process, 0); connect_process_winstation(Win32Process); + + if(Process->Peb != NULL) + { + /* map the gdi handle table to user land */ + Process->Peb->GdiSharedHandleTable = GDI_MapHandleTable(GdiTableSection, Process); + Process->Peb->GdiDCAttributeList = GDI_BATCH_LIMIT; + } } else { Modified: branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild [iso-8859-1] Wed Jan 12 12:50:22 2011 @@ -133,7 +133,6 @@ </if> </directory> <directory name="swm"> - <file>swmevent.c</file> <file>winman.c</file> </directory> <directory name="wine">
13 years, 11 months
1
0
0
0
[tkreuzer] 50365: [WIN32K] - In UserSetCursor, return a pointer to the old cursor, not the handle - really delete the pointer shape when NULL cursor is set, instead of just hiding it. - Move refere...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jan 12 11:49:29 2011 New Revision: 50365 URL:
http://svn.reactos.org/svn/reactos?rev=50365&view=rev
Log: [WIN32K] - In UserSetCursor, return a pointer to the old cursor, not the handle - really delete the pointer shape when NULL cursor is set, instead of just hiding it. - Move reference handling completely to NtUserSetCursor - In UserChangeDisplaySettings, set NULL cursor before change and restore old cursor after change to make sure we have the right color format. See issue #5722 for more details. Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c trunk/reactos/subsystems/win32/win32k/ntuser/display.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] Wed Jan 12 11:49:29 2011 @@ -99,7 +99,7 @@ return CurIcon; } -HCURSOR +PCURICON_OBJECT FASTCALL UserSetCursor( PCURICON_OBJECT NewCursor, @@ -107,22 +107,17 @@ { PSYSTEM_CURSORINFO CurInfo; PCURICON_OBJECT OldCursor; - HCURSOR hOldCursor = (HCURSOR)0; HDC hdcScreen; CurInfo = IntGetSysCursorInfo(); OldCursor = CurInfo->CurrentCursorObject; - if (OldCursor) - { - hOldCursor = (HCURSOR)OldCursor->Self; - } /* Is the new cursor the same as the old cursor? */ if (OldCursor == NewCursor) { /* Nothing to to do in this case */ - return hOldCursor; + return OldCursor; } /* Get the screen DC */ @@ -134,8 +129,6 @@ /* Do we have a new cursor? */ if (NewCursor) { - UserReferenceObject(NewCursor); - CurInfo->ShowingCursor = 1; CurInfo->CurrentCursorObject = NewCursor; @@ -147,8 +140,6 @@ NewCursor->IconInfo.yHotspot, gpsi->ptCursor.x, gpsi->ptCursor.y); - - } else { @@ -156,22 +147,19 @@ if (OldCursor && CurInfo->ShowingCursor) { /* Remove the cursor */ - GreMovePointer(hdcScreen, -1, -1); + //GreMovePointer(hdcScreen, -1, -1); DPRINT("Removing pointer!\n"); } CurInfo->CurrentCursorObject = NULL; CurInfo->ShowingCursor = 0; - } - - /* OldCursor is not in use anymore */ - if (OldCursor) - { - UserDereferenceObject(OldCursor); - } - - /* Return handle of the old cursor */ - return hOldCursor; + + /* Unset the bitmaps */ + GreSetPointerShape(hdcScreen, NULL, NULL, 0, 0, 0, 0); + } + + /* Return the old cursor */ + return OldCursor; } BOOL UserSetCursorPos( INT x, INT y, BOOL SendMouseMoveMsg) @@ -734,7 +722,7 @@ prcl = &rclLocal; } - + UserEnterExclusive(); /* Call the internal function */ @@ -873,38 +861,36 @@ NtUserSetCursor( HCURSOR hCursor) { - PCURICON_OBJECT CurIcon; - HICON OldCursor; - DECLARE_RETURN(HCURSOR); + PCURICON_OBJECT pcurOld, pcurNew; + HCURSOR hOldCursor = NULL; DPRINT("Enter NtUserSetCursor\n"); UserEnterExclusive(); if (hCursor) { - if (!(CurIcon = UserGetCurIconObject(hCursor))) - { - RETURN(NULL); + pcurNew = UserGetCurIconObject(hCursor); + if (!pcurNew) + { + EngSetLastError(ERROR_INVALID_HANDLE); + goto leave; } } else { - CurIcon = NULL; - } - - OldCursor = UserSetCursor(CurIcon, FALSE); - - if (CurIcon) - { - UserDereferenceObject(CurIcon); - } - - RETURN(OldCursor); - -CLEANUP: - DPRINT("Leave NtUserSetCursor, ret=%i\n",_ret_); + pcurNew = NULL; + } + + pcurOld = UserSetCursor(pcurNew, FALSE); + if (pcurOld) + { + hOldCursor = (HCURSOR)pcurOld->Self; + UserDereferenceObject(pcurOld); + } + +leave: UserLeave(); - END_CLEANUP; + return hOldCursor; } Modified: trunk/reactos/subsystems/win32/win32k/ntuser/display.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] Wed Jan 12 11:49:29 2011 @@ -739,15 +739,16 @@ if (!(flags & CDS_NORESET)) { ULONG ulResult; + PVOID pvOldCursor; /* Remove mouse pointer */ - UserSetCursor(NULL, TRUE); + pvOldCursor = UserSetCursor(NULL, TRUE); /* Do the mode switch */ ulResult = PDEVOBJ_bSwitchMode(ppdev, pdm); /* Restore mouse pointer, no hooks called */ - UserSetCursorPos(gpsi->ptCursor.x, gpsi->ptCursor.y, FALSE); + UserSetCursor(pvOldCursor, TRUE); /* Check for failure */ if (!ulResult)
13 years, 11 months
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
34
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
34
Results per page:
10
25
50
100
200