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
February 2014
----- 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
17 participants
464 discussions
Start a n
N
ew thread
[hbelusca] 62342: [NTVDM] - Add BOP 0x12 "BiosGetMemorySize" (same number as the corresponding INTerrupt). Needed by ntio.sys when initializing (see next commit). - Use ASCII names for bios image a...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Thu Feb 27 03:05:42 2014 New Revision: 62342 URL:
http://svn.reactos.org/svn/reactos?rev=62342&view=rev
Log: [NTVDM] - Add BOP 0x12 "BiosGetMemorySize" (same number as the corresponding INTerrupt). Needed by ntio.sys when initializing (see next commit). - Use ASCII names for bios image and dos kernel files names. - Use the file helper functions committed before for implementing ROM image file loading. Modified: branches/ntvdm/subsystems/ntvdm/bios/bios.c branches/ntvdm/subsystems/ntvdm/bios/bios.h branches/ntvdm/subsystems/ntvdm/bios/bios32/bios32.c branches/ntvdm/subsystems/ntvdm/bios/rom.c branches/ntvdm/subsystems/ntvdm/bios/rom.h Modified: branches/ntvdm/subsystems/ntvdm/bios/bios.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios/bio…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios/bios.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios/bios.c [iso-8859-1] Thu Feb 27 03:05:42 2014 @@ -12,10 +12,10 @@ #include "emulator.h" #include "callback.h" +#include "bop.h" #include "bios.h" -#include "bop.h" #include "rom.h" /* PRIVATE VARIABLES **********************************************************/ @@ -34,12 +34,12 @@ static VOID WINAPI BiosInitBop(LPWORD Stack) { /* Load the second part of the Windows NTVDM BIOS image */ - LPCWSTR BiosFileName = L"bios1.rom"; + LPCSTR BiosFileName = "bios1.rom"; PVOID BiosLocation = (PVOID)TO_LINEAR(BIOS_SEGMENT, 0x0000); DWORD BiosSize = 0; BOOLEAN Success; - DPRINT1("You are loading Windows NTVDM BIOS!"); + DPRINT1("You are loading Windows NTVDM BIOS!\n"); /* Initialize a private callback context */ InitializeContext(&__BiosContext, BIOS_SEGMENT, 0x0000); @@ -71,13 +71,13 @@ /* Initialize IVT and hardware */ /* Load VGA BIOS */ - // Success = LoadRom(L"v7vga.rom", (PVOID)0xC0000, &BiosSize); + // Success = LoadRom("v7vga.rom", (PVOID)0xC0000, &BiosSize); // DPRINT1("VGA BIOS loading %s ; GetLastError() = %u\n", Success ? "succeeded" : "failed", GetLastError()); ///////////// MUST BE DONE AFTER IVT INITIALIZATION !! ///////////////////// /* Load some ROMs */ - Success = LoadRom(L"boot.bin", (PVOID)0xE0000, &BiosSize); + Success = LoadRom("boot.bin", (PVOID)0xE0000, &BiosSize); DPRINT1("Test ROM loading %s ; GetLastError() = %u\n", Success ? "succeeded" : "failed", GetLastError()); SearchAndInitRoms(&__BiosContext); @@ -85,9 +85,10 @@ /* PUBLIC FUNCTIONS ***********************************************************/ -BOOLEAN BiosInitialize(IN LPCWSTR BiosFileName, - IN HANDLE ConsoleInput, - IN HANDLE ConsoleOutput) +BOOLEAN +BiosInitialize(IN LPCSTR BiosFileName, + IN HANDLE ConsoleInput, + IN HANDLE ConsoleOutput) { /* Register the BIOS support BOPs */ RegisterBop(BOP_BIOSINIT, BiosInitBop); @@ -148,7 +149,8 @@ } } -VOID BiosCleanup(VOID) +VOID +BiosCleanup(VOID) { if (Bios32Loaded) Bios32Cleanup(); } Modified: branches/ntvdm/subsystems/ntvdm/bios/bios.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios/bio…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios/bios.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios/bios.h [iso-8859-1] Thu Feb 27 03:05:42 2014 @@ -105,10 +105,13 @@ extern PBIOS_DATA_AREA Bda; -BOOLEAN BiosInitialize(IN LPCWSTR BiosFileName, - IN HANDLE ConsoleInput, - IN HANDLE ConsoleOutput); -VOID BiosCleanup(VOID); +BOOLEAN +BiosInitialize(IN LPCSTR BiosFileName, + IN HANDLE ConsoleInput, + IN HANDLE ConsoleOutput); + +VOID +BiosCleanup(VOID); #endif // _BIOS_H_ Modified: branches/ntvdm/subsystems/ntvdm/bios/bios32/bios32.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios/bio…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios/bios32/bios32.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios/bios32/bios32.c [iso-8859-1] Thu Feb 27 03:05:42 2014 @@ -12,6 +12,7 @@ #include "emulator.h" #include "callback.h" +#include "bop.h" #include "../rom.h" #include "../bios.h" @@ -26,6 +27,9 @@ CALLBACK16 BiosContext; PBIOS_DATA_AREA Bda; + +/* BOP Identifiers */ +#define BOP_GETMEMSIZE 0x12 /* PRIVATE FUNCTIONS **********************************************************/ @@ -347,6 +351,9 @@ ((PULONG)BaseAddress)[0x46] = (ULONG)NULL; ((PULONG)BaseAddress)[0x48] = (ULONG)NULL; ((PULONG)BaseAddress)[0x49] = (ULONG)NULL; + + /* Register the BIOS support BOPs */ + RegisterBop(BOP_GETMEMSIZE, BiosGetMemorySize); } /* PUBLIC FUNCTIONS ***********************************************************/ @@ -408,7 +415,7 @@ ///////////// MUST BE DONE AFTER IVT INITIALIZATION !! ///////////////////// /* Load some ROMs */ - Success = LoadRom(L"boot.bin", (PVOID)0xE0000, NULL); + Success = LoadRom("boot.bin", (PVOID)0xE0000, NULL); DPRINT1("Test ROM loading %s ; GetLastError() = %u\n", Success ? "succeeded" : "failed", GetLastError()); SearchAndInitRoms(&BiosContext); Modified: branches/ntvdm/subsystems/ntvdm/bios/rom.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios/rom…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios/rom.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios/rom.c [iso-8859-1] Thu Feb 27 03:05:42 2014 @@ -12,65 +12,48 @@ #include "emulator.h" #include "callback.h" +#include "utils.h" #include "rom.h" /* PRIVATE FUNCTIONS **********************************************************/ static HANDLE -OpenRomFile(IN LPCWSTR RomFileName, - OUT PDWORD RomSize OPTIONAL) +OpenRomFile(IN PCSTR RomFileName, + OUT PULONG RomSize OPTIONAL) { HANDLE hRomFile; - DWORD dwRomSize; + ULONG ulRomSize = 0; /* Open the ROM image file */ - SetLastError(0); // For debugging purposes - hRomFile = CreateFileW(RomFileName, - GENERIC_READ, - FILE_SHARE_READ, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL); - DPRINT1("ROM opening %s ; GetLastError() = %u\n", hRomFile != INVALID_HANDLE_VALUE ? "succeeded" : "failed", GetLastError()); - - /* We failed, bail out */ - if (hRomFile == INVALID_HANDLE_VALUE) return NULL; - - /* OK, we have a handle to the ROM image file */ + hRomFile = FileOpen(RomFileName, &ulRomSize); + + /* If we failed, bail out */ + if (hRomFile == NULL) return NULL; /* - * Retrieve the size of the file. - * * The size of the ROM image file is at most 256kB. For instance, * the SeaBIOS image, which includes also expansion ROMs inside it, * covers the range C000:0000 to F000:FFFF . - * - * We therefore can use GetFileSize. */ - dwRomSize = GetFileSize(hRomFile, NULL); - if ( (dwRomSize == INVALID_FILE_SIZE && GetLastError() != ERROR_SUCCESS) || - (dwRomSize > 0x40000) ) + if (ulRomSize > 0x40000) { /* We failed, bail out */ - DPRINT1("Error when retrieving ROM size, or size too large (%d)\n", dwRomSize); - - /* Close the ROM image file */ - CloseHandle(hRomFile); - + DPRINT1("ROM image size 0x%lx too large, expected at most 0x40000 (256kB)", ulRomSize); + FileClose(hRomFile); return NULL; } /* Success, return file handle and size if needed */ - if (RomSize) *RomSize = dwRomSize; + if (RomSize) *RomSize = ulRomSize; return hRomFile; } -static BOOL -LoadRomFileByHandle(IN HANDLE RomFileHandle, - IN PVOID RomLocation, - IN ULONG RomSize) +static BOOLEAN +LoadRomFileByHandle(IN HANDLE RomFileHandle, + IN PVOID RomLocation, + IN ULONG RomSize, + OUT PULONG BytesRead) { /* * The size of the ROM image file is at most 256kB. For instance, @@ -79,17 +62,15 @@ */ if (RomSize > 0x40000) { - DPRINT1("Wrong ROM image size 0x%lx, expected at most 0x40000 (256kB)", RomSize); + DPRINT1("ROM image size 0x%lx too large, expected at most 0x40000 (256kB)", RomSize); return FALSE; } /* Attempt to load the ROM image file into memory */ - SetLastError(0); // For debugging purposes - return ReadFile(RomFileHandle, - REAL_TO_PHYS(RomLocation), - RomSize, - &RomSize, - NULL); + return FileLoadByHandle(RomFileHandle, + REAL_TO_PHYS(RomLocation), + RomSize, + BytesRead); } static UCHAR @@ -159,73 +140,82 @@ /* PUBLIC FUNCTIONS ***********************************************************/ -BOOLEAN LoadBios(IN LPCWSTR BiosFileName, - OUT PVOID* BiosLocation OPTIONAL, - OUT PDWORD BiosSize OPTIONAL) -{ - BOOL Success; - HANDLE hBiosFile; - DWORD dwBiosSize = 0; - PVOID pBiosLocation; +BOOLEAN +LoadBios(IN PCSTR BiosFileName, + OUT PVOID* BiosLocation OPTIONAL, + OUT PULONG BiosSize OPTIONAL) +{ + BOOLEAN Success; + HANDLE hBiosFile; + ULONG ulBiosSize = 0; + PVOID pBiosLocation; /* Open the BIOS image file */ - hBiosFile = OpenRomFile(BiosFileName, &dwBiosSize); + hBiosFile = OpenRomFile(BiosFileName, &ulBiosSize); /* If we failed, bail out */ if (hBiosFile == NULL) return FALSE; /* BIOS location needs to be aligned on 32-bit boundary */ - // (PVOID)((ULONG_PTR)BaseAddress + ROM_AREA_END + 1 - dwBiosSize) - pBiosLocation = MEM_ALIGN_DOWN(TO_LINEAR(0xF000, 0xFFFF) + 1 - dwBiosSize, sizeof(ULONG)); + // (PVOID)((ULONG_PTR)BaseAddress + ROM_AREA_END + 1 - ulBiosSize) + pBiosLocation = MEM_ALIGN_DOWN(TO_LINEAR(0xF000, 0xFFFF) + 1 - ulBiosSize, sizeof(ULONG)); /* Attempt to load the BIOS image file into memory */ - Success = LoadRomFileByHandle(hBiosFile, pBiosLocation, dwBiosSize); + Success = LoadRomFileByHandle(hBiosFile, + pBiosLocation, + ulBiosSize, + &ulBiosSize); DPRINT1("BIOS loading %s ; GetLastError() = %u\n", Success ? "succeeded" : "failed", GetLastError()); /* Close the BIOS image file */ - CloseHandle(hBiosFile); + FileClose(hBiosFile); /* In case of success, return BIOS location and size if needed */ if (Success) { if (BiosLocation) *BiosLocation = pBiosLocation; - if (BiosSize) *BiosSize = dwBiosSize; - } - - return (BOOLEAN)Success; -} - -BOOLEAN LoadRom(IN LPCWSTR RomFileName, - IN PVOID RomLocation, - OUT PDWORD RomSize OPTIONAL) -{ - BOOL Success; - HANDLE hRomFile; - DWORD dwRomSize = 0; + if (BiosSize) *BiosSize = ulBiosSize; + } + + return Success; +} + +BOOLEAN +LoadRom(IN PCSTR RomFileName, + IN PVOID RomLocation, + OUT PULONG RomSize OPTIONAL) +{ + BOOLEAN Success; + HANDLE hRomFile; + ULONG ulRomSize = 0; /* Open the ROM image file */ - hRomFile = OpenRomFile(RomFileName, &dwRomSize); + hRomFile = OpenRomFile(RomFileName, &ulRomSize); /* If we failed, bail out */ if (hRomFile == NULL) return FALSE; /* Attempt to load the ROM image file into memory */ - Success = LoadRomFileByHandle(hRomFile, RomLocation, dwRomSize); + Success = LoadRomFileByHandle(hRomFile, + RomLocation, + ulRomSize, + &ulRomSize); DPRINT1("ROM loading %s ; GetLastError() = %u\n", Success ? "succeeded" : "failed", GetLastError()); /* Close the ROM image file and return */ - CloseHandle(hRomFile); + FileClose(hRomFile); /* In case of success, return ROM size if needed */ if (Success) { - if (RomSize) *RomSize = dwRomSize; - } - - return (BOOLEAN)Success; -} - -VOID SearchAndInitRoms(IN PCALLBACK16 Context) + if (RomSize) *RomSize = ulRomSize; + } + + return Success; +} + +VOID +SearchAndInitRoms(IN PCALLBACK16 Context) { /* Adapters ROMs -- Start: C8000, End: E0000, 2kB blocks */ InitRomRange(Context, 0xC8000, 0xE0000, 0x0800); Modified: branches/ntvdm/subsystems/ntvdm/bios/rom.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios/rom…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios/rom.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios/rom.h [iso-8859-1] Thu Feb 27 03:05:42 2014 @@ -22,15 +22,18 @@ /* FUNCTIONS ******************************************************************/ -BOOLEAN LoadBios(IN LPCWSTR BiosFileName, - OUT PVOID* BiosLocation OPTIONAL, - OUT PDWORD BiosSize OPTIONAL); +BOOLEAN +LoadBios(IN PCSTR BiosFileName, + OUT PVOID* BiosLocation OPTIONAL, + OUT PULONG BiosSize OPTIONAL); -BOOLEAN LoadRom(IN LPCWSTR RomFileName, - IN PVOID RomLocation, - OUT PDWORD RomSize OPTIONAL); +BOOLEAN +LoadRom(IN PCSTR RomFileName, + IN PVOID RomLocation, + OUT PULONG RomSize OPTIONAL); -VOID SearchAndInitRoms(IN PCALLBACK16 Context); +VOID +SearchAndInitRoms(IN PCALLBACK16 Context); #endif // _ROM_H_
10 years, 10 months
1
0
0
0
[hbelusca] 62341: [NTVDM] Add some utility functions (only file-oriented for now :) ). Will be used in the next commit.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Thu Feb 27 03:02:11 2014 New Revision: 62341 URL:
http://svn.reactos.org/svn/reactos?rev=62341&view=rev
Log: [NTVDM] Add some utility functions (only file-oriented for now :) ). Will be used in the next commit. Added: branches/ntvdm/subsystems/ntvdm/utils.c (with props) branches/ntvdm/subsystems/ntvdm/utils.h (with props) Modified: branches/ntvdm/subsystems/ntvdm/CMakeLists.txt Modified: branches/ntvdm/subsystems/ntvdm/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/CMakeLis…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] Thu Feb 27 03:02:11 2014 @@ -26,6 +26,7 @@ emulator.c io.c registers.c + utils.c vddsup.c ntvdm.c ntvdm.rc Added: branches/ntvdm/subsystems/ntvdm/utils.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/utils.c?…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/utils.c (added) +++ branches/ntvdm/subsystems/ntvdm/utils.c [iso-8859-1] Thu Feb 27 03:02:11 2014 @@ -0,0 +1,87 @@ +/* + * COPYRIGHT: GPL - See COPYING in the top level directory + * PROJECT: ReactOS Virtual DOS Machine + * FILE: utils.c + * PURPOSE: Utility Functions + * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) + */ + +/* INCLUDES *******************************************************************/ + +#define NDEBUG + +#include "emulator.h" + +/* PRIVATE FUNCTIONS **********************************************************/ + +/* PUBLIC FUNCTIONS ***********************************************************/ + +VOID +FileClose(IN HANDLE FileHandle) +{ + CloseHandle(FileHandle); +} + +HANDLE +FileOpen(IN PCSTR FileName, + OUT PULONG FileSize OPTIONAL) +{ + HANDLE hFile; + ULONG ulFileSize; + + /* Open the file */ + SetLastError(0); // For debugging purposes + hFile = CreateFileA(FileName, + GENERIC_READ, + FILE_SHARE_READ, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL); + DPRINT1("File '%s' opening %s ; GetLastError() = %u\n", + FileName, hFile != INVALID_HANDLE_VALUE ? "succeeded" : "failed", GetLastError()); + + /* If we failed, bail out */ + if (hFile == INVALID_HANDLE_VALUE) return NULL; + + /* OK, we have a handle to the file */ + + /* + * Retrieve the size of the file. In NTVDM we will handle files + * of maximum 1Mb so we can largely use GetFileSize only. + */ + ulFileSize = GetFileSize(hFile, NULL); + if (ulFileSize == INVALID_FILE_SIZE && GetLastError() != ERROR_SUCCESS) + { + /* We failed, bail out */ + DPRINT1("Error when retrieving file size, or size too large (%d)\n", ulFileSize); + FileClose(hFile); + return NULL; + } + + /* Success, return file handle and size if needed */ + if (FileSize) *FileSize = ulFileSize; + return hFile; +} + +BOOLEAN +FileLoadByHandle(IN HANDLE FileHandle, + IN PVOID Location, + IN ULONG FileSize, + OUT PULONG BytesRead) +{ + BOOLEAN Success; + + /* Attempt to load the file into memory */ + SetLastError(0); // For debugging purposes + Success = !!ReadFile(FileHandle, + Location, // REAL_TO_PHYS(LocationRealPtr), + FileSize, + BytesRead, + NULL); + DPRINT1("File loading %s ; GetLastError() = %u\n", Success ? "succeeded" : "failed", GetLastError()); + + return Success; +} + +/* EOF */ Propchange: branches/ntvdm/subsystems/ntvdm/utils.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/ntvdm/subsystems/ntvdm/utils.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/utils.h?…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/utils.h (added) +++ branches/ntvdm/subsystems/ntvdm/utils.h [iso-8859-1] Thu Feb 27 03:02:11 2014 @@ -0,0 +1,33 @@ +/* + * COPYRIGHT: GPL - See COPYING in the top level directory + * PROJECT: ReactOS Virtual DOS Machine + * FILE: utils.h + * PURPOSE: Utility Functions + * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) + */ + +#ifndef _UTILS_H_ +#define _UTILS_H_ + +/* INCLUDES *******************************************************************/ + +#include "ntvdm.h" + +/* FUNCTIONS ******************************************************************/ + +VOID +FileClose(IN HANDLE FileHandle); + +HANDLE +FileOpen(IN PCSTR FileName, + OUT PULONG FileSize OPTIONAL); + +BOOLEAN +FileLoadByHandle(IN HANDLE FileHandle, + IN PVOID Location, + IN ULONG FileSize, + OUT PULONG BytesRead); + +#endif // _UTILS_H_ + +/* EOF */ Propchange: branches/ntvdm/subsystems/ntvdm/utils.h ------------------------------------------------------------------------------ svn:eol-style = native
10 years, 10 months
1
0
0
0
[jimtabor] 62340: [Win32k] - Fix server side call for Get Combo and ListBox information so it does not loop through the message loop.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Thu Feb 27 01:12:32 2014 New Revision: 62340 URL:
http://svn.reactos.org/svn/reactos?rev=62340&view=rev
Log: [Win32k] - Fix server side call for Get Combo and ListBox information so it does not loop through the message loop. Modified: trunk/reactos/win32ss/user/ntuser/window.c Modified: trunk/reactos/win32ss/user/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/window…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] Thu Feb 27 01:12:32 2014 @@ -3248,7 +3248,40 @@ END_CLEANUP; } - +//// +//// ReactOS work around! Keep it the sames as in Combo.c and Controls.h +//// +/* combo state struct */ +typedef struct +{ + HWND self; + HWND owner; + UINT dwStyle; + HWND hWndEdit; + HWND hWndLBox; + UINT wState; + HFONT hFont; + RECT textRect; + RECT buttonRect; + RECT droppedRect; + INT droppedIndex; + INT fixedOwnerDrawHeight; + INT droppedWidth; /* last two are not used unless set */ + INT editHeight; /* explicitly */ + LONG UIState; +} HEADCOMBO,*LPHEADCOMBO; + +// Window Extra data container. +typedef struct _WND2CBOX +{ + WND; + LPHEADCOMBO pCBox; +} WND2CBOX, *PWND2CBOX; + +#define CBF_BUTTONDOWN 0x0002 +//// +//// +//// BOOL APIENTRY NtUserGetComboBoxInfo( @@ -3256,6 +3289,9 @@ PCOMBOBOXINFO pcbi) { PWND Wnd; + PPROCESSINFO ppi; + BOOL NotSameppi = FALSE; + BOOL Ret = TRUE; DECLARE_RETURN(BOOL); TRACE("Enter NtUserGetComboBoxInfo\n"); @@ -3281,22 +3317,95 @@ } _SEH2_END; + if (pcbi->cbSize < sizeof(COMBOBOXINFO)) + { + EngSetLastError(ERROR_INVALID_PARAMETER); + RETURN(FALSE); + } + // Pass the user pointer, it was already probed. - RETURN( (BOOL) co_IntSendMessage( Wnd->head.h, CB_GETCOMBOBOXINFO, 0, (LPARAM)pcbi)); + if ((Wnd->pcls->atomClassName != gpsi->atomSysClass[ICLS_COMBOBOX]) && Wnd->fnid != FNID_COMBOBOX) + { + RETURN( (BOOL) co_IntSendMessage( Wnd->head.h, CB_GETCOMBOBOXINFO, 0, (LPARAM)pcbi)); + } + + ppi = PsGetCurrentProcessWin32Process(); + NotSameppi = ppi != Wnd->head.pti->ppi; + if (NotSameppi) + { + KeAttachProcess(&Wnd->head.pti->ppi->peProcess->Pcb); + } + + _SEH2_TRY + { + LPHEADCOMBO lphc = ((PWND2CBOX)Wnd)->pCBox; + pcbi->rcItem = lphc->textRect; + pcbi->rcButton = lphc->buttonRect; + pcbi->stateButton = 0; + if (lphc->wState & CBF_BUTTONDOWN) + pcbi->stateButton |= STATE_SYSTEM_PRESSED; + if (RECTL_bIsEmptyRect(&lphc->buttonRect)) + pcbi->stateButton |= STATE_SYSTEM_INVISIBLE; + pcbi->hwndCombo = lphc->self; + pcbi->hwndItem = lphc->hWndEdit; + pcbi->hwndList = lphc->hWndLBox; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Ret = FALSE; + SetLastNtError(_SEH2_GetExceptionCode()); + } + _SEH2_END; + + RETURN( Ret); CLEANUP: + if (NotSameppi) KeDetachProcess(); TRACE("Leave NtUserGetComboBoxInfo, ret=%i\n",_ret_); UserLeave(); END_CLEANUP; } - +//// +//// ReactOS work around! Keep it the sames as in Listbox.c +//// +/* Listbox structure */ +typedef struct +{ + HWND self; /* Our own window handle */ + HWND owner; /* Owner window to send notifications to */ + UINT style; /* Window style */ + INT width; /* Window width */ + INT height; /* Window height */ + VOID *items; /* Array of items */ + INT nb_items; /* Number of items */ + INT top_item; /* Top visible item */ + INT selected_item; /* Selected item */ + INT focus_item; /* Item that has the focus */ + INT anchor_item; /* Anchor item for extended selection */ + INT item_height; /* Default item height */ + INT page_size; /* Items per listbox page */ + INT column_width; /* Column width for multi-column listboxes */ +} LB_DESCR; + +// Window Extra data container. +typedef struct _WND2LB +{ + WND; + LB_DESCR * pLBiv; +} WND2LB, *PWND2LB; +//// +//// +//// DWORD APIENTRY NtUserGetListBoxInfo( HWND hWnd) { PWND Wnd; + PPROCESSINFO ppi; + BOOL NotSameppi = FALSE; + DWORD Ret = 0; DECLARE_RETURN(DWORD); TRACE("Enter NtUserGetListBoxInfo\n"); @@ -3307,9 +3416,39 @@ RETURN( 0 ); } - RETURN( (DWORD) co_IntSendMessage( Wnd->head.h, LB_GETLISTBOXINFO, 0, 0 )); + if ((Wnd->pcls->atomClassName != gpsi->atomSysClass[ICLS_LISTBOX]) && Wnd->fnid != FNID_LISTBOX) + { + RETURN( (DWORD) co_IntSendMessage( Wnd->head.h, LB_GETLISTBOXINFO, 0, 0 )); + } + + // wine lisbox:test_GetListBoxInfo lb_getlistboxinfo = 0, should not send a message! + ppi = PsGetCurrentProcessWin32Process(); + NotSameppi = ppi != Wnd->head.pti->ppi; + if (NotSameppi) + { + KeAttachProcess(&Wnd->head.pti->ppi->peProcess->Pcb); + } + + _SEH2_TRY + { + LB_DESCR *descr = ((PWND2LB)Wnd)->pLBiv; + // See Controls ListBox.c:LB_GETLISTBOXINFO must match... + if (descr->style & LBS_MULTICOLUMN) //// ReactOS + Ret = descr->page_size * descr->column_width; + else + Ret = descr->page_size; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Ret = 0; + SetLastNtError(_SEH2_GetExceptionCode()); + } + _SEH2_END; + + RETURN( Ret); CLEANUP: + if (NotSameppi) KeDetachProcess(); TRACE("Leave NtUserGetListBoxInfo, ret=%lu\n", _ret_); UserLeave(); END_CLEANUP;
10 years, 10 months
1
0
0
0
[jimtabor] 62339: [User32|ListBox] - Patch by Huw Davies: If the listbox loses focus while holding capture, release it by essentially simulating a button up event.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Wed Feb 26 22:56:27 2014 New Revision: 62339 URL:
http://svn.reactos.org/svn/reactos?rev=62339&view=rev
Log: [User32|ListBox] - Patch by Huw Davies: If the listbox loses focus while holding capture, release it by essentially simulating a button up event. Modified: trunk/reactos/win32ss/user/user32/controls/listbox.c Modified: trunk/reactos/win32ss/user/user32/controls/listbox.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/contro…
============================================================================== --- trunk/reactos/win32ss/user/user32/controls/listbox.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/controls/listbox.c [iso-8859-1] Wed Feb 26 22:56:27 2014 @@ -3052,6 +3052,7 @@ SEND_NOTIFICATION( descr, LBN_SETFOCUS ); return 0; case WM_KILLFOCUS: + LISTBOX_HandleLButtonUp( descr ); /* Release capture if we have it */ descr->in_focus = FALSE; descr->wheel_remain = 0; if ((descr->focus_item != -1) && descr->caret_on)
10 years, 10 months
1
0
0
0
[jimtabor] 62338: [User32Test] - Update listbox and msg test to wine 1.7.13.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Wed Feb 26 22:54:03 2014 New Revision: 62338 URL:
http://svn.reactos.org/svn/reactos?rev=62338&view=rev
Log: [User32Test] - Update listbox and msg test to wine 1.7.13. Modified: trunk/rostests/winetests/user32/listbox.c trunk/rostests/winetests/user32/msg.c Modified: trunk/rostests/winetests/user32/listbox.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/listbox.…
============================================================================== --- trunk/rostests/winetests/user32/listbox.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/listbox.c [iso-8859-1] Wed Feb 26 22:54:03 2014 @@ -234,6 +234,8 @@ DestroyWindow (hLB); } +static int got_selchange; + static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch (msg) @@ -266,6 +268,10 @@ break; } + + case WM_COMMAND: + if (HIWORD( wparam ) == LBN_SELCHANGE) got_selchange++; + break; default: break; @@ -1583,6 +1589,29 @@ ok(ret > 0, "got %d\n", ret); todo_wine ok(lb_getlistboxinfo == 0, "got %d\n", lb_getlistboxinfo); + + DestroyWindow(listbox); + DestroyWindow(parent); +} + +static void test_missing_lbuttonup( void ) +{ + HWND listbox, parent, capture; + + parent = create_parent(); + listbox = create_listbox(WS_CHILD | WS_VISIBLE, parent); + + /* Send button down without a corresponding button up */ + SendMessageA(listbox, WM_LBUTTONDOWN, 0, MAKELPARAM(10,10)); + capture = GetCapture(); + ok(capture == listbox, "got %p expected %p\n", capture, listbox); + + /* Capture is released and LBN_SELCHANGE sent during WM_KILLFOCUS */ + got_selchange = 0; + SetFocus(NULL); + capture = GetCapture(); + ok(capture == NULL, "got %p\n", capture); + ok(got_selchange, "got %d\n", got_selchange); DestroyWindow(listbox); DestroyWindow(parent); @@ -1668,4 +1697,5 @@ test_listbox_dlgdir(); test_set_count(); test_GetListBoxInfo(); -} + test_missing_lbuttonup(); +} Modified: trunk/rostests/winetests/user32/msg.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/msg.c?re…
============================================================================== --- trunk/rostests/winetests/user32/msg.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/msg.c [iso-8859-1] Wed Feb 26 22:54:03 2014 @@ -1719,11 +1719,11 @@ { 0 } }; -static int after_end_dialog, test_def_id; +static BOOL after_end_dialog, test_def_id, paint_loop_done; static int sequence_cnt, sequence_size; static struct recvd_message* sequence; static int log_all_parent_messages; -static int paint_loop_done; +static CRITICAL_SECTION sequence_cs; /* user32 functions */ static HWND (WINAPI *pGetAncestor)(HWND,UINT); @@ -1814,7 +1814,8 @@ { struct recvd_message *seq; - if (!sequence) + EnterCriticalSection( &sequence_cs ); + if (!sequence) { sequence_size = 10; sequence = HeapAlloc( GetProcessHeap(), 0, sequence_size * sizeof(*sequence) ); @@ -1826,7 +1827,7 @@ } assert(sequence); - seq = &sequence[sequence_cnt]; + seq = &sequence[sequence_cnt++]; seq->hwnd = msg->hwnd; seq->message = msg->message; seq->flags = msg->flags; @@ -1835,6 +1836,7 @@ seq->line = line; seq->descr = msg->descr; seq->output[0] = 0; + LeaveCriticalSection( &sequence_cs ); if (msg->descr) { @@ -1919,8 +1921,6 @@ sprintf( seq->output + strlen(seq->output), " (flags %x)", msg->flags ); } } - - sequence_cnt++; } /* try to make sure pending X events have been processed before continuing */ @@ -1941,9 +1941,11 @@ static void flush_sequence(void) { + EnterCriticalSection( &sequence_cs ); HeapFree(GetProcessHeap(), 0, sequence); sequence = 0; sequence_cnt = sequence_size = 0; + LeaveCriticalSection( &sequence_cs ); } static void dump_sequence(const struct message *expected, const char *context, const char *file, int line) @@ -2030,7 +2032,7 @@ ok_sequence_( (exp), (contx), (todo), __FILE__, __LINE__) -static void ok_sequence_(const struct message *expected_list, const char *context, int todo, +static void ok_sequence_(const struct message *expected_list, const char *context, BOOL todo, const char *file, int line) { static const struct recvd_message end_of_sequence; @@ -4762,17 +4764,17 @@ flush_sequence(); - test_def_id = 1; + test_def_id = TRUE; SendMessageA(hwnd, WM_NULL, 0, 0); flush_sequence(); - after_end_dialog = 1; + after_end_dialog = TRUE; EndDialog( hwnd, 0 ); ok_sequence(WmEndCustomDialogSeq, "EndCustomDialog", FALSE); DestroyWindow(hwnd); - after_end_dialog = 0; - test_def_id = 0; + after_end_dialog = FALSE; + test_def_id = FALSE; hwnd = CreateWindowExA(0, "TestDialogClass", NULL, WS_POPUP, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL); @@ -7886,7 +7888,7 @@ } else ok(broken(1), "infinite loop\n"); if ( i == 0) - paint_loop_done = 1; + paint_loop_done = TRUE; return DefWindowProcA(hWnd,msg,wParam,lParam); } } @@ -9040,22 +9042,22 @@ trace("start scroll\n"); ScrollWindowEx( hwnd, 10, 10, &rect, NULL, NULL, NULL, SW_ERASE|SW_INVALIDATE); - ok_sequence(WmEmptySeq, "ScrollWindowEx", 0); + ok_sequence(WmEmptySeq, "ScrollWindowEx", FALSE); trace("end scroll\n"); flush_sequence(); flush_events(); - ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", 0); + ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", FALSE); flush_events(); flush_sequence(); /* Now without the SW_ERASE flag */ trace("start scroll\n"); ScrollWindowEx( hwnd, 10, 10, &rect, NULL, NULL, NULL, SW_INVALIDATE); - ok_sequence(WmEmptySeq, "ScrollWindowEx", 0); + ok_sequence(WmEmptySeq, "ScrollWindowEx", FALSE); trace("end scroll\n"); flush_sequence(); flush_events(); - ok_sequence(ScrollWindowPaint2, "ScrollWindowEx", 0); + ok_sequence(ScrollWindowPaint2, "ScrollWindowEx", FALSE); flush_events(); flush_sequence(); @@ -9069,7 +9071,7 @@ trace("end scroll\n"); flush_sequence(); flush_events(); - ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", 0); + ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", FALSE); flush_events(); flush_sequence(); @@ -9079,7 +9081,7 @@ trace("end scroll\n"); flush_sequence(); flush_events(); - ok_sequence(ScrollWindowPaint1, "ScrollWindow", 0); + ok_sequence(ScrollWindowPaint1, "ScrollWindow", FALSE); ok(DestroyWindow(hchild), "failed to destroy window\n"); ok(DestroyWindow(hwnd), "failed to destroy window\n"); @@ -9212,7 +9214,7 @@ ret = DestroyWindow(parent); ok( ret, "DestroyWindow() error %d\n", GetLastError()); test_DestroyWindow_flag = FALSE; - ok_sequence(destroy_window_with_children, "destroy window with children", 0); + ok_sequence(destroy_window_with_children, "destroy window with children", FALSE); ok(!IsWindow(parent), "parent still exists\n"); ok(!IsWindow(child1), "child1 still exists\n"); @@ -10229,8 +10231,7 @@ { MSG msg; DWORD time; - BOOL ret; - int go = 0; + BOOL ret, go = FALSE; time = GetTickCount(); while (GetTickCount() - time < 200 && !go) { @@ -12590,6 +12591,7 @@ SetMenu(hwnd, hmenu); SetForegroundWindow( hwnd ); + flush_events(); set_menu_style(hmenu, MNS_NOTIFYBYPOS); style = get_menu_style(hmenu); @@ -12708,7 +12710,7 @@ { HWND hwnd; - paint_loop_done = 0; + paint_loop_done = FALSE; hwnd = CreateWindowExA(0x0,"PaintLoopWindowClass", "PaintLoopWindowClass",WS_OVERLAPPEDWINDOW, 100, 100, 100, 100, 0, 0, 0, NULL ); @@ -12732,7 +12734,7 @@ { HWND hwnd; MSG msg; - int gotwmquit = FALSE; + BOOL gotwmquit = FALSE; hwnd = CreateWindowExA(0, "static", "test_defwndproc", WS_POPUP, 0,0,0,0,0,0,0, NULL); assert(hwnd); DefWindowProcA( hwnd, WM_ENDSESSION, 1, 0); @@ -12740,7 +12742,7 @@ if( msg.message == WM_QUIT) gotwmquit = TRUE; DispatchMessageA( &msg ); } - ok( gotwmquit == FALSE, "Unexpected WM_QUIT message!\n"); + ok(!gotwmquit, "Unexpected WM_QUIT message!\n"); DestroyWindow( hwnd); } @@ -14292,6 +14294,7 @@ return; } + InitializeCriticalSection( &sequence_cs ); init_procs(); hModuleImm32 = LoadLibraryA("imm32.dll"); @@ -14327,7 +14330,6 @@ test_winevents(); /* Fix message sequences before removing 4 lines below */ -#if 1 if (pUnhookWinEvent && hEvent_hook) { ret = pUnhookWinEvent(hEvent_hook); @@ -14335,7 +14337,6 @@ pUnhookWinEvent = 0; } hEvent_hook = 0; -#endif test_SetFocus(); test_SetParent(); @@ -14358,7 +14359,7 @@ test_paint_messages(); if(!winetest_interactive) skip("ReactOS ActivateActCtx seems to be broken.\n"); - else + else test_interthread_messages(); test_message_conversion(); test_accelerators(); @@ -14407,4 +14408,5 @@ GetLastError() == 0xdeadbeef, /* Win9x */ "unexpected error %d\n", GetLastError()); } + DeleteCriticalSection( &sequence_cs ); }
10 years, 10 months
1
0
0
0
[fireball] 62337: [ARWINSS] - Update the patch to trunk. Bright side: it got significantly smaller (22kb vs 7kb). Dark side: it misses the CSR stuff either.
by fireball@svn.reactos.org
Author: fireball Date: Wed Feb 26 20:24:22 2014 New Revision: 62337 URL:
http://svn.reactos.org/svn/reactos?rev=62337&view=rev
Log: [ARWINSS] - Update the patch to trunk. Bright side: it got significantly smaller (22kb vs 7kb). Dark side: it misses the CSR stuff either. Modified: branches/arwinss/trunk.diff Modified: branches/arwinss/trunk.diff URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/trunk.diff?rev=62337&r1…
============================================================================== --- branches/arwinss/trunk.diff [iso-8859-1] (original) +++ branches/arwinss/trunk.diff [iso-8859-1] Wed Feb 26 20:24:22 2014 @@ -1,8 +1,8 @@ Index: base/shell/explorer/desktop/desktop.cpp =================================================================== ---- base/shell/explorer/desktop/desktop.cpp (revision 57501) +--- base/shell/explorer/desktop/desktop.cpp (revision 62316) +++ base/shell/explorer/desktop/desktop.cpp (working copy) -@@ -327,8 +327,8 @@ +@@ -326,8 +326,8 @@ HWND DesktopWindow::Create() { static IconWindowClass wcDesktop(TEXT("Progman"), IDI_REACTOS, CS_DBLCLKS); @@ -15,36 +15,21 @@ int height = GetSystemMetrics(SM_CYSCREEN); Index: cmake/baseaddress.cmake =================================================================== ---- cmake/baseaddress.cmake (revision 57501) +--- cmake/baseaddress.cmake (revision 62316) +++ cmake/baseaddress.cmake (working copy) -@@ -1,7 +1,7 @@ - set(baseaddress_ntdll 0x77f20000) - set(baseaddress_kernel32 0x77da0000) - set(baseaddress_msvcrt 0x77d10000) --set(baseaddress_advapi32 0x77c60000) -+set(baseaddress_advapi32 0x77cb0000) - set(baseaddress_gdi32 0x77bf0000) - set(baseaddress_user32 0x77a60000) - set(baseaddress_dhcpcsvc 0x77a10000) -@@ -296,3 +296,4 @@ - set(baseaddress_netevent 0x70a10000) - set(baseaddress_tapiui 0x709b0000) - set(baseaddress_iologmsg 0x669a0000) +@@ -272,6 +272,7 @@ + set(baseaddress_wbemprox 0x70c70000) + set(baseaddress_windowscodecs 0x70b60000) + set(baseaddress_windowscodecsext 0x70b30000) +set(baseaddress_freetypd 0x709b0000) + set(baseaddress_wined3d 0x70960000) + set(baseaddress_winfax 0x70930000) + set(baseaddress_wing32 0x70900000) Index: cmake/config.cmake =================================================================== ---- cmake/config.cmake (revision 57501) +--- cmake/config.cmake (revision 62316) +++ cmake/config.cmake (working copy) -@@ -26,7 +26,7 @@ - - set(GDB FALSE CACHE BOOL - "Whether to compile for debugging with GDB. --If you don't use GDB, don't enable this.") -+If you don't use GDB, don't enable this.") - - if(CMAKE_BUILD_TYPE STREQUAL "Release") - set(DBG FALSE CACHE BOOL -@@ -56,6 +56,9 @@ +@@ -58,6 +58,9 @@ "Whether to compile support for ELF files. Do not enable unless you know what you're doing.") @@ -56,9 +41,9 @@ If you live in a country where software patents are valid/apply, don't Index: CMakeLists.txt =================================================================== ---- CMakeLists.txt (revision 57501) +--- CMakeLists.txt (revision 62316) +++ CMakeLists.txt (working copy) -@@ -126,6 +126,10 @@ +@@ -134,6 +134,10 @@ add_definitions(-D_WINKD_=1) endif() @@ -66,36 +51,22 @@ + add_definitions(-D_ARWINSS_=1) + endif() + - if(USE_PSEH3) - add_definitions(-D_USE_PSEH3=1) - endif() -@@ -245,6 +249,9 @@ - add_subdirectory(ntoskrnl) + if((NOT DEFINED PCH) AND (CMAKE_VERSION STREQUAL "2.8.12.1-ReactOS")) + set(PCH 1) + else() +@@ -236,6 +240,9 @@ add_subdirectory(subsystems) + add_subdirectory(tools/wpp) add_subdirectory(win32ss) + if (_ARWINSS_) + add_subdirectory(arwinss) + endif() - file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/include/reactos) - -Index: drivers/filesystems/npfs/create.c -=================================================================== ---- drivers/filesystems/npfs/create.c (revision 57501) -+++ drivers/filesystems/npfs/create.c (working copy) -@@ -227,6 +227,9 @@ - } - - Ccb->FileObject = FileObject; -+ KeInitializeEvent(&Ccb->ConnectEvent, SynchronizationEvent, FALSE); -+ KeInitializeEvent(&Ccb->ReadEvent, NotificationEvent, FALSE); -+ KeInitializeEvent(&Ccb->WriteEvent, NotificationEvent, FALSE); - - FileObject->FsContext = Fcb; - FileObject->FsContext2 = Ccb; + # Create {bootcd, livecd, bootcdregtest}.lst + create_iso_lists() Index: include/asm/syscalls.inc =================================================================== ---- include/asm/syscalls.inc (revision 57501) +--- include/asm/syscalls.inc (revision 62316) +++ include/asm/syscalls.inc (working copy) @@ -95,6 +95,7 @@ @@ -115,9 +86,9 @@ .ENDP Index: include/psdk/winddi.h =================================================================== ---- include/psdk/winddi.h (revision 57501) +--- include/psdk/winddi.h (revision 62316) +++ include/psdk/winddi.h (working copy) -@@ -2666,7 +2666,7 @@ +@@ -2683,7 +2683,7 @@ _In_ ULONG cjSize, _Out_bytecap_(cjSize) FONTINFO *pfi); @@ -126,24 +97,9 @@ GAMMA_TABLES* APIENTRY FONTOBJ_pGetGammaTables( -Index: include/psdk/winuser.h -=================================================================== ---- include/psdk/winuser.h (revision 57501) -+++ include/psdk/winuser.h (working copy) -@@ -2818,8 +2818,8 @@ - typedef LRESULT(CALLBACK *HOOKPROC)(int,WPARAM,LPARAM); - typedef BOOL(CALLBACK *PROPENUMPROCA)(HWND,LPCSTR,HANDLE); - typedef BOOL(CALLBACK *PROPENUMPROCW)(HWND,LPCWSTR,HANDLE); --typedef BOOL(CALLBACK *PROPENUMPROCEXA)(HWND,LPSTR,HANDLE,DWORD); --typedef BOOL(CALLBACK *PROPENUMPROCEXW)(HWND,LPWSTR,HANDLE,DWORD); -+typedef BOOL(CALLBACK *PROPENUMPROCEXA)(HWND,LPSTR,HANDLE,ULONG_PTR); -+typedef BOOL(CALLBACK *PROPENUMPROCEXW)(HWND,LPWSTR,HANDLE,ULONG_PTR); - typedef int(CALLBACK *EDITWORDBREAKPROCA)(LPSTR,int,int,int); - typedef int(CALLBACK *EDITWORDBREAKPROCW)(LPWSTR,int,int,int); - typedef LRESULT(CALLBACK *WNDPROC)(HWND,UINT,WPARAM,LPARAM); Index: include/reactos/wine/config.h =================================================================== ---- include/reactos/wine/config.h (revision 57501) +--- include/reactos/wine/config.h (revision 62316) +++ include/reactos/wine/config.h (working copy) @@ -1,3 +1,5 @@ +#include "reactos/buildno.h" @@ -153,12 +109,12 @@ /* Define to a function attribute for Microsoft hotpatch assembly prefix. */ Index: lib/3rdparty/CMakeLists.txt =================================================================== ---- lib/3rdparty/CMakeLists.txt (revision 57501) +--- lib/3rdparty/CMakeLists.txt (revision 62316) +++ lib/3rdparty/CMakeLists.txt (working copy) -@@ -3,7 +3,9 @@ +@@ -2,7 +2,9 @@ + add_subdirectory(adns) add_subdirectory(bzip2) add_subdirectory(cardlib) - add_subdirectory(expat) +if (NOT _ARWINSS_) add_subdirectory(freetype) +endif () @@ -167,7 +123,7 @@ add_subdirectory(libsamplerate) Index: lib/3rdparty/freetype/CMakeLists.txt =================================================================== ---- lib/3rdparty/freetype/CMakeLists.txt (revision 57501) +--- lib/3rdparty/freetype/CMakeLists.txt (revision 62316) +++ lib/3rdparty/freetype/CMakeLists.txt (working copy) @@ -11,7 +11,9 @@ src/base/ftbbox.c @@ -181,34 +137,28 @@ src/base/ftgxval.c Index: win32ss/CMakeLists.txt =================================================================== ---- win32ss/CMakeLists.txt (revision 57501) +--- win32ss/CMakeLists.txt (revision 62316) +++ win32ss/CMakeLists.txt (working copy) -@@ -10,10 +10,12 @@ +@@ -7,6 +7,8 @@ + + add_subdirectory(drivers) + ++if (NOT _ARWINSS_) ++ + if(USE_DIBLIB) add_subdirectory(gdi/diblib) endif() - -+add_subdirectory(user/win32csr) -+ -+if (NOT _ARWINSS_) - add_subdirectory(gdi/gdi32) - add_subdirectory(reactx) - add_subdirectory(user/user32) --add_subdirectory(user/win32csr) - - spec2def(win32k.sys win32k.spec ADD_IMPORTLIB) - -@@ -227,3 +229,5 @@ - - add_library(win32ksys sys-stubs.S) - set_source_files_properties(sys-stubs.S PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/w32ksvc.h) -+ +@@ -243,3 +245,4 @@ + add_asm_files(win32ksys_asm sys-stubs.S) + add_library(win32ksys ${win32ksys_asm}) + set_target_properties(win32ksys PROPERTIES LINKER_LANGUAGE "C") +endif() # _ARWINSS_ \ No newline at end of file Index: win32ss/drivers/CMakeLists.txt =================================================================== ---- win32ss/drivers/CMakeLists.txt (revision 57501) +--- win32ss/drivers/CMakeLists.txt (revision 62316) +++ win32ss/drivers/CMakeLists.txt (working copy) -@@ -1,5 +1,7 @@ +@@ -1,6 +1,8 @@ add_subdirectory(displays) +if (NOT _ARWINSS_) @@ -216,9 +166,10 @@ +endif () add_subdirectory(miniport) add_subdirectory(videoprt) + add_subdirectory(watchdog) Index: win32ss/include/ntgdihdl.h =================================================================== ---- win32ss/include/ntgdihdl.h (revision 57501) +--- win32ss/include/ntgdihdl.h (revision 62316) +++ win32ss/include/ntgdihdl.h (working copy) @@ -270,6 +270,7 @@ DWORD dwCFCount; @@ -248,617 +199,3 @@ typedef struct _BRUSH_ATTR /* Used with pen too. */ { FLONG AttrFlags; -Index: win32ss/user/win32csr/CMakeLists.txt -=================================================================== ---- win32ss/user/win32csr/CMakeLists.txt (revision 57501) -+++ win32ss/user/win32csr/CMakeLists.txt (working copy) -@@ -22,6 +22,7 @@ - file.c - guiconsole.c - handle.c -+ input.c - harderror.c - lineinput.c - tuiconsole.c -Index: win32ss/user/win32csr/desktopbg.c -=================================================================== ---- win32ss/user/win32csr/desktopbg.c (revision 57501) -+++ win32ss/user/win32csr/desktopbg.c (working copy) -@@ -53,7 +53,9 @@ - - static BOOL BgInitialized = FALSE; - static HWND VisibleDesktopWindow = NULL; --#if 0 -+#ifdef _ARWINSS_ -+static HWND BackgroundWnd; -+ - static - LRESULT - CALLBACK -@@ -82,7 +84,7 @@ - return (LRESULT)TRUE; - - case WM_CREATE: -- NtUserSetWindowFNID(Wnd, FNID_DESKTOP); // Anti-ReactOS hack! -+ //NtUserSetWindowFNID(Wnd, FNID_DESKTOP); // Anti-ReactOS hack! - case WM_CLOSE: - return 0; - -@@ -146,6 +148,7 @@ - FASTCALL - DtbgInit(VOID) - { -+#ifndef _ARWINSS_ - WNDCLASSEXW Class; - ATOM ClassAtom; - -@@ -172,9 +175,19 @@ - - return FALSE; - } -- -+#endif - VisibleDesktopWindow = NULL; - -+#ifdef _ARWINSS_ -+ /* set winstation if we don't have one yet */ -+ if (!GetProcessWindowStation()) -+ { -+ static const WCHAR WinSta0[] = {'W','i','n','S','t','a','0',0}; -+ HANDLE handle = OpenWindowStationW(WinSta0, FALSE, WINSTA_ALL_ACCESS); -+ if (handle) SetProcessWindowStation(handle); -+ } -+#endif -+ - return TRUE; - } - #endif -@@ -183,7 +196,9 @@ - WINAPI - DtbgDesktopThread(PVOID Data) - { -+#ifndef _ARWINSS_ - HWND BackgroundWnd; -+#endif - MSG msg; - PDTBG_THREAD_DATA ThreadData = (PDTBG_THREAD_DATA)Data; - -@@ -199,7 +214,7 @@ - - BackgroundWnd = CreateWindowW((LPCWSTR)DESKTOP_WINDOW_ATOM, - L"", -- WS_POPUP | WS_CLIPCHILDREN, -+ WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, - GetSystemMetrics(SM_XVIRTUALSCREEN), - GetSystemMetrics(SM_YVIRTUALSCREEN), - GetSystemMetrics(SM_CXVIRTUALSCREEN), -@@ -218,6 +233,9 @@ - - DPRINT("BackgroundWnd 0x%p\n",BackgroundWnd); - -+ /* Set window proc */ -+ SetWindowLongPtrW( BackgroundWnd, GWLP_WNDPROC, (LONG_PTR)DtbgWindowProc ); -+ - ThreadData->Status = STATUS_SUCCESS; - SetEvent(ThreadData->Event); - -@@ -245,9 +263,10 @@ - if (!BgInitialized) - { - BgInitialized = TRUE; -- -- // if (!DtbgInit()) -- // return STATUS_UNSUCCESSFUL; -+#ifdef _ARWINSS_ -+ if (!DtbgInit()) -+ return STATUS_UNSUCCESSFUL; -+#endif - } - - /* -@@ -283,6 +302,28 @@ - WaitForSingleObject(ThreadData.Event, INFINITE); - CloseHandle(ThreadData.Event); - -+#ifdef _ARWINSS_ -+ /* Show the desktop immediately */ -+ { -+ PRIVATE_NOTIFY_DESKTOP nmh; -+ -+ nmh.hdr.hwndFrom = BackgroundWnd; -+ nmh.hdr.idFrom = 0; -+ nmh.hdr.code = PM_SHOW_DESKTOP; -+ -+ nmh.ShowDesktop.Width = GetSystemMetrics(SM_CXVIRTUALSCREEN); -+ nmh.ShowDesktop.Height = GetSystemMetrics(SM_CYVIRTUALSCREEN); -+ -+ SendMessageW(BackgroundWnd, -+ WM_NOTIFY, -+ (WPARAM)nmh.hdr.hwndFrom, -+ (LPARAM)&nmh) -+ ? STATUS_UNSUCCESSFUL : STATUS_SUCCESS; -+ -+ RedrawWindow(BackgroundWnd, NULL, 0, RDW_INVALIDATE | RDW_FRAME | RDW_ERASENOW | RDW_ALLCHILDREN); -+ } -+#endif -+ - return ThreadData.Status; - } - -Index: win32ss/user/win32csr/dllmain.c -=================================================================== ---- win32ss/user/win32csr/dllmain.c (revision 57501) -+++ win32ss/user/win32csr/dllmain.c (working copy) -@@ -16,6 +16,9 @@ - extern VOID WINAPI PrivateCsrssManualGuiCheck(LONG Check); - extern LIST_ENTRY DosDeviceHistory; - extern RTL_CRITICAL_SECTION Win32CsrDefineDosDeviceCritSec; -+#ifdef _ARWINSS_ -+void CsrInitInputSupport(); -+#endif - - /* GLOBALS *******************************************************************/ - -@@ -262,7 +265,9 @@ - // - // HACK HACK HACK ReactOS to BOOT! Initialization BUG ALERT! See bug 5655. - // -+#ifndef _ARWINSS_ - hhk = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardHookProc, NULL, 0); -+#endif - // BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! - // BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! - // BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! BUG ALERT! -@@ -312,14 +317,18 @@ - WINAPI - PrivateCsrssManualGuiCheck(LONG Check) - { -+#ifndef _ARWINSS_ - NtUserCallOneParam(Check, ONEPARAM_ROUTINE_CSRSS_GUICHECK); -+#endif - } - - DWORD - WINAPI - CreateSystemThreads(PVOID pParam) - { -+#ifndef _ARWINSS_ - NtUserCallOneParam((DWORD)pParam, ONEPARAM_ROUTINE_CREATESYSTEMTHREADS); -+#endif - DPRINT1("This thread should not terminate!\n"); - return 0; - } -@@ -328,9 +337,11 @@ - WINAPI - Win32CsrInitialization(IN PCSR_SERVER_DLL ServerDll) - { -+#ifndef _ARWINSS_ - HANDLE ServerThread; - CLIENT_ID ClientId; - NTSTATUS Status; -+#endif - - Win32CsrApiHeap = RtlGetProcessHeap(); - -@@ -353,6 +364,9 @@ - InitializeListHead(&DosDeviceHistory); - - /* Start Raw Input Threads */ -+#ifdef _ARWINSS_ -+ CsrInitInputSupport(); -+#else - Status = RtlCreateUserThread(NtCurrentProcess(), NULL, TRUE, 0, 0, 0, (PTHREAD_START_ROUTINE)CreateSystemThreads, (PVOID)0, &ServerThread, &ClientId); - if (NT_SUCCESS(Status)) - { -@@ -361,7 +375,7 @@ - } - else - DPRINT1("Cannot start Raw Input Thread!\n"); -- -+#endif - return STATUS_SUCCESS; - } - -Index: win32ss/user/win32csr/input.c -=================================================================== ---- win32ss/user/win32csr/input.c (revision 0) -+++ win32ss/user/win32csr/input.c (working copy) -@@ -0,0 +1,387 @@ -+/* -+ * PROJECT: ReactOS CSRSS -+ * LICENSE: GPL - See COPYING in the top level directory -+ * FILE: subsystems/win32/csrss/api/input.c -+ * PURPOSE: CSRSS input support -+ * COPYRIGHT: Casper S. Hornstrup (chorns(a)users.sourceforge.net) -+ * -+ * this file is heavily based on subsystems\win32\win32k\ntuser\input.c from trunk -+ */ -+ -+#define NDEBUG -+#include "w32csr.h" -+#include <debug.h> -+#define NTOS_MODE_USER -+#include <ndk/iofuncs.h> -+#include <ntddmou.h> -+#include <ntddkbd.h> -+ -+static HHOOK gKeyboardHook, gMouseHook; -+ -+#define ClearMouseInput(mi) \ -+ mi.dx = 0; \ -+ mi.dy = 0; \ -+ mi.mouseData = 0; \ -+ mi.dwFlags = 0; -+ -+#define SendMouseEvent(mi) \ -+ if(mi.dx != 0 || mi.dy != 0) \ -+ mi.dwFlags |= MOUSEEVENTF_MOVE; \ -+ if(mi.dwFlags) \ -+ mouse_event(mi.dwFlags,mi.dx,mi.dy, mi.mouseData, 0); \ -+ ClearMouseInput(mi); -+ -+ -+static LRESULT CALLBACK DummyHookProc( INT code, WPARAM wparam, LPARAM lparam ){ -+ return CallNextHookEx( 0, code, wparam, lparam ); -+} -+ -+ -+VOID FASTCALL -+ProcessMouseInputData(PMOUSE_INPUT_DATA Data, ULONG InputCount) -+{ -+ PMOUSE_INPUT_DATA mid; -+ MOUSEINPUT mi; -+ ULONG i; -+ -+ ClearMouseInput(mi); -+ mi.time = 0; -+ mi.dwExtraInfo = 0; -+ for(i = 0; i < InputCount; i++) -+ { -+ mid = (Data + i); -+ mi.dx += mid->LastX; -+ mi.dy += mid->LastY; -+ -+ /* Check if the mouse move is absolute */ -+ if (mid->Flags == MOUSE_MOVE_ABSOLUTE) -+ { -+ /* Set flag and convert to screen location */ -+ mi.dwFlags |= MOUSEEVENTF_ABSOLUTE; -+ mi.dx = mi.dx / (65535 / (GetSystemMetrics(SM_CXVIRTUALSCREEN) - 1)); -+ mi.dy = mi.dy / (65535 / (GetSystemMetrics(SM_CYVIRTUALSCREEN) - 1)); -+ } -+ -+ if(mid->ButtonFlags) -+ { -+ if(mid->ButtonFlags & MOUSE_LEFT_BUTTON_DOWN) -+ { -+ mi.dwFlags |= MOUSEEVENTF_LEFTDOWN; -+ SendMouseEvent(mi); -+ } -+ if(mid->ButtonFlags & MOUSE_LEFT_BUTTON_UP) -+ { -+ mi.dwFlags |= MOUSEEVENTF_LEFTUP; -+ SendMouseEvent(mi); -+ } -+ if(mid->ButtonFlags & MOUSE_MIDDLE_BUTTON_DOWN) -+ { -+ mi.dwFlags |= MOUSEEVENTF_MIDDLEDOWN; -+ SendMouseEvent(mi); -+ } -+ if(mid->ButtonFlags & MOUSE_MIDDLE_BUTTON_UP) -+ { -+ mi.dwFlags |= MOUSEEVENTF_MIDDLEUP; -+ SendMouseEvent(mi); -+ } -+ if(mid->ButtonFlags & MOUSE_RIGHT_BUTTON_DOWN) -+ { -+ mi.dwFlags |= MOUSEEVENTF_RIGHTDOWN; -+ SendMouseEvent(mi); -+ } -+ if(mid->ButtonFlags & MOUSE_RIGHT_BUTTON_UP) -+ { -+ mi.dwFlags |= MOUSEEVENTF_RIGHTUP; -+ SendMouseEvent(mi); -+ } -+ if(mid->ButtonFlags & MOUSE_BUTTON_4_DOWN) -+ { -+ mi.mouseData |= XBUTTON1; -+ mi.dwFlags |= MOUSEEVENTF_XDOWN; -+ SendMouseEvent(mi); -+ } -+ if(mid->ButtonFlags & MOUSE_BUTTON_4_UP) -+ { -+ mi.mouseData |= XBUTTON1; -+ mi.dwFlags |= MOUSEEVENTF_XUP; -+ SendMouseEvent(mi); -+ } -+ if(mid->ButtonFlags & MOUSE_BUTTON_5_DOWN) -+ { -+ mi.mouseData |= XBUTTON2; -+ mi.dwFlags |= MOUSEEVENTF_XDOWN; -+ SendMouseEvent(mi); -+ } -+ if(mid->ButtonFlags & MOUSE_BUTTON_5_UP) -+ { -+ mi.mouseData |= XBUTTON2; -+ mi.dwFlags |= MOUSEEVENTF_XUP; -+ SendMouseEvent(mi); -+ } -+ if(mid->ButtonFlags & MOUSE_WHEEL) -+ { -+ mi.mouseData = mid->ButtonData; -+ mi.dwFlags |= MOUSEEVENTF_WHEEL; -+ SendMouseEvent(mi); -+ } -+ } -+ } -+ -+ SendMouseEvent(mi); -+} -+ -+DWORD WINAPI MouseInputThread(LPVOID lpParameter) -+{ -+ UNICODE_STRING MouseDeviceName = RTL_CONSTANT_STRING(L"\\Device\\PointerClass0"); -+ OBJECT_ATTRIBUTES MouseObjectAttributes; -+ IO_STATUS_BLOCK Iosb; -+ HANDLE MouseDeviceHandle; -+ NTSTATUS Status; -+ -+ InitializeObjectAttributes(&MouseObjectAttributes, -+ &MouseDeviceName, -+ 0, -+ NULL, -+ NULL); -+ -+ do -+ { -+ Sleep(1000); -+ Status = NtOpenFile(&MouseDeviceHandle, -+ FILE_ALL_ACCESS, -+ &MouseObjectAttributes, -+ &Iosb, -+ 0, -+ FILE_SYNCHRONOUS_IO_ALERT); -+ } while (!NT_SUCCESS(Status)); -+ -+ while(1) -+ { -+ MOUSE_INPUT_DATA MouseInput; -+ Status = NtReadFile(MouseDeviceHandle, -+ NULL, -+ NULL, -+ NULL, -+ &Iosb, -+ &MouseInput, -+ sizeof(MOUSE_INPUT_DATA), -+ NULL, -+ NULL); -+ //if(Status == STATUS_ALERTED) -+ //{ -+ // break; -+ //} -+ if(Status == STATUS_PENDING) -+ { -+ NtWaitForSingleObject(MouseDeviceHandle, FALSE, NULL); -+ Status = Iosb.Status; -+ } -+ if(!NT_SUCCESS(Status)) -+ { -+ DPRINT1("Win32K: Failed to read from mouse.\n"); -+ return Status; -+ } -+ DPRINT("MouseEvent\n"); -+ -+ if(!gMouseHook) -+ gMouseHook = SetWindowsHookEx(WH_MOUSE_LL, DummyHookProc, NULL, 0); -+ -+ ProcessMouseInputData(&MouseInput, Iosb.Information / sizeof(MOUSE_INPUT_DATA)); -+ } -+} -+ -+/* Sends the keyboard commands to turn on/off the lights. -+ */ -+static NTSTATUS APIENTRY -+IntKeyboardUpdateLeds(HANDLE KeyboardDeviceHandle, -+ PKEYBOARD_INPUT_DATA KeyInput, -+ PKEYBOARD_INDICATOR_TRANSLATION IndicatorTrans) -+{ -+ NTSTATUS Status; -+ UINT Count; -+ static KEYBOARD_INDICATOR_PARAMETERS Indicators; -+ IO_STATUS_BLOCK Block; -+ -+ if (!IndicatorTrans) -+ return STATUS_NOT_SUPPORTED; -+ -+ if (KeyInput->Flags & (KEY_E0 | KEY_E1 | KEY_BREAK)) -+ return STATUS_SUCCESS; -+ -+ for (Count = 0; Count < IndicatorTrans->NumberOfIndicatorKeys; Count++) -+ { -+ if (KeyInput->MakeCode == IndicatorTrans->IndicatorList[Count].MakeCode) -+ { -+ Indicators.LedFlags ^= -+ IndicatorTrans->IndicatorList[Count].IndicatorFlags; -+ -+ /* Update the lights on the hardware */ -+ -+ Status = NtDeviceIoControlFile(KeyboardDeviceHandle, -+ NULL, -+ NULL, -+ NULL, -+ &Block, -+ IOCTL_KEYBOARD_SET_INDICATORS, -+ &Indicators, sizeof(Indicators), -+ NULL, 0); -+ -+ return Status; -+ } -+ } -+ -+ return STATUS_SUCCESS; -+} -+ -+/* Asks the keyboard driver to send a small table that shows which -+ * lights should connect with which scancodes -+ */ -+static NTSTATUS APIENTRY -+IntKeyboardGetIndicatorTrans(HANDLE KeyboardDeviceHandle, -+ PKEYBOARD_INDICATOR_TRANSLATION *IndicatorTrans) -+{ -+ NTSTATUS Status; -+ DWORD Size = 0; -+ IO_STATUS_BLOCK Block; -+ PKEYBOARD_INDICATOR_TRANSLATION Ret; -+ -+ Size = sizeof(KEYBOARD_INDICATOR_TRANSLATION); -+ -+ Ret = HeapAlloc(Win32CsrApiHeap, 0, Size); -+ -+ while (Ret) -+ { -+ Status = NtDeviceIoControlFile(KeyboardDeviceHandle, -+ NULL, -+ NULL, -+ NULL, -+ &Block, -+ IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION, -+ NULL, -+ 0, -+ Ret, Size); -+ -+ if (Status != STATUS_BUFFER_TOO_SMALL) -+ break; -+ -+ HeapFree(Win32CsrApiHeap, 0, Ret); -+ -+ Size += sizeof(KEYBOARD_INDICATOR_TRANSLATION); -+ -+ Ret = HeapAlloc(Win32CsrApiHeap, 0, Size); -+ } -+ -+ if (!Ret) -+ return STATUS_INSUFFICIENT_RESOURCES; -+ -+ if (Status != STATUS_SUCCESS) -+ { -+ HeapFree(Win32CsrApiHeap, 0, Ret); -+ return Status; -+ } -+ -+ *IndicatorTrans = Ret; -+ return Status; -+} -+ -+DWORD WINAPI KeyboardInputThread(LPVOID lpParameter) -+{ -+ UNICODE_STRING KeyboardDeviceName = RTL_CONSTANT_STRING(L"\\Device\\KeyboardClass0"); -+ OBJECT_ATTRIBUTES KeyboardObjectAttributes; -+ IO_STATUS_BLOCK Iosb; -+ HANDLE KeyboardDeviceHandle; -+ NTSTATUS Status; -+ PKEYBOARD_INDICATOR_TRANSLATION IndicatorTrans = NULL; -+ -+ InitializeObjectAttributes(&KeyboardObjectAttributes, -+ &KeyboardDeviceName, -+ 0, -+ NULL, -+ NULL); -+ -+ do -+ { -+ Sleep(1000); -+ Status = NtOpenFile(&KeyboardDeviceHandle, -+ FILE_ALL_ACCESS, -+ &KeyboardObjectAttributes, -+ &Iosb, -+ 0, -+ FILE_SYNCHRONOUS_IO_ALERT); -+ } while (!NT_SUCCESS(Status)); -+ -+ IntKeyboardGetIndicatorTrans(KeyboardDeviceHandle, -+ &IndicatorTrans); -+ while(1) -+ { -+ KEYBOARD_INPUT_DATA KeyInput; -+ DWORD flags; -+ -+ Status = NtReadFile(KeyboardDeviceHandle, -+ NULL, -+ NULL, -+ NULL, -+ &Iosb, -+ &KeyInput, -+ sizeof(KEYBOARD_INPUT_DATA), -+ NULL, -+ NULL); -+ -+ if(Status == STATUS_ALERTED) -+ { -+ break; -+ } -+ if(Status == STATUS_PENDING) -+ { -+ NtWaitForSingleObject(KeyboardDeviceHandle, FALSE, NULL); -+ Status = Iosb.Status; -+ } -+ if(!NT_SUCCESS(Status)) -+ { -+ DPRINT1("Win32K: Failed to read from mouse.\n"); -+ return Status; -+ } -+ -+ DPRINT("KeyRaw: %s %04x\n", -+ (KeyInput.Flags & KEY_BREAK) ? "up" : "down", -+ KeyInput.MakeCode ); -+ -+ if (!NT_SUCCESS(Status)) -+ { -+ DPRINT1("Win32K: Failed to read from keyboard.\n"); -+ return Status; -+ } -+ -+ IntKeyboardUpdateLeds(KeyboardDeviceHandle, -+ &KeyInput, -+ IndicatorTrans); -+ -+ flags = 0; -+ -+ if (KeyInput.Flags & KEY_E0) -+ flags |= KEYEVENTF_EXTENDEDKEY; -+ -+ if (KeyInput.Flags & KEY_BREAK) -+ flags |= KEYEVENTF_KEYUP; -+ -+ if(!gKeyboardHook) -+ gKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, DummyHookProc, NULL, 0); -+ -+ keybd_event(MapVirtualKey(KeyInput.MakeCode & 0xff, MAPVK_VSC_TO_VK), KeyInput.MakeCode & 0xff, flags , 0); -+ } -+ -+ return Status; -+} -+ -+ -+void CsrInitInputSupport() -+{ -+ HANDLE MouseThreadHandle, KeyboardThreadHandle; -+ -+ ClipCursor(NULL); -+ -+ MouseThreadHandle = CreateThread(NULL, 0, MouseInputThread, NULL, 0,NULL); -+ KeyboardThreadHandle = CreateThread(NULL, 0, KeyboardInputThread, NULL, 0,NULL); -+} -+ -+/* EOF */ -Index: win32ss/user/win32csr/input.c -=================================================================== ---- win32ss/user/win32csr/input.c (revision 48725) -+++ win32ss/user/win32csr/input.c (working copy) - -Property changes on: win32ss/user/win32csr/input.c -___________________________________________________________________ -Added: svn:eol-style -## -0,0 +1 ## -+native -\ No newline at end of property
10 years, 10 months
1
0
0
0
[fireball] 62336: Make Arwinss compile in newest trunk. It wouldn't work yet as CSRSS stuff should be fixed, however at least a buildable Arwinss is a good starting point. Thanks goes to Hermes Bel...
by fireball@svn.reactos.org
Author: fireball Date: Wed Feb 26 20:22:07 2014 New Revision: 62336 URL:
http://svn.reactos.org/svn/reactos?rev=62336&view=rev
Log: Make Arwinss compile in newest trunk. It wouldn't work yet as CSRSS stuff should be fixed, however at least a buildable Arwinss is a good starting point. Thanks goes to Hermes Belusca, Amine Khaldi and also to Oleg Izgagin (BMSTU student) for their help with this update. Added: branches/arwinss/arwinss/client/gdi32/historic.c - copied, changed from r62316, trunk/reactos/win32ss/gdi/gdi32/misc/historic.c Removed: branches/arwinss/arwinss/client/gdi32/gdi32.rbuild Modified: branches/arwinss/arwinss/client/gdi32/CMakeLists.txt branches/arwinss/arwinss/client/gdi32/freetype.c branches/arwinss/arwinss/client/gdi32/gdi32.spec branches/arwinss/arwinss/client/user32/CMakeLists.txt branches/arwinss/arwinss/client/user32/csr.c branches/arwinss/arwinss/client/user32/exticon.c branches/arwinss/arwinss/client/user32/spy.c branches/arwinss/arwinss/client/winent.drv/CMakeLists.txt branches/arwinss/arwinss/freetype/CMakeLists.txt branches/arwinss/arwinss/server/CMakeLists.txt branches/arwinss/arwinss/server/include/win32k.h branches/arwinss/arwinss/server/main/csr.c branches/arwinss/arwinss/server/main/init.c Modified: branches/arwinss/arwinss/client/gdi32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/client/gdi32/CM…
============================================================================== --- branches/arwinss/arwinss/client/gdi32/CMakeLists.txt [iso-8859-1] (original) +++ branches/arwinss/arwinss/client/gdi32/CMakeLists.txt [iso-8859-1] Wed Feb 26 20:22:07 2014 @@ -39,6 +39,7 @@ printdrv.c region.c regglue.c + historic.c gdi32.rc ${CMAKE_CURRENT_BINARY_DIR}/gdi32_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/gdi32.def) Modified: branches/arwinss/arwinss/client/gdi32/freetype.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/client/gdi32/fr…
============================================================================== --- branches/arwinss/arwinss/client/gdi32/freetype.c [iso-8859-1] (original) +++ branches/arwinss/arwinss/client/gdi32/freetype.c [iso-8859-1] Wed Feb 26 20:22:07 2014 @@ -82,7 +82,7 @@ #include "windef.h" #include "winbase.h" #include <ndk/ntndk.h> -#include <ddk/ntstatus.h> +//#include <ddk/ntstatus.h> #include "winerror.h" #include "winreg.h" #include "wingdi.h" Removed: branches/arwinss/arwinss/client/gdi32/gdi32.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/client/gdi32/gd…
============================================================================== --- branches/arwinss/arwinss/client/gdi32/gdi32.rbuild [iso-8859-1] (original) +++ branches/arwinss/arwinss/client/gdi32/gdi32.rbuild (removed) @@ -1,48 +0,0 @@ -<module name="gdi32" type="win32dll" baseaddress="${BASEADDRESS_GDI32}" installbase="system32" installname="gdi32.dll" unicode="yes"> - <importlibrary definition="gdi32.spec" /> - <include base="gdi32">include</include> - <include base="ReactOS">include/reactos/wine</include> - <include base="ReactOS">lib/3rdparty/freetype/include</include> - <define name="_DISABLE_TIDENTS" /> - <redefine name="WINVER">0x0600</redefine> - <redefine name="_WIN32_WINNT">0x0501</redefine> - <define name="LANGPACK" /> - <define name="__WINESRC__" /> - <define name="_WINE" /> - <library>wine</library> - <library>ntdll</library> - <library>usp10</library> - <library>user32</library> - <library>freetype</library> - <library>win32ksys</library> - <library>pseh</library> - <library>dxguid</library> - - <file>atan2.c</file> - <file>bidi.c</file> - <file>bitblt.c</file> - <file>bitmap.c</file> - <file>brush.c</file> - <file>clipping.c</file> - <file>dc.c</file> - <file>dib.c</file> - <file>driver.c</file> - <file>enhmetafile.c</file> - <file>enhmeta2.c</file> - <file>font.c</file> - <file>freetype.c</file> - <file>gdiobj.c</file> - <file>icm.c</file> - <file>mapping.c</file> - <file>metafile.c</file> - <file>opengl.c</file> - <file>painting.c</file> - <file>palette.c</file> - <file>path.c</file> - <file>pen.c</file> - <file>printdrv.c</file> - <file>region.c</file> - <file>regglue.c</file> - - <file>gdi32.rc</file> -</module> Modified: branches/arwinss/arwinss/client/gdi32/gdi32.spec URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/client/gdi32/gd…
============================================================================== --- branches/arwinss/arwinss/client/gdi32/gdi32.spec [iso-8859-1] (original) +++ branches/arwinss/arwinss/client/gdi32/gdi32.spec [iso-8859-1] Wed Feb 26 20:22:07 2014 @@ -277,7 +277,7 @@ @ stub GdiDciInitialize @ stub GdiDciSetClipList @ stub GdiDciSetDestination -@ stub GdiDeleteLocalDC +@ stdcall GdiDeleteLocalDC(ptr) @ stub GdiDeleteLocalObject @ stub GdiDeleteSpoolFileHandle @ stub GdiDescribePixelFormat @@ -310,8 +310,8 @@ @ stub GdiGetDC @ stub GdiGetDevmodeForPage @ stub GdiGetLocalBitmap -@ stub GdiGetLocalBrush -@ stub GdiGetLocalDC +@ stdcall GdiGetLocalBrush(ptr) +@ stdcall GdiGetLocalDC(ptr) @ stub GdiGetLocalFont @ stub GdiGetPageCount @ stub GdiGetPageHandle @@ -337,7 +337,7 @@ @ stub GdiReleaseDC @ stub GdiReleaseLocalDC @ stub GdiResetDCEMF -@ stub GdiSetAttrs +@ stdcall GdiSetAttrs(ptr) @ stdcall GdiSetBatchLimit(long) @ stub GdiSetLastError @ stub GdiSetPixelFormat Copied: branches/arwinss/arwinss/client/gdi32/historic.c (from r62316, trunk/reactos/win32ss/gdi/gdi32/misc/historic.c) URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/client/gdi32/hi…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/misc/historic.c [iso-8859-1] (original) +++ branches/arwinss/arwinss/client/gdi32/historic.c [iso-8859-1] Wed Feb 26 20:22:07 2014 @@ -7,18 +7,29 @@ * */ -#include <precomp.h> - -/* - * @implemented - */ -BOOL +#include "config.h" + +#include <stdarg.h> +#include <string.h> + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winnls.h" +#include "winreg.h" + +#include "gdi_private.h" + +/* + * @implemented + */ +/*BOOL WINAPI EngQueryEMFInfo(HDEV hdev, EMFINFO *pEMFInfo) { return FALSE; -} +}*/ /* * @implemented @@ -200,23 +211,10 @@ /* * @implemented - */ -BOOL -WINAPI -FixBrushOrgEx(HDC hDC, - INT nXOrg, - INT nYOrg, - LPPOINT lpPoint) -{ - /* Note Windows 2000/XP/VISTA always returns FALSE */ - return FALSE; -} - -/* - * @implemented * * GDIEntry 16 */ +#if 0 DWORD WINAPI DdSwapTextureHandles(LPDDRAWI_DIRECTDRAW_LCL pDDraw, @@ -226,6 +224,7 @@ /* Note Windows 2000/XP/VISTA always returns success */ return TRUE; } +#endif /* * @implemented Modified: branches/arwinss/arwinss/client/user32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/client/user32/C…
============================================================================== --- branches/arwinss/arwinss/client/user32/CMakeLists.txt [iso-8859-1] (original) +++ branches/arwinss/arwinss/client/user32/CMakeLists.txt [iso-8859-1] Wed Feb 26 20:22:07 2014 @@ -4,13 +4,11 @@ spec2def(user32.dll user32.spec ADD_IMPORTLIB) include_directories( - BEFORE ${REACTOS_SOURCE_DIR}/include/reactos/wine ${REACTOS_SOURCE_DIR}/include/reactos/subsys ${REACTOS_SOURCE_DIR}/arwinss/include ${REACTOS_SOURCE_DIR}/win32ss/include + ${REACTOS_SOURCE_DIR}/include/reactos/wine ) - -set_rc_compiler() list(APPEND SOURCE atom.c @@ -75,6 +73,6 @@ add_delay_importlibs(user32 imm32 usp10) add_importlibs(user32 gdi32 advapi32 version msvcrt kernel32 ntdll) -add_pch(user32 include/user32.h) +add_pch(user32 include/user32.h SOURCE) add_cd_file(TARGET user32 DESTINATION reactos/system32 FOR all) Modified: branches/arwinss/arwinss/client/user32/csr.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/client/user32/c…
============================================================================== --- branches/arwinss/arwinss/client/user32/csr.c [iso-8859-1] (original) +++ branches/arwinss/arwinss/client/user32/csr.c [iso-8859-1] Wed Feb 26 20:22:07 2014 @@ -24,31 +24,35 @@ #include <windowsx.h> #include <winnls32.h> #include <ndk/ntndk.h> -#include <ddk/ntstatus.h> +//#include <ddk/ntstatus.h> /* CSRSS Headers */ -#include <csrss/csrss.h> +#include <subsys/csr/csr.h> +#include <subsys/win/winmsg.h> + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(usercsr); + /* FUNCTIONS ******************************************************************/ /*********************************************************************** * ExitWindowsEx (USER32.@) */ -BOOL WINAPI ExitWindowsEx( UINT uFlags, DWORD dwReason ) +BOOL WINAPI ExitWindowsEx( UINT uFlags, DWORD dwReserved ) { - CSR_API_MESSAGE Request; - ULONG CsrRequest; NTSTATUS Status; + USER_API_MESSAGE ApiMessage; - CsrRequest = MAKE_CSR_API(EXIT_REACTOS, CSR_GUI); - Request.Data.ExitReactosRequest.Flags = uFlags; - Request.Data.ExitReactosRequest.Reserved = dwReason; + ApiMessage.Data.ExitReactosRequest.Flags = uFlags; + ApiMessage.Data.ExitReactosRequest.Reserved = dwReserved; - Status = CsrClientCallServer(&Request, + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, NULL, - CsrRequest, - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpExitWindowsEx), + sizeof(USER_EXIT_REACTOS)); + if (!NT_SUCCESS(Status)) { SetLastError(RtlNtStatusToDosError(Status)); return FALSE; @@ -57,23 +61,23 @@ return TRUE; } + /*********************************************************************** * RegisterServicesProcess (USER32.@) */ -BOOL WINAPI RegisterServicesProcess(DWORD ServicesProcessId) +BOOL WINAPI +RegisterServicesProcess(DWORD ServicesProcessId) { - CSR_API_MESSAGE Request; - ULONG CsrRequest; NTSTATUS Status; + USER_API_MESSAGE ApiMessage; - CsrRequest = MAKE_CSR_API(REGISTER_SERVICES_PROCESS, CSR_GUI); - Request.Data.RegisterServicesProcessRequest.ProcessId = (HANDLE)ServicesProcessId; + ApiMessage.Data.RegisterServicesProcessRequest.ProcessId = ServicesProcessId; - Status = CsrClientCallServer(&Request, + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, NULL, - CsrRequest, - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpRegisterServicesProcess), + sizeof(USER_REGISTER_SERVICES_PROCESS)); + if (!NT_SUCCESS(Status)) { SetLastError(RtlNtStatusToDosError(Status)); return FALSE; @@ -87,23 +91,22 @@ */ BOOL WINAPI RegisterLogonProcess(DWORD dwProcessId, BOOL bRegister) { - CSR_API_MESSAGE Request; - ULONG CsrRequest; - NTSTATUS Status; + NTSTATUS Status; + USER_API_MESSAGE ApiMessage; - CsrRequest = MAKE_CSR_API(REGISTER_LOGON_PROCESS, CSR_GUI); - Request.Data.RegisterLogonProcessRequest.ProcessId = (HANDLE)dwProcessId; - Request.Data.RegisterLogonProcessRequest.Register = bRegister; + ApiMessage.Data.RegisterLogonProcessRequest.ProcessId = dwProcessId; + ApiMessage.Data.RegisterLogonProcessRequest.Register = bRegister; - Status = CsrClientCallServer(&Request, - NULL, - CsrRequest, - sizeof(CSR_API_MESSAGE)); - if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) - { - SetLastError(RtlNtStatusToDosError(Status)); - return FALSE; - } + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpRegisterLogonProcess), + sizeof(USER_REGISTER_LOGON_PROCESS)); + if (!NT_SUCCESS(Status)) + { + ERR("Failed to register logon process with CSRSS\n"); + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; + } return TRUE; } @@ -116,6 +119,7 @@ WINAPI SetLogonNotifyWindow (HWND Wnd, HWINSTA WinSta) { +#if 0 /* Maybe we should call NtUserSetLogonNotifyWindow and let that one inform CSRSS??? */ CSR_API_MESSAGE Request; ULONG CsrRequest; @@ -133,10 +137,12 @@ SetLastError(RtlNtStatusToDosError(Status)); return FALSE; } - + return TRUE; +#else + ERR("SetLogonNotifyWindow is not yet implemented in Arwinss\n"); + return FALSE; +#endif } - - /* EOF */ Modified: branches/arwinss/arwinss/client/user32/exticon.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/client/user32/e…
============================================================================== --- branches/arwinss/arwinss/client/user32/exticon.c [iso-8859-1] (original) +++ branches/arwinss/arwinss/client/user32/exticon.c [iso-8859-1] Wed Feb 26 20:22:07 2014 @@ -120,7 +120,7 @@ { pos = (min + max) / 2; if (entry[pos].u1.Id == id) - return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry[pos].u2.s3.OffsetToDirectory); + return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry[pos].u2.s2.OffsetToDirectory); if (entry[pos].u1.Id > id) max = pos - 1; else min = pos + 1; } @@ -138,7 +138,7 @@ { const IMAGE_RESOURCE_DIRECTORY_ENTRY *entry; entry = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1); - return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry->u2.s3.OffsetToDirectory); + return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry->u2.s2.OffsetToDirectory); } /************************************************************************* @@ -524,7 +524,7 @@ const IMAGE_RESOURCE_DIRECTORY *resdir; /* go down this resource entry, name */ - resdir = (const IMAGE_RESOURCE_DIRECTORY *)((const char *)rootresdir + xresent->u2.s3.OffsetToDirectory); + resdir = (const IMAGE_RESOURCE_DIRECTORY *)((const char *)rootresdir + xresent->u2.s2.OffsetToDirectory); /* default language (0) */ resdir = find_entry_default(resdir,rootresdir); Modified: branches/arwinss/arwinss/client/user32/spy.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/client/user32/s…
============================================================================== --- branches/arwinss/arwinss/client/user32/spy.c [iso-8859-1] (original) +++ branches/arwinss/arwinss/client/user32/spy.c [iso-8859-1] Wed Feb 26 20:22:07 2014 @@ -31,7 +31,7 @@ #include "win.h" #include "user_private.h" #include "wine/debug.h" -#include "commctrl.h" +#include "wine/commctrl.h" #include "commdlg.h" #include "richedit.h" Modified: branches/arwinss/arwinss/client/winent.drv/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/client/winent.d…
============================================================================== --- branches/arwinss/arwinss/client/winent.drv/CMakeLists.txt [iso-8859-1] (original) +++ branches/arwinss/arwinss/client/winent.drv/CMakeLists.txt [iso-8859-1] Wed Feb 26 20:22:07 2014 @@ -42,5 +42,5 @@ ${PSEH_LIB}) add_importlibs(winent gdi32 user32 imm32 msvcrt kernel32 ntdll) -#add_pch(winent include/precomp.h) +#add_pch(winent include/precomp.h SOURCE) add_cd_file(TARGET winent DESTINATION reactos/system32 FOR all) Modified: branches/arwinss/arwinss/freetype/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/freetype/CMakeL…
============================================================================== --- branches/arwinss/arwinss/freetype/CMakeLists.txt [iso-8859-1] (original) +++ branches/arwinss/arwinss/freetype/CMakeLists.txt [iso-8859-1] Wed Feb 26 20:22:07 2014 @@ -1,7 +1,5 @@ spec2def(freetype.dll freetype.spec ADD_IMPORTLIB) - -set_rc_compiler() add_definitions( -DFT2_BUILD_LIBRARY) Modified: branches/arwinss/arwinss/server/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/CMakeLis…
============================================================================== --- branches/arwinss/arwinss/server/CMakeLists.txt [iso-8859-1] (original) +++ branches/arwinss/arwinss/server/CMakeLists.txt [iso-8859-1] Wed Feb 26 20:22:07 2014 @@ -140,8 +140,10 @@ libcntpr) add_importlibs(win32k ntoskrnl hal) -add_pch(win32k pch.h) +add_pch(win32k pch.h SOURCE) add_cd_file(TARGET win32k DESTINATION reactos/system32 FOR all) -add_library(win32ksys sys-stubs.S) set_source_files_properties(sys-stubs.S PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/w32ksvc.h) +add_asm_files(win32ksys_asm sys-stubs.S) +add_library(win32ksys ${win32ksys_asm}) +set_target_properties(win32ksys PROPERTIES LINKER_LANGUAGE "C") Modified: branches/arwinss/arwinss/server/include/win32k.h URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/include/…
============================================================================== --- branches/arwinss/arwinss/server/include/win32k.h [iso-8859-1] (original) +++ branches/arwinss/arwinss/server/include/win32k.h [iso-8859-1] Wed Feb 26 20:22:07 2014 @@ -31,6 +31,7 @@ #include <winerror.h> #include <wingdi.h> #define NT_BUILD_ENVIRONMENT +#define _ENGINE_EXPORT_ #include <winddi.h> #include <winuser.h> #include <prntfont.h> @@ -41,9 +42,6 @@ /* SEH Support with PSEH */ #include <pseh/pseh2.h> - -/* CSRSS Header */ -#include <csrss/csrss.h> /* Public Win32K Headers */ #include <include/callback.h> Modified: branches/arwinss/arwinss/server/main/csr.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/main/csr…
============================================================================== --- branches/arwinss/arwinss/server/main/csr.c [iso-8859-1] (original) +++ branches/arwinss/arwinss/server/main/csr.c [iso-8859-1] Wed Feb 26 20:22:07 2014 @@ -12,12 +12,13 @@ //#define NDEBUG #include <debug.h> -static HANDLE WindowsApiPort = NULL; +//static HANDLE WindowsApiPort = NULL; PEPROCESS CsrProcess = NULL; VOID NTAPI CsrInit(void) { +#if 0 NTSTATUS Status; UNICODE_STRING PortName; ULONG ConnectInfoLength; @@ -46,9 +47,13 @@ CsrProcess = PsGetCurrentProcess(); DPRINT("Win32k registered with CSRSS\n"); -} - - +#else + UNIMPLEMENTED; +#endif +} + + +#if 0 NTSTATUS FASTCALL co_CsrNotify(PCSR_API_MESSAGE Request) { @@ -87,6 +92,7 @@ return Status; } +#endif NTSTATUS @@ -174,6 +180,7 @@ NTAPI CsrNotifyCreateDesktop(HDESK Desktop) { +#if 0 CSR_API_MESSAGE Request; NTSTATUS Status; @@ -200,12 +207,17 @@ } return STATUS_SUCCESS; +#else + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +#endif } NTSTATUS NTAPI CsrNotifyShowDesktop(HWND DesktopWindow, ULONG Width, ULONG Height) { +#if 0 CSR_API_MESSAGE Request; Request.Type = MAKE_CSR_API(SHOW_DESKTOP, CSR_GUI); @@ -214,6 +226,10 @@ Request.Data.ShowDesktopRequest.Height = Height; return co_CsrNotify(&Request); +#else + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +#endif } /* EOF */ Modified: branches/arwinss/arwinss/server/main/init.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/arwinss/server/main/ini…
============================================================================== --- branches/arwinss/arwinss/server/main/init.c [iso-8859-1] (original) +++ branches/arwinss/arwinss/server/main/init.c [iso-8859-1] Wed Feb 26 20:22:07 2014 @@ -57,7 +57,7 @@ RtlZeroMemory(Win32Process, sizeof(PROCESSINFO)); - PsSetProcessWin32Process(Process, Win32Process); + PsSetProcessWin32Process(Process, Win32Process, NULL); Win32Process->peProcess = Process; /* FIXME - unlock the process */ @@ -144,7 +144,7 @@ RtlZeroMemory(Win32Thread, sizeof(THREADINFO)); - PsSetThreadWin32Thread(Thread, Win32Thread); + PsSetThreadWin32Thread(Thread, Win32Thread, NULL); /* FIXME - unlock the process */ } if (Type == PsW32ThreadCalloutInitialize) @@ -169,7 +169,7 @@ close_thread_desktop(Win32Thread); UserLeave(); - PsSetThreadWin32Thread(Thread, NULL); + PsSetThreadWin32Thread(Thread, NULL, NULL); } DPRINT("Leave Win32kThreadCallback\n"); @@ -341,15 +341,15 @@ CalloutData.PowerStateCallout = Win32kPowerStateCallout; CalloutData.JobCallout = Win32kJobCallout; CalloutData.BatchFlushRoutine = NtGdiFlushUserBatch; - CalloutData.DesktopOpenProcedure = Win32kDesktopOpenProcedure; - CalloutData.DesktopOkToCloseProcedure = Win32kDesktopOkToCloseProcedure; - CalloutData.DesktopCloseProcedure = Win32kDesktopCloseProcedure; - CalloutData.DesktopDeleteProcedure = Win32kDesktopDeleteProcedure; - CalloutData.WindowStationOkToCloseProcedure = Win32kWindowStationOkToCloseProcedure; - CalloutData.WindowStationCloseProcedure = Win32kWindowStationCloseProcedure; - CalloutData.WindowStationDeleteProcedure = Win32kWindowStationDeleteProcedure; - CalloutData.WindowStationParseProcedure = Win32kWindowStationParseProcedure; - CalloutData.WindowStationOpenProcedure = Win32kWindowStationOpenProcedure; + CalloutData.DesktopOpenProcedure = (PKWIN32_SESSION_CALLOUT)Win32kDesktopOpenProcedure; + CalloutData.DesktopOkToCloseProcedure = (PKWIN32_SESSION_CALLOUT)Win32kDesktopOkToCloseProcedure; + CalloutData.DesktopCloseProcedure = (PKWIN32_SESSION_CALLOUT)Win32kDesktopCloseProcedure; + CalloutData.DesktopDeleteProcedure = (PKWIN32_SESSION_CALLOUT)Win32kDesktopDeleteProcedure; + CalloutData.WindowStationOkToCloseProcedure = (PKWIN32_SESSION_CALLOUT)Win32kWindowStationOkToCloseProcedure; + CalloutData.WindowStationCloseProcedure = (PKWIN32_SESSION_CALLOUT)Win32kWindowStationCloseProcedure; + CalloutData.WindowStationDeleteProcedure = (PKWIN32_SESSION_CALLOUT)Win32kWindowStationDeleteProcedure; + CalloutData.WindowStationParseProcedure = (PKWIN32_SESSION_CALLOUT)Win32kWindowStationParseProcedure; + CalloutData.WindowStationOpenProcedure = (PKWIN32_SESSION_CALLOUT)Win32kWindowStationOpenProcedure; CalloutData.Win32DataCollectionProcedure = Win32kWin32DataCollectionProcedure; /* Register them */
10 years, 10 months
1
0
0
0
[dquintana] 62335: [RSHELL] * Add a new logging wrapper to record calls from the start menu back to the explorer site. CORE-7586
by dquintana@svn.reactos.org
Author: dquintana Date: Wed Feb 26 14:05:55 2014 New Revision: 62335 URL:
http://svn.reactos.org/svn/reactos?rev=62335&view=rev
Log: [RSHELL] * Add a new logging wrapper to record calls from the start menu back to the explorer site. CORE-7586 Added: branches/shell-experiments/base/shell/rshell/logging/CStartMenuSiteWrap.cpp (with props) Modified: branches/shell-experiments/base/shell/rshell/CMakeLists.txt branches/shell-experiments/base/shell/rshell/logging/CMenuBandWrap.cpp branches/shell-experiments/base/shell/rshell/logging/CMenuDeskBarWrap.cpp branches/shell-experiments/base/shell/rshell/logging/CMenuSiteWrap.cpp branches/shell-experiments/base/shell/rshell/precomp.h branches/shell-experiments/base/shell/rshell/wraplog.cpp Modified: branches/shell-experiments/base/shell/rshell/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMakeLists.txt [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMakeLists.txt [iso-8859-1] Wed Feb 26 14:05:55 2014 @@ -20,6 +20,7 @@ logging/CMenuBandWrap.cpp logging/CMenuDeskBarWrap.cpp logging/CMenuSiteWrap.cpp + logging/CStartMenuSiteWrap.cpp ${CMAKE_CURRENT_BINARY_DIR}/rshell.def) add_library(rshell SHARED ${SOURCE}) Modified: branches/shell-experiments/base/shell/rshell/logging/CMenuBandWrap.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/logging/CMenuBandWrap.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/logging/CMenuBandWrap.cpp [iso-8859-1] Wed Feb 26 14:05:55 2014 @@ -23,7 +23,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(CMenuBandWrap); class CMenuBandWrap : - public CComCoClass<CMenuBandWrap>, public CComObjectRootEx<CComMultiThreadModelNoCS>, public IDeskBand, public IObjectWithSite, Modified: branches/shell-experiments/base/shell/rshell/logging/CMenuDeskBarWrap.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/logging/CMenuDeskBarWrap.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/logging/CMenuDeskBarWrap.cpp [iso-8859-1] Wed Feb 26 14:05:55 2014 @@ -21,7 +21,6 @@ #include "wraplog.h" class CMenuDeskBarWrap : - public CComCoClass<CMenuDeskBarWrap>, public CComObjectRootEx<CComMultiThreadModelNoCS>, public IOleCommandTarget, public IServiceProvider, @@ -216,6 +215,24 @@ HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::SetSite(IUnknown *pUnkSite) { WrapLogEnter("CMenuDeskBarWrap<%p>::SetSite(IUnknown *pUnkSite=%p)\n", this, pUnkSite); + +#if WRAP_TRAYPRIV + CComPtr<ITrayPriv> inTp; + HRESULT hr2 = pUnkSite->QueryInterface(IID_PPV_ARG(ITrayPriv, &inTp)); + if (SUCCEEDED(hr2)) + { + ITrayPriv * outTp; + hr2 = CStartMenuSite_Wrapper(inTp, IID_PPV_ARG(ITrayPriv, &outTp)); + if (SUCCEEDED(hr2)) + { + pUnkSite = outTp; + } + else + { + outTp->Release(); + } + } +#endif HRESULT hr = m_IObjectWithSite->SetSite(pUnkSite); WrapLogExit("CMenuDeskBarWrap::SetSite()", hr); return hr; Modified: branches/shell-experiments/base/shell/rshell/logging/CMenuSiteWrap.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/logging/CMenuSiteWrap.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/logging/CMenuSiteWrap.cpp [iso-8859-1] Wed Feb 26 14:05:55 2014 @@ -24,7 +24,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(menusite); class CMenuSiteWrap : - public CComCoClass<CMenuSiteWrap>, public CComObjectRootEx<CComMultiThreadModelNoCS>, public IBandSite, public IDeskBarClient, Added: branches/shell-experiments/base/shell/rshell/logging/CStartMenuSiteWrap.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/logging/CStartMenuSiteWrap.cpp (added) +++ branches/shell-experiments/base/shell/rshell/logging/CStartMenuSiteWrap.cpp [iso-8859-1] Wed Feb 26 14:05:55 2014 @@ -0,0 +1,190 @@ +/* + * Shell Menu Site + * + * Copyright 2014 David Quintana + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "precomp.h" +#include "wraplog.h" + +WINE_DEFAULT_DEBUG_CHANNEL(menusite); + +class CStartMenuSiteWrap : + public CComObjectRootEx<CComMultiThreadModelNoCS>, + public IServiceProvider, + public ITrayPriv, + public IOleWindow, + public IOleCommandTarget +{ +public: + CStartMenuSiteWrap() {} + ~CStartMenuSiteWrap(); + + HRESULT InitWrap(ITrayPriv * bandSite); + +private: + CComPtr<IServiceProvider > m_IServiceProvider; + CComPtr<ITrayPriv > m_ITrayPriv; + CComPtr<IOleWindow > m_IOleWindow; + CComPtr<IOleCommandTarget> m_IOleCommandTarget; + +public: + // IServiceProvider + virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject); + + // ITrayPriv + virtual HRESULT STDMETHODCALLTYPE Execute(THIS_ IShellFolder*, LPCITEMIDLIST); + virtual HRESULT STDMETHODCALLTYPE Unknown(THIS_ PVOID, PVOID, PVOID, PVOID); + virtual HRESULT STDMETHODCALLTYPE AppendMenu(THIS_ HMENU*); + + // IOleWindow + virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *phwnd); + virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode); + + // IOleCommandTarget + virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID * pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText); + virtual HRESULT STDMETHODCALLTYPE Exec(const GUID * pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut); + + DECLARE_NOT_AGGREGATABLE(CStartMenuSiteWrap) + DECLARE_PROTECT_FINAL_CONSTRUCT() + BEGIN_COM_MAP(CStartMenuSiteWrap) + COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider) + COM_INTERFACE_ENTRY_IID(IID_ITrayPriv, ITrayPriv) + COM_INTERFACE_ENTRY_IID(IID_IOleWindow, IOleWindow) + COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget) + END_COM_MAP() +}; + +extern "C" +HRESULT CStartMenuSite_Wrapper(ITrayPriv * trayPriv, REFIID riid, LPVOID *ppv) +{ + HRESULT hr; + + *ppv = NULL; + + CStartMenuSiteWrap * site = new CComObject<CStartMenuSiteWrap>(); + + if (!site) + return E_OUTOFMEMORY; + + hr = site->InitWrap(trayPriv); + if (FAILED(hr)) + { + site->Release(); + return hr; + } + + hr = site->QueryInterface(riid, ppv); + + if (FAILED(hr)) + site->Release(); + + return hr; +} + +HRESULT CStartMenuSiteWrap::InitWrap(ITrayPriv * bandSite) +{ + HRESULT hr; + + WrapLogOpen(); + + m_ITrayPriv = bandSite; + + hr = bandSite->QueryInterface(IID_PPV_ARG(IServiceProvider, &m_IServiceProvider)); + if (FAILED(hr)) return hr; + hr = bandSite->QueryInterface(IID_PPV_ARG(IOleWindow, &m_IOleWindow)); + if (FAILED(hr)) return hr; + hr = bandSite->QueryInterface(IID_PPV_ARG(IOleCommandTarget, &m_IOleCommandTarget)); + return hr; +} + +CStartMenuSiteWrap::~CStartMenuSiteWrap() +{ + WrapLogClose(); +} + +// *** IServiceProvider methods *** +HRESULT STDMETHODCALLTYPE CStartMenuSiteWrap::QueryService(REFGUID guidService, REFIID riid, void **ppvObject) +{ + WrapLogEnter("CStartMenuSiteWrap<%p>::QueryService(REFGUID guidService=%s, REFIID riid=%s, void **ppvObject=%p)\n", this, Wrap(guidService), Wrap(riid), ppvObject); + HRESULT hr = m_IServiceProvider->QueryService(guidService, riid, ppvObject); + if (ppvObject) WrapLogPost("*ppvObject=%p\n", *ppvObject); + WrapLogExit("CStartMenuSiteWrap::QueryService()", hr); + return hr; +} + +// *** ITrayPriv methods *** +HRESULT STDMETHODCALLTYPE CStartMenuSiteWrap::Execute(IShellFolder* psf, LPCITEMIDLIST pidl) +{ + WrapLogEnter("CStartMenuSiteWrap<%p>::Execute(IShellFolder* psf=%p, LPCITEMIDLIST pidl=%p)\n", this, psf, pidl); + HRESULT hr = m_ITrayPriv->Execute(psf, pidl); + WrapLogExit("CStartMenuSiteWrap::Execute()", hr); + return hr; +} + +HRESULT STDMETHODCALLTYPE CStartMenuSiteWrap::Unknown(PVOID unk1, PVOID unk2, PVOID unk3, PVOID unk4) +{ + WrapLogEnter("CStartMenuSiteWrap<%p>::Unknown(PVOID unk1=%p, PVOID unk2=%p, PVOID unk3=%p, PVOID unk4=%p)\n", this, unk1, unk2, unk3, unk4); + HRESULT hr = m_ITrayPriv->Unknown(unk1, unk2, unk3, unk4); + WrapLogExit("CStartMenuSiteWrap::Unknown()", hr); + return hr; +} + +HRESULT STDMETHODCALLTYPE CStartMenuSiteWrap::AppendMenu(HMENU * phmenu) +{ + WrapLogEnter("CStartMenuSiteWrap<%p>::AppendMenu(HMENU * phmenu=%p)\n", this, phmenu); + HRESULT hr = m_ITrayPriv->AppendMenu(phmenu); + WrapLogExit("CStartMenuSiteWrap::AppendMenu()", hr); + return hr; +} + +// *** IOleWindow methods *** +HRESULT STDMETHODCALLTYPE CStartMenuSiteWrap::GetWindow(HWND *phwnd) +{ + WrapLogEnter("CStartMenuSiteWrap<%p>::GetWindow(HWND *phwnd=%p)\n", this, phwnd); + HRESULT hr = m_IOleWindow->GetWindow(phwnd); + if (phwnd) WrapLogPost("*phwnd=%p\n", *phwnd); + WrapLogExit("CStartMenuSiteWrap::GetWindow()", hr); + return hr; +} + +HRESULT STDMETHODCALLTYPE CStartMenuSiteWrap::ContextSensitiveHelp(BOOL fEnterMode) +{ + WrapLogEnter("CStartMenuSiteWrap<%p>::ContextSensitiveHelp(BOOL fEnterMode=%d)\n", this, fEnterMode); + HRESULT hr = m_IOleWindow->ContextSensitiveHelp(fEnterMode); + WrapLogExit("CStartMenuSiteWrap::ContextSensitiveHelp()", hr); + return hr; +} + +// *** IOleCommandTarget methods *** +HRESULT STDMETHODCALLTYPE CStartMenuSiteWrap::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText) +{ + WrapLogEnter("CStartMenuSiteWrap<%p>::QueryStatus(const GUID *pguidCmdGroup=%p, ULONG cCmds=%u, prgCmds=%p, pCmdText=%p)\n", this, pguidCmdGroup, cCmds, prgCmds, pCmdText); + HRESULT hr = m_IOleCommandTarget->QueryStatus(pguidCmdGroup, cCmds, prgCmds, pCmdText); + if (pguidCmdGroup) WrapLogPost("*pguidCmdGroup=%s\n", Wrap(*pguidCmdGroup)); + WrapLogExit("CStartMenuSiteWrap::QueryStatus()", hr); + return hr; +} + +HRESULT STDMETHODCALLTYPE CStartMenuSiteWrap::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) +{ + WrapLogEnter("CStartMenuSiteWrap<%p>::Exec(const GUID *pguidCmdGroup=%p, DWORD nCmdID=%d, DWORD nCmdexecopt=%d, VARIANT *pvaIn=%p, VARIANT *pvaOut=%p)\n", this, pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut); + if (pguidCmdGroup) WrapLogPre("*pguidCmdGroup=%s\n", Wrap(*pguidCmdGroup)); + HRESULT hr = m_IOleCommandTarget->Exec(pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut); + WrapLogExit("CStartMenuSiteWrap::Exec()", hr); + return hr; +} Propchange: branches/shell-experiments/base/shell/rshell/logging/CStartMenuSiteWrap.cpp ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/shell-experiments/base/shell/rshell/precomp.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/precomp.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/precomp.h [iso-8859-1] Wed Feb 26 14:05:55 2014 @@ -6,6 +6,7 @@ #define WRAP_MENUDESKBAR 0 #define WRAP_MENUSITE 0 #define WRAP_MENUBAND 0 +#define WRAP_TRAYPRIV 0 #define MERGE_FOLDERS 0 @@ -47,6 +48,7 @@ extern "C" HRESULT CMenuSite_Wrapper(IBandSite * bs, REFIID riid, LPVOID *ppv); extern "C" HRESULT CMenuBand_Wrapper(IShellMenu * sm, REFIID riid, LPVOID *ppv); extern "C" HRESULT CMergedFolder_Constructor(IShellFolder* userLocal, IShellFolder* allUsers, REFIID riid, LPVOID *ppv); +extern "C" HRESULT CStartMenuSite_Wrapper(ITrayPriv * trayPriv, REFIID riid, LPVOID *ppv); static __inline ULONG Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...) Modified: branches/shell-experiments/base/shell/rshell/wraplog.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/wraplog.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/wraplog.cpp [iso-8859-1] Wed Feb 26 14:05:55 2014 @@ -13,7 +13,7 @@ { if (openCount == 0) { - log = fopen("\\RShellWrap.log", "w"); + log = fopen("G:\\RShellWrap.log", "w"); nTemps = 0; callLevel = 0; }
10 years, 10 months
1
0
0
0
[dquintana] 62334: [EXPLORER-NEW] * Show the start menu at the same position and alignment Windows uses. [RSHELL] * Use IShellFolder methods instead of SHCreateShellItem. * Handle toolbar window ev...
by dquintana@svn.reactos.org
Author: dquintana Date: Wed Feb 26 11:13:23 2014 New Revision: 62334 URL:
http://svn.reactos.org/svn/reactos?rev=62334&view=rev
Log: [EXPLORER-NEW] * Show the start menu at the same position and alignment Windows uses. [RSHELL] * Use IShellFolder methods instead of SHCreateShellItem. * Handle toolbar window events from the toolbar class. * Improve the positioning calculations. * TODO: How to tell the submenus of the start menu to show towards the left? For when the taskbar is ABE_RIGHT. CORE-7596 Modified: branches/shell-experiments/base/shell/explorer-new/traywnd.c branches/shell-experiments/base/shell/rshell/CMenuBand.cpp branches/shell-experiments/base/shell/rshell/CMenuBand.h branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp branches/shell-experiments/base/shell/rshell/CMenuDeskBar.h branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp branches/shell-experiments/base/shell/rshell/CMenuToolbars.h branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp branches/shell-experiments/base/shell/rshell/precomp.h branches/shell-experiments/base/shell/rshell/wraplog.cpp Modified: branches/shell-experiments/base/shell/explorer-new/traywnd.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/ex…
============================================================================== --- branches/shell-experiments/base/shell/explorer-new/traywnd.c [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/explorer-new/traywnd.c [iso-8859-1] Wed Feb 26 11:13:23 2014 @@ -2083,21 +2083,24 @@ if (GetWindowRect(This->hwndStart, (RECT*) &rcExclude)) { - if (ITrayWindowImpl_IsPosHorizontal(This)) - { + switch (This->Position) + { + case ABE_BOTTOM: pt.x = rcExclude.left; pt.y = rcExclude.top; dwFlags |= MPPF_BOTTOM; - } - else - { - if (This->Position == ABE_LEFT) - pt.x = rcExclude.left; - else - pt.x = rcExclude.right; - + break; + case ABE_TOP: + case ABE_LEFT: + pt.x = rcExclude.left; pt.y = rcExclude.bottom; - dwFlags |= MPPF_BOTTOM; + dwFlags |= MPPF_TOP | MPPF_ALIGN_RIGHT; + break; + case ABE_RIGHT: + pt.x = rcExclude.right; + pt.y = rcExclude.bottom; + dwFlags |= MPPF_TOP | MPPF_ALIGN_LEFT; + break; } IMenuPopup_Popup(This->StartMenuPopup, Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Wed Feb 26 11:13:23 2014 @@ -58,11 +58,6 @@ m_popupItem(-1) { m_focusManager = CMenuFocusManager::AcquireManager(); - - m_marlett = CreateFont( - 0, 0, 0, 0, 0, 0, 0, 0, DEFAULT_CHARSET, - OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, - DEFAULT_QUALITY, FF_DONTCARE, L"Marlett"); } CMenuBand::~CMenuBand() @@ -74,8 +69,6 @@ if (m_SFToolbar) delete m_SFToolbar; - - DeleteObject(m_marlett); } HRESULT STDMETHODCALLTYPE CMenuBand::Initialize( @@ -553,186 +546,18 @@ HRESULT STDMETHODCALLTYPE CMenuBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult) { - RECT rc; - HDC hdc; - HBRUSH bgBrush; - HBRUSH hotBrush; - NMHDR * hdr; - NMTBCUSTOMDRAW * cdraw; - NMTBHOTITEM * hot; - NMMOUSE * rclick; - NMPGCALCSIZE* csize; - TBBUTTONINFO btni; - BOOL useFlatMenus = FALSE; - COLORREF clrText; - COLORREF clrTextHighlight; - - *theResult = 0; - switch (uMsg) - { - case WM_COMMAND: - - if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hWnd) == S_OK) - { - return m_staticToolbar->OnCommand(wParam, lParam, theResult); - } - - if (m_SFToolbar && m_SFToolbar->IsWindowOwner(hWnd) == S_OK) - { - return m_SFToolbar->OnCommand(wParam, lParam, theResult); - } - - return S_OK; - - case WM_NOTIFY: - hdr = reinterpret_cast<LPNMHDR>(lParam); - switch (hdr->code) - { - case PGN_CALCSIZE: - csize = reinterpret_cast<LPNMPGCALCSIZE>(hdr); - - if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hWnd) == S_OK) - { - SIZE tbs; - m_staticToolbar->GetIdealSize(tbs); - if (csize->dwFlag == PGF_CALCHEIGHT) - { - csize->iHeight = tbs.cy; - } - else if (csize->dwFlag == PGF_CALCWIDTH) - { - csize->iHeight = tbs.cx; - } - } - - if (m_SFToolbar && m_SFToolbar->IsWindowOwner(hWnd) == S_OK) - { - SIZE tbs; - m_SFToolbar->GetIdealSize(tbs); - if (csize->dwFlag == PGF_CALCHEIGHT) - { - csize->iHeight = tbs.cy; - } - else if (csize->dwFlag == PGF_CALCWIDTH) - { - csize->iHeight = tbs.cx; - } - } - return S_OK; - - case TBN_DROPDOWN: - - if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hWnd) == S_OK) - { - WPARAM wp = reinterpret_cast<LPNMTOOLBAR>(hdr)->iItem; - return m_staticToolbar->OnCommand(wp, 0, theResult); - } - - if (m_SFToolbar && m_SFToolbar->IsWindowOwner(hWnd) == S_OK) - { - WPARAM wp = reinterpret_cast<LPNMTOOLBAR>(hdr)->iItem; - return m_SFToolbar->OnCommand(wp, 0, theResult); - } - - return S_OK; - - case TBN_HOTITEMCHANGE: - hot = reinterpret_cast<LPNMTBHOTITEM>(hdr); - - if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hWnd) == S_OK) - { - return m_staticToolbar->OnHotItemChange(hot); - } - - if (m_SFToolbar && m_SFToolbar->IsWindowOwner(hWnd) == S_OK) - { - return m_SFToolbar->OnHotItemChange(hot); - } - - return S_OK; - - case NM_RCLICK: - rclick = reinterpret_cast<LPNMMOUSE>(hdr); - - if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hWnd) == S_OK) - { - return m_staticToolbar->OnContextMenu(rclick); - } - - if (m_SFToolbar && m_SFToolbar->IsWindowOwner(hWnd) == S_OK) - { - return m_SFToolbar->OnContextMenu(rclick); - } - - return S_OK; - - case NM_CUSTOMDRAW: - cdraw = reinterpret_cast<LPNMTBCUSTOMDRAW>(hdr); - switch (cdraw->nmcd.dwDrawStage) - { - case CDDS_PREPAINT: - *theResult = CDRF_NOTIFYITEMDRAW; - return S_OK; - - case CDDS_ITEMPREPAINT: - - SystemParametersInfo(SPI_GETFLATMENU, 0, &useFlatMenus, 0); - - clrText = GetSysColor(COLOR_MENUTEXT); - clrTextHighlight = GetSysColor(COLOR_HIGHLIGHTTEXT); - - bgBrush = GetSysColorBrush(COLOR_MENU); - hotBrush = GetSysColorBrush(useFlatMenus ? COLOR_MENUHILIGHT : COLOR_HIGHLIGHT); - - rc = cdraw->nmcd.rc; - hdc = cdraw->nmcd.hdc; - - if (((INT)cdraw->nmcd.dwItemSpec == m_hotItem || - (m_hotItem < 0 && (INT)cdraw->nmcd.dwItemSpec == m_popupItem))) - { - cdraw->nmcd.uItemState = CDIS_HOT; - } - - switch (cdraw->nmcd.uItemState) - { - case CDIS_HOT: - case CDIS_FOCUS: - FillRect(hdc, &rc, hotBrush); - SetTextColor(hdc, clrTextHighlight); - cdraw->clrText = clrTextHighlight; - break; - default: - FillRect(hdc, &rc, bgBrush); - SetTextColor(hdc, clrText); - cdraw->clrText = clrText; - break; - } - - cdraw->iListGap += 4; - - *theResult = CDRF_NOTIFYPOSTPAINT | TBCDRF_NOBACKGROUND | TBCDRF_NOEDGES | TBCDRF_NOOFFSET | TBCDRF_NOMARK | 0x00800000; // FIXME: the last bit is Vista+, for debugging only - return S_OK; - - case CDDS_ITEMPOSTPAINT: - btni.cbSize = sizeof(btni); - btni.dwMask = TBIF_STYLE; - SendMessage(hWnd, TB_GETBUTTONINFO, cdraw->nmcd.dwItemSpec, reinterpret_cast<LPARAM>(&btni)); - if (btni.fsStyle & BTNS_DROPDOWN) - { - SelectObject(cdraw->nmcd.hdc, m_marlett); - WCHAR text [] = L"8"; - SetBkMode(cdraw->nmcd.hdc, TRANSPARENT); - DrawTextEx(cdraw->nmcd.hdc, text, 1, &cdraw->nmcd.rc, DT_NOCLIP | DT_VCENTER | DT_RIGHT | DT_SINGLELINE, NULL); - } - *theResult = TRUE; - return S_OK; - } - return S_OK; - } - return S_OK; - } - + + if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hWnd) == S_OK) + { + return m_staticToolbar->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult); + } + + if (m_SFToolbar && m_SFToolbar->IsWindowOwner(hWnd) == S_OK) + { + return m_SFToolbar->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult); + } + return S_FALSE; } Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] Wed Feb 26 11:13:23 2014 @@ -61,8 +61,6 @@ CMenuToolbarBase * m_hotBar; INT m_hotItem; INT m_popupItem; - - HFONT m_marlett; public: CMenuBand(); Modified: branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] Wed Feb 26 11:13:23 2014 @@ -280,6 +280,7 @@ return hr; ::AdjustWindowRect(&rc, ::GetWindowLong(m_hWnd, GWL_STYLE), FALSE); + ::OffsetRect(&rc, -rc.left, -rc.top); if (m_Banner != NULL) { @@ -287,35 +288,46 @@ ::GetObject(m_Banner, sizeof(bm), &bm); rc.right += bm.bmWidth; } - + int x, y, cx, cy; RECT rcWorkArea; - SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, 0); + GetWindowRect(GetDesktopWindow(), &rcWorkArea); int waHeight = rcWorkArea.bottom - rcWorkArea.top; - switch (dwFlags & MPPF_POS_MASK) - { - case MPPF_LEFT: - case MPPF_TOP: + switch (dwFlags & 0xFF000000) + { + case MPPF_BOTTOM: + x = ppt->x; + cx = rc.right - rc.left; + y = ppt->y - rc.bottom; + cy = rc.bottom - rc.top; + break; + case MPPF_RIGHT: + x = ppt->x + rc.left; + cx = rc.right - rc.left; + y = ppt->y + rc.top; + cy = rc.bottom - rc.top; + break; + case MPPF_TOP | MPPF_ALIGN_LEFT: x = ppt->x - rc.right; cx = rc.right - rc.left; + y = ppt->y + rc.top; + cy = rc.bottom - rc.top; break; - default: + case MPPF_TOP | MPPF_ALIGN_RIGHT: x = ppt->x; cx = rc.right - rc.left; - break; - } - - if (dwFlags & MPPF_BOTTOM) - { - y = ppt->y - rc.bottom; - cy = rc.bottom - rc.top; - } - else - { y = ppt->y + rc.top; cy = rc.bottom - rc.top; + break; + } + + if (x + cx > rcWorkArea.right) + { + // FIXME: Works, but it's oversimplified. + x = prcExclude->left - cx; + dwFlags = (dwFlags & (~MPPF_TOP)) | MPPF_LEFT; } if (y < rcWorkArea.top) @@ -333,8 +345,11 @@ y = rcWorkArea.bottom - cy; } + + this->SetWindowPos(HWND_TOPMOST, x, y, cx, cy, SWP_SHOWWINDOW); + m_ShowFlags = dwFlags; m_Shown = true; // HACK: The bar needs to be notified of the size AFTER it is shown. @@ -343,7 +358,6 @@ _OnSize(WM_SIZE, 0, 0, bHandled); UIActivateIO(TRUE, NULL); - return S_OK; } Modified: branches/shell-experiments/base/shell/rshell/CMenuDeskBar.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuDeskBar.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuDeskBar.h [iso-8859-1] Wed Feb 26 11:13:23 2014 @@ -47,7 +47,8 @@ DWORD m_IconSize; HBITMAP m_Banner; - BOOL m_Shown; + BOOL m_Shown; + DWORD m_ShowFlags; public: CMenuDeskBar(); Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Wed Feb 26 11:13:23 2014 @@ -40,13 +40,149 @@ #define TIMERID_HOTTRACK 1 #define SUBCLASS_ID_MENUBAND 1 +HRESULT CMenuToolbarBase::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult) +{ + RECT rc; + HDC hdc; + HBRUSH bgBrush; + HBRUSH hotBrush; + NMHDR * hdr; + NMTBCUSTOMDRAW * cdraw; + NMTBHOTITEM * hot; + NMMOUSE * rclick; + NMPGCALCSIZE* csize; + TBBUTTONINFO btni; + COLORREF clrText; + COLORREF clrTextHighlight; + SIZE tbs; + + *theResult = 0; + switch (uMsg) + { + case WM_COMMAND: + return OnCommand(wParam, lParam, theResult); + + case WM_NOTIFY: + hdr = reinterpret_cast<LPNMHDR>(lParam); + switch (hdr->code) + { + case PGN_CALCSIZE: + csize = reinterpret_cast<LPNMPGCALCSIZE>(hdr); + + GetIdealSize(tbs); + if (csize->dwFlag == PGF_CALCHEIGHT) + { + csize->iHeight = tbs.cy; + } + else if (csize->dwFlag == PGF_CALCWIDTH) + { + csize->iHeight = tbs.cx; + } + return S_OK; + + case TBN_DROPDOWN: + wParam = reinterpret_cast<LPNMTOOLBAR>(hdr)->iItem; + return OnCommand(wParam, 0, theResult); + + case TBN_HOTITEMCHANGE: + hot = reinterpret_cast<LPNMTBHOTITEM>(hdr); + return OnHotItemChange(hot); + + case NM_RCLICK: + rclick = reinterpret_cast<LPNMMOUSE>(hdr); + + return OnContextMenu(rclick); + + case NM_CUSTOMDRAW: + cdraw = reinterpret_cast<LPNMTBCUSTOMDRAW>(hdr); + switch (cdraw->nmcd.dwDrawStage) + { + case CDDS_PREPAINT: + *theResult = CDRF_NOTIFYITEMDRAW; + return S_OK; + + case CDDS_ITEMPREPAINT: + + clrText = GetSysColor(COLOR_MENUTEXT); + clrTextHighlight = GetSysColor(COLOR_HIGHLIGHTTEXT); + + bgBrush = GetSysColorBrush(COLOR_MENU); + hotBrush = GetSysColorBrush(m_useFlatMenus ? COLOR_MENUHILIGHT : COLOR_HIGHLIGHT); + + rc = cdraw->nmcd.rc; + hdc = cdraw->nmcd.hdc; + + if (((INT) cdraw->nmcd.dwItemSpec == m_hotItem || + (m_hotItem < 0 && (INT) cdraw->nmcd.dwItemSpec == m_popupItem))) + { + cdraw->nmcd.uItemState = CDIS_HOT; + } + + switch (cdraw->nmcd.uItemState) + { + case CDIS_HOT: + case CDIS_FOCUS: + FillRect(hdc, &rc, hotBrush); + SetTextColor(hdc, clrTextHighlight); + cdraw->clrText = clrTextHighlight; + break; + default: + FillRect(hdc, &rc, bgBrush); + SetTextColor(hdc, clrText); + cdraw->clrText = clrText; + break; + } + + cdraw->iListGap += 4; + + *theResult = CDRF_NOTIFYPOSTPAINT | TBCDRF_NOBACKGROUND | TBCDRF_NOEDGES | TBCDRF_NOOFFSET | TBCDRF_NOMARK | 0x00800000; // FIXME: the last bit is Vista+, for debugging only + return S_OK; + + case CDDS_ITEMPOSTPAINT: + btni.cbSize = sizeof(btni); + btni.dwMask = TBIF_STYLE; + SendMessage(hWnd, TB_GETBUTTONINFO, cdraw->nmcd.dwItemSpec, reinterpret_cast<LPARAM>(&btni)); + if (btni.fsStyle & BTNS_DROPDOWN) + { + SelectObject(cdraw->nmcd.hdc, m_marlett); + WCHAR text[] = L"8"; + SetBkMode(cdraw->nmcd.hdc, TRANSPARENT); + RECT rc = cdraw->nmcd.rc; + rc.right += 1; + DrawTextEx(cdraw->nmcd.hdc, text, 1, &rc, DT_NOCLIP | DT_VCENTER | DT_RIGHT | DT_SINGLELINE, NULL); + } + *theResult = TRUE; + return S_OK; + } + return S_OK; + } + return S_OK; + } + + return S_FALSE; +} + CMenuToolbarBase::CMenuToolbarBase(CMenuBand *menuBand, BOOL usePager) : m_hwnd(NULL), + m_useFlatMenus(FALSE), m_menuBand(menuBand), m_hwndToolbar(NULL), m_dwMenuFlags(0), - m_hasIdealSize(FALSE) -{ + m_hotItem(-1), + m_popupItem(-1), + m_SubclassOld(NULL), + m_hasIdealSize(FALSE), + m_usePager(usePager) +{ + m_marlett = CreateFont( + 0, 0, 0, 0, 0, 0, 0, 0, DEFAULT_CHARSET, + OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, + DEFAULT_QUALITY, FF_DONTCARE, L"Marlett"); +} + +CMenuToolbarBase::~CMenuToolbarBase() +{ + DeleteObject(m_marlett); } HRESULT CMenuToolbarBase::IsWindowOwner(HWND hwnd) @@ -65,6 +201,8 @@ ::ShowWindow(m_hwnd, fShow ? SW_SHOW : SW_HIDE); UpdateImageLists(); + + SystemParametersInfo(SPI_GETFLATMENU, 0, &m_useFlatMenus, 0); return S_OK; } @@ -283,9 +421,8 @@ ClientToScreen(m_hwndToolbar, &a); ClientToScreen(m_hwndToolbar, &b); - POINTL pt = { b.x - 4, a.y }; + POINTL pt = { b.x - 3, a.y - 3 }; RECTL rcl = { a.x, a.y, b.x, b.y }; // maybe-TODO: fetch client area of deskbar? - #if USE_SYSTEM_MENUSITE hr = CoCreateInstance(CLSID_MenuBandSite, @@ -332,6 +469,7 @@ if (FAILED(hr)) return hr; + m_popupItem = itemId; m_menuBand->_OnPopupSubMenu(itemId, popup, &pt, &rcl); return S_OK; @@ -680,21 +818,22 @@ tbb.fsState = TBSTATE_ENABLED; tbb.fsStyle = 0; - CComPtr<IShellItem> psi; - hr = SHCreateShellItem(NULL, m_shellFolder, item, &psi); + STRRET sr = { STRRET_CSTR, { 0 } }; + + hr = m_shellFolder->GetDisplayNameOf(item, SIGDN_NORMALDISPLAY, &sr); if (FAILED(hr)) return hr; - hr = psi->GetDisplayName(SIGDN_NORMALDISPLAY, &MenuString); - if (FAILED(hr)) - return hr; + StrRetToStr(&sr, NULL, &MenuString); index = SHMapPIDLToSystemImageListIndex(m_shellFolder, item, &indexOpen); - SFGAOF attrs; - hr = psi->GetAttributes(SFGAO_FOLDER, &attrs); - - if (attrs != 0) + LPCITEMIDLIST itemc = item; + + SFGAOF attrs = SFGAO_FOLDER; + hr = m_shellFolder->GetAttributesOf(1, &itemc, &attrs); + + if (attrs & SFGAO_FOLDER) { tbb.fsStyle |= BTNS_DROPDOWN; } @@ -706,7 +845,7 @@ // FIXME: remove before deleting the toolbar or it will leak SendMessageW(m_hwndToolbar, TB_ADDBUTTONS, 1, reinterpret_cast<LPARAM>(&tbb)); - HeapFree(GetProcessHeap(), 0, MenuString); + CoTaskMemFree(MenuString); } CoTaskMemFree(item); @@ -869,15 +1008,12 @@ HRESULT CMenuSFToolbar::HasSubMenu(UINT uItem) { HRESULT hr; - CComPtr<IShellItem> psi; - hr = SHCreateShellItem(NULL, m_shellFolder, GetPidlFromId(uItem), &psi); - if (FAILED(hr)) - return S_FALSE; - - SFGAOF attrs; - hr = psi->GetAttributes(SFGAO_FOLDER, &attrs); - if (FAILED(hr)) - return hr; - - return (attrs != 0) ? S_OK : S_FALSE; -} + LPCITEMIDLIST pidl = GetPidlFromId(uItem); + + SFGAOF attrs = SFGAO_FOLDER; + hr = m_shellFolder->GetAttributesOf(1, &pidl, &attrs); + if (FAILED(hr)) + return hr; + + return (attrs & SFGAO_FOLDER) ? S_OK : S_FALSE; +} Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] Wed Feb 26 11:13:23 2014 @@ -25,13 +25,16 @@ class CMenuToolbarBase { private: - HWND m_hwnd; // May be the pager + HWND m_hwnd; // May be the pager + HFONT m_marlett; + BOOL m_useFlatMenus; protected: CMenuBand * m_menuBand; HWND m_hwndToolbar; DWORD m_dwMenuFlags; INT m_hotItem; + INT m_popupItem; WNDPROC m_SubclassOld; BOOL m_hasIdealSize; SIZE m_idealSize; @@ -42,7 +45,7 @@ public: CMenuToolbarBase(CMenuBand *menuBand, BOOL usePager); - virtual ~CMenuToolbarBase() {} + virtual ~CMenuToolbarBase(); HRESULT IsWindowOwner(HWND hwnd); HRESULT CreateToolbar(HWND hwndParent, DWORD dwFlags); @@ -50,11 +53,12 @@ HRESULT ShowWindow(BOOL fShow); HRESULT Close(); + HRESULT OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult); + virtual HRESULT FillToolbar() = 0; virtual HRESULT PopupItem(UINT uItem) = 0; virtual HRESULT HasSubMenu(UINT uItem) = 0; virtual HRESULT OnContextMenu(NMMOUSE * rclick) = 0; - virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult); HRESULT PopupSubMenu(UINT itemId, UINT index, IShellMenu* childShellMenu); HRESULT PopupSubMenu(UINT index, HMENU menu); @@ -69,6 +73,8 @@ void InvalidateDraw(); protected: + virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult); + LRESULT CALLBACK SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); HRESULT UpdateImageLists(); Modified: branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp [iso-8859-1] Wed Feb 26 11:13:23 2014 @@ -77,7 +77,7 @@ return hr; if (hr == S_FALSE) m_FirstDone = true; - if (celt < 2) + else if (celt < 2) return hr; } @@ -85,16 +85,19 @@ if (*pceltFetched < celt) { rgelt += *pceltFetched; - celt = (*pceltFetched - celt); + celt = (celt - *pceltFetched); *pceltFetched = 0; + + hr = m_AllUSers->Next(celt, rgelt, pceltFetched); + if (FAILED(hr)) + return hr; + + *pceltFetched += offset; + + return hr; } - hr = m_UserLocal->Next(celt, rgelt, pceltFetched); - if (FAILED(hr)) - return hr; - - *pceltFetched += offset; - return hr; + return S_OK; } virtual HRESULT STDMETHODCALLTYPE Skip( @@ -227,6 +230,7 @@ if (SUCCEEDED(hr)) return hr; + *rgfInOut = 0; hr = m_AllUSers->GetAttributesOf(cidl, apidl, rgfInOut); return hr; Modified: branches/shell-experiments/base/shell/rshell/precomp.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/precomp.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/precomp.h [iso-8859-1] Wed Feb 26 11:13:23 2014 @@ -6,6 +6,8 @@ #define WRAP_MENUDESKBAR 0 #define WRAP_MENUSITE 0 #define WRAP_MENUBAND 0 + +#define MERGE_FOLDERS 0 #include <stdio.h> #include <tchar.h> Modified: branches/shell-experiments/base/shell/rshell/wraplog.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/wraplog.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/wraplog.cpp [iso-8859-1] Wed Feb 26 11:13:23 2014 @@ -13,7 +13,7 @@ { if (openCount == 0) { - log = fopen("RShellWrap.log", "w"); + log = fopen("\\RShellWrap.log", "w"); nTemps = 0; callLevel = 0; }
10 years, 10 months
1
0
0
0
[hbelusca] 62333: [NTVDM] - BIOS32: As a demonstration, load a BIOS expansion ROM (the one I've tested is the "OS in PCI expansion ROM" from: https://sites.google.com/site/pinczakko/building-a-kern...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed Feb 26 01:16:56 2014 New Revision: 62333 URL:
http://svn.reactos.org/svn/reactos?rev=62333&view=rev
Log: [NTVDM] - BIOS32: As a demonstration, load a BIOS expansion ROM (the one I've tested is the "OS in PCI expansion ROM" from:
https://sites.google.com/site/pinczakko/building-a-kernel-in-pci-expansion-…
; we don't support PCI thingies at all, but the bootstrap code works correctly). - Initialize the BIOS32 stack for the callbacks. - In the common BIOS functions, if we try to load the Windows NTVDM (SoftPC) BIOS (file: bios4.rom), we immediately hit a BOP 0x00 followed by INT 0x19 (bootstrap to run an OS). The BOP 0x00 is the function used by the BIOS to ask NTVDM to initialize the hardware, the IVT with data and so on. Also we finish to load the low part of the NTVDM BIOS in it (file: bios1.rom). It's work-in-progress, nothing is done, there are lots of debugging code... Have fun! (to load a custom bios you need to put its filename as the first parameter of the BiosInitialize call, in the main() function in ntvdm.c). Modified: branches/ntvdm/subsystems/ntvdm/bios/bios.c branches/ntvdm/subsystems/ntvdm/bios/bios.h branches/ntvdm/subsystems/ntvdm/bios/bios32/bios32.c branches/ntvdm/subsystems/ntvdm/bios/bios32/bios32.h Modified: branches/ntvdm/subsystems/ntvdm/bios/bios.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios/bio…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios/bios.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios/bios.c [iso-8859-1] Wed Feb 26 01:16:56 2014 @@ -11,13 +11,77 @@ #define NDEBUG #include "emulator.h" +#include "callback.h" + #include "bios.h" + +#include "bop.h" +#include "rom.h" /* PRIVATE VARIABLES **********************************************************/ static BOOLEAN Bios32Loaded = FALSE; +static CALLBACK16 __BiosContext; + +/* BOP Identifiers */ +#define BOP_BIOSINIT 0x00 // Windows NTVDM (SoftPC) BIOS calls BOP 0x00 + // to let the virtual machine initialize itself + // the IVT and its hardware. + /* PRIVATE FUNCTIONS **********************************************************/ + +static VOID WINAPI BiosInitBop(LPWORD Stack) +{ + /* Load the second part of the Windows NTVDM BIOS image */ + LPCWSTR BiosFileName = L"bios1.rom"; + PVOID BiosLocation = (PVOID)TO_LINEAR(BIOS_SEGMENT, 0x0000); + DWORD BiosSize = 0; + BOOLEAN Success; + + DPRINT1("You are loading Windows NTVDM BIOS!"); + + /* Initialize a private callback context */ + InitializeContext(&__BiosContext, BIOS_SEGMENT, 0x0000); + + Success = LoadRom(BiosFileName, BiosLocation, &BiosSize); + DPRINT1("BIOS loading %s ; GetLastError() = %u\n", Success ? "succeeded" : "failed", GetLastError()); + + if (Success == FALSE) return; + + // DisplayMessage(L"First bytes at 0x%p: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n" + // L"3 last bytes at 0x%p: 0x%02x 0x%02x 0x%02x", + // BiosLocation, + // *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 0), + // *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 1), + // *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 2), + // *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 3), + // *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 4), + // *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 5), + // *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 6), + // *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 7), + // *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 8), + // *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 9), + + // (PVOID)((ULONG_PTR)BiosLocation + BiosSize - 2), + // *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + BiosSize - 2), + // *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + BiosSize - 1), + // *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + BiosSize - 0)); + + /* Initialize IVT and hardware */ + + /* Load VGA BIOS */ + // Success = LoadRom(L"v7vga.rom", (PVOID)0xC0000, &BiosSize); + // DPRINT1("VGA BIOS loading %s ; GetLastError() = %u\n", Success ? "succeeded" : "failed", GetLastError()); + + ///////////// MUST BE DONE AFTER IVT INITIALIZATION !! ///////////////////// + + /* Load some ROMs */ + Success = LoadRom(L"boot.bin", (PVOID)0xE0000, &BiosSize); + DPRINT1("Test ROM loading %s ; GetLastError() = %u\n", Success ? "succeeded" : "failed", GetLastError()); + + SearchAndInitRoms(&__BiosContext); +} /* PUBLIC FUNCTIONS ***********************************************************/ @@ -25,47 +89,18 @@ IN HANDLE ConsoleInput, IN HANDLE ConsoleOutput) { + /* Register the BIOS support BOPs */ + RegisterBop(BOP_BIOSINIT, BiosInitBop); + if (BiosFileName) { - BOOL Success; - HANDLE hBiosFile; - DWORD BiosSize; - PVOID BiosLocation; + PVOID BiosLocation = NULL; + DWORD BiosSize = 0; + BOOLEAN Success = LoadBios(BiosFileName, &BiosLocation, &BiosSize); - /* Open the BIOS file */ - SetLastError(0); // For debugging purposes - hBiosFile = CreateFileW(BiosFileName, - GENERIC_READ, - FILE_SHARE_READ, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL); - DPRINT1("BIOS opening %s ; GetLastError() = %u\n", hBiosFile != INVALID_HANDLE_VALUE ? "succeeded" : "failed", GetLastError()); + DPRINT1("BIOS loading %s ; GetLastError() = %u\n", Success ? "succeeded" : "failed", GetLastError()); - /* If we failed, bail out */ - if (hBiosFile == INVALID_HANDLE_VALUE) return FALSE; - - /* OK, we have a handle to the BIOS file */ - - /* - * Retrieve the size of the file. Since the size of the BIOS file - * should be at most 64kB, we just use GetFileSize. - */ - BiosSize = GetFileSize(hBiosFile, NULL); - if (BiosSize == INVALID_FILE_SIZE && GetLastError() != ERROR_SUCCESS) - { - /* We failed, return failure */ - - /* Close the BIOS file */ - CloseHandle(hBiosFile); - - return FALSE; - } - - /* BIOS location needs to be aligned on 32-bit boundary */ - /* (PVOID)((ULONG_PTR)BaseAddress + ROM_AREA_END + 1 - BiosSize) */ - BiosLocation = (PVOID)MEM_ALIGN_DOWN((ULONG_PTR)TO_LINEAR(0xF000, 0xFFFF) + 1 - BiosSize, sizeof(ULONG)); + if (Success == FALSE) return FALSE; DisplayMessage(L"First bytes at 0x%p: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n" L"3 last bytes at 0x%p: 0x%02x 0x%02x 0x%02x", @@ -81,41 +116,10 @@ *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 8), *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 9), - (PVOID)((ULONG_PTR)TO_LINEAR(0xF000, 0xFFFF) - 2), - *(PCHAR)((ULONG_PTR)SEG_OFF_TO_PTR(0xF000, 0xFFFF) - 2), - *(PCHAR)((ULONG_PTR)SEG_OFF_TO_PTR(0xF000, 0xFFFF) - 1), - *(PCHAR)((ULONG_PTR)SEG_OFF_TO_PTR(0xF000, 0xFFFF) - 0)); - - /* Attempt to load the BIOS file into memory */ - SetLastError(0); // For debugging purposes - Success = ReadFile(hBiosFile, - REAL_TO_PHYS(BiosLocation), - BiosSize, - &BiosSize, - NULL); - DPRINT1("BIOS loading %s ; GetLastError() = %u\n", Success ? "succeeded" : "failed", GetLastError()); - - /* Close the BIOS file */ - CloseHandle(hBiosFile); - - DisplayMessage(L"First bytes at 0x%p: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n" - L"3 last bytes at 0x%p: 0x%02x 0x%02x 0x%02x", - BiosLocation, - *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 0), - *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 1), - *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 2), - *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 3), - *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 4), - *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 5), - *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 6), - *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 7), - *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 8), - *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + 9), - - (PVOID)((ULONG_PTR)TO_LINEAR(0xF000, 0xFFFF) - 2), - *(PCHAR)((ULONG_PTR)SEG_OFF_TO_PTR(0xF000, 0xFFFF) - 2), - *(PCHAR)((ULONG_PTR)SEG_OFF_TO_PTR(0xF000, 0xFFFF) - 1), - *(PCHAR)((ULONG_PTR)SEG_OFF_TO_PTR(0xF000, 0xFFFF) - 0)); + (PVOID)((ULONG_PTR)BiosLocation + BiosSize - 2), + *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + BiosSize - 2), + *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + BiosSize - 1), + *(PCHAR)((ULONG_PTR)REAL_TO_PHYS(BiosLocation) + BiosSize - 0)); DisplayMessage(L"POST at 0x%p: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x", TO_LINEAR(getCS(), getIP()), Modified: branches/ntvdm/subsystems/ntvdm/bios/bios.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios/bio…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios/bios.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios/bios.h [iso-8859-1] Wed Feb 26 01:16:56 2014 @@ -16,13 +16,10 @@ /* DEFINES ********************************************************************/ -#define ROM_AREA_START 0xE0000 -#define ROM_AREA_END 0xFFFFF +// #define BDA_SEGMENT 0x40 +#define BIOS_SEGMENT 0xF000 #if 0 - -#define BDA_SEGMENT 0x40 -#define BIOS_SEGMENT 0xF000 /* * BIOS Data Area at 0040:XXXX Modified: branches/ntvdm/subsystems/ntvdm/bios/bios32/bios32.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios/bio…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios/bios32/bios32.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios/bios32/bios32.c [iso-8859-1] Wed Feb 26 01:16:56 2014 @@ -13,6 +13,8 @@ #include "emulator.h" #include "callback.h" +#include "../rom.h" +#include "../bios.h" #include "bios32.h" #include "io.h" @@ -355,7 +357,21 @@ BOOLEAN Bios32Initialize(IN HANDLE ConsoleInput, IN HANDLE ConsoleOutput) { + BOOLEAN Success; UCHAR Low, High; + + /* Disable interrupts */ + setIF(0); + + /* Initialize the stack */ + // That's what says IBM... (stack at 30:00FF going downwards) + // setSS(0x0000); + // setSP(0x0400); + setSS(0x0050); // Stack at 50:0400, going downwards + setSP(0x0400); + + /* Set data segment */ + setDS(BDA_SEGMENT); /* Initialize the BDA */ Bda = (PBIOS_DATA_AREA)SEG_OFF_TO_PTR(BDA_SEGMENT, 0); @@ -389,6 +405,14 @@ /* Enable interrupts */ setIF(1); + ///////////// MUST BE DONE AFTER IVT INITIALIZATION !! ///////////////////// + + /* Load some ROMs */ + Success = LoadRom(L"boot.bin", (PVOID)0xE0000, NULL); + DPRINT1("Test ROM loading %s ; GetLastError() = %u\n", Success ? "succeeded" : "failed", GetLastError()); + + SearchAndInitRoms(&BiosContext); + /* We are done */ return TRUE; } Modified: branches/ntvdm/subsystems/ntvdm/bios/bios32/bios32.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios/bio…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios/bios32/bios32.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios/bios32/bios32.h [iso-8859-1] Wed Feb 26 01:16:56 2014 @@ -31,11 +31,8 @@ #define BIOS_EQUIPMENT_LIST 0x2C // HACK: Disable FPU for now -#define ROM_AREA_START 0xE0000 -#define ROM_AREA_END 0xFFFFF - #define BDA_SEGMENT 0x40 -#define BIOS_SEGMENT 0xF000 +// #define BIOS_SEGMENT 0xF000 /* * BIOS Data Area at 0040:XXXX
10 years, 10 months
1
0
0
0
← Newer
1
2
3
4
5
6
...
47
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
35
36
37
38
39
40
41
42
43
44
45
46
47
Results per page:
10
25
50
100
200