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
April 2015
----- 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
481 discussions
Start a n
N
ew thread
[aandrejevic] 67444: [NTVDM] Implement INT 21h, AH = 52h (Get List of Lists - SYSVARS). Rewrite the SFT code to keep the SFT in guest memory. Implement the NUL device driver.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Sun Apr 26 18:09:57 2015 New Revision: 67444 URL:
http://svn.reactos.org/svn/reactos?rev=67444&view=rev
Log: [NTVDM] Implement INT 21h, AH = 52h (Get List of Lists - SYSVARS). Rewrite the SFT code to keep the SFT in guest memory. Implement the NUL device driver. Added: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.h (with props) trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.c (with props) trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.h (with props) Modified: trunk/reactos/subsystems/mvdm/ntvdm/CMakeLists.txt trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/bios.c trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/device.c trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/device.h trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.h trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c Modified: trunk/reactos/subsystems/mvdm/ntvdm/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/CMak…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/CMakeLists.txt [iso-8859-1] Sun Apr 26 18:09:57 2015 @@ -33,6 +33,7 @@ dos/dos32krnl/dos.c dos/dos32krnl/dosfiles.c dos/dos32krnl/emsdrv.c + dos/dos32krnl/handle.c dos/dos32krnl/himem.c dos/dos32krnl/memory.c dos/mouse32.c Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/bios.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/bios.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/bios.c [iso-8859-1] Sun Apr 26 18:09:57 2015 @@ -15,6 +15,7 @@ #include "int32.h" #include "dos.h" +#include "dosfiles.h" #include "memory.h" #include "bios/bios.h" @@ -56,43 +57,33 @@ BOOLEAN DosCheckInput(VOID) { - PDOS_SFT_ENTRY SftEntry = DosGetSftEntry(DOS_INPUT_HANDLE); - - if (SftEntry == NULL) + PDOS_FILE_DESCRIPTOR Descriptor = DosGetHandleFileDescriptor(DOS_INPUT_HANDLE); + + if (Descriptor == NULL) { /* Invalid handle */ DosLastError = ERROR_INVALID_HANDLE; // ERROR_FILE_NOT_FOUND return FALSE; } - switch (SftEntry->Type) - { - case DOS_SFT_ENTRY_WIN32: - { - DWORD FileSizeHigh; - DWORD FileSize = GetFileSize(SftEntry->Handle, &FileSizeHigh); - LONG LocationHigh = 0; - DWORD Location = SetFilePointer(SftEntry->Handle, 0, &LocationHigh, FILE_CURRENT); - - return ((Location != FileSize) || (LocationHigh != FileSizeHigh)); - } - - case DOS_SFT_ENTRY_DEVICE: - { - WORD Result; - - if (!SftEntry->DeviceNode->InputStatusRoutine) return FALSE; - - Result = SftEntry->DeviceNode->InputStatusRoutine(SftEntry->DeviceNode); - return !(Result & DOS_DEVSTAT_BUSY); - } - - default: - { - /* Invalid handle */ - DosLastError = ERROR_INVALID_HANDLE; - return FALSE; - } + if (Descriptor->DeviceInfo & (1 << 7)) + { + WORD Result; + PDOS_DEVICE_NODE Node = DosGetDriverNode(Descriptor->DevicePointer); + + if (!Node->InputStatusRoutine) return FALSE; + + Result = Node->InputStatusRoutine(Node); + return !(Result & DOS_DEVSTAT_BUSY); + } + else + { + DWORD FileSizeHigh; + DWORD FileSize = GetFileSize(Descriptor->Win32Handle, &FileSizeHigh); + LONG LocationHigh = 0; + DWORD Location = SetFilePointer(Descriptor->Win32Handle, 0, &LocationHigh, FILE_CURRENT); + + return ((Location != FileSize) || (LocationHigh != FileSizeHigh)); } } Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/device.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/device.c [iso-8859-1] Sun Apr 26 18:09:57 2015 @@ -40,7 +40,6 @@ C_ASSERT((sizeof(StrategyRoutine) + sizeof(InterruptRoutine)) == DEVICE_CODE_SIZE); static LIST_ENTRY DeviceList = { &DeviceList, &DeviceList }; -static DWORD FirstDriver = 0xFFFFFFFF; static PDOS_REQUEST_HEADER DeviceRequest; /* PRIVATE FUNCTIONS **********************************************************/ @@ -213,17 +212,9 @@ static VOID DosAddDriver(DWORD Driver) { - PDOS_DRIVER LastDriver; - - if (LOWORD(FirstDriver) == 0xFFFF) - { - /* This is the first driver */ - FirstDriver = Driver; - return; - } - - /* The list isn't empty, so find the last driver in it */ - LastDriver = (PDOS_DRIVER)FAR_POINTER(FirstDriver); + PDOS_DRIVER LastDriver = &SysVars->NullDevice; + + /* Find the last driver in the list */ while (LOWORD(LastDriver->Link) != 0xFFFF) { LastDriver = (PDOS_DRIVER)FAR_POINTER(LastDriver->Link); @@ -231,18 +222,25 @@ /* Add the new driver to the list */ LastDriver->Link = Driver; + LastDriver = (PDOS_DRIVER)FAR_POINTER(Driver); + + if (LastDriver->DeviceAttributes & DOS_DEVATTR_CLOCK) + { + /* Update the active CLOCK driver */ + SysVars->ActiveClock = Driver; + } + + if (LastDriver->DeviceAttributes + & (DOS_DEVATTR_STDIN | DOS_DEVATTR_STDOUT | DOS_DEVATTR_CON)) + { + /* Update the active CON driver */ + SysVars->ActiveCon = Driver; + } } static VOID DosRemoveDriver(DWORD Driver) { - DWORD CurrentDriver = FirstDriver; - - if (FirstDriver == Driver) - { - /* Update the first driver */ - FirstDriver = ((PDOS_DRIVER)FAR_POINTER(FirstDriver))->Link; - return; - } + DWORD CurrentDriver = MAKELONG(FIELD_OFFSET(DOS_SYSVARS, NullDevice), DOS_DATA_SEGMENT); while (LOWORD(CurrentDriver) != 0xFFFF) { @@ -289,48 +287,54 @@ /* PUBLIC FUNCTIONS ***********************************************************/ +PDOS_DEVICE_NODE DosGetDriverNode(DWORD Driver) +{ + PLIST_ENTRY i; + PDOS_DEVICE_NODE Node; + + for (i = DeviceList.Flink; i != &DeviceList; i = i->Flink) + { + Node = CONTAINING_RECORD(i, DOS_DEVICE_NODE, Entry); + if (Node->Driver == Driver) break; + } + + if (i == &DeviceList) + { + DPRINT1("The driver at %04X:%04X has no associated device node. " + "Installing automagically.\n", + HIWORD(Driver), + LOWORD(Driver)); + + /* Create the device node */ + Node = DosCreateDeviceNode(Driver); + Node->IoctlReadRoutine = DosDriverDispatchIoctlRead; + Node->ReadRoutine = DosDriverDispatchRead; + Node->PeekRoutine = DosDriverDispatchPeek; + Node->InputStatusRoutine = DosDriverDispatchInputStatus; + Node->FlushInputRoutine = DosDriverDispatchFlushInput; + Node->IoctlWriteRoutine = DosDriverDispatchIoctlWrite; + Node->WriteRoutine = DosDriverDispatchWrite; + Node->OutputStatusRoutine = DosDriverDispatchOutputStatus; + Node->FlushOutputRoutine = DosDriverDispatchFlushOutput; + Node->OpenRoutine = DosDriverDispatchOpen; + Node->CloseRoutine = DosDriverDispatchClose; + Node->OutputUntilBusyRoutine = DosDriverDispatchOutputUntilBusy; + } + + return Node; +} + PDOS_DEVICE_NODE DosGetDevice(LPCSTR DeviceName) { - PLIST_ENTRY i; - DWORD CurrentDriver = FirstDriver; + DWORD CurrentDriver = MAKELONG(FIELD_OFFSET(DOS_SYSVARS, NullDevice), DOS_DATA_SEGMENT); ANSI_STRING DeviceNameString; RtlInitAnsiString(&DeviceNameString, DeviceName); while (LOWORD(CurrentDriver) != 0xFFFF) { - PDOS_DEVICE_NODE Node; + PDOS_DEVICE_NODE Node = DosGetDriverNode(CurrentDriver); PDOS_DRIVER DriverHeader = (PDOS_DRIVER)FAR_POINTER(CurrentDriver); - - /* Get the device node for this driver */ - for (i = DeviceList.Flink; i != &DeviceList; i = i->Flink) - { - Node = CONTAINING_RECORD(i, DOS_DEVICE_NODE, Entry); - if (Node->Driver == CurrentDriver) break; - } - - if (i == &DeviceList) - { - DPRINT1("The driver at %04X:%04X has no associated device node. " - "Installing automagically.\n", - HIWORD(CurrentDriver), - LOWORD(CurrentDriver)); - - /* Create the device node */ - Node = DosCreateDeviceNode(CurrentDriver); - Node->IoctlReadRoutine = DosDriverDispatchIoctlRead; - Node->ReadRoutine = DosDriverDispatchRead; - Node->PeekRoutine = DosDriverDispatchPeek; - Node->InputStatusRoutine = DosDriverDispatchInputStatus; - Node->FlushInputRoutine = DosDriverDispatchFlushInput; - Node->IoctlWriteRoutine = DosDriverDispatchIoctlWrite; - Node->WriteRoutine = DosDriverDispatchWrite; - Node->OutputStatusRoutine = DosDriverDispatchOutputStatus; - Node->FlushOutputRoutine = DosDriverDispatchFlushOutput; - Node->OpenRoutine = DosDriverDispatchOpen; - Node->CloseRoutine = DosDriverDispatchClose; - Node->OutputUntilBusyRoutine = DosDriverDispatchOutputUntilBusy; - } if (RtlEqualString(&Node->Name, &DeviceNameString, TRUE)) return Node; CurrentDriver = DriverHeader->Link; Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/device.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/device.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/device.h [iso-8859-1] Sun Apr 26 18:09:57 2015 @@ -194,6 +194,7 @@ /* FUNCTIONS ******************************************************************/ +PDOS_DEVICE_NODE DosGetDriverNode(DWORD Driver); PDOS_DEVICE_NODE DosGetDevice(LPCSTR DeviceName); PDOS_DEVICE_NODE DosCreateDevice(WORD Attributes, PCHAR DeviceName); PDOS_DEVICE_NODE DosCreateDeviceEx Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Sun Apr 26 18:09:57 2015 @@ -19,6 +19,8 @@ #include "dos.h" #include "dos/dem.h" #include "device.h" +#include "handle.h" +#include "dosfiles.h" #include "memory.h" #include "himem.h" @@ -39,11 +41,12 @@ /*static*/ BYTE CurrentDrive; static CHAR LastDrive = 'E'; static CHAR CurrentDirectories[NUM_DRIVES][DOS_DIR_LENGTH]; -static DOS_SFT_ENTRY DosSystemFileTable[DOS_SFT_SIZE]; static WORD DosErrorLevel = 0x0000; static PBYTE InDos; /* PUBLIC VARIABLES ***********************************************************/ + +PDOS_SYSVARS SysVars; /* Echo state for INT 21h, AH = 01h and AH = 3Fh */ BOOLEAN DoEcho = FALSE; @@ -120,456 +123,6 @@ return DestSegment; } -/* Taken from base/shell/cmd/console.c */ -static BOOL IsConsoleHandle(HANDLE hHandle) -{ - DWORD dwMode; - - /* Check whether the handle may be that of a console... */ - if ((GetFileType(hHandle) & FILE_TYPE_CHAR) == 0) return FALSE; - - /* - * It may be. Perform another test... The idea comes from the - * MSDN description of the WriteConsole API: - * - * "WriteConsole fails if it is used with a standard handle - * that is redirected to a file. If an application processes - * multilingual output that can be redirected, determine whether - * the output handle is a console handle (one method is to call - * the GetConsoleMode function and check whether it succeeds). - * If the handle is a console handle, call WriteConsole. If the - * handle is not a console handle, the output is redirected and - * you should call WriteFile to perform the I/O." - */ - return GetConsoleMode(hHandle, &dwMode); -} - -static inline PDOS_SFT_ENTRY DosFindFreeSftEntry(VOID) -{ - UINT i; - - for (i = 0; i < DOS_SFT_SIZE; i++) - { - if (DosSystemFileTable[i].Type == DOS_SFT_ENTRY_NONE) - { - return &DosSystemFileTable[i]; - } - } - - return NULL; -} - -static inline PDOS_SFT_ENTRY DosFindWin32SftEntry(HANDLE Handle) -{ - UINT i; - - for (i = 0; i < DOS_SFT_SIZE; i++) - { - if (DosSystemFileTable[i].Type == DOS_SFT_ENTRY_WIN32 - && DosSystemFileTable[i].Handle == Handle) - { - return &DosSystemFileTable[i]; - } - } - - return NULL; -} - -static inline PDOS_SFT_ENTRY DosFindDeviceSftEntry(PDOS_DEVICE_NODE Device) -{ - UINT i; - - for (i = 0; i < DOS_SFT_SIZE; i++) - { - if (DosSystemFileTable[i].Type == DOS_SFT_ENTRY_DEVICE - && DosSystemFileTable[i].DeviceNode == Device) - { - return &DosSystemFileTable[i]; - } - } - - return NULL; -} - -WORD DosOpenHandle(HANDLE Handle) -{ - WORD DosHandle; - PDOS_PSP PspBlock; - LPBYTE HandleTable; - PDOS_SFT_ENTRY SftEntry; - - /* The system PSP has no handle table */ - if (CurrentPsp == SYSTEM_PSP) return INVALID_DOS_HANDLE; - - /* Get a pointer to the handle table */ - PspBlock = SEGMENT_TO_PSP(CurrentPsp); - HandleTable = (LPBYTE)FAR_POINTER(PspBlock->HandleTablePtr); - - /* Find a free entry in the JFT */ - for (DosHandle = 0; DosHandle < PspBlock->HandleTableSize; DosHandle++) - { - if (HandleTable[DosHandle] == 0xFF) break; - } - - /* If there are no free entries, fail */ - if (DosHandle == PspBlock->HandleTableSize) return INVALID_DOS_HANDLE; - - /* Check if the handle is already in the SFT */ - SftEntry = DosFindWin32SftEntry(Handle); - if (SftEntry != NULL) - { - /* Already in the table, reference it */ - SftEntry->RefCount++; - goto Finish; - } - - /* Find a free SFT entry to use */ - SftEntry = DosFindFreeSftEntry(); - if (SftEntry == NULL) - { - /* The SFT is full */ - return INVALID_DOS_HANDLE; - } - - /* Initialize the empty table entry */ - SftEntry->Type = DOS_SFT_ENTRY_WIN32; - SftEntry->Handle = Handle; - SftEntry->RefCount = 1; - -Finish: - - /* Set the JFT entry to that SFT index */ - HandleTable[DosHandle] = ARRAY_INDEX(SftEntry, DosSystemFileTable); - - /* Return the new handle */ - return DosHandle; -} - -WORD DosOpenDevice(PDOS_DEVICE_NODE Device) -{ - WORD DosHandle; - PDOS_PSP PspBlock; - LPBYTE HandleTable; - PDOS_SFT_ENTRY SftEntry; - - DPRINT("DosOpenDevice(\"%Z\")\n", &Device->Name); - - /* The system PSP has no handle table */ - if (CurrentPsp == SYSTEM_PSP) return INVALID_DOS_HANDLE; - - /* Get a pointer to the handle table */ - PspBlock = SEGMENT_TO_PSP(CurrentPsp); - HandleTable = (LPBYTE)FAR_POINTER(PspBlock->HandleTablePtr); - - /* Find a free entry in the JFT */ - for (DosHandle = 0; DosHandle < PspBlock->HandleTableSize; DosHandle++) - { - if (HandleTable[DosHandle] == 0xFF) break; - } - - /* If there are no free entries, fail */ - if (DosHandle == PspBlock->HandleTableSize) return INVALID_DOS_HANDLE; - - /* Check if the device is already in the SFT */ - SftEntry = DosFindDeviceSftEntry(Device); - if (SftEntry != NULL) - { - /* Already in the table, reference it */ - SftEntry->RefCount++; - goto Finish; - } - - /* Find a free SFT entry to use */ - SftEntry = DosFindFreeSftEntry(); - if (SftEntry == NULL) - { - /* The SFT is full */ - return INVALID_DOS_HANDLE; - } - - /* Initialize the empty table entry */ - SftEntry->Type = DOS_SFT_ENTRY_DEVICE; - SftEntry->DeviceNode = Device; - SftEntry->RefCount = 1; - -Finish: - - /* Call the open routine, if it exists */ - if (Device->OpenRoutine) Device->OpenRoutine(Device); - - /* Set the JFT entry to that SFT index */ - HandleTable[DosHandle] = ARRAY_INDEX(SftEntry, DosSystemFileTable); - - /* Return the new handle */ - return DosHandle; -} - -static VOID DosCopyHandleTable(LPBYTE DestinationTable) -{ - UINT i; - PDOS_PSP PspBlock; - LPBYTE SourceTable; - - /* Clear the table first */ - for (i = 0; i < 20; i++) DestinationTable[i] = 0xFF; - - /* Check if this is the initial process */ - if (CurrentPsp == SYSTEM_PSP) - { - PDOS_SFT_ENTRY SftEntry; - HANDLE StandardHandles[3]; - PDOS_DEVICE_NODE Con = DosGetDevice("CON"); - ASSERT(Con != NULL); - - /* Get the native standard handles */ - StandardHandles[0] = GetStdHandle(STD_INPUT_HANDLE); - StandardHandles[1] = GetStdHandle(STD_OUTPUT_HANDLE); - StandardHandles[2] = GetStdHandle(STD_ERROR_HANDLE); - - for (i = 0; i < 3; i++) - { - /* Find the corresponding SFT entry */ - if (IsConsoleHandle(StandardHandles[i])) - { - SftEntry = DosFindDeviceSftEntry(Con); - } - else - { - SftEntry = DosFindWin32SftEntry(StandardHandles[i]); - } - - if (SftEntry == NULL) - { - /* Create a new SFT entry for it */ - SftEntry = DosFindFreeSftEntry(); - if (SftEntry == NULL) - { - DPRINT1("Cannot create standard handle %d, the SFT is full!\n", i); - continue; - } - - SftEntry->RefCount = 0; - - if (IsConsoleHandle(StandardHandles[i])) - { - SftEntry->Type = DOS_SFT_ENTRY_DEVICE; - SftEntry->DeviceNode = Con; - - /* Call the open routine */ - if (Con->OpenRoutine) Con->OpenRoutine(Con); - } - else - { - SftEntry->Type = DOS_SFT_ENTRY_WIN32; - SftEntry->Handle = StandardHandles[i]; - } - } - - SftEntry->RefCount++; - DestinationTable[i] = ARRAY_INDEX(SftEntry, DosSystemFileTable); - } - } - else - { - /* Get the parent PSP block and handle table */ - PspBlock = SEGMENT_TO_PSP(CurrentPsp); - SourceTable = (LPBYTE)FAR_POINTER(PspBlock->HandleTablePtr); - - /* Copy the first 20 handles into the new table */ - for (i = 0; i < DEFAULT_JFT_SIZE; i++) - { - DestinationTable[i] = SourceTable[i]; - - /* Increase the reference count */ - DosSystemFileTable[SourceTable[i]].RefCount++; - } - } -} - -static BOOLEAN DosResizeHandleTable(WORD NewSize) -{ - PDOS_PSP PspBlock; - LPBYTE HandleTable; - WORD Segment; - - /* Get the PSP block */ - PspBlock = SEGMENT_TO_PSP(CurrentPsp); - - if (NewSize == PspBlock->HandleTableSize) - { - /* No change */ - return TRUE; - } - - if (PspBlock->HandleTableSize > DEFAULT_JFT_SIZE) - { - /* Get the segment of the current table */ - Segment = (LOWORD(PspBlock->HandleTablePtr) >> 4) + HIWORD(PspBlock->HandleTablePtr); - - if (NewSize <= DEFAULT_JFT_SIZE) - { - /* Get the current handle table */ - HandleTable = FAR_POINTER(PspBlock->HandleTablePtr); - - /* Copy it to the PSP */ - RtlCopyMemory(PspBlock->HandleTable, HandleTable, NewSize); - - /* Free the memory */ - DosFreeMemory(Segment); - - /* Update the handle table pointer and size */ - PspBlock->HandleTableSize = NewSize; - PspBlock->HandleTablePtr = MAKELONG(0x18, CurrentPsp); - } - else - { - /* Resize the memory */ - if (!DosResizeMemory(Segment, NewSize, NULL)) - { - /* Unable to resize, try allocating it somewhere else */ - Segment = DosAllocateMemory(NewSize, NULL); - if (Segment == 0) return FALSE; - - /* Get the new handle table */ - HandleTable = SEG_OFF_TO_PTR(Segment, 0); - - /* Copy the handles to the new table */ - RtlCopyMemory(HandleTable, - FAR_POINTER(PspBlock->HandleTablePtr), - PspBlock->HandleTableSize); - - /* Update the handle table pointer */ - PspBlock->HandleTablePtr = MAKELONG(0, Segment); - } - - /* Update the handle table size */ - PspBlock->HandleTableSize = NewSize; - } - } - else if (NewSize > DEFAULT_JFT_SIZE) - { - Segment = DosAllocateMemory(NewSize, NULL); - if (Segment == 0) return FALSE; - - /* Get the new handle table */ - HandleTable = SEG_OFF_TO_PTR(Segment, 0); - - /* Copy the handles from the PSP to the new table */ - RtlCopyMemory(HandleTable, - FAR_POINTER(PspBlock->HandleTablePtr), - PspBlock->HandleTableSize); - - /* Update the handle table pointer and size */ - PspBlock->HandleTableSize = NewSize; - PspBlock->HandleTablePtr = MAKELONG(0, Segment); - } - - return TRUE; -} - -static BOOLEAN DosCloseHandle(WORD DosHandle) -{ - PDOS_PSP PspBlock; - LPBYTE HandleTable; - PDOS_SFT_ENTRY SftEntry; - - DPRINT("DosCloseHandle: DosHandle 0x%04X\n", DosHandle); - - /* The system PSP has no handle table */ - if (CurrentPsp == SYSTEM_PSP) return FALSE; - - /* Get a pointer to the handle table */ - PspBlock = SEGMENT_TO_PSP(CurrentPsp); - HandleTable = (LPBYTE)FAR_POINTER(PspBlock->HandleTablePtr); - - /* Make sure the handle is open */ - if (HandleTable[DosHandle] == 0xFF) return FALSE; - - /* Make sure the SFT entry is valid */ - SftEntry = &DosSystemFileTable[HandleTable[DosHandle]]; - if (SftEntry->Type == DOS_SFT_ENTRY_NONE) return FALSE; - - /* Decrement the reference count of the SFT entry */ - SftEntry->RefCount--; - - /* Check if the reference count fell to zero */ - if (!SftEntry->RefCount) - { - switch (SftEntry->Type) - { - case DOS_SFT_ENTRY_WIN32: - { - /* Close the win32 handle and clear it */ - CloseHandle(SftEntry->Handle); - - break; - } - - case DOS_SFT_ENTRY_DEVICE: - { - PDOS_DEVICE_NODE Node = SftEntry->DeviceNode; - - /* Call the close routine, if it exists */ - if (Node->CloseRoutine) SftEntry->DeviceNode->CloseRoutine(SftEntry->DeviceNode); - - break; - } - - default: - { - /* Shouldn't happen */ - ASSERT(FALSE); - } - } - - /* Invalidate the SFT entry */ - SftEntry->Type = DOS_SFT_ENTRY_NONE; - } - - /* Clear the entry in the JFT */ - HandleTable[DosHandle] = 0xFF; - - return TRUE; -} - -static BOOLEAN DosDuplicateHandle(WORD OldHandle, WORD NewHandle) -{ - BYTE SftIndex; - PDOS_PSP PspBlock; - LPBYTE HandleTable; - - DPRINT("DosDuplicateHandle: OldHandle 0x%04X, NewHandle 0x%04X\n", - OldHandle, - NewHandle); - - /* The system PSP has no handle table */ - if (CurrentPsp == SYSTEM_PSP) return FALSE; - - /* Get a pointer to the handle table */ - PspBlock = SEGMENT_TO_PSP(CurrentPsp); - HandleTable = (LPBYTE)FAR_POINTER(PspBlock->HandleTablePtr); - - /* Make sure the old handle is open */ - if (HandleTable[OldHandle] == 0xFF) return FALSE; - - /* Check if the new handle is open */ - if (HandleTable[NewHandle] != 0xFF) - { - /* Close it */ - DosCloseHandle(NewHandle); - } - - /* Increment the reference count of the SFT entry */ - SftIndex = HandleTable[OldHandle]; - DosSystemFileTable[SftIndex].RefCount++; - - /* Make the new handle point to that SFT entry */ - HandleTable[NewHandle] = SftIndex; - - /* Return success */ - return TRUE; -} - static BOOLEAN DosChangeDrive(BYTE Drive) { WCHAR DirectoryPath[DOS_CMDLINE_LENGTH]; @@ -674,25 +227,6 @@ } /* PUBLIC FUNCTIONS ***********************************************************/ - -PDOS_SFT_ENTRY DosGetSftEntry(WORD DosHandle) -{ - PDOS_PSP PspBlock; - LPBYTE HandleTable; - - /* The system PSP has no handle table */ - if (CurrentPsp == SYSTEM_PSP) return NULL; - - /* Get a pointer to the handle table */ - PspBlock = SEGMENT_TO_PSP(CurrentPsp); - HandleTable = (LPBYTE)FAR_POINTER(PspBlock->HandleTablePtr); - - /* Make sure the handle is open */ - if (HandleTable[DosHandle] == 0xFF) return NULL; - - /* Return a pointer to the SFT entry */ - return &DosSystemFileTable[HandleTable[DosHandle]]; -} VOID DosInitializePsp(WORD PspSegment, LPCSTR CommandLine, @@ -1279,110 +813,6 @@ LOWORD(PspBlock->TerminateAddress)); } -BOOLEAN DosHandleIoctl(BYTE ControlCode, WORD FileHandle) -{ - PDOS_SFT_ENTRY SftEntry = DosGetSftEntry(FileHandle); - PDOS_DEVICE_NODE Node = NULL; - - /* Make sure it exists */ - if (!SftEntry) - { - DosLastError = ERROR_FILE_NOT_FOUND; - return FALSE; - } - - if (SftEntry->Type == DOS_SFT_ENTRY_DEVICE) Node = SftEntry->DeviceNode; - - switch (ControlCode) - { - /* Get Device Information */ - case 0x00: - { - WORD InfoWord = 0; - - /* - * See Ralf Brown:
http://www.ctyme.com/intr/rb-2820.htm
- * for a list of possible flags. - */ - - if (Node) - { - /* Return the device attributes with bit 7 set */ - InfoWord = Node->DeviceAttributes | (1 << 7); - } - - setDX(InfoWord); - return TRUE; - } - - /* Set Device Information */ - case 0x01: - { - // TODO: NOT IMPLEMENTED - UNIMPLEMENTED; - - return FALSE; - } - - /* Read From Device I/O Control Channel */ - case 0x02: - { - WORD Length = getCX(); - - if (Node == NULL || !(Node->DeviceAttributes & DOS_DEVATTR_IOCTL)) - { - DosLastError = ERROR_INVALID_FUNCTION; - return FALSE; - } - - /* Do nothing if there is no IOCTL routine */ - if (!Node->IoctlReadRoutine) - { - setAX(0); - return TRUE; - } - - Node->IoctlReadRoutine(Node, MAKELONG(getDX(), getDS()), &Length); - - setAX(Length); - return TRUE; - } - - /* Write To Device I/O Control Channel */ - case 0x03: - { - WORD Length = getCX(); - - if (Node == NULL || !(Node->DeviceAttributes & DOS_DEVATTR_IOCTL)) - { - DosLastError = ERROR_INVALID_FUNCTION; - return FALSE; - } - - /* Do nothing if there is no IOCTL routine */ - if (!Node->IoctlWriteRoutine) - { - setAX(0); - return TRUE; - } - - Node->IoctlWriteRoutine(Node, MAKELONG(getDX(), getDS()), &Length); - - setAX(Length); - return TRUE; - } - - /* Unsupported control code */ - default: - { - DPRINT1("Unsupported IOCTL: 0x%02X\n", ControlCode); - - DosLastError = ERROR_INVALID_PARAMETER; - return FALSE; - } - } -} - VOID WINAPI DosInt20h(LPWORD Stack) { /* This is the exit interrupt */ @@ -2196,20 +1626,8 @@ case 0x3D: { WORD FileHandle; - WORD ErrorCode; LPCSTR FileName = (LPCSTR)SEG_OFF_TO_PTR(getDS(), getDX()); - PDOS_DEVICE_NODE Device = DosGetDevice(FileName); - - if (Device) - { - FileHandle = DosOpenDevice(Device); - ErrorCode = (FileHandle != INVALID_DOS_HANDLE) - ? ERROR_SUCCESS : ERROR_TOO_MANY_OPEN_FILES; - } - else - { - ErrorCode = DosOpenFile(&FileHandle, FileName, getAL()); - } + WORD ErrorCode = DosOpenFile(&FileHandle, FileName, getAL()); if (ErrorCode == ERROR_SUCCESS) { @@ -2391,9 +1809,12 @@ /* IOCTL */ case 0x44: { - if (DosHandleIoctl(getAL(), getBX())) - { - Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; + WORD Length = getCX(); + + if (DosDeviceIoControl(getBX(), getAL(), MAKELONG(getDX(), getDS()), &Length)) + { + Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; + setAX(Length); } else { @@ -2407,57 +1828,26 @@ /* Duplicate Handle */ case 0x45: { - WORD NewHandle; - PDOS_SFT_ENTRY SftEntry = DosGetSftEntry(getBX()); - - if (SftEntry == NULL || SftEntry->Type == DOS_SFT_ENTRY_NONE) - { - /* The handle is invalid */ - Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - setAX(ERROR_INVALID_HANDLE); - break; - } - - /* Open a new handle to the same entry */ - switch (SftEntry->Type) - { - case DOS_SFT_ENTRY_WIN32: - { - NewHandle = DosOpenHandle(SftEntry->Handle); - break; - } - - case DOS_SFT_ENTRY_DEVICE: - { - NewHandle = DosOpenDevice(SftEntry->DeviceNode); - break; - } - - default: - { - /* Shouldn't happen */ - ASSERT(FALSE); - } - } - - if (NewHandle == INVALID_DOS_HANDLE) - { - /* Too many files open */ - Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - setAX(ERROR_TOO_MANY_OPEN_FILES); - break; - } - - /* Return the result */ - Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; - setAX(NewHandle); + WORD NewHandle = DosDuplicateHandle(getBX()); + + if (NewHandle != INVALID_DOS_HANDLE) + { + setAX(NewHandle); + Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; + } + else + { + Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; + setAX(DosLastError); + } + break; } /* Force Duplicate Handle */ case 0x46: { - if (DosDuplicateHandle(getBX(), getCX())) + if (DosForceDuplicateHandle(getBX(), getCX())) { Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; } @@ -2686,10 +2076,9 @@ */ /* Return the DOS "list of lists" in ES:BX */ - setES(0x0000); - setBX(0x0000); - - DPRINT1("INT 21h, AH=52h: This application requires the internal DOS List of lists (SYSVARS). UNIMPLEMENTED\n"); + setES(DOS_DATA_SEGMENT); + setBX(FIELD_OFFSET(DOS_SYSVARS, FirstDpb)); + break; } @@ -2850,44 +2239,30 @@ /* Lock/Unlock Region of File */ case 0x5C: { - PDOS_SFT_ENTRY SftEntry = DosGetSftEntry(getBX()); - - if (SftEntry == NULL || SftEntry->Type != DOS_SFT_ENTRY_WIN32) - { - /* The handle is invalid */ - Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - setAX(ERROR_INVALID_HANDLE); - break; - } - if (getAL() == 0x00) { /* Lock region of file */ - if (LockFile(SftEntry->Handle, - MAKELONG(getCX(), getDX()), 0, - MAKELONG(getSI(), getDI()), 0)) + if (DosLockFile(getBX(), MAKELONG(getCX(), getDX()), MAKELONG(getSI(), getDI()))) { Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; } else { Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - setAX(GetLastError()); + setAX(DosLastError); } } else if (getAL() == 0x01) { /* Unlock region of file */ - if (UnlockFile(SftEntry->Handle, - MAKELONG(getCX(), getDX()), 0, - MAKELONG(getSI(), getDI()), 0)) + if (DosUnlockFile(getBX(), MAKELONG(getCX(), getDX()), MAKELONG(getSI(), getDI()))) { Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; } else { Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; - setAX(GetLastError()); + setAX(DosLastError); } } else @@ -3109,13 +2484,26 @@ BOOLEAN DosKRNLInitialize(VOID) { - #if 1 UCHAR i; CHAR CurrentDirectory[MAX_PATH]; CHAR DosDirectory[DOS_DIR_LENGTH]; LPSTR Path; + PDOS_SFT Sft; + + const BYTE NullDriverRoutine[] = { + /* Strategy routine entry */ + 0x26, // mov [Request.Status], DOS_DEVSTAT_DONE + 0xC7, + 0x47, + FIELD_OFFSET(DOS_REQUEST_HEADER, Status), + LOBYTE(DOS_DEVSTAT_DONE), + HIBYTE(DOS_DEVSTAT_DONE), + + /* Interrupt routine entry */ + 0xCB, // retf + }; FILE *Stream; WCHAR Buffer[256]; @@ -3169,11 +2557,34 @@ fclose(Stream); } + /* Initialize the list of lists */ + SysVars = (PDOS_SYSVARS)SEG_OFF_TO_PTR(DOS_DATA_SEGMENT, 0); + RtlZeroMemory(SysVars, sizeof(DOS_SYSVARS)); + SysVars->FirstMcb = FIRST_MCB_SEGMENT; + SysVars->FirstSft = MAKELONG(MASTER_SFT_OFFSET, DOS_DATA_SEGMENT); + + /* Initialize the NUL device driver */ + SysVars->NullDevice.Link = 0xFFFFFFFF; + SysVars->NullDevice.DeviceAttributes = DOS_DEVATTR_NUL | DOS_DEVATTR_CHARACTER; + SysVars->NullDevice.StrategyRoutine = FIELD_OFFSET(DOS_SYSVARS, NullDriverRoutine); + SysVars->NullDevice.InterruptRoutine = SysVars->NullDevice.StrategyRoutine + 6; + RtlFillMemory(SysVars->NullDevice.DeviceName, + sizeof(SysVars->NullDevice.DeviceName), + ' '); + RtlCopyMemory(SysVars->NullDevice.DeviceName, "NUL", strlen("NUL")); + RtlCopyMemory(SysVars->NullDriverRoutine, + NullDriverRoutine, + sizeof(NullDriverRoutine)); + /* Initialize the SFT */ - for (i = 0; i < DOS_SFT_SIZE; i++) - { - DosSystemFileTable[i].Type = DOS_SFT_ENTRY_NONE; - DosSystemFileTable[i].RefCount = 0; + Sft = (PDOS_SFT)FAR_POINTER(SysVars->FirstSft); + Sft->Link = 0xFFFFFFFF; + Sft->NumDescriptors = DOS_SFT_SIZE; + + for (i = 0; i < Sft->NumDescriptors; i++) + { + /* Clear the file descriptor entry */ + RtlZeroMemory(&Sft->FileDescriptors[i], sizeof(DOS_FILE_DESCRIPTOR)); } #endif Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.h [iso-8859-1] Sun Apr 26 18:09:57 2015 @@ -30,6 +30,8 @@ #define USER_MEMORY_SIZE (0x9FFE - FIRST_MCB_SEGMENT) #define SYSTEM_PSP 0x08 #define SYSTEM_ENV_BLOCK 0x800 +#define DOS_DATA_SEGMENT 0xA0 +#define MASTER_SFT_OFFSET 0x100 #define INVALID_DOS_HANDLE 0xFFFF #define DOS_INPUT_HANDLE 0 @@ -48,7 +50,6 @@ #define NUM_DRIVES ('Z' - 'A' + 1) #define DOS_CHAR_ATTRIBUTE 0x07 #define DOS_PROGRAM_NAME_TAG 0x0001 -#define DEFAULT_JFT_SIZE 20 /* 16 MB of EMS memory */ #define EMS_TOTAL_PAGES 1024 @@ -59,25 +60,6 @@ DOS_LOAD_ONLY = 0x01, DOS_LOAD_OVERLAY = 0x03 } DOS_EXEC_TYPE; - -typedef enum -{ - DOS_SFT_ENTRY_NONE, - DOS_SFT_ENTRY_WIN32, - DOS_SFT_ENTRY_DEVICE -} DOS_SFT_ENTRY_TYPE; - -typedef struct _DOS_SFT_ENTRY -{ - DOS_SFT_ENTRY_TYPE Type; - WORD RefCount; - - union - { - HANDLE Handle; - PDOS_DEVICE_NODE DeviceNode; - }; -} DOS_SFT_ENTRY, *PDOS_SFT_ENTRY; #pragma pack(push, 1) @@ -95,6 +77,30 @@ BYTE BlockRecord; BYTE RecordNumber[3]; } DOS_FCB, *PDOS_FCB; + +typedef struct _DOS_SYSVARS +{ + DWORD OemHandler; + WORD Int21hReturn; + WORD ShareRetryCount; + WORD ShareRetryDelay; + DWORD DiskBuffer; + WORD UnreadConInput; + WORD FirstMcb; + + /* This is where the SYSVARS really start */ + DWORD FirstDpb; + DWORD FirstSft; + DWORD ActiveClock; + DWORD ActiveCon; + BYTE Reserved0[6]; + DWORD CurrentDirs; + BYTE Reserved1[6]; + BYTE NumBlockDevices; + BYTE NumLocalDrives; + DOS_DRIVER NullDevice; + BYTE NullDriverRoutine[7]; +} DOS_SYSVARS, *PDOS_SYSVARS; typedef struct _DOS_PSP { @@ -128,15 +134,6 @@ CHAR Buffer[ANYSIZE_ARRAY]; } DOS_INPUT_BUFFER, *PDOS_INPUT_BUFFER; -typedef struct _DOS_DRIVER_HEADER -{ - DWORD NextDriver; - WORD Attributes; - WORD StrategyEntry; - WORD InterruptEntry; - CHAR DeviceName[8]; -} DOS_DRIVER_HEADER, *PDOS_DRIVER_HEADER; - typedef struct _DOS_FIND_FILE_BLOCK { CHAR DriveLetter; @@ -181,6 +178,7 @@ extern BOOLEAN DoEcho; extern WORD CurrentPsp; extern WORD DosLastError; +extern PDOS_SYSVARS SysVars; /* FUNCTIONS ******************************************************************/ @@ -208,35 +206,6 @@ * DOS Kernel Functions * See dos.c */ -WORD DosOpenHandle(HANDLE Handle); -PDOS_SFT_ENTRY DosGetSftEntry(WORD DosHandle); - -WORD DosCreateFileEx(LPWORD Handle, - LPWORD CreationStatus, - LPCSTR FilePath, - BYTE AccessShareModes, - WORD CreateActionFlags, - WORD Attributes); -WORD DosCreateFile(LPWORD Handle, - LPCSTR FilePath, - DWORD CreationDisposition, - WORD Attributes); -WORD DosOpenFile(LPWORD Handle, - LPCSTR FilePath, - BYTE AccessShareModes); -WORD DosReadFile(WORD FileHandle, - DWORD Buffer, - WORD Count, - LPWORD BytesRead); -WORD DosWriteFile(WORD FileHandle, - DWORD Buffer, - WORD Count, - LPWORD BytesWritten); -WORD DosSeekFile(WORD FileHandle, - LONG Offset, - BYTE Origin, - LPDWORD NewOffset); -BOOL DosFlushFileBuffers(WORD FileHandle); VOID DosInitializePsp( WORD PspSegment, Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c [iso-8859-1] Sun Apr 26 18:09:57 2015 @@ -17,10 +17,124 @@ #include "dos.h" #include "dos/dem.h" +#include "dosfiles.h" +#include "handle.h" #include "bios/bios.h" /* PUBLIC FUNCTIONS ***********************************************************/ + +BYTE DosFindFreeDescriptor(VOID) +{ + UINT i; + BYTE Count = 0; + DWORD CurrentSft = SysVars->FirstSft; + + while (LOWORD(CurrentSft) != 0xFFFF) + { + PDOS_SFT Sft = (PDOS_SFT)FAR_POINTER(CurrentSft); + + for (i = 0; i < Sft->NumDescriptors; i++) + { + if (Sft->FileDescriptors[i].RefCount == 0) return Count; + Count++; + } + + /* Go to the next table */ + CurrentSft = Sft->Link; + } + + /* Invalid ID */ + return 0xFF; +} + +BYTE DosFindWin32Descriptor(HANDLE Win32Handle) +{ + UINT i; + BYTE Count = 0; + DWORD CurrentSft = SysVars->FirstSft; + + while (LOWORD(CurrentSft) != 0xFFFF) + { + PDOS_SFT Sft = (PDOS_SFT)FAR_POINTER(CurrentSft); + + for (i = 0; i < Sft->NumDescriptors; i++) + { + if ((Sft->FileDescriptors[i].RefCount > 0) + && !(Sft->FileDescriptors[i].DeviceInfo & (1 << 7)) + && (Sft->FileDescriptors[i].Win32Handle == Win32Handle)) + { + return Count; + } + + Count++; + } + + /* Go to the next table */ + CurrentSft = Sft->Link; + } + + /* Invalid ID */ + return 0xFF; +} + +BYTE DosFindDeviceDescriptor(DWORD DevicePointer) +{ + UINT i; + BYTE Count = 0; + DWORD CurrentSft = SysVars->FirstSft; + + while (LOWORD(CurrentSft) != 0xFFFF) + { + PDOS_SFT Sft = (PDOS_SFT)FAR_POINTER(CurrentSft); + + for (i = 0; i < Sft->NumDescriptors; i++) + { + if ((Sft->FileDescriptors[i].RefCount > 0) + && (Sft->FileDescriptors[i].DeviceInfo & (1 << 7)) + && (Sft->FileDescriptors[i].DevicePointer == DevicePointer)) + { + return Count; + } + + Count++; + } + + /* Go to the next table */ + CurrentSft = Sft->Link; + } + + /* Invalid ID */ + return 0xFF; +} + +PDOS_FILE_DESCRIPTOR DosGetFileDescriptor(BYTE Id) +{ + DWORD CurrentSft = SysVars->FirstSft; + + while (LOWORD(CurrentSft) != 0xFFFF) + { + PDOS_SFT Sft = (PDOS_SFT)FAR_POINTER(CurrentSft); + + /* Return it if it's in this table */ + if (Id <= Sft->NumDescriptors) return &Sft->FileDescriptors[Id]; + + /* Go to the next table */ + Id -= Sft->NumDescriptors; + CurrentSft = Sft->Link; + } + + /* Invalid ID */ + return NULL; +} + +PDOS_FILE_DESCRIPTOR DosGetHandleFileDescriptor(WORD DosHandle) +{ + BYTE DescriptorId = DosQueryHandle(DosHandle); + if (DescriptorId == 0xFF) return NULL; + + return DosGetFileDescriptor(DescriptorId); +} WORD DosCreateFileEx(LPWORD Handle, LPWORD CreationStatus, @@ -37,6 +151,8 @@ DWORD CreationDisposition = 0; BOOL InheritableFile = FALSE; SECURITY_ATTRIBUTES SecurityAttributes; + BYTE DescriptorId; + PDOS_FILE_DESCRIPTOR Descriptor; DPRINT1("DosCreateFileEx: FilePath \"%s\", AccessShareModes 0x%04X, CreateActionFlags 0x%04X, Attributes 0x%04X\n", FilePath, AccessShareModes, CreateActionFlags, Attributes); @@ -228,8 +344,26 @@ } } + DescriptorId = DosFindFreeDescriptor(); + if (DescriptorId == 0xFF) + { + /* Close the file and return the error code */ + CloseHandle(FileHandle); + return ERROR_TOO_MANY_OPEN_FILES; + } + + /* Set up the new descriptor */ + Descriptor = DosGetFileDescriptor(DescriptorId); + RtlZeroMemory(Descriptor, sizeof(*Descriptor)); + + Descriptor->OpenMode = AccessShareModes; + Descriptor->Attributes = LOBYTE(GetFileAttributesA(FilePath)); + Descriptor->Size = GetFileSize(FileHandle, NULL); + Descriptor->OwnerPsp = CurrentPsp; + Descriptor->Win32Handle = FileHandle; + /* Open the DOS handle */ - DosHandle = DosOpenHandle(FileHandle); + DosHandle = DosOpenHandle(DescriptorId); if (DosHandle == INVALID_DOS_HANDLE) { /* Close the file and return the error code */ @@ -249,6 +383,8 @@ { HANDLE FileHandle; WORD DosHandle; + BYTE DescriptorId; + PDOS_FILE_DESCRIPTOR Descriptor; DPRINT("DosCreateFile: FilePath \"%s\", CreationDisposition 0x%04X, Attributes 0x%04X\n", FilePath, CreationDisposition, Attributes); @@ -267,15 +403,32 @@ return (WORD)GetLastError(); } - /* Open the DOS handle */ - DosHandle = DosOpenHandle(FileHandle); - if (DosHandle == INVALID_DOS_HANDLE) + DescriptorId = DosFindFreeDescriptor(); + if (DescriptorId == 0xFF) { /* Close the file and return the error code */ CloseHandle(FileHandle); return ERROR_TOO_MANY_OPEN_FILES; } + /* Set up the new descriptor */ + Descriptor = DosGetFileDescriptor(DescriptorId); + RtlZeroMemory(Descriptor, sizeof(*Descriptor)); + + Descriptor->Attributes = LOBYTE(GetFileAttributesA(FilePath)); + Descriptor->Size = GetFileSize(FileHandle, NULL); + Descriptor->OwnerPsp = CurrentPsp; + Descriptor->Win32Handle = FileHandle; + + /* Open the DOS handle */ + DosHandle = DosOpenHandle(DescriptorId); + if (DosHandle == INVALID_DOS_HANDLE) + { + /* Close the file and return the error code */ + CloseHandle(FileHandle); + return ERROR_TOO_MANY_OPEN_FILES; + } + /* It was successful */ *Handle = DosHandle; return ERROR_SUCCESS; @@ -285,12 +438,11 @@ LPCSTR FilePath, BYTE AccessShareModes) { - HANDLE FileHandle; - ACCESS_MASK AccessMode = 0; - DWORD ShareMode = 0; - BOOL InheritableFile = FALSE; - SECURITY_ATTRIBUTES SecurityAttributes; + HANDLE FileHandle = NULL; + PDOS_DEVICE_NODE Node; WORD DosHandle; + BYTE DescriptorId; + PDOS_FILE_DESCRIPTOR Descriptor; DPRINT("DosOpenFile: FilePath \"%s\", AccessShareModes 0x%04X\n", FilePath, AccessShareModes); @@ -300,86 +452,125 @@ // explains what those AccessShareModes are (see the uStyle flag). // - /* Parse the access mode */ - switch (AccessShareModes & 0x03) - { - /* Read-only */ - case 0: - AccessMode = GENERIC_READ; - break; - - /* Write only */ - case 1: - AccessMode = GENERIC_WRITE; - break; - - /* Read and write */ - case 2: - AccessMode = GENERIC_READ | GENERIC_WRITE; - break; - - /* Invalid */ - default: - return ERROR_INVALID_PARAMETER; - } - - /* Parse the share mode */ - switch ((AccessShareModes >> 4) & 0x07) - { - /* Compatibility mode */ - case 0: - ShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; - break; - - /* No sharing "DenyAll" */ - case 1: - ShareMode = 0; - break; - - /* No write share "DenyWrite" */ - case 2: - ShareMode = FILE_SHARE_READ; - break; - - /* No read share "DenyRead" */ - case 3: - ShareMode = FILE_SHARE_WRITE; - break; - - /* Full share "DenyNone" */ - case 4: - ShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; - break; - - /* Invalid */ - default: - return ERROR_INVALID_PARAMETER; - } - - /* Check for inheritance */ - InheritableFile = ((AccessShareModes & 0x80) == 0); - - /* Assign default security attributes to the file, and set the inheritance flag */ - SecurityAttributes.nLength = sizeof(SecurityAttributes); - SecurityAttributes.lpSecurityDescriptor = NULL; - SecurityAttributes.bInheritHandle = InheritableFile; - - /* Open the file */ - FileHandle = CreateFileA(FilePath, - AccessMode, - ShareMode, - &SecurityAttributes, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL); - if (FileHandle == INVALID_HANDLE_VALUE) - { - /* Return the error code */ - return (WORD)GetLastError(); + Node = DosGetDevice(FilePath); + if (Node != NULL) + { + if (Node->OpenRoutine) Node->OpenRoutine(Node); + } + else + { + ACCESS_MASK AccessMode = 0; + DWORD ShareMode = 0; + BOOL InheritableFile = FALSE; + SECURITY_ATTRIBUTES SecurityAttributes; + + /* Parse the access mode */ + switch (AccessShareModes & 0x03) + { + /* Read-only */ + case 0: + AccessMode = GENERIC_READ; + break; + + /* Write only */ + case 1: + AccessMode = GENERIC_WRITE; + break; + + /* Read and write */ + case 2: + AccessMode = GENERIC_READ | GENERIC_WRITE; + break; + + /* Invalid */ + default: + return ERROR_INVALID_PARAMETER; + } + + /* Parse the share mode */ + switch ((AccessShareModes >> 4) & 0x07) + { + /* Compatibility mode */ + case 0: + ShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; + break; + + /* No sharing "DenyAll" */ + case 1: + ShareMode = 0; + break; + + /* No write share "DenyWrite" */ + case 2: + ShareMode = FILE_SHARE_READ; + break; + + /* No read share "DenyRead" */ + case 3: + ShareMode = FILE_SHARE_WRITE; + break; + + /* Full share "DenyNone" */ + case 4: + ShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; + break; + + /* Invalid */ + default: + return ERROR_INVALID_PARAMETER; + } + + /* Check for inheritance */ + InheritableFile = ((AccessShareModes & 0x80) == 0); + + /* Assign default security attributes to the file, and set the inheritance flag */ + SecurityAttributes.nLength = sizeof(SecurityAttributes); + SecurityAttributes.lpSecurityDescriptor = NULL; + SecurityAttributes.bInheritHandle = InheritableFile; + + /* Open the file */ + FileHandle = CreateFileA(FilePath, + AccessMode, + ShareMode, + &SecurityAttributes, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL); + if (FileHandle == INVALID_HANDLE_VALUE) + { + /* Return the error code */ + return (WORD)GetLastError(); + } + } + + DescriptorId = DosFindFreeDescriptor(); + if (DescriptorId == 0xFF) + { + /* Close the file and return the error code */ + CloseHandle(FileHandle); + return ERROR_TOO_MANY_OPEN_FILES; + } + + /* Set up the new descriptor */ + Descriptor = DosGetFileDescriptor(DescriptorId); + RtlZeroMemory(Descriptor, sizeof(*Descriptor)); + + if (Node != NULL) + { + Descriptor->DevicePointer = Node->Driver; + Descriptor->DeviceInfo = Node->DeviceAttributes | (1 << 7); + } + else + { + Descriptor->OpenMode = AccessShareModes; + Descriptor->Attributes = LOBYTE(GetFileAttributesA(FilePath)); + Descriptor->Size = GetFileSize(FileHandle, NULL); + Descriptor->OwnerPsp = CurrentPsp; + Descriptor->Win32Handle = FileHandle; } /* Open the DOS handle */ - DosHandle = DosOpenHandle(FileHandle); + DosHandle = DosOpenHandle(DescriptorId); if (DosHandle == INVALID_DOS_HANDLE) { /* Close the file and return the error code */ @@ -398,27 +589,39 @@ LPWORD BytesRead) { WORD Result = ERROR_SUCCESS; - PDOS_SFT_ENTRY SftEntry = DosGetSftEntry(FileHandle); + PDOS_FILE_DESCRIPTOR Descriptor = DosGetHandleFileDescriptor(FileHandle); DPRINT("DosReadFile: FileHandle 0x%04X, Count 0x%04X\n", FileHandle, Count); - if (SftEntry == NULL) + if (Descriptor == NULL) { /* Invalid handle */ return ERROR_INVALID_HANDLE; } - if (SftEntry->Type == DOS_SFT_ENTRY_WIN32) + if (Descriptor->DeviceInfo & (1 << 7)) + { + PDOS_DEVICE_NODE Node = DosGetDriverNode(Descriptor->DevicePointer); + if (!Node->ReadRoutine) return ERROR_INVALID_FUNCTION; + + /* Read the device */ + Node->ReadRoutine(Node, Buffer, &Count); + *BytesRead = Count; + } + else { DWORD BytesRead32 = 0; LPVOID LocalBuffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, Count); ASSERT(LocalBuffer != NULL); /* Read the file */ - if (ReadFile(SftEntry->Handle, LocalBuffer, Count, &BytesRead32, NULL)) + if (ReadFile(Descriptor->Win32Handle, LocalBuffer, Count, &BytesRead32, NULL)) { /* Write to the memory */ MemWrite(TO_LINEAR(HIWORD(Buffer), LOWORD(Buffer)), LocalBuffer, LOWORD(BytesRead32)); + + /* Update the position */ + Descriptor->Position += BytesRead32; } else { @@ -429,19 +632,6 @@ /* The number of bytes read is always 16-bit */ *BytesRead = LOWORD(BytesRead32); RtlFreeHeap(RtlGetProcessHeap(), 0, LocalBuffer); - } - else if (SftEntry->Type == DOS_SFT_ENTRY_DEVICE) - { - if (!SftEntry->DeviceNode->ReadRoutine) return ERROR_INVALID_FUNCTION; - - /* Read the device */ - SftEntry->DeviceNode->ReadRoutine(SftEntry->DeviceNode, Buffer, &Count); - *BytesRead = Count; - } - else - { - /* Invalid handle */ - return ERROR_INVALID_HANDLE; } /* Return the error code */ @@ -454,17 +644,26 @@ LPWORD BytesWritten) { WORD Result = ERROR_SUCCESS; - PDOS_SFT_ENTRY SftEntry = DosGetSftEntry(FileHandle); + PDOS_FILE_DESCRIPTOR Descriptor = DosGetHandleFileDescriptor(FileHandle); DPRINT("DosWriteFile: FileHandle 0x%04X, Count 0x%04X\n", FileHandle, Count); - if (SftEntry == NULL) + if (Descriptor == NULL) { /* Invalid handle */ return ERROR_INVALID_HANDLE; } - if (SftEntry->Type == DOS_SFT_ENTRY_WIN32) + if (Descriptor->DeviceInfo & (1 << 7)) + { + PDOS_DEVICE_NODE Node = DosGetDriverNode(Descriptor->DevicePointer); + if (!Node->WriteRoutine) return ERROR_INVALID_FUNCTION; + + /* Read the device */ + Node->WriteRoutine(Node, Buffer, &Count); + *BytesWritten = Count; + } + else { DWORD BytesWritten32 = 0; LPVOID LocalBuffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, Count); @@ -474,7 +673,13 @@ MemRead(TO_LINEAR(HIWORD(Buffer), LOWORD(Buffer)), LocalBuffer, Count); /* Write the file */ - if (!WriteFile(SftEntry->Handle, LocalBuffer, Count, &BytesWritten32, NULL)) + if (WriteFile(Descriptor->Win32Handle, LocalBuffer, Count, &BytesWritten32, NULL)) + { + /* Update the position and size */ + Descriptor->Position += BytesWritten32; + if (Descriptor->Position > Descriptor->Size) Descriptor->Size = Descriptor->Position; + } + else { /* Store the error code */ Result = (WORD)GetLastError(); @@ -483,19 +688,6 @@ /* The number of bytes written is always 16-bit */ *BytesWritten = LOWORD(BytesWritten32); RtlFreeHeap(RtlGetProcessHeap(), 0, LocalBuffer); - } - else if (SftEntry->Type == DOS_SFT_ENTRY_DEVICE) - { - if (!SftEntry->DeviceNode->WriteRoutine) return ERROR_INVALID_FUNCTION; - - /* Read the device */ - SftEntry->DeviceNode->WriteRoutine(SftEntry->DeviceNode, Buffer, &Count); - *BytesWritten = Count; - } - else - { - /* Invalid handle */ - return ERROR_INVALID_HANDLE; } /* Return the error code */ @@ -509,25 +701,20 @@ { WORD Result = ERROR_SUCCESS; DWORD FilePointer; - PDOS_SFT_ENTRY SftEntry = DosGetSftEntry(FileHandle); + PDOS_FILE_DESCRIPTOR Descriptor = DosGetHandleFileDescriptor(FileHandle); DPRINT("DosSeekFile: FileHandle 0x%04X, Offset 0x%08X, Origin 0x%02X\n", FileHandle, Offset, Origin); - if (SftEntry == NULL) + if (Descriptor == NULL) { /* Invalid handle */ return ERROR_INVALID_HANDLE; } - if (SftEntry->Type == DOS_SFT_ENTRY_NONE) - { - /* Invalid handle */ - return ERROR_INVALID_HANDLE; - } - else if (SftEntry->Type == DOS_SFT_ENTRY_DEVICE) + if (Descriptor->DeviceInfo & (1 << 7)) { /* For character devices, always return success */ return ERROR_SUCCESS; @@ -539,7 +726,7 @@ return ERROR_INVALID_FUNCTION; } - FilePointer = SetFilePointer(SftEntry->Handle, Offset, NULL, Origin); + FilePointer = SetFilePointer(Descriptor->Win32Handle, Offset, NULL, Origin); /* Check if there's a possibility the operation failed */ if (FilePointer == INVALID_SET_FILE_POINTER) @@ -554,6 +741,9 @@ return Result; } + /* Update the descriptor */ + Descriptor->Position = FilePointer; + /* Return the file pointer, if requested */ if (NewOffset) *NewOffset = FilePointer; @@ -563,38 +753,164 @@ BOOL DosFlushFileBuffers(WORD FileHandle) { - PDOS_SFT_ENTRY SftEntry = DosGetSftEntry(FileHandle); - - if (SftEntry == NULL) + PDOS_FILE_DESCRIPTOR Descriptor = DosGetHandleFileDescriptor(FileHandle); + + if (Descriptor == NULL) { /* Invalid handle */ - return ERROR_INVALID_HANDLE; - } - - switch (SftEntry->Type) - { - case DOS_SFT_ENTRY_WIN32: - { - return FlushFileBuffers(SftEntry->Handle); - } - - case DOS_SFT_ENTRY_DEVICE: - { - if (SftEntry->DeviceNode->FlushInputRoutine) - SftEntry->DeviceNode->FlushInputRoutine(SftEntry->DeviceNode); - - if (SftEntry->DeviceNode->FlushOutputRoutine) - SftEntry->DeviceNode->FlushOutputRoutine(SftEntry->DeviceNode); - + DosLastError = ERROR_INVALID_HANDLE; + return FALSE; + } + + if (Descriptor->DeviceInfo & (1 << 7)) + { + PDOS_DEVICE_NODE Node = DosGetDriverNode(Descriptor->DevicePointer); + + if (Node->FlushInputRoutine) Node->FlushInputRoutine(Node); + if (Node->FlushOutputRoutine) Node->FlushOutputRoutine(Node); + + return TRUE; + } + else + { + return FlushFileBuffers(Descriptor->Win32Handle); + } +} + +BOOLEAN DosLockFile(WORD DosHandle, DWORD Offset, DWORD Size) +{ + PDOS_FILE_DESCRIPTOR Descriptor = DosGetHandleFileDescriptor(DosHandle); + + if (Descriptor == NULL) + { + /* Invalid handle */ + DosLastError = ERROR_INVALID_HANDLE; + return FALSE; + } + + /* Always succeed for character devices */ + if (Descriptor->DeviceInfo & (1 << 7)) return TRUE; + + if (!LockFile(Descriptor->Win32Handle, Offset, 0, Size, 0)) + { + DosLastError = GetLastError(); + return FALSE; + } + + return TRUE; +} + +BOOLEAN DosUnlockFile(WORD DosHandle, DWORD Offset, DWORD Size) +{ + PDOS_FILE_DESCRIPTOR Descriptor = DosGetHandleFileDescriptor(DosHandle); + + if (Descriptor == NULL) + { + /* Invalid handle */ + DosLastError = ERROR_INVALID_HANDLE; + return FALSE; + } + + /* Always succeed for character devices */ + if (Descriptor->DeviceInfo & (1 << 7)) return TRUE; + + if (!UnlockFile(Descriptor->Win32Handle, Offset, 0, Size, 0)) + { + DosLastError = GetLastError(); + return FALSE; + } + + return TRUE; +} + +BOOLEAN DosDeviceIoControl(WORD FileHandle, BYTE ControlCode, DWORD Buffer, PWORD Length) +{ + PDOS_FILE_DESCRIPTOR Descriptor = DosGetHandleFileDescriptor(FileHandle); + PDOS_DEVICE_NODE Node = NULL; + + if (!Descriptor) + { + DosLastError = ERROR_INVALID_HANDLE; + return FALSE; + } + + if (Descriptor->DeviceInfo & (1 << 7)) + { + Node = DosGetDriverNode(Descriptor->DevicePointer); + } + + switch (ControlCode) + { + /* Get Device Information */ + case 0x00: + { + /* + * See Ralf Brown:
http://www.ctyme.com/intr/rb-2820.htm
+ * for a list of possible flags. + */ + setDX(Descriptor->DeviceInfo); return TRUE; } - + + /* Set Device Information */ + case 0x01: + { + // TODO: NOT IMPLEMENTED + UNIMPLEMENTED; + + return FALSE; + } + + /* Read From Device I/O Control Channel */ + case 0x02: + { + if (Node == NULL || !(Node->DeviceAttributes & DOS_DEVATTR_IOCTL)) + { + DosLastError = ERROR_INVALID_FUNCTION; + return FALSE; + } + + /* Do nothing if there is no IOCTL routine */ + if (!Node->IoctlReadRoutine) + { + *Length = 0; + return TRUE; + } + + Node->IoctlReadRoutine(Node, Buffer, Length); + return TRUE; + } + + /* Write To Device I/O Control Channel */ + case 0x03: + { + if (Node == NULL || !(Node->DeviceAttributes & DOS_DEVATTR_IOCTL)) + { + DosLastError = ERROR_INVALID_FUNCTION; + return FALSE; + } + + /* Do nothing if there is no IOCTL routine */ + if (!Node->IoctlWriteRoutine) + { + *Length = 0; + return TRUE; + } + + Node->IoctlWriteRoutine(Node, Buffer, Length); + return TRUE; + } + + /* Unsupported control code */ default: { - /* Invalid handle */ + DPRINT1("Unsupported IOCTL: 0x%02X\n", ControlCode); + + DosLastError = ERROR_INVALID_PARAMETER; return FALSE; } } } + /* EOF */ Added: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.h (added) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.h [iso-8859-1] Sun Apr 26 18:09:57 2015 @@ -0,0 +1,108 @@ +/* + * COPYRIGHT: GPL - See COPYING in the top level directory + * PROJECT: ReactOS Virtual DOS Machine + * FILE: dos/dos32krnl/dosfiles.h + * PURPOSE: DOS32 Files Support + * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + */ + +/* DEFINES ********************************************************************/ + +#pragma pack(push, 1) + +typedef struct _DOS_FILE_DESCRIPTOR +{ + WORD RefCount; + WORD OpenMode; + BYTE Attributes; + WORD DeviceInfo; + DWORD DevicePointer; + WORD Time; + WORD Date; + DWORD Size; + DWORD Position; + DWORD Reserved; + WORD OwnerPsp; + HANDLE Win32Handle; + BYTE Padding[0x1E - sizeof(HANDLE)]; +} DOS_FILE_DESCRIPTOR, *PDOS_FILE_DESCRIPTOR; + +C_ASSERT(sizeof(DOS_FILE_DESCRIPTOR) == 0x3B); + +typedef struct _DOS_SFT +{ + DWORD Link; + WORD NumDescriptors; + DOS_FILE_DESCRIPTOR FileDescriptors[ANYSIZE_ARRAY]; +} DOS_SFT, *PDOS_SFT; + +/* FUNCTIONS ******************************************************************/ + +BYTE DosFindFreeDescriptor(VOID); +BYTE DosFindWin32Descriptor(HANDLE Win32Handle); +BYTE DosFindDeviceDescriptor(DWORD DevicePointer); +PDOS_FILE_DESCRIPTOR DosGetFileDescriptor(BYTE Id); +PDOS_FILE_DESCRIPTOR DosGetHandleFileDescriptor(WORD DosHandle); + +WORD DosCreateFileEx +( + LPWORD Handle, + LPWORD CreationStatus, + LPCSTR FilePath, + BYTE AccessShareModes, + WORD CreateActionFlags, + WORD Attributes +); + +WORD DosCreateFile +( + LPWORD Handle, + LPCSTR FilePath, + DWORD CreationDisposition, + WORD Attributes +); + +WORD DosOpenFile +( + LPWORD Handle, + LPCSTR FilePath, + BYTE AccessShareModes +); + +WORD DosReadFile +( + WORD FileHandle, + DWORD Buffer, + WORD Count, + LPWORD BytesRead +); + +WORD DosWriteFile +( + WORD FileHandle, + DWORD Buffer, + WORD Count, + LPWORD BytesWritten +); + +WORD DosSeekFile +( + WORD FileHandle, + LONG Offset, + BYTE Origin, + LPDWORD NewOffset +); + +BOOL DosFlushFileBuffers(WORD FileHandle); +BOOLEAN DosLockFile(WORD DosHandle, DWORD Offset, DWORD Size); +BOOLEAN DosUnlockFile(WORD DosHandle, DWORD Offset, DWORD Size); + +BOOLEAN DosDeviceIoControl +( + WORD FileHandle, + BYTE ControlCode, + DWORD Buffer, + PWORD Length +); + +#pragma pack(pop) Propchange: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.h ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.c (added) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.c [iso-8859-1] Sun Apr 26 18:09:57 2015 @@ -0,0 +1,378 @@ +/* + * COPYRIGHT: GPLv2+ - See COPYING in the top level directory + * PROJECT: ReactOS Virtual DOS Machine + * FILE: dos/dos32krnl/handle.c + * PURPOSE: DOS32 Handles (Job File Table) + * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + */ + +/* INCLUDES *******************************************************************/ + +#define NDEBUG + +#include "ntvdm.h" +#include "emulator.h" + +#include "dos.h" +#include "dos/dem.h" +#include "dosfiles.h" +#include "handle.h" +#include "memory.h" + +/* PRIVATE FUNCTIONS **********************************************************/ + +/* Taken from base/shell/cmd/console.c */ +static BOOL IsConsoleHandle(HANDLE hHandle) +{ + DWORD dwMode; + + /* Check whether the handle may be that of a console... */ + if ((GetFileType(hHandle) & FILE_TYPE_CHAR) == 0) return FALSE; + + /* + * It may be. Perform another test... The idea comes from the + * MSDN description of the WriteConsole API: + * + * "WriteConsole fails if it is used with a standard handle + * that is redirected to a file. If an application processes + * multilingual output that can be redirected, determine whether + * the output handle is a console handle (one method is to call + * the GetConsoleMode function and check whether it succeeds). + * If the handle is a console handle, call WriteConsole. If the + * handle is not a console handle, the output is redirected and + * you should call WriteFile to perform the I/O." + */ + return GetConsoleMode(hHandle, &dwMode); +} + +/* PUBLIC FUNCTIONS ***********************************************************/ + +VOID DosCopyHandleTable(LPBYTE DestinationTable) +{ + UINT i; + PDOS_PSP PspBlock; + LPBYTE SourceTable; + PDOS_FILE_DESCRIPTOR Descriptor; + + /* Clear the table first */ + for (i = 0; i < DEFAULT_JFT_SIZE; i++) DestinationTable[i] = 0xFF; + + /* Check if this is the initial process */ + if (CurrentPsp == SYSTEM_PSP) + { + BYTE DescriptorId; + HANDLE StandardHandles[3]; + + /* Get the native standard handles */ + StandardHandles[0] = GetStdHandle(STD_INPUT_HANDLE); + StandardHandles[1] = GetStdHandle(STD_OUTPUT_HANDLE); + StandardHandles[2] = GetStdHandle(STD_ERROR_HANDLE); + + for (i = 0; i < 3; i++) + { + /* Find the corresponding SFT entry */ + if (IsConsoleHandle(StandardHandles[i])) + { + DescriptorId = DosFindDeviceDescriptor(SysVars->ActiveCon); + } + else + { + DescriptorId = DosFindWin32Descriptor(StandardHandles[i]); + } + + if (DescriptorId != 0xFF) + { + Descriptor = DosGetFileDescriptor(DescriptorId); + } + else + { + /* Create a new SFT entry for it */ + DescriptorId = DosFindFreeDescriptor(); + if (DescriptorId == 0xFF) + { + DPRINT1("Cannot create standard handle %d, the SFT is full!\n", i); + continue; + } + + Descriptor = DosGetFileDescriptor(DescriptorId); + ASSERT(Descriptor != NULL); + RtlZeroMemory(Descriptor, sizeof(*Descriptor)); + + if (IsConsoleHandle(StandardHandles[i])) + { + PDOS_DEVICE_NODE Node = DosGetDriverNode(SysVars->ActiveCon); + + Descriptor->DeviceInfo = 1 << 7; + Descriptor->DevicePointer = SysVars->ActiveCon; + + /* Call the open routine */ + if (Node->OpenRoutine) Node->OpenRoutine(Node); + } + else + { + Descriptor->Win32Handle = StandardHandles[i]; + } + } + + Descriptor->RefCount++; + DestinationTable[i] = DescriptorId; + } + } + else + { + /* Get the parent PSP block and handle table */ + PspBlock = SEGMENT_TO_PSP(CurrentPsp); + SourceTable = (LPBYTE)FAR_POINTER(PspBlock->HandleTablePtr); + + /* Copy the first 20 handles into the new table */ + for (i = 0; i < DEFAULT_JFT_SIZE; i++) + { + Descriptor = DosGetFileDescriptor(SourceTable[i]); + DestinationTable[i] = SourceTable[i]; + + /* Increase the reference count */ + Descriptor->RefCount++; + } + } +} + +BOOLEAN DosResizeHandleTable(WORD NewSize) +{ + PDOS_PSP PspBlock; + LPBYTE HandleTable; + WORD Segment; + + /* Get the PSP block */ + PspBlock = SEGMENT_TO_PSP(CurrentPsp); + + if (NewSize == PspBlock->HandleTableSize) + { + /* No change */ + return TRUE; + } + + if (PspBlock->HandleTableSize > DEFAULT_JFT_SIZE) + { + /* Get the segment of the current table */ + Segment = (LOWORD(PspBlock->HandleTablePtr) >> 4) + HIWORD(PspBlock->HandleTablePtr); + + if (NewSize <= DEFAULT_JFT_SIZE) + { + /* Get the current handle table */ + HandleTable = FAR_POINTER(PspBlock->HandleTablePtr); + + /* Copy it to the PSP */ + RtlCopyMemory(PspBlock->HandleTable, HandleTable, NewSize); + + /* Free the memory */ + DosFreeMemory(Segment); + + /* Update the handle table pointer and size */ + PspBlock->HandleTableSize = NewSize; + PspBlock->HandleTablePtr = MAKELONG(0x18, CurrentPsp); + } + else + { + /* Resize the memory */ + if (!DosResizeMemory(Segment, NewSize, NULL)) + { + /* Unable to resize, try allocating it somewhere else */ + Segment = DosAllocateMemory(NewSize, NULL); + if (Segment == 0) return FALSE; + + /* Get the new handle table */ + HandleTable = SEG_OFF_TO_PTR(Segment, 0); + + /* Copy the handles to the new table */ + RtlCopyMemory(HandleTable, + FAR_POINTER(PspBlock->HandleTablePtr), + PspBlock->HandleTableSize); + + /* Update the handle table pointer */ + PspBlock->HandleTablePtr = MAKELONG(0, Segment); + } + + /* Update the handle table size */ + PspBlock->HandleTableSize = NewSize; + } + } + else if (NewSize > DEFAULT_JFT_SIZE) + { + Segment = DosAllocateMemory(NewSize, NULL); + if (Segment == 0) return FALSE; + + /* Get the new handle table */ + HandleTable = SEG_OFF_TO_PTR(Segment, 0); + + /* Copy the handles from the PSP to the new table */ + RtlCopyMemory(HandleTable, + FAR_POINTER(PspBlock->HandleTablePtr), + PspBlock->HandleTableSize); + + /* Update the handle table pointer and size */ + PspBlock->HandleTableSize = NewSize; + PspBlock->HandleTablePtr = MAKELONG(0, Segment); + } + + return TRUE; +} + + +WORD DosOpenHandle(BYTE DescriptorId) +{ + WORD DosHandle; + PDOS_PSP PspBlock; + LPBYTE HandleTable; + PDOS_FILE_DESCRIPTOR Descriptor = DosGetFileDescriptor(DescriptorId); + + DPRINT("DosOpenHandle: DescriptorId 0x%02X\n", DescriptorId); + + /* Make sure the descriptor ID is valid */ + if (Descriptor == NULL) return INVALID_DOS_HANDLE; + + /* The system PSP has no handle table */ + if (CurrentPsp == SYSTEM_PSP) return INVALID_DOS_HANDLE; + + /* Get a pointer to the handle table */ + PspBlock = SEGMENT_TO_PSP(CurrentPsp); + HandleTable = (LPBYTE)FAR_POINTER(PspBlock->HandleTablePtr); + + /* Find a free entry in the JFT */ + for (DosHandle = 0; DosHandle < PspBlock->HandleTableSize; DosHandle++) + { + if (HandleTable[DosHandle] == 0xFF) break; + } + + /* If there are no free entries, fail */ + if (DosHandle == PspBlock->HandleTableSize) return INVALID_DOS_HANDLE; + + /* Reference the descriptor */ + Descriptor->RefCount++; + + /* Set the JFT entry to that descriptor ID */ + HandleTable[DosHandle] = DescriptorId; + + /* Return the new handle */ + return DosHandle; +} + +BYTE DosQueryHandle(WORD DosHandle) +{ + PDOS_PSP PspBlock; + LPBYTE HandleTable; + + DPRINT("DosQueryHandle: DosHandle 0x%04X\n", DosHandle); + + /* The system PSP has no handle table */ + if (CurrentPsp == SYSTEM_PSP) return 0xFF; + + /* Get a pointer to the handle table */ + PspBlock = SEGMENT_TO_PSP(CurrentPsp); + HandleTable = (LPBYTE)FAR_POINTER(PspBlock->HandleTablePtr); + + /* Return the descriptor ID */ + return HandleTable[DosHandle]; +} + +WORD DosDuplicateHandle(WORD DosHandle) +{ + BYTE DescriptorId = DosQueryHandle(DosHandle); + + if (DescriptorId == 0xFF) + { + DosLastError = ERROR_INVALID_HANDLE; + return INVALID_DOS_HANDLE; + } + + return DosOpenHandle(DescriptorId); +} + +BOOLEAN DosForceDuplicateHandle(WORD OldHandle, WORD NewHandle) +{ + BYTE DescriptorId; + PDOS_PSP PspBlock; + LPBYTE HandleTable; + PDOS_FILE_DESCRIPTOR Descriptor; + + DPRINT("DosForceDuplicateHandle: OldHandle 0x%04X, NewHandle 0x%04X\n", + OldHandle, + NewHandle); + + /* The system PSP has no handle table */ + if (CurrentPsp == SYSTEM_PSP) return FALSE; + + /* Get a pointer to the handle table */ + PspBlock = SEGMENT_TO_PSP(CurrentPsp); + HandleTable = (LPBYTE)FAR_POINTER(PspBlock->HandleTablePtr); + + /* Make sure the old handle is open */ + if (HandleTable[OldHandle] == 0xFF) return FALSE; + + /* Check if the new handle is open */ + if (HandleTable[NewHandle] != 0xFF) + { + /* Close it */ + DosCloseHandle(NewHandle); + } + + DescriptorId = HandleTable[OldHandle]; + Descriptor = DosGetFileDescriptor(DescriptorId); + if (Descriptor == NULL) return FALSE; + + /* Increment the reference count of the descriptor */ + Descriptor->RefCount++; + + /* Make the new handle point to that descriptor */ + HandleTable[NewHandle] = DescriptorId; + + /* Return success */ + return TRUE; +} + +BOOLEAN DosCloseHandle(WORD DosHandle) +{ + PDOS_PSP PspBlock; + LPBYTE HandleTable; + PDOS_FILE_DESCRIPTOR Descriptor; + + DPRINT("DosCloseHandle: DosHandle 0x%04X\n", DosHandle); + + /* The system PSP has no handle table */ + if (CurrentPsp == SYSTEM_PSP) return FALSE; + + /* Get a pointer to the handle table */ + PspBlock = SEGMENT_TO_PSP(CurrentPsp); + HandleTable = (LPBYTE)FAR_POINTER(PspBlock->HandleTablePtr); + + /* Make sure the handle is open */ + if (HandleTable[DosHandle] == 0xFF) return FALSE; + + /* Make sure the descriptor is valid */ + Descriptor = DosGetFileDescriptor(HandleTable[DosHandle]); + if (Descriptor == NULL) return FALSE; + + /* Decrement the reference count of the descriptor */ + Descriptor->RefCount--; + + /* Check if the reference count fell to zero */ + if (!Descriptor->RefCount) + { + if (Descriptor->DeviceInfo & (1 << 7)) + { + PDOS_DEVICE_NODE Node = DosGetDriverNode(Descriptor->DevicePointer); + + /* Call the close routine, if it exists */ + if (Node->CloseRoutine) Node->CloseRoutine(Node); + } + else + { + /* Close the win32 handle */ + CloseHandle(Descriptor->Win32Handle); + } + } + + /* Clear the entry in the JFT */ + HandleTable[DosHandle] = 0xFF; + + return TRUE; +} Propchange: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.h (added) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.h [iso-8859-1] Sun Apr 26 18:09:57 2015 @@ -0,0 +1,21 @@ +/* + * COPYRIGHT: GPLv2+ - See COPYING in the top level directory + * PROJECT: ReactOS Virtual DOS Machine + * FILE: dos/dos32krnl/handle.h + * PURPOSE: DOS32 Handles (Job File Table) + * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + */ + +/* DEFINITIONS ****************************************************************/ + +#define DEFAULT_JFT_SIZE 20 + +/* FUNCTIONS ******************************************************************/ + +VOID DosCopyHandleTable(LPBYTE DestinationTable); +BOOLEAN DosResizeHandleTable(WORD NewSize); +WORD DosOpenHandle(BYTE DescriptorId); +BYTE DosQueryHandle(WORD DosHandle); +WORD DosDuplicateHandle(WORD DosHandle); +BOOLEAN DosForceDuplicateHandle(WORD OldHandle, WORD NewHandle); +BOOLEAN DosCloseHandle(WORD DosHandle); Propchange: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.h ------------------------------------------------------------------------------ svn:eol-style = native
9 years, 8 months
1
0
0
0
[hbelusca] 67443: Forgot this change too.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Apr 26 17:50:38 2015 New Revision: 67443 URL:
http://svn.reactos.org/svn/reactos?rev=67443&view=rev
Log: Forgot this change too. Modified: trunk/rostests/apitests/msvcrt/CommandLine.c Modified: trunk/rostests/apitests/msvcrt/CommandLine.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/msvcrt/CommandLi…
============================================================================== --- trunk/rostests/apitests/msvcrt/CommandLine.c [iso-8859-1] (original) +++ trunk/rostests/apitests/msvcrt/CommandLine.c [iso-8859-1] Sun Apr 26 17:50:38 2015 @@ -304,7 +304,7 @@ else UtilityProgramDirectory[0] = 0; /* Suppress the executable.exe name */ - wcscat(UtilityProgramDirectory, L"data\\CmdLineUtil.exe"); + wcscat(UtilityProgramDirectory, L"testdata\\CmdLineUtil.exe"); /* Close the opened quote if needed. */ if (UtilityProgramDirectory[0] == L'"') wcscat(UtilityProgramDirectory, L"\"");
9 years, 8 months
1
0
0
0
[hbelusca] 67442: [REACTOS]: Add a "testdata" subdirectory in %SystemRoot%\bin\ where you can put all needed extra files for the tests. In addition, all the files present in your rostests\testdata ...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Apr 26 17:47:55 2015 New Revision: 67442 URL:
http://svn.reactos.org/svn/reactos?rev=67442&view=rev
Log: [REACTOS]: Add a "testdata" subdirectory in %SystemRoot%\bin\ where you can put all needed extra files for the tests. In addition, all the files present in your rostests\testdata local directory of your working copy are also copied into %SystemRoot%\bin\testdata . Added: trunk/rostests/testdata/ (with props) trunk/rostests/testdata/README.txt (with props) Modified: trunk/reactos/cmake/CMakeMacros.cmake trunk/rostests/CMakeLists.txt trunk/rostests/apitests/msvcrt/CmdLineUtil/CMakeLists.txt Modified: trunk/reactos/cmake/CMakeMacros.cmake URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/CMakeMacros.cmake?re…
============================================================================== --- trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] (original) +++ trunk/reactos/cmake/CMakeMacros.cmake [iso-8859-1] Sun Apr 26 17:47:55 2015 @@ -171,7 +171,7 @@ set(${var} 6) elseif(${dir} STREQUAL reactos/bin) set(${var} 7) - elseif(${dir} STREQUAL reactos/bin/data) + elseif(${dir} STREQUAL reactos/bin/testdata) set(${var} 8) elseif(${dir} STREQUAL reactos/media) set(${var} 9) Modified: trunk/rostests/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/CMakeLists.txt?rev=67442&…
============================================================================== --- trunk/rostests/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/CMakeLists.txt [iso-8859-1] Sun Apr 26 17:47:55 2015 @@ -12,4 +12,13 @@ #add_subdirectory(win32) add_subdirectory(winetests) + +## Extra files needed for the various tests can be added into the "testdata" subdirectory. +if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/testdata/) + file(GLOB_RECURSE TESTDATA_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/testdata/ ${CMAKE_CURRENT_SOURCE_DIR}/testdata/*) + foreach(item ${TESTDATA_FILES}) + add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/testdata/${item} DESTINATION reactos/bin/testdata NAME_ON_CD ${item} FOR regtest) + endforeach(item) +endif() + end_module_group() Modified: trunk/rostests/apitests/msvcrt/CmdLineUtil/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/msvcrt/CmdLineUt…
============================================================================== --- trunk/rostests/apitests/msvcrt/CmdLineUtil/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/msvcrt/CmdLineUtil/CMakeLists.txt [iso-8859-1] Sun Apr 26 17:47:55 2015 @@ -2,4 +2,4 @@ add_executable(CmdLineUtil CmdLineUtil.c) set_module_type(CmdLineUtil win32gui UNICODE) add_importlibs(CmdLineUtil msvcrt kernel32 ntdll) -add_cd_file(TARGET CmdLineUtil DESTINATION reactos/bin/data FOR all) +add_cd_file(TARGET CmdLineUtil DESTINATION reactos/bin/testdata FOR all) Propchange: trunk/rostests/testdata/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Sun Apr 26 17:47:55 2015 @@ -0,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/rostests/testdata/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/rostests/testdata/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Added: trunk/rostests/testdata/README.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/testdata/README.txt?rev=6…
============================================================================== --- trunk/rostests/testdata/README.txt (added) +++ trunk/rostests/testdata/README.txt [iso-8859-1] Sun Apr 26 17:47:55 2015 @@ -0,0 +1,2 @@ +This directory contains all the extra files needed for the various tests to run. +They are copied into the subdirectory %SystemRoot%\bin\testdata. Propchange: trunk/rostests/testdata/README.txt ------------------------------------------------------------------------------ svn:eol-style = native
9 years, 8 months
1
0
0
0
[dreimer] 67441: [ROSAPPS] Fix a few resource errors. Thx goes to Igor Koshpaev for noticing.
by dreimer@svn.reactos.org
Author: dreimer Date: Sun Apr 26 17:25:26 2015 New Revision: 67441 URL:
http://svn.reactos.org/svn/reactos?rev=67441&view=rev
Log: [ROSAPPS] Fix a few resource errors. Thx goes to Igor Koshpaev for noticing. Modified: trunk/rosapps/applications/sysutils/systeminfo/lang/de-DE.rc trunk/rosapps/applications/winfile/Ru.rc trunk/rosapps/templates/old_wordpad/lang/fr-FR.rc Modified: trunk/rosapps/applications/sysutils/systeminfo/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/syst…
============================================================================== --- trunk/rosapps/applications/sysutils/systeminfo/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/sysutils/systeminfo/lang/de-DE.rc [iso-8859-1] Sun Apr 26 17:25:26 2015 @@ -10,7 +10,7 @@ Parameterliste:\n\ /S System Bestimmt das Remotesystem mit dem die Verbindung\n\ hergestellt werden soll.\n\n\ - /U [Domäne\]Benutzer Bestimmt den Benutzerkontext unter dem\n\ + /U [Domäne\\]Benutzer Bestimmt den Benutzerkontext unter dem\n\ der Befehl ausgeführt werden soll.\n\n\ /P [Passwort] Bestimmt das Kennwort für den zugewiesenen\n\ Benutzerkontext. Bei Auslassung, wird dieses\n\ Modified: trunk/rosapps/applications/winfile/Ru.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/winfile/Ru.rc…
============================================================================== --- trunk/rosapps/applications/winfile/Ru.rc [iso-8859-1] (original) +++ trunk/rosapps/applications/winfile/Ru.rc [iso-8859-1] Sun Apr 26 17:25:26 2015 @@ -245,7 +245,7 @@ IDS_COL_SEC "Ð âезРÑÐ ÑР°СÐÐ Ð Ð ÑСÐСâСÐ" IDS_FREE_SPACE_FMT "%1 Ð ÑР· %2 СÐÐ ÐÐ ÑР±РÑÐ ÒÐ Ð Ð Ñ" - IDS_UNIT_KB "Ð ZÐ Q" - IDS_UNIT_MB "Ð \Ð Q" - IDS_UNIT_GB "Ð SÐ Q" -} + IDS_UNIT_KB "kB" + IDS_UNIT_MB "MB" + IDS_UNIT_GB "GB" +} Modified: trunk/rosapps/templates/old_wordpad/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/old_wordpad/lang…
============================================================================== --- trunk/rosapps/templates/old_wordpad/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/rosapps/templates/old_wordpad/lang/fr-FR.rc [iso-8859-1] Sun Apr 26 17:25:26 2015 @@ -110,7 +110,7 @@ STRINGTABLE DISCARDABLE BEGIN - IDS_LICENSE "Ce programme est un logiciel libre; vous pouvez le redistribuer et/ou le modifier tout en respectant les termes de la \"GNU General Public License\" publiée par la Free Software Foundation; dans sa version 2 (ou selon votre préférence) toute version suivante.\r\n\r\nCe programme est distribué dans l'espoir qu'il sera utile, cependant SANS GARANTIE D'AUCUNE SORTE; sans même une garantie implicite de COMMERCIABILITE ou DE CONFORMITE A UNE UTILISATION PARTICULIERE. \r\n\r\nVoir la Licence Publique Générale GNU pour plus de détails. Vous devriez avoir reçu un exemplaire de la Licence Publique Générale GNU avec ce programme ; si ce n'est pas le cas, écrivez à la Free Software Foundation Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA." + IDS_LICENSE "Ce programme est un logiciel libre; vous pouvez le redistribuer et/ou le modifier tout en respectant les termes de la ""GNU General Public License"" publiée par la Free Software Foundation; dans sa version 2 (ou selon votre préférence) toute version suivante.\r\n\r\nCe programme est distribué dans l'espoir qu'il sera utile, cependant SANS GARANTIE D'AUCUNE SORTE; sans même une garantie implicite de COMMERCIABILITE ou DE CONFORMITE A UNE UTILISATION PARTICULIERE. \r\n\r\nVoir la Licence Publique Générale GNU pour plus de détails. Vous devriez avoir reçu un exemplaire de la Licence Publique Générale GNU avec ce programme ; si ce n'est pas le cas, écrivez à la Free Software Foundation Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA." IDS_DEFAULT_NAME "Document %1!u!" IDS_READY " Prêt." END
9 years, 8 months
1
0
0
0
[dreimer] 67440: [DXTN] Really really fix MSVC this time.
by dreimer@svn.reactos.org
Author: dreimer Date: Sun Apr 26 17:09:11 2015 New Revision: 67440 URL:
http://svn.reactos.org/svn/reactos?rev=67440&view=rev
Log: [DXTN] Really really fix MSVC this time. Modified: trunk/reactos/dll/3rdparty/dxtn/CMakeLists.txt Modified: trunk/reactos/dll/3rdparty/dxtn/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/3rdparty/dxtn/CMakeLis…
============================================================================== --- trunk/reactos/dll/3rdparty/dxtn/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/3rdparty/dxtn/CMakeLists.txt [iso-8859-1] Sun Apr 26 17:09:11 2015 @@ -10,5 +10,7 @@ set_entrypoint(dxtn 0) add_importlibs(dxtn msvcrt) -add_compile_flags("-Wno-unused-but-set-variable") +if(NOT MSVC) + add_target_compile_flags(dxtn "-Wno-unused-but-set-variable") +endif() add_cd_file(TARGET dxtn DESTINATION reactos/system32 FOR all)
9 years, 8 months
1
0
0
0
[dreimer] 67439: [ROSAPPS] put -Wno-unused-but-set-variable between a if(NOT MSVC) to really make MSVC happy this time / Get rid of -Wno-implicit-function-declaration (include juggling + add defini...
by dreimer@svn.reactos.org
Author: dreimer Date: Sun Apr 26 17:08:34 2015 New Revision: 67439 URL:
http://svn.reactos.org/svn/reactos?rev=67439&view=rev
Log: [ROSAPPS] put -Wno-unused-but-set-variable between a if(NOT MSVC) to really make MSVC happy this time / Get rid of -Wno-implicit-function-declaration (include juggling + add definitions) and -Wno-format-extra-args (shorten sprinf) in ncftp. / Fix rosperf build and add it to cmake build now. Modified: trunk/rosapps/applications/devutils/symdump/CMakeLists.txt trunk/rosapps/applications/net/ncftp/CMakeLists.txt trunk/rosapps/applications/net/ncftp/libncftp/syshdrs.h trunk/rosapps/applications/net/ncftp/ncftp/cmds.c trunk/rosapps/applications/net/ncftp/ncftp/syshdrs.h trunk/rosapps/applications/net/ncftp/sio/syshdrs.h trunk/rosapps/applications/sysutils/logevent/CMakeLists.txt trunk/rosapps/applications/sysutils/pedump/CMakeLists.txt trunk/rosapps/applications/sysutils/utils/CMakeLists.txt trunk/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt trunk/rosapps/applications/sysutils/utils/rosperf/rosperf.c trunk/rosapps/templates/dialog/CMakeLists.txt Modified: trunk/rosapps/applications/devutils/symdump/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/devutils/symd…
============================================================================== --- trunk/rosapps/applications/devutils/symdump/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rosapps/applications/devutils/symdump/CMakeLists.txt [iso-8859-1] Sun Apr 26 17:08:34 2015 @@ -4,5 +4,7 @@ set_module_type(symdump win32cui) target_link_libraries(symdump wine) add_importlibs(symdump dbghelp shlwapi msvcrt kernel32) -add_compile_flags("-Wno-unused-but-set-variable") +if(NOT MSVC) + add_target_compile_flags(symdump "-Wno-unused-but-set-variable") +endif() add_cd_file(TARGET symdump DESTINATION reactos/system32 FOR all) Modified: trunk/rosapps/applications/net/ncftp/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/net/ncftp/CMa…
============================================================================== --- trunk/rosapps/applications/net/ncftp/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rosapps/applications/net/ncftp/CMakeLists.txt [iso-8859-1] Sun Apr 26 17:08:34 2015 @@ -70,6 +70,10 @@ add_executable(ncftp ${SOURCE} ncftp.rc) set_module_type(ncftp win32cui) -add_target_compile_flags(ncftp "-Wno-unused-but-set-variable -Wno-implicit-function-declaration -Wno-format-extra-args") +if(NOT MSVC) + add_target_compile_flags(ncftp "-DHAVE_UTIME_H -DHAVE_UNISTD_H -Wno-unused-but-set-variable") +else() + add_target_compile_flags(ncftp "-DHAVE_UTIME_H -DHAVE_UNISTD_H") +endif() add_importlibs(ncftp advapi32 user32 ws2_32 msvcrt kernel32) add_cd_file(TARGET ncftp DESTINATION reactos/system32 FOR all) Modified: trunk/rosapps/applications/net/ncftp/libncftp/syshdrs.h URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/net/ncftp/lib…
============================================================================== --- trunk/rosapps/applications/net/ncftp/libncftp/syshdrs.h [iso-8859-1] (original) +++ trunk/rosapps/applications/net/ncftp/libncftp/syshdrs.h [iso-8859-1] Sun Apr 26 17:08:34 2015 @@ -50,8 +50,6 @@ # define lstat _stat # define fstat _fstat # define dup _dup -# define utime _utime -# define utimbuf _utimbuf # endif # ifndef unlink # define unlink remove Modified: trunk/rosapps/applications/net/ncftp/ncftp/cmds.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/net/ncftp/ncf…
============================================================================== --- trunk/rosapps/applications/net/ncftp/ncftp/cmds.c [iso-8859-1] (original) +++ trunk/rosapps/applications/net/ncftp/ncftp/cmds.c [iso-8859-1] Sun Apr 26 17:08:34 2015 @@ -1211,7 +1211,7 @@ SysPerror("CreateMailslot"); (void) fprintf(stderr, "Could not create communication channel with %s.\n", "ncftpbookmarks.exe"); (void) fprintf(stderr, "%s", "This means if you select a bookmark to connect to that NcFTP\n"); - (void) fprintf(stderr, "%s", "will not get the message from %s.\n", "ncftpbookmarks.exe"); + (void) fprintf(stderr, "%s", "will not get the message from %s.\n"); } winExecResult = WinExec(prog, SW_SHOWNORMAL); Modified: trunk/rosapps/applications/net/ncftp/ncftp/syshdrs.h URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/net/ncftp/ncf…
============================================================================== --- trunk/rosapps/applications/net/ncftp/ncftp/syshdrs.h [iso-8859-1] (original) +++ trunk/rosapps/applications/net/ncftp/ncftp/syshdrs.h [iso-8859-1] Sun Apr 26 17:08:34 2015 @@ -44,6 +44,8 @@ # include <fcntl.h> # include <signal.h> # include <assert.h> +# include <utime.h> +# include <direct.h> # undef strcasecmp # define strcasecmp stricmp # undef strncasecmp Modified: trunk/rosapps/applications/net/ncftp/sio/syshdrs.h URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/net/ncftp/sio…
============================================================================== --- trunk/rosapps/applications/net/ncftp/sio/syshdrs.h [iso-8859-1] (original) +++ trunk/rosapps/applications/net/ncftp/sio/syshdrs.h [iso-8859-1] Sun Apr 26 17:08:34 2015 @@ -13,6 +13,7 @@ /* Include "wincfg.h" in place of "config.h" */ # include "wincfg.h" # include <winsock2.h> /* includes <windows.h> */ +# include <io.h> # define _POSIX_ 1 # ifdef HAVE_UNISTD_H # include <unistd.h> @@ -28,7 +29,6 @@ # include <ctype.h> # include <stdarg.h> # include <time.h> -# include <io.h> # include <sys/types.h> # include <sys/stat.h> # include <fcntl.h> Modified: trunk/rosapps/applications/sysutils/logevent/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/loge…
============================================================================== --- trunk/rosapps/applications/sysutils/logevent/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rosapps/applications/sysutils/logevent/CMakeLists.txt [iso-8859-1] Sun Apr 26 17:08:34 2015 @@ -1,6 +1,8 @@ add_executable(logevent logevent.c logevent.rc) set_module_type(logevent win32cui) -add_target_compile_flags(logevent "-Wno-unused-but-set-variable") +if(NOT MSVC) + add_target_compile_flags(logevent "-Wno-unused-but-set-variable") +endif() add_importlibs(logevent advapi32 msvcrt kernel32) add_cd_file(TARGET logevent DESTINATION reactos/system32 FOR all) Modified: trunk/rosapps/applications/sysutils/pedump/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/pedu…
============================================================================== --- trunk/rosapps/applications/sysutils/pedump/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rosapps/applications/sysutils/pedump/CMakeLists.txt [iso-8859-1] Sun Apr 26 17:08:34 2015 @@ -1,6 +1,8 @@ add_executable(pedump pedump.c pedump.rc) set_module_type(pedump win32cui) -add_target_compile_flags(pedump "-Wno-unused-but-set-variable") +if(NOT MSVC) + add_target_compile_flags(pedump "-Wno-unused-but-set-variable") +endif() add_importlibs(pedump msvcrt kernel32 ntdll) add_cd_file(TARGET pedump DESTINATION reactos/system32 FOR all) Modified: trunk/rosapps/applications/sysutils/utils/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/util…
============================================================================== --- trunk/rosapps/applications/sysutils/utils/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rosapps/applications/sysutils/utils/CMakeLists.txt [iso-8859-1] Sun Apr 26 17:08:34 2015 @@ -6,6 +6,6 @@ add_subdirectory(objdir) add_subdirectory(partinfo) add_subdirectory(ps) -#add_subdirectory(rosperf) +add_subdirectory(rosperf) add_subdirectory(stats) add_subdirectory(tickcount) Modified: trunk/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/util…
============================================================================== --- trunk/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt [iso-8859-1] Sun Apr 26 17:08:34 2015 @@ -11,6 +11,8 @@ add_executable(rosperf ${SOURCE} rosperf.rc) set_module_type(rosperf win32cui UNICODE) -add_target_compile_flags(rosperf "-Wno-unused-but-set-variable") +if(NOT MSVC) + add_target_compile_flags(rosperf "-Wno-unused-but-set-variable") +endif() add_importlibs(rosperf version msimg32 gdi32 shell32 advapi32 user32 ntdll msvcrt kernel32) add_cd_file(TARGET rosperf DESTINATION reactos/system32 FOR all) Modified: trunk/rosapps/applications/sysutils/utils/rosperf/rosperf.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/util…
============================================================================== --- trunk/rosapps/applications/sysutils/utils/rosperf/rosperf.c [iso-8859-1] (original) +++ trunk/rosapps/applications/sysutils/utils/rosperf/rosperf.c [iso-8859-1] Sun Apr 26 17:08:34 2015 @@ -858,9 +858,9 @@ } int WINAPI -WinMain(HINSTANCE hInstance, +wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPSTR lpszCmdLine, + LPWSTR lpszCmdLine, int nCmdShow) { PTEST Tests; Modified: trunk/rosapps/templates/dialog/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/dialog/CMakeList…
============================================================================== --- trunk/rosapps/templates/dialog/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rosapps/templates/dialog/CMakeLists.txt [iso-8859-1] Sun Apr 26 17:08:34 2015 @@ -9,6 +9,8 @@ add_executable(template_dialog ${SOURCE} dialog.rc) set_module_type(template_dialog win32cui) -add_target_compile_flags(template_dialog "-Wno-unused-but-set-variable") +if(NOT MSVC) + add_target_compile_flags(template_dialog "-Wno-unused-but-set-variable") +endif() add_importlibs(template_dialog user32 gdi32 comctl32 msvcrt kernel32 ntdll) add_cd_file(TARGET template_dialog DESTINATION reactos/system32 FOR all)
9 years, 8 months
1
0
0
0
[dreimer] 67438: [DXTN] -Wno-error=unused-but-set-variable -> -Wno-unused-but-set-variable to make MSVC happy
by dreimer@svn.reactos.org
Author: dreimer Date: Sun Apr 26 14:12:24 2015 New Revision: 67438 URL:
http://svn.reactos.org/svn/reactos?rev=67438&view=rev
Log: [DXTN] -Wno-error=unused-but-set-variable -> -Wno-unused-but-set-variable to make MSVC happy Modified: trunk/reactos/dll/3rdparty/dxtn/CMakeLists.txt Modified: trunk/reactos/dll/3rdparty/dxtn/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/3rdparty/dxtn/CMakeLis…
============================================================================== --- trunk/reactos/dll/3rdparty/dxtn/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/3rdparty/dxtn/CMakeLists.txt [iso-8859-1] Sun Apr 26 14:12:24 2015 @@ -10,5 +10,5 @@ set_entrypoint(dxtn 0) add_importlibs(dxtn msvcrt) -add_compile_flags("-Wno-error=unused-but-set-variable") +add_compile_flags("-Wno-unused-but-set-variable") add_cd_file(TARGET dxtn DESTINATION reactos/system32 FOR all)
9 years, 8 months
1
0
0
0
[dreimer] 67437: [ROSAPPS] Add sysutils/utils folder completely (except rosperf for now) / Fix two wrong output paths in roshttpd and ncftp / -Wno-error=unused-but-set-variable -> -Wno-unused-but-s...
by dreimer@svn.reactos.org
Author: dreimer Date: Sun Apr 26 14:11:18 2015 New Revision: 67437 URL:
http://svn.reactos.org/svn/reactos?rev=67437&view=rev
Log: [ROSAPPS] Add sysutils/utils folder completely (except rosperf for now) / Fix two wrong output paths in roshttpd and ncftp / -Wno-error=unused-but-set-variable -> -Wno-unused-but-set-variable to make MSVC happy Added: trunk/rosapps/applications/sysutils/utils/binpatch/CMakeLists.txt (with props) trunk/rosapps/applications/sysutils/utils/driver/CMakeLists.txt (with props) trunk/rosapps/applications/sysutils/utils/driver/load/CMakeLists.txt (with props) trunk/rosapps/applications/sysutils/utils/driver/unload/CMakeLists.txt (with props) trunk/rosapps/applications/sysutils/utils/infinst/CMakeLists.txt (with props) trunk/rosapps/applications/sysutils/utils/nts2w32err/CMakeLists.txt (with props) trunk/rosapps/applications/sysutils/utils/objdir/CMakeLists.txt (with props) trunk/rosapps/applications/sysutils/utils/partinfo/CMakeLists.txt (with props) trunk/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt (with props) trunk/rosapps/applications/sysutils/utils/stats/CMakeLists.txt (with props) trunk/rosapps/applications/sysutils/utils/tickcount/CMakeLists.txt (with props) Modified: trunk/rosapps/applications/devutils/symdump/CMakeLists.txt trunk/rosapps/applications/net/ncftp/CMakeLists.txt trunk/rosapps/applications/net/roshttpd/CMakeLists.txt trunk/rosapps/applications/sysutils/utils/CMakeLists.txt Modified: trunk/rosapps/applications/devutils/symdump/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/devutils/symd…
============================================================================== --- trunk/rosapps/applications/devutils/symdump/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rosapps/applications/devutils/symdump/CMakeLists.txt [iso-8859-1] Sun Apr 26 14:11:18 2015 @@ -4,5 +4,5 @@ set_module_type(symdump win32cui) target_link_libraries(symdump wine) add_importlibs(symdump dbghelp shlwapi msvcrt kernel32) -add_compile_flags("-Wno-error=unused-but-set-variable") +add_compile_flags("-Wno-unused-but-set-variable") add_cd_file(TARGET symdump DESTINATION reactos/system32 FOR all) Modified: trunk/rosapps/applications/net/ncftp/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/net/ncftp/CMa…
============================================================================== --- trunk/rosapps/applications/net/ncftp/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rosapps/applications/net/ncftp/CMakeLists.txt [iso-8859-1] Sun Apr 26 14:11:18 2015 @@ -72,4 +72,4 @@ set_module_type(ncftp win32cui) add_target_compile_flags(ncftp "-Wno-unused-but-set-variable -Wno-implicit-function-declaration -Wno-format-extra-args") add_importlibs(ncftp advapi32 user32 ws2_32 msvcrt kernel32) -add_cd_file(TARGET ncftp DESTINATION reactos FOR all) +add_cd_file(TARGET ncftp DESTINATION reactos/system32 FOR all) Modified: trunk/rosapps/applications/net/roshttpd/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/net/roshttpd/…
============================================================================== --- trunk/rosapps/applications/net/roshttpd/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rosapps/applications/net/roshttpd/CMakeLists.txt [iso-8859-1] Sun Apr 26 14:11:18 2015 @@ -16,4 +16,4 @@ add_executable(roshttpd ${SOURCE} common/roshttpd.rc) set_module_type(roshttpd win32cui) add_importlibs(roshttpd user32 ws2_32 msvcrt kernel32) -add_cd_file(TARGET roshttpd DESTINATION reactos FOR all) +add_cd_file(TARGET roshttpd DESTINATION reactos/system32 FOR all) Modified: trunk/rosapps/applications/sysutils/utils/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/util…
============================================================================== --- trunk/rosapps/applications/sysutils/utils/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rosapps/applications/sysutils/utils/CMakeLists.txt [iso-8859-1] Sun Apr 26 14:11:18 2015 @@ -1,15 +1,11 @@ -#add_subdirectory(binpatch) +add_subdirectory(binpatch) add_subdirectory(cat) -#add_subdirectory(driver) -#add_subdirectory(infinst) -#add_subdirectory(nts2w32err) -#add_subdirectory(objdir) -#add_subdirectory(partinfo) -#add_subdirectory(pice) -#add_subdirectory(pnpdump) +add_subdirectory(driver) +add_subdirectory(infinst) +add_subdirectory(nts2w32err) +add_subdirectory(objdir) +add_subdirectory(partinfo) add_subdirectory(ps) #add_subdirectory(rosperf) -#add_subdirectory(sdkparse) -#add_subdirectory(stats) -#add_subdirectory(theme) -#add_subdirectory(tickcount) +add_subdirectory(stats) +add_subdirectory(tickcount) Added: trunk/rosapps/applications/sysutils/utils/binpatch/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/util…
============================================================================== --- trunk/rosapps/applications/sysutils/utils/binpatch/CMakeLists.txt (added) +++ trunk/rosapps/applications/sysutils/utils/binpatch/CMakeLists.txt [iso-8859-1] Sun Apr 26 14:11:18 2015 @@ -0,0 +1,5 @@ + +add_executable(binpatch patch.c) +set_module_type(binpatch win32cui) +add_importlibs(binpatch ntdll msvcrt kernel32) +add_cd_file(TARGET binpatch DESTINATION reactos/bin FOR all) Propchange: trunk/rosapps/applications/sysutils/utils/binpatch/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rosapps/applications/sysutils/utils/driver/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/util…
============================================================================== --- trunk/rosapps/applications/sysutils/utils/driver/CMakeLists.txt (added) +++ trunk/rosapps/applications/sysutils/utils/driver/CMakeLists.txt [iso-8859-1] Sun Apr 26 14:11:18 2015 @@ -0,0 +1,2 @@ +add_subdirectory(load) +add_subdirectory(unload) Propchange: trunk/rosapps/applications/sysutils/utils/driver/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rosapps/applications/sysutils/utils/driver/load/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/util…
============================================================================== --- trunk/rosapps/applications/sysutils/utils/driver/load/CMakeLists.txt (added) +++ trunk/rosapps/applications/sysutils/utils/driver/load/CMakeLists.txt [iso-8859-1] Sun Apr 26 14:11:18 2015 @@ -0,0 +1,5 @@ + +add_executable(load load.c) +set_module_type(load win32cui UNICODE) +add_importlibs(load ntdll user32 msvcrt kernel32) +add_cd_file(TARGET load DESTINATION reactos/bin FOR all) Propchange: trunk/rosapps/applications/sysutils/utils/driver/load/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rosapps/applications/sysutils/utils/driver/unload/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/util…
============================================================================== --- trunk/rosapps/applications/sysutils/utils/driver/unload/CMakeLists.txt (added) +++ trunk/rosapps/applications/sysutils/utils/driver/unload/CMakeLists.txt [iso-8859-1] Sun Apr 26 14:11:18 2015 @@ -0,0 +1,5 @@ + +add_executable(unload unload.c) +set_module_type(unload win32cui UNICODE) +add_importlibs(unload ntdll user32 msvcrt kernel32) +add_cd_file(TARGET unload DESTINATION reactos/bin FOR all) Propchange: trunk/rosapps/applications/sysutils/utils/driver/unload/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rosapps/applications/sysutils/utils/infinst/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/util…
============================================================================== --- trunk/rosapps/applications/sysutils/utils/infinst/CMakeLists.txt (added) +++ trunk/rosapps/applications/sysutils/utils/infinst/CMakeLists.txt [iso-8859-1] Sun Apr 26 14:11:18 2015 @@ -0,0 +1,5 @@ + +add_executable(infinst infinst.c) +set_module_type(infinst win32cui) +add_importlibs(infinst ntdll user32 setupapi comdlg32 msvcrt kernel32) +add_cd_file(TARGET infinst DESTINATION reactos/bin FOR all) Propchange: trunk/rosapps/applications/sysutils/utils/infinst/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rosapps/applications/sysutils/utils/nts2w32err/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/util…
============================================================================== --- trunk/rosapps/applications/sysutils/utils/nts2w32err/CMakeLists.txt (added) +++ trunk/rosapps/applications/sysutils/utils/nts2w32err/CMakeLists.txt [iso-8859-1] Sun Apr 26 14:11:18 2015 @@ -0,0 +1,5 @@ + +add_executable(nts2w32err nts2w32err.c) +set_module_type(nts2w32err win32cui) +add_importlibs(nts2w32err ntdll msvcrt kernel32) +add_cd_file(TARGET nts2w32err DESTINATION reactos/bin FOR all) Propchange: trunk/rosapps/applications/sysutils/utils/nts2w32err/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rosapps/applications/sysutils/utils/objdir/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/util…
============================================================================== --- trunk/rosapps/applications/sysutils/utils/objdir/CMakeLists.txt (added) +++ trunk/rosapps/applications/sysutils/utils/objdir/CMakeLists.txt [iso-8859-1] Sun Apr 26 14:11:18 2015 @@ -0,0 +1,5 @@ + +add_executable(objdir objdir.c) +set_module_type(objdir win32cui) +add_importlibs(objdir ntdll msvcrt kernel32) +add_cd_file(TARGET objdir DESTINATION reactos/bin FOR all) Propchange: trunk/rosapps/applications/sysutils/utils/objdir/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rosapps/applications/sysutils/utils/partinfo/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/util…
============================================================================== --- trunk/rosapps/applications/sysutils/utils/partinfo/CMakeLists.txt (added) +++ trunk/rosapps/applications/sysutils/utils/partinfo/CMakeLists.txt [iso-8859-1] Sun Apr 26 14:11:18 2015 @@ -0,0 +1,5 @@ + +add_executable(partinfo partinfo.c) +set_module_type(partinfo win32cui) +add_importlibs(partinfo ntdll msvcrt kernel32) +add_cd_file(TARGET partinfo DESTINATION reactos/bin FOR all) Propchange: trunk/rosapps/applications/sysutils/utils/partinfo/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/util…
============================================================================== --- trunk/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt (added) +++ trunk/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt [iso-8859-1] Sun Apr 26 14:11:18 2015 @@ -0,0 +1,16 @@ + +list(APPEND SOURCE + rosperf.c + lines.c + fill.c + scroll.c + text.c + alphablend.c + testlist.c + gradient.c) + +add_executable(rosperf ${SOURCE} rosperf.rc) +set_module_type(rosperf win32cui UNICODE) +add_target_compile_flags(rosperf "-Wno-unused-but-set-variable") +add_importlibs(rosperf version msimg32 gdi32 shell32 advapi32 user32 ntdll msvcrt kernel32) +add_cd_file(TARGET rosperf DESTINATION reactos/system32 FOR all) Propchange: trunk/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rosapps/applications/sysutils/utils/stats/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/util…
============================================================================== --- trunk/rosapps/applications/sysutils/utils/stats/CMakeLists.txt (added) +++ trunk/rosapps/applications/sysutils/utils/stats/CMakeLists.txt [iso-8859-1] Sun Apr 26 14:11:18 2015 @@ -0,0 +1,5 @@ + +add_executable(stats stats.c) +set_module_type(stats win32cui UNICODE) +add_importlibs(stats ntdll msvcrt kernel32) +add_cd_file(TARGET stats DESTINATION reactos/bin FOR all) Propchange: trunk/rosapps/applications/sysutils/utils/stats/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rosapps/applications/sysutils/utils/tickcount/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/util…
============================================================================== --- trunk/rosapps/applications/sysutils/utils/tickcount/CMakeLists.txt (added) +++ trunk/rosapps/applications/sysutils/utils/tickcount/CMakeLists.txt [iso-8859-1] Sun Apr 26 14:11:18 2015 @@ -0,0 +1,5 @@ + +add_executable(tickcount tickcount.c) +set_module_type(tickcount win32cui UNICODE) +add_importlibs(tickcount ntdll msvcrt kernel32) +add_cd_file(TARGET tickcount DESTINATION reactos/bin FOR all) Propchange: trunk/rosapps/applications/sysutils/utils/tickcount/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native
9 years, 8 months
1
0
0
0
[khornicek] 67436: [W32KNAPI] - NEW_CURSORICON is no more
by khornicek@svn.reactos.org
Author: khornicek Date: Sun Apr 26 13:17:24 2015 New Revision: 67436 URL:
http://svn.reactos.org/svn/reactos?rev=67436&view=rev
Log: [W32KNAPI] - NEW_CURSORICON is no more Modified: trunk/rostests/apitests/w32kdll/w32kdll_ros/w32kdll_ros.spec trunk/rostests/apitests/w32kdll/w32kdll_ros/win32ksvc-ros.h Modified: trunk/rostests/apitests/w32kdll/w32kdll_ros/w32kdll_ros.spec URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32kdll/w32kdll_…
============================================================================== --- trunk/rostests/apitests/w32kdll/w32kdll_ros/w32kdll_ros.spec [iso-8859-1] (original) +++ trunk/rostests/apitests/w32kdll/w32kdll_ros/w32kdll_ros.spec [iso-8859-1] Sun Apr 26 13:17:24 2015 @@ -382,7 +382,7 @@ @ stdcall NtUserEvent(long) @ stdcall NtUserExcludeUpdateRgn(ptr ptr) @ stdcall NtUserFillWindow(ptr ptr ptr ptr) -@ stdcall NtUserFindExistingCursorIcon(ptr ptr ptr ptr) # FIXME: 3 on XP +@ stdcall NtUserFindExistingCursorIcon(ptr ptr ptr) @ stdcall NtUserFindWindowEx(ptr ptr ptr ptr long) @ stdcall NtUserFlashWindowEx(ptr) @ stdcall NtUserGetAltTabInfo(ptr long ptr wstr long long) @@ -518,7 +518,7 @@ @ stdcall NtUserSetConsoleReserveKeys(long long) @ stdcall NtUserSetCursor(ptr) @ stdcall NtUserSetCursorContents(ptr ptr) -; @ stdcall NtUserSetCursorIconData(ptr ptr ptr ptr) # FIXME 4 with new iconcursor / XP +@ stdcall NtUserSetCursorIconData(ptr ptr ptr ptr) @ stdcall NtUserSetDbgTag(long long) @ stdcall NtUserSetFocus(ptr) @ stdcall NtUserSetImeHotKey(long long long long long) Modified: trunk/rostests/apitests/w32kdll/w32kdll_ros/win32ksvc-ros.h URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32kdll/w32kdll_…
============================================================================== --- trunk/rostests/apitests/w32kdll/w32kdll_ros/win32ksvc-ros.h [iso-8859-1] (original) +++ trunk/rostests/apitests/w32kdll/w32kdll_ros/win32ksvc-ros.h [iso-8859-1] Sun Apr 26 13:17:24 2015 @@ -379,11 +379,7 @@ SVC_(UserEvent, 1) SVC_(UserExcludeUpdateRgn, 2) SVC_(UserFillWindow, 4) -#ifdef NEW_CURSORICON SVC_(UserFindExistingCursorIcon, 3) -#else -SVC_(UserFindExistingCursorIcon, 4) -#endif SVC_(UserFindWindowEx, 5) SVC_(UserFlashWindowEx, 1) SVC_(UserGetAltTabInfo, 6) @@ -519,11 +515,7 @@ SVC_(UserSetConsoleReserveKeys, 2) SVC_(UserSetCursor, 1) SVC_(UserSetCursorContents, 2) -#ifdef NEW_CURSORICON SVC_(UserSetCursorIconData, 4) -#else -SVC_(UserSetCursorIconData, 6) -#endif SVC_(UserSetDbgTag, 2) SVC_(UserSetFocus, 1) SVC_(UserSetImeHotKey, 5)
9 years, 8 months
1
0
0
0
[dreimer] 67435: [ROSAPPS] Add previously built templates back to build. Fix several warnings in dialog and mdi template. This should be it for rosapps stuff
by dreimer@svn.reactos.org
Author: dreimer Date: Sun Apr 26 13:06:35 2015 New Revision: 67435 URL:
http://svn.reactos.org/svn/reactos?rev=67435&view=rev
Log: [ROSAPPS] Add previously built templates back to build. Fix several warnings in dialog and mdi template. This should be it for rosapps stuff Added: trunk/rosapps/templates/CMakeLists.txt (with props) trunk/rosapps/templates/dialog/CMakeLists.txt (with props) trunk/rosapps/templates/mdi/CMakeLists.txt (with props) trunk/rosapps/templates/old_wordpad/CMakeLists.txt (with props) Modified: trunk/rosapps/CMakeLists.txt trunk/rosapps/templates/dialog/dialog.rc trunk/rosapps/templates/dialog/memdlg.c trunk/rosapps/templates/mdi/childwnd.c trunk/rosapps/templates/mdi/framewnd.c trunk/rosapps/templates/mdi/main.c trunk/rosapps/templates/mdi/main.h Modified: trunk/rosapps/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/CMakeLists.txt?rev=67435&r…
============================================================================== --- trunk/rosapps/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rosapps/CMakeLists.txt [iso-8859-1] Sun Apr 26 13:06:35 2015 @@ -2,3 +2,4 @@ add_subdirectory(demos) add_subdirectory(drivers) add_subdirectory(lib) +add_subdirectory(templates) Added: trunk/rosapps/templates/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/CMakeLists.txt?r…
============================================================================== --- trunk/rosapps/templates/CMakeLists.txt (added) +++ trunk/rosapps/templates/CMakeLists.txt [iso-8859-1] Sun Apr 26 13:06:35 2015 @@ -0,0 +1,3 @@ +add_subdirectory(dialog) +add_subdirectory(mdi) +add_subdirectory(old_wordpad) Propchange: trunk/rosapps/templates/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rosapps/templates/dialog/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/dialog/CMakeList…
============================================================================== --- trunk/rosapps/templates/dialog/CMakeLists.txt (added) +++ trunk/rosapps/templates/dialog/CMakeLists.txt [iso-8859-1] Sun Apr 26 13:06:35 2015 @@ -0,0 +1,14 @@ + +list(APPEND SOURCE + dialog.c + memdlg.c + page1.c + page2.c + page3.c + trace.c) + +add_executable(template_dialog ${SOURCE} dialog.rc) +set_module_type(template_dialog win32cui) +add_target_compile_flags(template_dialog "-Wno-unused-but-set-variable") +add_importlibs(template_dialog user32 gdi32 comctl32 msvcrt kernel32 ntdll) +add_cd_file(TARGET template_dialog DESTINATION reactos/system32 FOR all) Propchange: trunk/rosapps/templates/dialog/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/rosapps/templates/dialog/dialog.rc URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/dialog/dialog.rc…
============================================================================== --- trunk/rosapps/templates/dialog/dialog.rc [iso-8859-1] (original) +++ trunk/rosapps/templates/dialog/dialog.rc [iso-8859-1] Sun Apr 26 13:06:35 2015 @@ -1,6 +1,6 @@ //Microsoft Developer Studio generated resource script. // -#include "resrc1.h" +// #include "resrc1.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// Modified: trunk/rosapps/templates/dialog/memdlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/dialog/memdlg.c?…
============================================================================== --- trunk/rosapps/templates/dialog/memdlg.c [iso-8859-1] (original) +++ trunk/rosapps/templates/dialog/memdlg.c [iso-8859-1] Sun Apr 26 13:06:35 2015 @@ -137,7 +137,7 @@ *lpw++ = 0x0082; // static class for (lpwsz = (LPWSTR)lpw; - *lpwsz++ = (WCHAR)*lpszMessage++; + *lpwsz++ == (WCHAR)*lpszMessage++; ); lpw = (LPWORD)lpwsz; lpw = lpwAlign(lpw); // align creation data on DWORD boundary Added: trunk/rosapps/templates/mdi/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/mdi/CMakeLists.t…
============================================================================== --- trunk/rosapps/templates/mdi/CMakeLists.txt (added) +++ trunk/rosapps/templates/mdi/CMakeLists.txt [iso-8859-1] Sun Apr 26 13:06:35 2015 @@ -0,0 +1,11 @@ + +list(APPEND SOURCE + about.c + framewnd.c + childwnd.c + main.c) + +add_executable(template_mdi ${SOURCE} mdi.rc) +set_module_type(template_mdi win32cui) +add_importlibs(template_mdi advapi32 user32 gdi32 comctl32 msvcrt kernel32 ntdll) +add_cd_file(TARGET template_mdi DESTINATION reactos/system32 FOR all) Propchange: trunk/rosapps/templates/mdi/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/rosapps/templates/mdi/childwnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/mdi/childwnd.c?r…
============================================================================== --- trunk/rosapps/templates/mdi/childwnd.c [iso-8859-1] (original) +++ trunk/rosapps/templates/mdi/childwnd.c [iso-8859-1] Sun Apr 26 13:06:35 2015 @@ -44,14 +44,14 @@ static void draw_splitbar(HWND hWnd, int x) { - RECT rt; - HDC hdc = GetDC(hWnd); - - GetClientRect(hWnd, &rt); - rt.left = x - SPLIT_WIDTH/2; - rt.right = x + SPLIT_WIDTH/2+1; - InvertRect(hdc, &rt); - ReleaseDC(hWnd, hdc); + RECT rt; + HDC hdc = GetDC(hWnd); + + GetClientRect(hWnd, &rt); + rt.left = x - SPLIT_WIDTH/2; + rt.right = x + SPLIT_WIDTH/2+1; + InvertRect(hdc, &rt); + ReleaseDC(hWnd, hdc); } static void OnPaint(HWND hWnd, ChildWnd* pChildWnd) @@ -84,7 +84,7 @@ static void OnSize(ChildWnd* pChildWnd, WPARAM wParam, LPARAM lParam) { if (wParam != SIZE_MINIMIZED) { - //resize_tree(pChildWnd, LOWORD(lParam), HIWORD(lParam)); + //resize_tree(pChildWnd, LOWORD(lParam), HIWORD(lParam)); } } @@ -104,155 +104,154 @@ ChildWnd* pChildWnd = (ChildWnd*)GetWindowLong(hWnd, GWL_USERDATA); ASSERT(pChildWnd); - if (1) { - switch(message) { - case WM_CREATE: + switch(message) { + case WM_CREATE: + return 0; + + case WM_MDIACTIVATE: // set an alternate menu here + if (lParam == (LPARAM)hWnd) { + } else { + } + DrawMenuBar(hFrameWnd); + // return 0; + break; + + case WM_PAINT: + OnPaint(hWnd, pChildWnd); + return 0; + + case WM_NCDESTROY: + // SetWindowLong(hWnd, GWL_USERDATA, 0); + break; + + case WM_SETCURSOR: + if (LOWORD(lParam) == HTCLIENT) { + POINT pt; + GetCursorPos(&pt); + ScreenToClient(hWnd, &pt); + + if (pt.x>=pChildWnd->nSplitPos-SPLIT_WIDTH/2 && pt.x<pChildWnd->nSplitPos+SPLIT_WIDTH/2+1) { + SetCursor(LoadCursor(0, IDC_SIZEWE)); + return TRUE; + } + } + //goto def; + break; + + case WM_LBUTTONDOWN: { + RECT rt; + int x = LOWORD(lParam); + GetClientRect(hWnd, &rt); + if (x>=pChildWnd->nSplitPos-SPLIT_WIDTH/2 && x<pChildWnd->nSplitPos+SPLIT_WIDTH/2+1) { + last_split = pChildWnd->nSplitPos; +#ifdef _NO_EXTENSIONS + draw_splitbar(hWnd, last_split); +#endif + SetCapture(hWnd); + } + break;} + + case WM_LBUTTONUP: + if (GetCapture() == hWnd) { +#ifdef _NO_EXTENSIONS + RECT rt; + int x = LOWORD(lParam); + draw_splitbar(hWnd, last_split); + last_split = -1; + GetClientRect(hWnd, &rt); + pChildWnd->nSplitPos = x; + //resize_tree(pChildWnd, rt.right, rt.bottom); +#endif + ReleaseCapture(); + } + break; + +#ifdef _NO_EXTENSIONS + case WM_CAPTURECHANGED: + if (GetCapture()==hWnd && last_split>=0) + draw_splitbar(hWnd, last_split); + break; +#endif + case WM_KEYDOWN: + if (wParam == VK_ESCAPE) + if (GetCapture() == hWnd) { + RECT rt; +#ifdef _NO_EXTENSIONS + draw_splitbar(hWnd, last_split); +#else + pChildWnd->nSplitPos = last_split; +#endif + GetClientRect(hWnd, &rt); + //resize_tree(pChildWnd, rt.right, rt.bottom); + last_split = -1; + ReleaseCapture(); + SetCursor(LoadCursor(0, IDC_ARROW)); + } + break; + + case WM_MOUSEMOVE: + if (GetCapture() == hWnd) { + RECT rt; + int x = LOWORD(lParam); +#ifdef _NO_EXTENSIONS + HDC hdc = GetDC(hWnd); + GetClientRect(hWnd, &rt); + rt.left = last_split-SPLIT_WIDTH/2; + rt.right = last_split+SPLIT_WIDTH/2+1; + InvertRect(hdc, &rt); + last_split = x; + rt.left = x-SPLIT_WIDTH/2; + rt.right = x+SPLIT_WIDTH/2+1; + InvertRect(hdc, &rt); + ReleaseDC(hWnd, hdc); +#else + GetClientRect(hWnd, &rt); + if (x>=0 && x<rt.right) { + pChildWnd->nSplitPos = x; + resize_tree(pChildWnd, rt.right, rt.bottom); + rt.left = x-SPLIT_WIDTH/2; + rt.right = x+SPLIT_WIDTH/2+1; + InvalidateRect(hWnd, &rt, FALSE); + UpdateWindow(pChildWnd->left.hWnd); + UpdateWindow(hWnd); + UpdateWindow(pChildWnd->right.hWnd); + } +#endif + } + break; + +#ifndef _NO_EXTENSIONS + case WM_GETMINMAXINFO: + DefMDIChildProc(hWnd, message, wParam, lParam); + {LPMINMAXINFO lpmmi = (LPMINMAXINFO)lParam; + lpmmi->ptMaxTrackSize.x <<= 1;//2*GetSystemMetrics(SM_CXSCREEN) / SM_CXVIRTUALSCREEN + lpmmi->ptMaxTrackSize.y <<= 1;//2*GetSystemMetrics(SM_CYSCREEN) / SM_CYVIRTUALSCREEN + break;} +#endif + + case WM_SETFOCUS: + SetCurrentDirectory(pChildWnd->szPath); + SetFocus(pChildWnd->nFocusPanel? pChildWnd->hRightWnd: pChildWnd->hLeftWnd); + break; +/* + case WM_COMMAND: + pane = GetFocus()==pChildWnd->left.hWnd? &pChildWnd->left: &pChildWnd->right; + switch(LOWORD(wParam)) { + case ID_WINDOW_NEW_WINDOW: return 0; - - case WM_MDIACTIVATE: // set an alternate menu here - if (lParam == (LPARAM)hWnd) { - } else { - } - DrawMenuBar(hFrameWnd); -// return 0; + default: + return pane_command(pane, LOWORD(wParam)); break; - - case WM_PAINT: - OnPaint(hWnd, pChildWnd); - return 0; - - case WM_NCDESTROY: - //SetWindowLong(hWnd, GWL_USERDATA, 0); - break; - - case WM_SETCURSOR: - if (LOWORD(lParam) == HTCLIENT) { - POINT pt; - GetCursorPos(&pt); - ScreenToClient(hWnd, &pt); - - if (pt.x>=pChildWnd->nSplitPos-SPLIT_WIDTH/2 && pt.x<pChildWnd->nSplitPos+SPLIT_WIDTH/2+1) { - SetCursor(LoadCursor(0, IDC_SIZEWE)); - return TRUE; - } - } - //goto def; - break; - - case WM_LBUTTONDOWN: { - RECT rt; - int x = LOWORD(lParam); - GetClientRect(hWnd, &rt); - if (x>=pChildWnd->nSplitPos-SPLIT_WIDTH/2 && x<pChildWnd->nSplitPos+SPLIT_WIDTH/2+1) { - last_split = pChildWnd->nSplitPos; -#ifdef _NO_EXTENSIONS - draw_splitbar(hWnd, last_split); -#endif - SetCapture(hWnd); - } - break;} - - case WM_LBUTTONUP: - if (GetCapture() == hWnd) { -#ifdef _NO_EXTENSIONS - RECT rt; - int x = LOWORD(lParam); - draw_splitbar(hWnd, last_split); - last_split = -1; - GetClientRect(hWnd, &rt); - pChildWnd->nSplitPos = x; - //resize_tree(pChildWnd, rt.right, rt.bottom); -#endif - ReleaseCapture(); - } - break; - -#ifdef _NO_EXTENSIONS - case WM_CAPTURECHANGED: - if (GetCapture()==hWnd && last_split>=0) - draw_splitbar(hWnd, last_split); - break; -#endif - case WM_KEYDOWN: - if (wParam == VK_ESCAPE) - if (GetCapture() == hWnd) { - RECT rt; -#ifdef _NO_EXTENSIONS - draw_splitbar(hWnd, last_split); -#else - pChildWnd->nSplitPos = last_split; -#endif - GetClientRect(hWnd, &rt); - //resize_tree(pChildWnd, rt.right, rt.bottom); - last_split = -1; - ReleaseCapture(); - SetCursor(LoadCursor(0, IDC_ARROW)); - } - break; - - case WM_MOUSEMOVE: - if (GetCapture() == hWnd) { - RECT rt; - int x = LOWORD(lParam); -#ifdef _NO_EXTENSIONS - HDC hdc = GetDC(hWnd); - GetClientRect(hWnd, &rt); - rt.left = last_split-SPLIT_WIDTH/2; - rt.right = last_split+SPLIT_WIDTH/2+1; - InvertRect(hdc, &rt); - last_split = x; - rt.left = x-SPLIT_WIDTH/2; - rt.right = x+SPLIT_WIDTH/2+1; - InvertRect(hdc, &rt); - ReleaseDC(hWnd, hdc); -#else - GetClientRect(hWnd, &rt); - if (x>=0 && x<rt.right) { - pChildWnd->nSplitPos = x; - resize_tree(pChildWnd, rt.right, rt.bottom); - rt.left = x-SPLIT_WIDTH/2; - rt.right = x+SPLIT_WIDTH/2+1; - InvalidateRect(hWnd, &rt, FALSE); - UpdateWindow(pChildWnd->left.hWnd); - UpdateWindow(hWnd); - UpdateWindow(pChildWnd->right.hWnd); - } -#endif - } - break; - -#ifndef _NO_EXTENSIONS - case WM_GETMINMAXINFO: - DefMDIChildProc(hWnd, message, wParam, lParam); - {LPMINMAXINFO lpmmi = (LPMINMAXINFO)lParam; - lpmmi->ptMaxTrackSize.x <<= 1;//2*GetSystemMetrics(SM_CXSCREEN) / SM_CXVIRTUALSCREEN - lpmmi->ptMaxTrackSize.y <<= 1;//2*GetSystemMetrics(SM_CYSCREEN) / SM_CYVIRTUALSCREEN - break;} -#endif - - case WM_SETFOCUS: - SetCurrentDirectory(pChildWnd->szPath); - SetFocus(pChildWnd->nFocusPanel? pChildWnd->hRightWnd: pChildWnd->hLeftWnd); - break; -/* - case WM_COMMAND: - pane = GetFocus()==pChildWnd->left.hWnd? &pChildWnd->left: &pChildWnd->right; - switch(LOWORD(wParam)) { - case ID_WINDOW_NEW_WINDOW: - return 0; - default: - return pane_command(pane, LOWORD(wParam)); - break; - } - break; + } + break; */ - case WM_SIZE: + case WM_SIZE: if (wParam != SIZE_MINIMIZED) { OnSize(pChildWnd, wParam, lParam); } // fall through - default: def: + // default: def: return DefMDIChildProc(hWnd, message, wParam, lParam); - } + } return DefMDIChildProc(hWnd, message, wParam, lParam); } Modified: trunk/rosapps/templates/mdi/framewnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/mdi/framewnd.c?r…
============================================================================== --- trunk/rosapps/templates/mdi/framewnd.c [iso-8859-1] (original) +++ trunk/rosapps/templates/mdi/framewnd.c [iso-8859-1] Sun Apr 26 13:06:35 2015 @@ -70,12 +70,12 @@ MoveWindow(hMDIClient, prect->left-1,prect->top-1,prect->right+2,prect->bottom+1, TRUE); } -static void resize_frame(HWND hWnd, int cx, int cy) +/* static void resize_frame(HWND hWnd, int cx, int cy) { RECT rect = {0, 0, cx, cy}; resize_frame_rect(hWnd, &rect); -} +}*/ void resize_frame_client(HWND hWnd) { Modified: trunk/rosapps/templates/mdi/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/mdi/main.c?rev=6…
============================================================================== --- trunk/rosapps/templates/mdi/main.c [iso-8859-1] (original) +++ trunk/rosapps/templates/mdi/main.c [iso-8859-1] Sun Apr 26 13:06:35 2015 @@ -92,28 +92,27 @@ }; ATOM hChildWndClass = RegisterClass(&wcChild); // register child windows class #else - WNDCLASSEX wcChild = { - sizeof(WNDCLASSEX), - CS_HREDRAW | CS_VREDRAW/*style*/, - ChildWndProc, - 0/*cbClsExtra*/, - sizeof(HANDLE)/*cbWndExtra*/, - hInstance, - LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MDI_APP)), - LoadCursor(0, IDC_ARROW), - 0/*hbrBackground*/, - 0/*lpszMenuName*/, - szChildClass, - (HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDC_MDI_APP), IMAGE_ICON, - GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED) - - }; - ATOM hChildWndClass = RegisterClassEx(&wcChild); // register child windows class + // WNDCLASSEX wcChild = { + // sizeof(WNDCLASSEX), + // CS_HREDRAW | CS_VREDRAW/*style*/, + // ChildWndProc, + // 0/*cbClsExtra*/, + // sizeof(HANDLE)/*cbWndExtra*/, + // hInstance, + // LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MDI_APP)), + // LoadCursor(0, IDC_ARROW), + // 0/*hbrBackground*/, + // 0/*lpszMenuName*/, + // szChildClass, + // (HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDC_MDI_APP), IMAGE_ICON, + // GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED) + // }; + // ATOM hChildWndClass = RegisterClassEx(&wcChild); // register child windows class #endif HMENU hMenu = LoadMenu(hInstance, MAKEINTRESOURCE(IDC_MDI_APP)); HMENU hMenuOptions = GetSubMenu(hMenu, ID_OPTIONS_MENU); - HMENU hChildMenu = LoadMenu(hInstance, MAKEINTRESOURCE(IDC_MDI_APP_CHILD)); + // HMENU hChildMenu = LoadMenu(hInstance, MAKEINTRESOURCE(IDC_MDI_APP_CHILD)); INITCOMMONCONTROLSEX icc = { sizeof(INITCOMMONCONTROLSEX), Modified: trunk/rosapps/templates/mdi/main.h URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/mdi/main.h?rev=6…
============================================================================== --- trunk/rosapps/templates/mdi/main.h [iso-8859-1] (original) +++ trunk/rosapps/templates/mdi/main.h [iso-8859-1] Sun Apr 26 13:06:35 2015 @@ -33,7 +33,7 @@ #include "resource.h" -#include "../../lib/ros2win/ros2win.h" +// #include "../../lib/ros2win/ros2win.h" //////////////////////////////////////////////////////////////////////////////// Added: trunk/rosapps/templates/old_wordpad/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/templates/old_wordpad/CMak…
============================================================================== --- trunk/rosapps/templates/old_wordpad/CMakeLists.txt (added) +++ trunk/rosapps/templates/old_wordpad/CMakeLists.txt [iso-8859-1] Sun Apr 26 13:06:35 2015 @@ -0,0 +1,13 @@ + +list(APPEND SOURCE + dialogs.c + editwnd.c + mainwnd.c + misc.c + opensave.c + wordpad.c) + +add_executable(old_wordpad ${SOURCE} wordpad.rc) +set_module_type(old_wordpad win32gui UNICODE) +add_importlibs(old_wordpad user32 gdi32 comdlg32 advapi32 shell32 comctl32 msvcrt kernel32 ntdll) +add_cd_file(TARGET old_wordpad DESTINATION reactos/system32 FOR all) Propchange: trunk/rosapps/templates/old_wordpad/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native
9 years, 8 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
49
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
48
49
Results per page:
10
25
50
100
200