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] 67364: [BASESRV] In BaseSrvGetNextVDMCommand, the VDM_FLAG_DONT_WAIT flag is enough to tell it not to create a wait handle.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Thu Apr 23 02:53:08 2015 New Revision: 67364 URL:
http://svn.reactos.org/svn/reactos?rev=67364&view=rev
Log: [BASESRV] In BaseSrvGetNextVDMCommand, the VDM_FLAG_DONT_WAIT flag is enough to tell it not to create a wait handle. Modified: trunk/reactos/subsystems/win/basesrv/vdm.c Modified: trunk/reactos/subsystems/win/basesrv/vdm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win/basesrv/vdm…
============================================================================== --- trunk/reactos/subsystems/win/basesrv/vdm.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win/basesrv/vdm.c [iso-8859-1] Thu Apr 23 02:53:08 2015 @@ -1068,8 +1068,7 @@ } /* There is no command yet */ - if ((GetNextVdmCommandRequest->VDMState & (VDM_FLAG_DONT_WAIT | VDM_FLAG_RETRY)) - != (VDM_FLAG_DONT_WAIT | VDM_FLAG_RETRY)) + if (!(GetNextVdmCommandRequest->VDMState & VDM_FLAG_DONT_WAIT)) { if (ConsoleRecord->ServerEvent) {
9 years, 8 months
1
0
0
0
[aandrejevic] 67363: [NTVDM][KERNEL32] In DosCreateProcess, allocate space for the environment block dynamically and expand it if needed, just like we do in CommandThreadProc. In GetNextVDMCommand, ...
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Thu Apr 23 02:30:53 2015 New Revision: 67363 URL:
http://svn.reactos.org/svn/reactos?rev=67363&view=rev
Log: [NTVDM][KERNEL32] In DosCreateProcess, allocate space for the environment block dynamically and expand it if needed, just like we do in CommandThreadProc. In GetNextVDMCommand, remove the check that checks whether VDMState is one of VDM_NOT_LOADED, VDM_NOT_READY or VDM_READY - that check makes no sense whatsoever, since those aren't input values for that structure field. Their bit masks do correspond to valid input fields, but even then the check makes no sense. Modified: trunk/reactos/dll/win32/kernel32/client/vdm.c trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c Modified: trunk/reactos/dll/win32/kernel32/client/vdm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/vdm.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/vdm.c [iso-8859-1] Thu Apr 23 02:30:53 2015 @@ -1278,7 +1278,22 @@ if (CommandData != NULL) { - if (CommandData->VDMState & (VDM_NOT_LOADED | VDM_NOT_READY | VDM_READY)) + if ((CommandData->VDMState == VDM_INC_REENTER_COUNT) + || (CommandData->VDMState == VDM_DEC_REENTER_COUNT)) + { + /* Setup the input parameters */ + SetReenterCount->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + SetReenterCount->fIncDec = CommandData->VDMState; + + /* Call CSRSS */ + Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX, BasepSetReenterCount), + sizeof(BASE_SET_REENTER_COUNT)); + BaseSetLastNTError(Status); + Result = NT_SUCCESS(Status); + } + else { /* Clear the structure */ ZeroMemory(GetNextVdmCommand, sizeof(*GetNextVdmCommand)); @@ -1545,26 +1560,6 @@ /* It was successful */ Result = TRUE; - } - else if ((CommandData->VDMState == VDM_INC_REENTER_COUNT) - || (CommandData->VDMState == VDM_DEC_REENTER_COUNT)) - { - /* Setup the input parameters */ - SetReenterCount->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; - SetReenterCount->fIncDec = CommandData->VDMState; - - /* Call CSRSS */ - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(BASESRV_SERVERDLL_INDEX, BasepSetReenterCount), - sizeof(BASE_SET_REENTER_COUNT)); - BaseSetLastNTError(Status); - Result = NT_SUCCESS(Status); - } - else - { - BaseSetLastNTError(STATUS_INVALID_PARAMETER); - Result = FALSE; } } else 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] Thu Apr 23 02:30:53 2015 @@ -1039,7 +1039,8 @@ CHAR PifFile[MAX_PATH]; CHAR Desktop[MAX_PATH]; CHAR Title[MAX_PATH]; - CHAR Env[MAX_PATH]; + ULONG EnvSize = 256; + PVOID Env = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, EnvSize); STARTUPINFOA StartupInfo; PROCESS_INFORMATION ProcessInfo; @@ -1098,16 +1099,24 @@ CommandInfo.Env = Env; CommandInfo.EnvLen = sizeof(Env); +Command: /* Get the VDM command information */ if (!GetNextVDMCommand(&CommandInfo)) { + if (CommandInfo.EnvLen > EnvSize) + { + /* Expand the environment size */ + EnvSize = CommandInfo.EnvLen; + CommandInfo.Env = Env = RtlReAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, Env, EnvSize); + + /* Repeat the request */ + CommandInfo.VDMState |= VDM_FLAG_RETRY; + goto Command; + } + /* Shouldn't happen */ ASSERT(FALSE); } - - /* Increment the re-entry count */ - CommandInfo.VDMState = VDM_INC_REENTER_COUNT; - GetNextVDMCommand(&CommandInfo); /* Load the executable */ Result = DosLoadExecutable(LoadType, @@ -1116,11 +1125,15 @@ Env, &Parameters->StackLocation, &Parameters->EntryPoint); - if (Result != ERROR_SUCCESS) + if (Result == ERROR_SUCCESS) + { + /* Increment the re-entry count */ + CommandInfo.VDMState = VDM_INC_REENTER_COUNT; + GetNextVDMCommand(&CommandInfo); + } + else { DisplayMessage(L"Could not load '%S'. Error: %u", AppName, Result); - // FIXME: Decrement the reenter count. Or, instead, just increment - // the VDM reenter count *only* if this call succeeds... } break; @@ -1133,6 +1146,8 @@ WaitForSingleObject(ProcessInfo.hProcess, INFINITE); } } + + RtlFreeHeap(RtlGetProcessHeap(), 0, Env); /* Close the handles */ CloseHandle(ProcessInfo.hProcess);
9 years, 8 months
1
0
0
0
[aandrejevic] 67362: [NTVDM] Implement INT 21h, AH = 34h (Get Address of InDOS Flag).
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Thu Apr 23 01:17:11 2015 New Revision: 67362 URL:
http://svn.reactos.org/svn/reactos?rev=67362&view=rev
Log: [NTVDM] Implement INT 21h, AH = 34h (Get Address of InDOS Flag). Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c 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] Thu Apr 23 01:17:11 2015 @@ -31,6 +31,8 @@ /* PRIVATE VARIABLES **********************************************************/ +#define INDOS_POINTER MAKELONG(0x00FE, 0x0070) + CALLBACK16 DosContext; static DWORD DiskTransferArea; @@ -39,6 +41,7 @@ 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 ***********************************************************/ @@ -1369,6 +1372,8 @@ PDOS_COUNTRY_CODE_BUFFER CountryCodeBuffer; INT Return; + (*InDos)++; + /* Check the value in the AH register */ switch (getAH()) { @@ -1546,7 +1551,12 @@ DosPrintCharacter(DOS_OUTPUT_HANDLE, '^'); DosPrintCharacter(DOS_OUTPUT_HANDLE, 'C'); - if (DosControlBreak()) return; + if (DosControlBreak()) + { + /* Set the character to a newline to exit the loop */ + Character = '\r'; + } + break; } @@ -1873,6 +1883,15 @@ break; } + /* Get Address of InDOS flag */ + case 0x34: + { + setES(HIWORD(INDOS_POINTER)); + setBX(LOWORD(INDOS_POINTER)); + + break; + } + /* Get Interrupt Vector */ case 0x35: { @@ -2895,6 +2914,8 @@ Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; } } + + (*InDos)--; } VOID WINAPI DosBreakInterrupt(LPWORD Stack) @@ -2985,6 +3006,10 @@ FILE *Stream; WCHAR Buffer[256]; + /* Setup the InDOS flag */ + InDos = (PBYTE)FAR_POINTER(INDOS_POINTER); + *InDos = 0; + /* Clear the current directory buffer */ RtlZeroMemory(CurrentDirectories, sizeof(CurrentDirectories));
9 years, 8 months
1
0
0
0
[hbelusca] 67361: [NTVDM] - Report A20 line status in the PS/2 controller output port. - Properly implement XMS functions 3 and 5 (Global Enable/Disable A20 line), 4 and 6 (Local Enable/Disable A20...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Thu Apr 23 01:02:36 2015 New Revision: 67361 URL:
http://svn.reactos.org/svn/reactos?rev=67361&view=rev
Log: [NTVDM] - Report A20 line status in the PS/2 controller output port. - Properly implement XMS functions 3 and 5 (Global Enable/Disable A20 line), 4 and 6 (Local Enable/Disable A20 line) and 7 (Get A20 line status) using flag+counter and PS/2 I/O calls. - Fix XMS driver version report. Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/himem.c trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/himem.h trunk/reactos/subsystems/mvdm/ntvdm/emulator.c trunk/reactos/subsystems/mvdm/ntvdm/emulator.h trunk/reactos/subsystems/mvdm/ntvdm/hardware/ps2.c Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/himem.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/himem.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/himem.c [iso-8859-1] Thu Apr 23 01:02:36 2015 @@ -13,6 +13,8 @@ #include "ntvdm.h" #include "emulator.h" #include "cpu/bop.h" +#include "io.h" +#include "hardware/ps2.h" #include "dos.h" #include "dos/dem.h" @@ -44,6 +46,125 @@ static RTL_BITMAP AllocBitmap; static ULONG BitmapBuffer[(XMS_BLOCKS + 31) / 32]; +/* + * Flag used by Global Enable/Disable A20 functions, so that they don't + * need to re-change the state of A20 if it was already enabled/disabled. + */ +static BOOLEAN IsA20Enabled = FALSE; +/* + * This flag is set to TRUE or FALSE when A20 line was already disabled or + * enabled when XMS driver was loaded. + * In case A20 was disabled, we are allowed to modify it. In case A20 was + * already enabled, we are not allowed to touch it. + */ +static BOOLEAN CanChangeA20 = TRUE; +/* + * Count for enabling or disabling the A20 line. The A20 line is enabled + * only if the enabling count is greater than or equal to 0. + */ +static LONG A20EnableCount = 0; + +/* HELPERS FOR A20 LINE *******************************************************/ + +static BOOLEAN PCAT_A20Control(BYTE Control, PBOOLEAN A20Status) +{ + BYTE ControllerOutput; + + /* Retrieve PS/2 controller output byte */ + IOWriteB(PS2_CONTROL_PORT, 0xD0); + ControllerOutput = IOReadB(PS2_DATA_PORT); + + switch (Control) + { + case 0: /* Disable A20 line */ + ControllerOutput &= ~0x02; + IOWriteB(PS2_CONTROL_PORT, 0xD1); + IOWriteB(PS2_DATA_PORT, ControllerOutput); + break; + + case 1: /* Enable A20 line */ + ControllerOutput |= 0x02; + IOWriteB(PS2_CONTROL_PORT, 0xD1); + IOWriteB(PS2_DATA_PORT, ControllerOutput); + break; + + default: /* Get A20 status */ + break; + } + + if (A20Status) + *A20Status = (ControllerOutput & 0x02) != 0; + + /* Return success */ + return TRUE; +} + +static VOID XmsLocalEnableA20(VOID) +{ + /* Enable A20 only if we can do so, otherwise make the caller believe we enabled it */ + if (!CanChangeA20) goto Quit; + + /* The count is zero so enable A20 */ + if (A20EnableCount == 0 && !PCAT_A20Control(1, NULL)) + goto Fail; + + ++A20EnableCount; + +Quit: + setAX(0x0001); /* Line successfully enabled */ + setBL(XMS_STATUS_SUCCESS); + return; + +Fail: + setAX(0x0000); /* Line failed to be enabled */ + setBL(XMS_STATUS_A20_ERROR); + return; +} + +static VOID XmsLocalDisableA20(VOID) +{ + /* Disable A20 only if we can do so, otherwise make the caller believe we disabled it */ + if (!CanChangeA20) goto Quit; + + /* If the count is already zero, fail */ + if (A20EnableCount == 0) goto Fail; + + --A20EnableCount; + + /* The count is zero so disable A20 */ + if (A20EnableCount == 0 && !PCAT_A20Control(0, NULL)) + goto Fail; + +Quit: + setAX(0x0001); /* Line successfully disabled */ + setBL(XMS_STATUS_SUCCESS); + return; + +Fail: + setAX(0x0000); /* Line failed to be enabled */ + setBL(XMS_STATUS_A20_ERROR); + return; +} + +static VOID XmsGetA20State(VOID) +{ + BOOLEAN A20Status = FALSE; + + /* + * NOTE: The XMS specification explicitely says that this check is done + * in a hardware-independent manner, by checking whether high memory wraps. + * For our purposes we just call the emulator API. + */ + + /* Get A20 status */ + if (PCAT_A20Control(2, &A20Status)) + setBL(XMS_STATUS_SUCCESS); + else + setBL(XMS_STATUS_A20_ERROR); + + setAX(A20Status); +} + /* PRIVATE FUNCTIONS **********************************************************/ static inline PXMS_HANDLE GetHandleRecord(WORD Handle) @@ -158,23 +279,75 @@ /* Get XMS Version */ case 0x00: { - setAX(0x0300); /* XMS version 3.0 */ + setAX(0x0300); /* XMS version 3.00 */ + setBX(0x0301); /* Driver version 3.01 */ setDX(0x0001); /* HMA present */ - break; } /* Global Enable A20 */ case 0x03: { - EmulatorSetA20(TRUE); + /* Enable A20 if needed */ + if (!IsA20Enabled) + { + XmsLocalEnableA20(); + if (getAX() != 1) + { + /* XmsLocalEnableA20 failed and already set AX and BL to their correct values */ + break; + } + + IsA20Enabled = TRUE; + } + + setAX(0x0001); /* Line successfully enabled */ + setBL(XMS_STATUS_SUCCESS); break; } /* Global Disable A20 */ case 0x04: { - EmulatorSetA20(FALSE); + /* Disable A20 if needed */ + if (IsA20Enabled) + { + XmsLocalDisableA20(); + if (getAX() != 1) + { + /* XmsLocalDisableA20 failed and already set AX and BL to their correct values */ + break; + } + + IsA20Enabled = FALSE; + } + + setAX(0x0001); /* Line successfully disabled */ + setBL(XMS_STATUS_SUCCESS); + break; + } + + /* Local Enable A20 */ + case 0x05: + { + /* This call sets AX and BL to their correct values */ + XmsLocalEnableA20(); + break; + } + + /* Local Disable A20 */ + case 0x06: + { + /* This call sets AX and BL to their correct values */ + XmsLocalDisableA20(); + break; + } + + /* Query A20 State */ + case 0x07: + { + /* This call sets AX and BL to their correct values */ + XmsGetA20State(); break; } @@ -184,7 +357,6 @@ setAX(FreeBlocks); setDX(XMS_BLOCKS); setBL(XMS_STATUS_SUCCESS); - break; } Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/himem.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/himem.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/himem.h [iso-8859-1] Thu Apr 23 01:02:36 2015 @@ -15,6 +15,7 @@ #define XMS_STATUS_SUCCESS 0x00 #define XMS_STATUS_NOT_IMPLEMENTED 0x80 +#define XMS_STATUS_A20_ERROR 0x82 #define XMS_STATUS_HMA_IN_USE 0x91 #define XMS_STATUS_OUT_OF_MEMORY 0xA0 #define XMS_STATUS_OUT_OF_HANDLES 0xA1 Modified: trunk/reactos/subsystems/mvdm/ntvdm/emulator.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/emul…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/emulator.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/emulator.c [iso-8859-1] Thu Apr 23 01:02:36 2015 @@ -162,6 +162,11 @@ A20Line = Enabled; } +BOOLEAN EmulatorGetA20(VOID) +{ + return A20Line; +} + static VOID WINAPI EmulatorDebugBreakBop(LPWORD Stack) { DPRINT1("NTVDM: BOP_DEBUGGER\n"); Modified: trunk/reactos/subsystems/mvdm/ntvdm/emulator.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/emul…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/emulator.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/emulator.h [iso-8859-1] Thu Apr 23 01:02:36 2015 @@ -134,6 +134,7 @@ VOID EmulatorInterruptSignal(VOID); VOID EmulatorSetA20(BOOLEAN Enabled); +BOOLEAN EmulatorGetA20(VOID); BOOLEAN EmulatorInitialize(HANDLE ConsoleInput, HANDLE ConsoleOutput); VOID EmulatorCleanup(VOID); Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/ps2.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hard…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/hardware/ps2.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/ps2.c [iso-8859-1] Thu Apr 23 01:02:36 2015 @@ -181,7 +181,11 @@ /* Read controller output port */ case 0xD0: { - // TODO: Not implemented + /* Bit 0 always set, and bit 1 is the A20 gate state */ + OutputBuffer = (!!EmulatorGetA20() << 1) | 0x01; + // FIXME: Set the status of IRQ1 and IRQ12 + + StatusRegister |= (1 << 0); // There is something to read break; } @@ -231,6 +235,8 @@ /* Update the A20 line setting */ EmulatorSetA20(Data & (1 << 1)); + // FIXME: Add the status of IRQ1 and IRQ12 + break; }
9 years, 8 months
1
0
0
0
[dreimer] 67360: [INF] Add the recently added two font substitutes in livecd.inf either.
by dreimer@svn.reactos.org
Author: dreimer Date: Wed Apr 22 22:52:32 2015 New Revision: 67360 URL:
http://svn.reactos.org/svn/reactos?rev=67360&view=rev
Log: [INF] Add the recently added two font substitutes in livecd.inf either. Modified: trunk/reactos/boot/bootdata/livecd.inf Modified: trunk/reactos/boot/bootdata/livecd.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/livecd.inf?r…
============================================================================== --- trunk/reactos/boot/bootdata/livecd.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/livecd.inf [iso-8859-1] Wed Apr 22 22:52:32 2015 @@ -52,7 +52,9 @@ HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes","MS Shell Dlg 2",0x00000000,"Tahoma" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes","Tahoma",0x00000000,"Tahoma" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes","Terminal",0x00000000,"DejaVu Sans Mono" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes","Times",0x00000000,"Liberation Serif" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes","Times New Roman",0x00000000,"Liberation Serif" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes","Tms Rmn",0x00000000,"Liberation Serif" ; FIXME: Registration
9 years, 8 months
1
0
0
0
[akhaldi] 67359: [SHELL32] Set default values for fields when volume information is not available. Fix drawing of free/used space pie chart when free space is 0 bytes. Disable editing of volume lab...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Apr 22 22:24:46 2015 New Revision: 67359 URL:
http://svn.reactos.org/svn/reactos?rev=67359&view=rev
Log: [SHELL32] Set default values for fields when volume information is not available. Fix drawing of free/used space pie chart when free space is 0 bytes. Disable editing of volume label for non-fixed disks. Brought to you by Barrett Karish. CORE-9595 Modified: trunk/reactos/dll/win32/shell32/dialogs/drvdefext.cpp trunk/reactos/dll/win32/shell32/lang/bg-BG.rc trunk/reactos/dll/win32/shell32/lang/ca-ES.rc trunk/reactos/dll/win32/shell32/lang/cs-CZ.rc trunk/reactos/dll/win32/shell32/lang/da-DK.rc trunk/reactos/dll/win32/shell32/lang/de-DE.rc trunk/reactos/dll/win32/shell32/lang/el-GR.rc trunk/reactos/dll/win32/shell32/lang/en-GB.rc trunk/reactos/dll/win32/shell32/lang/en-US.rc trunk/reactos/dll/win32/shell32/lang/es-ES.rc trunk/reactos/dll/win32/shell32/lang/fi-FI.rc trunk/reactos/dll/win32/shell32/lang/fr-FR.rc trunk/reactos/dll/win32/shell32/lang/he-IL.rc trunk/reactos/dll/win32/shell32/lang/hu-HU.rc trunk/reactos/dll/win32/shell32/lang/it-IT.rc trunk/reactos/dll/win32/shell32/lang/ja-JP.rc trunk/reactos/dll/win32/shell32/lang/ko-KR.rc trunk/reactos/dll/win32/shell32/lang/nl-NL.rc trunk/reactos/dll/win32/shell32/lang/no-NO.rc trunk/reactos/dll/win32/shell32/lang/pl-PL.rc trunk/reactos/dll/win32/shell32/lang/pt-BR.rc trunk/reactos/dll/win32/shell32/lang/pt-PT.rc trunk/reactos/dll/win32/shell32/lang/ro-RO.rc trunk/reactos/dll/win32/shell32/lang/ru-RU.rc trunk/reactos/dll/win32/shell32/lang/sk-SK.rc trunk/reactos/dll/win32/shell32/lang/sl-SI.rc trunk/reactos/dll/win32/shell32/lang/sq-AL.rc trunk/reactos/dll/win32/shell32/lang/sv-SE.rc trunk/reactos/dll/win32/shell32/lang/tr-TR.rc trunk/reactos/dll/win32/shell32/lang/uk-UA.rc trunk/reactos/dll/win32/shell32/lang/zh-CN.rc trunk/reactos/dll/win32/shell32/lang/zh-TW.rc trunk/reactos/dll/win32/shell32/shresdef.h Modified: trunk/reactos/dll/win32/shell32/dialogs/drvdefext.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/dialogs/…
============================================================================== --- trunk/reactos/dll/win32/shell32/dialogs/drvdefext.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/dialogs/drvdefext.cpp [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -223,20 +223,39 @@ HBRUSH hbrOld = (HBRUSH)SelectObject(pDrawItem->hDC, hMagBrush); INT xRadial = xCenter + (INT)(cos(M_PI+m_FreeSpacePerc/100.0f*M_PI*2.0f)*cx/2); INT yRadial = yCenter - (INT)(sin(M_PI+m_FreeSpacePerc/100.0f*M_PI*2.0f)*cy/2); - Pie(pDrawItem->hDC, - pDrawItem->rcItem.left, pDrawItem->rcItem.top, - pDrawItem->rcItem.right, pDrawItem->rcItem.bottom - 10, - pDrawItem->rcItem.left, yCenter, - xRadial, yRadial); - - SelectObject(pDrawItem->hDC, hBlueBrush); - Pie(pDrawItem->hDC, - pDrawItem->rcItem.left, pDrawItem->rcItem.top, - pDrawItem->rcItem.right, pDrawItem->rcItem.bottom - 10, - xRadial, yRadial, - pDrawItem->rcItem.left, yCenter); - SelectObject(pDrawItem->hDC, hbrOld); - + if (m_FreeSpacePerc > 0) + { + Pie(pDrawItem->hDC, + pDrawItem->rcItem.left, + pDrawItem->rcItem.top, + pDrawItem->rcItem.right, + pDrawItem->rcItem.bottom - 10, + pDrawItem->rcItem.left, + yCenter, + xRadial, + yRadial); + + SelectObject(pDrawItem->hDC, hBlueBrush); + Pie(pDrawItem->hDC, + pDrawItem->rcItem.left, + pDrawItem->rcItem.top, + pDrawItem->rcItem.right, + pDrawItem->rcItem.bottom - 10, + xRadial, + yRadial, + pDrawItem->rcItem.left, + yCenter); + SelectObject(pDrawItem->hDC, hbrOld); + } + else + { + SelectObject(pDrawItem->hDC, hBlueBrush); + Ellipse(pDrawItem->hDC, + pDrawItem->rcItem.left, + pDrawItem->rcItem.top, + pDrawItem->rcItem.right, + pDrawItem->rcItem.bottom - 10); + } HPEN hOldPen = (HPEN)SelectObject(pDrawItem->hDC, hDarkMagPen); for (INT x = pDrawItem->rcItem.left; x < pDrawItem->rcItem.right; ++x) { @@ -272,6 +291,11 @@ SetDlgItemTextW(hwndDlg, 14000, wszVolumeName); SetDlgItemTextW(hwndDlg, 14002, wszFileSystem); } + else + { + LoadStringW(shell32_hInstance, IDS_FS_UNKNOWN, wszFileSystem, _countof(wszFileSystem)); + SetDlgItemTextW(hwndDlg, 14002, wszFileSystem); + } /* Set drive type and icon */ UINT DriveType = GetDriveTypeW(m_wszDrive); @@ -283,6 +307,10 @@ case DRIVE_RAMDISK: IconId = IDI_SHELL_RAMDISK; break; default: IconId = IDI_SHELL_DRIVE; TypeStrId = IDS_DRIVE_FIXED; } + + if (DriveType != DRIVE_FIXED) + EnableWindow(GetDlgItem(hwndDlg, 14000), false); + HICON hIcon = (HICON)LoadImage(shell32_hInstance, MAKEINTRESOURCE(IconId), IMAGE_ICON, 32, 32, LR_SHARED); if (hIcon) SendDlgItemMessageW(hwndDlg, 14016, STM_SETICON, (WPARAM)hIcon, 0); @@ -315,6 +343,23 @@ if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, wszBuf, _countof(wszBuf))) SetDlgItemTextW(hwndDlg, 14008, wszBuf); + } + else + { + m_FreeSpacePerc = 0; + + if (SH_FormatByteSize(0, wszBuf, _countof(wszBuf))) + { + SetDlgItemTextW(hwndDlg, 14003, wszBuf); + SetDlgItemTextW(hwndDlg, 14005, wszBuf); + SetDlgItemTextW(hwndDlg, 14007, wszBuf); + } + if (StrFormatByteSizeW(0, wszBuf, _countof(wszBuf))) + { + SetDlgItemTextW(hwndDlg, 14004, wszBuf); + SetDlgItemTextW(hwndDlg, 14006, wszBuf); + SetDlgItemTextW(hwndDlg, 14008, wszBuf); + } } /* Set drive description */ Modified: trunk/reactos/dll/win32/shell32/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/bg-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/bg-BG.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "ÐеÑÑен диÑк" IDS_DRIVE_CDROM "ÐÐ ÑеÑеÑ" IDS_DRIVE_NETWORK "ÐÑежов диÑк" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "ÐÑваÑÑне Ñ" Modified: trunk/reactos/dll/win32/shell32/lang/ca-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ca-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/ca-ES.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/ca-ES.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "Local Disk" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Network Disk" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Open With" Modified: trunk/reactos/dll/win32/shell32/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/cs-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/cs-CZ.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/cs-CZ.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -759,6 +759,7 @@ IDS_DRIVE_FIXED "MÃstnà disk" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "SÃÅ¥ový Disk" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "OtevÅÃt v" Modified: trunk/reactos/dll/win32/shell32/lang/da-DK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/da-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/da-DK.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/da-DK.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -759,6 +759,7 @@ IDS_DRIVE_FIXED "Local Disk" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Network Disk" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Open With" Modified: trunk/reactos/dll/win32/shell32/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/de-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/de-DE.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -754,6 +754,7 @@ IDS_DRIVE_FIXED "Lokaler Datenträger" IDS_DRIVE_CDROM "CD-Laufwerk" IDS_DRIVE_NETWORK "Netzlaufwerk" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Ãffnen mit..." Modified: trunk/reactos/dll/win32/shell32/lang/el-GR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/el-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/el-GR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/el-GR.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "ΤοÏικÏÏ Î´Î¯ÏκοÏ" IDS_DRIVE_CDROM "Îονάδα CD" IDS_DRIVE_NETWORK "ÎίÏÎºÎ¿Ï Î´Î¹ÎºÏÏÎ¿Ï " + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Îνοιγμαμε" Modified: trunk/reactos/dll/win32/shell32/lang/en-GB.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/en-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/en-GB.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/en-GB.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "Local Disk" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Network Disk" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Open With" Modified: trunk/reactos/dll/win32/shell32/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/en-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/en-US.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "Local Disk" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Network Disk" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Open With" Modified: trunk/reactos/dll/win32/shell32/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/es-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/es-ES.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -754,6 +754,7 @@ IDS_DRIVE_FIXED "Disco local" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Unidad de red" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Abrir con" Modified: trunk/reactos/dll/win32/shell32/lang/fi-FI.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/fi-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/fi-FI.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/fi-FI.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "Local Disk" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Network Disk" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Open With" Modified: trunk/reactos/dll/win32/shell32/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/fr-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/fr-FR.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "Disque local" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Disque réseau" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Ouvrir avec" Modified: trunk/reactos/dll/win32/shell32/lang/he-IL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/he-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/he-IL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/he-IL.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "××× × ×ק×××" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "××× × ×¨×©×ª" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "פת××× ×××צע×ת" Modified: trunk/reactos/dll/win32/shell32/lang/hu-HU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/hu-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/hu-HU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/hu-HU.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "Local Disk" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Network Disk" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Open With" Modified: trunk/reactos/dll/win32/shell32/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/it-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/it-IT.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "Disco locale" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Disco di Rete" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Apri con" Modified: trunk/reactos/dll/win32/shell32/lang/ja-JP.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ja-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/ja-JP.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/ja-JP.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "ãã¼ã«ã« ãã£ã¹ã¯" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "ãããã¯ã¼ã¯ ãã£ã¹ã¯" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "ããã°ã©ã ããéã" Modified: trunk/reactos/dll/win32/shell32/lang/ko-KR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ko-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/ko-KR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/ko-KR.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "Local Disk" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Network Disk" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Open With" Modified: trunk/reactos/dll/win32/shell32/lang/nl-NL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/nl-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/nl-NL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/nl-NL.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "Local Disk" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Network Disk" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Open With" Modified: trunk/reactos/dll/win32/shell32/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/no-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/no-NO.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/no-NO.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "Lokal Disk" IDS_DRIVE_CDROM "CD stasjon" IDS_DRIVE_NETWORK "Nettverk disk" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Ã pne med" Modified: trunk/reactos/dll/win32/shell32/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/pl-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/pl-PL.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "Dysk lokalny" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Dysk sieciowy" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Otwórz za pomocÄ " Modified: trunk/reactos/dll/win32/shell32/lang/pt-BR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/pt-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/pt-BR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/pt-BR.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "Disco Local" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Disco de Rede" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Abrir Com" Modified: trunk/reactos/dll/win32/shell32/lang/pt-PT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/pt-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/pt-PT.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/pt-PT.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "Disco Local" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Disco de Rede" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Abre com..." Modified: trunk/reactos/dll/win32/shell32/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ro-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/ro-RO.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/ro-RO.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -755,6 +755,7 @@ IDS_DRIVE_FIXED "Disc local" IDS_DRIVE_CDROM "CD-ROM" IDS_DRIVE_NETWORK "Disc din reÈea" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Deschide cu" Modified: trunk/reactos/dll/win32/shell32/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/ru-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/ru-RU.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -755,6 +755,7 @@ IDS_DRIVE_FIXED "ÐокалÑнÑй диÑк" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "СеÑевой диÑк" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "ÐÑкÑÑÑÑ Ñ Ð¿Ð¾Ð¼Ð¾ÑÑÑ" Modified: trunk/reactos/dll/win32/shell32/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/sk-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/sk-SK.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/sk-SK.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "Lokálny disk" IDS_DRIVE_CDROM "Jednotka CD" IDS_DRIVE_NETWORK "Sieťový disk" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Otvoriť v progra&me" Modified: trunk/reactos/dll/win32/shell32/lang/sl-SI.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/sl-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/sl-SI.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/sl-SI.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "Local Disk" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Network Disk" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Open With" Modified: trunk/reactos/dll/win32/shell32/lang/sq-AL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/sq-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/sq-AL.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/sq-AL.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -757,6 +757,7 @@ IDS_DRIVE_FIXED "Disku Vendorë" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Disku Rrjetit" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Hap me" Modified: trunk/reactos/dll/win32/shell32/lang/sv-SE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/sv-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/sv-SE.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/sv-SE.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "Local Disk" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Network Disk" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Open With" Modified: trunk/reactos/dll/win32/shell32/lang/tr-TR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/tr-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/tr-TR.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/tr-TR.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "Yerel Disk" IDS_DRIVE_CDROM "Optik Sürücü" IDS_DRIVE_NETWORK "AÄ Sürücüsü" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Birlikte Aç" Modified: trunk/reactos/dll/win32/shell32/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/uk-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/uk-UA.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -753,6 +753,7 @@ IDS_DRIVE_FIXED "ÐокалÑний диÑк" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "ÐеÑежний диÑк" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "ÐÑдкÑиÑи за допомогоÑ" Modified: trunk/reactos/dll/win32/shell32/lang/zh-CN.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/zh-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/zh-CN.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/zh-CN.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -762,6 +762,7 @@ IDS_DRIVE_FIXED "Local Disk" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Network Disk" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "æå¼æ¹å¼" Modified: trunk/reactos/dll/win32/shell32/lang/zh-TW.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/lang/zh-…
============================================================================== --- trunk/reactos/dll/win32/shell32/lang/zh-TW.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/lang/zh-TW.rc [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -761,6 +761,7 @@ IDS_DRIVE_FIXED "Local Disk" IDS_DRIVE_CDROM "CDROM" IDS_DRIVE_NETWORK "Network Disk" + IDS_FS_UNKNOWN "Unknown" /* Open With */ IDS_OPEN_WITH "Open With" Modified: trunk/reactos/dll/win32/shell32/shresdef.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shresdef…
============================================================================== --- trunk/reactos/dll/win32/shell32/shresdef.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shresdef.h [iso-8859-1] Wed Apr 22 22:24:46 2015 @@ -107,6 +107,7 @@ #define IDS_DRIVE_FIXED 72 #define IDS_DRIVE_CDROM 73 #define IDS_DRIVE_NETWORK 74 +#define IDS_FS_UNKNOWN 75 #define IDS_LOGOFF_TITLE 78 #define IDS_LOGOFF_PROMPT 79
9 years, 8 months
1
0
0
0
[akhaldi] 67358: [SHELL32] Fix improperly formatted or missing disk letter in disk Properties. By Barrett Karish. CORE-9532
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Apr 22 22:16:58 2015 New Revision: 67358 URL:
http://svn.reactos.org/svn/reactos?rev=67358&view=rev
Log: [SHELL32] Fix improperly formatted or missing disk letter in disk Properties. By Barrett Karish. CORE-9532 Modified: trunk/reactos/dll/win32/shell32/dialogs/drive.cpp Modified: trunk/reactos/dll/win32/shell32/dialogs/drive.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/dialogs/…
============================================================================== --- trunk/reactos/dll/win32/shell32/dialogs/drive.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/dialogs/drive.cpp [iso-8859-1] Wed Apr 22 22:16:58 2015 @@ -137,12 +137,27 @@ { psh.pszCaption = wszName; psh.dwFlags |= PSH_PROPTITLE; + pwszDrive[2] = 0; if (wszName[0] == UNICODE_NULL) { - /* FIXME: check if disk is a really a local hdd */ - UINT i = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, wszName, sizeof(wszName) / sizeof(WCHAR) - 6); - StringCchPrintf(wszName + i, sizeof(wszName) / sizeof(WCHAR) - i, L" (%s)", pwszDrive); - } + UINT len; + switch (GetDriveTypeW(pwszDrive)) + { + case DRIVE_CDROM: + len = LoadStringW(shell32_hInstance, IDS_DRIVE_CDROM, wszName, _countof(wszName)); + break; + case DRIVE_REMOTE: + len = LoadStringW(shell32_hInstance, IDS_DRIVE_NETWORK, wszName, _countof(wszName)); + break; + case DRIVE_FIXED: + default: + len = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, wszName, _countof(wszName)); + break; + } + StringCchPrintf(wszName + len, _countof(wszName) - len, L" (%s)", pwszDrive); + } + else + StringCchPrintf(wszName + wcslen(wszName), _countof(wszName) - wcslen(wszName), L" (%s)", pwszDrive); } CComPtr<IDataObject> pDataObj;
9 years, 8 months
1
0
0
0
[akhaldi] 67357: [GDI32] Add missing newline in a debug print.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Apr 22 22:02:45 2015 New Revision: 67357 URL:
http://svn.reactos.org/svn/reactos?rev=67357&view=rev
Log: [GDI32] Add missing newline in a debug print. Modified: trunk/reactos/win32ss/gdi/gdi32/objects/font.c Modified: trunk/reactos/win32ss/gdi/gdi32/objects/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/font.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/font.c [iso-8859-1] Wed Apr 22 22:02:45 2015 @@ -2211,7 +2211,7 @@ if (!SearchPathW(lpszBuffer, lpszFilename, NULL, MAX_PATH, lpszAbsPath, NULL)) { - DPRINT1("Font not found. The Buffer is: %ls, the FileName is: %S", lpszBuffer, lpszFilename); + DPRINT1("Font not found. The Buffer is: %ls, the FileName is: %S\n", lpszBuffer, lpszFilename); return 0; } }
9 years, 8 months
1
0
0
0
[dreimer] 67356: [NTVDM] Add missing \n at DBGPRINT
by dreimer@svn.reactos.org
Author: dreimer Date: Wed Apr 22 21:35:14 2015 New Revision: 67356 URL:
http://svn.reactos.org/svn/reactos?rev=67356&view=rev
Log: [NTVDM] Add missing \n at DBGPRINT Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dos.c 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] Wed Apr 22 21:35:14 2015 @@ -2556,7 +2556,7 @@ setES(0x0000); setBX(0x0000); - DPRINT1("INT 21h, AH=52h: This application requires the internal DOS List of lists (SYSVARS). UNIMPLEMENTED"); + DPRINT1("INT 21h, AH=52h: This application requires the internal DOS List of lists (SYSVARS). UNIMPLEMENTED\n"); break; }
9 years, 8 months
1
0
0
0
[pschweitzer] 67355: [KERNEL32] - Halfplement BasepGetComputerNameFromNtPath() which allows querying the computer name given a handle & an NT path - Implement BasepNotifyTrackingService() which iss...
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Wed Apr 22 21:20:35 2015 New Revision: 67355 URL:
http://svn.reactos.org/svn/reactos?rev=67355&view=rev
Log: [KERNEL32] - Halfplement BasepGetComputerNameFromNtPath() which allows querying the computer name given a handle & an NT path - Implement BasepNotifyTrackingService() which issues a FileTrackingInformation on file move Modified: trunk/reactos/dll/win32/kernel32/client/file/move.c Modified: trunk/reactos/dll/win32/kernel32/client/file/move.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/move.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/move.c [iso-8859-1] Wed Apr 22 21:20:35 2015 @@ -178,16 +178,312 @@ /* - * @unimplemented + * @implemented + */ +DWORD +WINAPI +BasepGetComputerNameFromNtPath(IN PUNICODE_STRING NewPath, + IN HANDLE NewHandle, + OUT PWSTR ComputerName, + IN OUT PULONG ComputerNameLength) +{ + BOOL Query = FALSE; + WCHAR Letter; + PWSTR AbsolutePath, EndOfName; + USHORT AbsolutePathLength, NameLength; + WCHAR TargetDevice[0x105]; + WCHAR DeviceName[] = {'A', ':', '\0'}; /* Init to something, will be set later */ + UNICODE_STRING UncString = RTL_CONSTANT_STRING(L"\\??\\UNC\\"); + UNICODE_STRING GlobalString = RTL_CONSTANT_STRING(L"\\??\\"); + + DPRINT("BasepGetComputerNameFromNtPath(%wZ, %p, %p, %lu)\n", NewPath, NewHandle, ComputerName, ComputerNameLength); + + /* If it's an UNC path */ + if (RtlPrefixUnicodeString(&UncString, NewPath, TRUE)) + { + /* Check for broken caller */ + if (NewPath->Length <= UncString.Length) + { + return ERROR_BAD_PATHNAME; + } + + /* Skip UNC prefix */ + AbsolutePath = &NewPath->Buffer[UncString.Length / sizeof(WCHAR)]; + AbsolutePathLength = NewPath->Length - UncString.Length; + + /* And query DFS */ + Query = TRUE; + } + /* Otherwise, we have to be in global (NT path!), with drive letter */ + else if (RtlPrefixUnicodeString(&GlobalString, NewPath, TRUE) && NewPath->Buffer[5] == ':') + { + /* Path is like that: \??\C:\Complete Path\To File.ext */ + /* Get the letter and upcase it if required */ + Letter = NewPath->Buffer[4]; + if (Letter >= 'a' && Letter <= 'z') + { + Letter -= ('a' - 'A'); + } + DeviceName[0] = Letter; + + /* Query the associated DOS device */ + if (!QueryDosDeviceW(DeviceName, TargetDevice, ARRAYSIZE(TargetDevice))) + { + return GetLastError(); + } + + /* If that's a network share */ + if (TargetDevice == wcsstr(TargetDevice, L"\\Device\\LanmanRedirector\\;")) + { + /* Path is like that: \Device\LanmanRedirector\;C:0000000000000000\Complete Path\To File.ext */ + /* Check we have the correct drive letter */ + if (TargetDevice[26] == DeviceName[0] && + TargetDevice[27] == ':') + { + /* Check for the path begin, computer name is before */ + PWSTR Path = wcschr(&TargetDevice[28], '\\'); + if (Path == NULL) + { + return ERROR_BAD_PATHNAME; + } + + AbsolutePath = Path + 1; + AbsolutePathLength = sizeof(WCHAR) * (ARRAYSIZE(TargetDevice) - (AbsolutePath - TargetDevice)); + } + else + { + return ERROR_BAD_PATHNAME; + } + } + /* If it's a local device */ + else if (TargetDevice == wcsstr(TargetDevice, L"\\Device\\Harddisk") + || TargetDevice == wcsstr(TargetDevice, L"\\Device\\CdRom") + || TargetDevice == wcsstr(TargetDevice, L"\\Device\\Floppy")) + { + /* Just query the computer name */ + if (!GetComputerNameW(ComputerName, ComputerNameLength)) + { + return GetLastError(); + } + + return ERROR_SUCCESS; + } + /* If it's a DFS share */ + else if (TargetDevice == wcsstr(TargetDevice, L"\\Device\\WinDfs\\")) + { + /* Obviously, query DFS */ + Query = TRUE; + } + else + { + return ERROR_BAD_PATHNAME; + } + } + else + { + return ERROR_BAD_PATHNAME; + } + + /* Query DFS, currently not implemented - shouldn't be missing in ReactOS yet ;-) */ + if (Query) + { + UNIMPLEMENTED_DBGBREAK("Querying DFS not implemented!\n"); + AbsolutePath = NULL; + AbsolutePathLength = 0; + } + + /* Now, properly extract the computer name from the full path */ + EndOfName = AbsolutePath; + if (AbsolutePathLength) + { + for (NameLength = 0; NameLength < AbsolutePathLength; NameLength += sizeof(WCHAR)) + { + /* Look for the next \, it will be the end of computer name */ + if (EndOfName[0] == '\\') + { + break; + } + /* Computer name cannot contain ., if we get to that point, something went wrong... */ + else if (EndOfName[0] == '.') + { + return ERROR_BAD_PATHNAME; + } + + ++EndOfName; + } + } + + NameLength = EndOfName - AbsolutePath; + /* Check we didn't overflow and that our computer name isn't ill-formed */ + if (NameLength >= AbsolutePathLength || NameLength >= MAX_COMPUTERNAME_LENGTH * sizeof(WCHAR)) + { + return ERROR_BAD_PATHNAME; + } + + /* Check we can fit */ + if (NameLength + sizeof(UNICODE_NULL) > *ComputerNameLength * sizeof(WCHAR)) + { + return ERROR_BUFFER_OVERFLOW; + } + + /* Write, zero and done! */ + RtlCopyMemory(ComputerName, AbsolutePath, NameLength); + *ComputerNameLength = NameLength / sizeof(WCHAR); + ComputerName[NameLength / sizeof(WCHAR)] = UNICODE_NULL; + + return ERROR_SUCCESS; +} + + +/* + * @implemented */ NTSTATUS WINAPI -BasepNotifyTrackingService(IN PHANDLE ExistingHandle, +BasepNotifyTrackingService(IN OUT PHANDLE ExistingHandle, IN POBJECT_ATTRIBUTES ObjectAttributes, IN HANDLE NewHandle, IN PUNICODE_STRING NewPath) { - return STATUS_NOT_IMPLEMENTED; + NTSTATUS Status; + ULONG ComputerNameLength, FileAttributes; + WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1]; + OEM_STRING ComputerNameStringA; + CHAR ComputerNameStringBuffer[0x105]; + UNICODE_STRING ComputerNameStringW; + IO_STATUS_BLOCK IoStatusBlock; + FILE_BASIC_INFORMATION FileBasicInfo; + HANDLE hFullWrite; + struct + { + FILE_TRACKING_INFORMATION; + CHAR Buffer[(MAX_COMPUTERNAME_LENGTH + 1) * sizeof(WCHAR)]; + } FileTrackingInfo; + + DPRINT("BasepNotifyTrackingService(%p, %p, %p, %wZ)\n", *ExistingHandle, ObjectAttributes, NewHandle, NewPath); + + Status = STATUS_SUCCESS; + ComputerNameLength = ARRAYSIZE(ComputerName); + + /* Attempt to get computer name of target handle */ + if (BasepGetComputerNameFromNtPath(NewPath, NewHandle, ComputerName, &ComputerNameLength)) + { + /* If we failed to get it, we will just notify with the handle */ + FileTrackingInfo.ObjectInformationLength = 0; + } + else + { + /* Convert the retrieved computer name to ANSI and attach it to the notification */ + ComputerNameStringA.Length = 0; + ComputerNameStringA.MaximumLength = ARRAYSIZE(ComputerNameStringBuffer); + ComputerNameStringA.Buffer = ComputerNameStringBuffer; + + RtlInitUnicodeString(&ComputerNameStringW, ComputerName); + Status = RtlUnicodeStringToOemString(&ComputerNameStringA, &ComputerNameStringW, 0); + if (!NT_SUCCESS(Status)) + { + return Status; + } + + RtlCopyMemory(FileTrackingInfo.ObjectInformation, ComputerNameStringA.Buffer, ComputerNameStringA.Length); + FileTrackingInfo.ObjectInformation[ComputerNameStringA.Length] = 0; + FileTrackingInfo.ObjectInformationLength = ComputerNameStringA.Length + 1; + } + + /* Attach the handle we moved */ + FileTrackingInfo.DestinationFile = NewHandle; + + /* Final, notify */ + Status = NtSetInformationFile(*ExistingHandle, + &IoStatusBlock, + &FileTrackingInfo, + sizeof(FileTrackingInfo), + FileTrackingInformation); + if (Status != STATUS_ACCESS_DENIED) + { + return Status; + } + + /* If we get here, we got access denied error, this comes from a + * read-only flag. So, close the file, in order to reopen it with enough + * rights to remove said flag and reattempt notification + */ + CloseHandle(*ExistingHandle); + + /* Reopen it, to be able to change the destination file attributes */ + Status = NtOpenFile(ExistingHandle, + SYNCHRONIZE | FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES, + ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + FILE_SYNCHRONOUS_IO_NONALERT); + if (!NT_SUCCESS(Status)) + { + *ExistingHandle = INVALID_HANDLE_VALUE; + return Status; + } + + /* Get the file attributes */ + Status = NtQueryInformationFile(*ExistingHandle, + &IoStatusBlock, + &FileBasicInfo, + sizeof(FileBasicInfo), + FileBasicInformation); + if (!NT_SUCCESS(Status)) + { + return Status; + } + + /* Get rid of the read only flag */ + FileAttributes = FileBasicInfo.FileAttributes & ~FILE_ATTRIBUTE_READONLY; + RtlZeroMemory(&FileBasicInfo, sizeof(FileBasicInfo)); + FileBasicInfo.FileAttributes = FileAttributes; + + /* Attempt... */ + Status = NtSetInformationFile(*ExistingHandle, + &IoStatusBlock, + &FileBasicInfo, + sizeof(FileBasicInfo), + FileBasicInformation); + if (!NT_SUCCESS(Status)) + { + return Status; + } + + /* Now, reopen with maximum accesses to notify */ + Status = NtOpenFile(&hFullWrite, + GENERIC_WRITE | SYNCHRONIZE, + ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + FILE_SYNCHRONOUS_IO_NONALERT); + if (NT_SUCCESS(Status)) + { + NtClose(*ExistingHandle); + *ExistingHandle = hFullWrite; + + /* Full success, notify! */ + Status = NtSetInformationFile(*ExistingHandle, + &IoStatusBlock, + &FileTrackingInfo, + sizeof(FileTrackingInfo), + FileTrackingInformation); + } + + /* If opening with full access failed or if notify failed, restore read-only */ + if (!NT_SUCCESS(Status)) + { + FileBasicInfo.FileAttributes |= FILE_ATTRIBUTE_READONLY; + + Status = NtSetInformationFile(*ExistingHandle, + &IoStatusBlock, + &FileBasicInfo, + sizeof(FileBasicInfo), + FileBasicInformation); + } + + /* We're done */ + return Status; }
9 years, 8 months
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
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