reactos.git
6 years ago[NTOS:PS] Skip backtrace on non-x86
Ivan Labutin [Mon, 18 Dec 2017 07:27:31 +0000 (08:27 +0100)]
[NTOS:PS] Skip backtrace on non-x86

6 years ago[SAC] Fix wrong sized variable in SAC driver
Ivan Labutin [Mon, 13 Nov 2017 15:26:37 +0000 (18:26 +0300)]
[SAC] Fix wrong sized variable in SAC driver

6 years ago[NTOS:FSRTL] Fixed incorrect comparison
Ivan Labutin [Mon, 13 Nov 2017 14:08:27 +0000 (15:08 +0100)]
[NTOS:FSRTL] Fixed incorrect comparison

6 years ago[NTOS][NDK][RTL] A bunch of 'wrong size' fixes
Ivan Labutin [Mon, 13 Nov 2017 14:06:29 +0000 (15:06 +0100)]
[NTOS][NDK][RTL] A bunch of 'wrong size' fixes

6 years ago[NTOS:MM] Quick fix: use SIZE_T instead of ULONG, because ULONG is 32-bit and on...
Ivan Labutin [Fri, 10 Nov 2017 17:19:45 +0000 (20:19 +0300)]
[NTOS:MM] Quick fix: use SIZE_T instead of ULONG, because ULONG is 32-bit and on 64-bit truncates values

6 years ago[NTOS:KE] Improve readability of CPU flag checks and fix error checking wrong registe...
Ivan Labutin [Fri, 10 Nov 2017 16:44:30 +0000 (19:44 +0300)]
[NTOS:KE] Improve readability of CPU flag checks and fix error checking wrong register for HT support

6 years ago[NTOS:KE] Remove duplicate NX enabling
Ivan Labutin [Thu, 9 Nov 2017 22:33:47 +0000 (23:33 +0100)]
[NTOS:KE] Remove duplicate NX enabling

6 years ago[NTOS:MM] Comment out debug code for x86 that should not run on x64
Ivan Labutin [Thu, 9 Nov 2017 22:30:57 +0000 (01:30 +0300)]
[NTOS:MM] Comment out debug code for x86 that should not run on x64

6 years ago[NTOS:KE] Move RtlpUse16ByteSLists initialization into KiInitializeKernel
Ivan Labutin [Thu, 9 Nov 2017 22:23:55 +0000 (01:23 +0300)]
[NTOS:KE] Move RtlpUse16ByteSLists initialization into KiInitializeKernel

6 years ago[NTOS:KE] EFER constants fix
Ivan Labutin [Thu, 9 Nov 2017 22:06:30 +0000 (01:06 +0300)]
[NTOS:KE] EFER constants fix

6 years ago[NTOSKRNL] Fix return of uninitialized variable in PspSetQuotaLimits
Timo Kreuzer [Wed, 11 Oct 2017 13:33:15 +0000 (15:33 +0200)]
[NTOSKRNL] Fix return of uninitialized variable in PspSetQuotaLimits
CID-1322247

6 years ago[BROWSEUI] Implement ACLCustomMRU.
Mark Jansen [Sun, 17 Dec 2017 14:29:30 +0000 (15:29 +0100)]
[BROWSEUI] Implement ACLCustomMRU.
CORE-9281

6 years ago[BROWSEUI_APITEST] Add tests for IACLCustomMRU.
Mark Jansen [Sat, 16 Dec 2017 16:22:48 +0000 (17:22 +0100)]
[BROWSEUI_APITEST] Add tests for IACLCustomMRU.
CORE-9281

6 years ago[COM_APITEST] Add IACLCustomMRU
Mark Jansen [Sat, 16 Dec 2017 13:50:49 +0000 (14:50 +0100)]
[COM_APITEST] Add IACLCustomMRU

6 years ago[MSI_WINETEST] Add a PCH.
Amine Khaldi [Mon, 18 Dec 2017 12:48:13 +0000 (13:48 +0100)]
[MSI_WINETEST] Add a PCH.

6 years ago[MSHTML_WINETEST] Add a PCH.
Amine Khaldi [Mon, 18 Dec 2017 12:43:24 +0000 (13:43 +0100)]
[MSHTML_WINETEST] Add a PCH.

6 years ago[KERNEL32_WINETEST] Add a PCH.
Amine Khaldi [Mon, 18 Dec 2017 12:28:00 +0000 (13:28 +0100)]
[KERNEL32_WINETEST] Add a PCH.

6 years ago[APITESTS][WINETESTS] Addendum to the recent PCH work.
Amine Khaldi [Mon, 18 Dec 2017 12:21:47 +0000 (13:21 +0100)]
[APITESTS][WINETESTS] Addendum to the recent PCH work.

6 years ago[UUID] Add SID_SHTMLEditServices.
Amine Khaldi [Mon, 18 Dec 2017 12:18:07 +0000 (13:18 +0100)]
[UUID] Add SID_SHTMLEditServices.

6 years ago[FS] During 1st stage, disable any FS we don't support install to in order to let...
Pierre Schweitzer [Mon, 18 Dec 2017 07:44:24 +0000 (08:44 +0100)]
[FS] During 1st stage, disable any FS we don't support install to in order to let RawFS these volumes.
This avoids bloated setup and avoids potential bugs in 3rd party drivers.

This is following 806cd1.

6 years ago[NTOSKRNL] Make again an attempt at killing the IopParseDevice() hack.
Pierre Schweitzer [Sun, 17 Dec 2017 22:30:58 +0000 (23:30 +0100)]
[NTOSKRNL] Make again an attempt at killing the IopParseDevice() hack.

For the record, the only place it was remaining was 1st stage, notably because
FSD (FastAT <3) was missing a few features. As this features weren't triggered
in 3rd stage (unless forced), it was not needed there any longer.

Now that they are implemented, and seem working out of the box, this hack might
not be longer anymore.

This is my ... ?! pfff attempt at killing it. It might not be the last, so just
disabling the hack for now. If there are no regressions (who can really believe that?)
we'll be clear for dropping it once for all.

6 years ago[FASFAT] Enable FAT volume dismount using VPB swapout
Pierre Schweitzer [Sun, 17 Dec 2017 22:29:33 +0000 (23:29 +0100)]
[FASFAT] Enable FAT volume dismount using VPB swapout

6 years ago[USETUP] Our current FAT ChkDsk being a bit slow when using the right path make
Pierre Schweitzer [Sun, 17 Dec 2017 22:26:38 +0000 (23:26 +0100)]
[USETUP] Our current FAT ChkDsk being a bit slow when using the right path make
it only perform a full check if dirty bit is set (which should never happen *cough*).

This is needed because otherwise, ReactOS installation takes forever when IopParseDevice is gone
due to slow ChkDsk.

6 years ago[SETUP] Remove FSDs which have broken dismount implementation.
Pierre Schweitzer [Sun, 17 Dec 2017 22:13:56 +0000 (23:13 +0100)]
[SETUP] Remove FSDs which have broken dismount implementation.
This avoids issues when these partitions are formatted to FAT for setup.

For now, this commit doesn't change anything, but once IopParseDevice hack
gets removed, this will make a difference!

CORE-6305

6 years ago[HAL] Use 64 bits for physical addresses.
Timo Kreuzer [Sun, 17 Dec 2017 16:37:43 +0000 (17:37 +0100)]
[HAL] Use 64 bits for physical addresses.

6 years ago[FASTFAT] Add a comment (and an ASSERT) in VfatCreateFile() that shows that my stats...
Pierre Schweitzer [Sun, 17 Dec 2017 17:25:43 +0000 (18:25 +0100)]
[FASTFAT] Add a comment (and an ASSERT) in VfatCreateFile() that shows that my stats code is broken...

6 years ago[FASTFAT] While closing FCBs on dismount, release from tail to head and not the contrary.
Pierre Schweitzer [Sun, 17 Dec 2017 17:21:51 +0000 (18:21 +0100)]
[FASTFAT] While closing FCBs on dismount, release from tail to head and not the contrary.
It fixes assertion failure in vfatDestroyFCB() where we would have release parent before child.
This is still not perfect, but less bug prone...

With this commits (and ENABLE_SWAPOUT defined), ReactOS seems to unmount FAT volumes quite nice! :-)
(Tried with fsutil volume dismount X:)

6 years ago[FASTFAT] Fix a handle count leak on volume close. This can prevent locking a volume!
Pierre Schweitzer [Sun, 17 Dec 2017 17:20:04 +0000 (18:20 +0100)]
[FASTFAT] Fix a handle count leak on volume close. This can prevent locking a volume!

6 years ago[FASTFAT] When not able to lock a volume due to open handles, print open handles
Pierre Schweitzer [Sun, 17 Dec 2017 17:19:03 +0000 (18:19 +0100)]
[FASTFAT] When not able to lock a volume due to open handles, print open handles

6 years ago[RAPPS] Select 'Available' category by default.
Alexander Shaposhnikov [Sun, 17 Dec 2017 14:09:55 +0000 (16:09 +0200)]
[RAPPS] Select 'Available' category by default.

6 years ago[MSCONFIG_NEW] Temporarily "fix" the header of the SimpChinese resource file because...
Hermès Bélusca-Maïto [Sun, 17 Dec 2017 13:44:23 +0000 (14:44 +0100)]
[MSCONFIG_NEW] Temporarily "fix" the header of the SimpChinese resource file because this has nothing to do with Paint whatsoever. Proper headers will be used as soon as msconfig_new replaces the old one and such headers be used in all of its code.

6 years ago[TRANSLATION] Improve Simplified Chinese Translations.
Luo Yufan [Fri, 15 Dec 2017 11:11:24 +0000 (19:11 +0800)]
[TRANSLATION] Improve Simplified Chinese Translations.

* Fix Simplified Chinese Translation of EXPLORER.
* Fix Simplified Chinese Translation of MSCONFIG_NEW.
* Fix Simplified Chinese Translation of MSPAINT.
* Fix Simplified Chinese Translation of SHELL32.
* Fix Simplified Chinese Translation of SYSDM.
* Fix Simplified Chinese Translation of SETUP/REACTOS.

6 years ago[VFATLIB] Never touch the file system if not in interactive or RW mode.
Pierre Schweitzer [Sun, 17 Dec 2017 12:59:20 +0000 (13:59 +0100)]
[VFATLIB] Never touch the file system if not in interactive or RW mode.
It's critical not to perform any write on a volume without an exclusive lock on it.
That lock is only acquired if ChkDsk is started in RW mode.
Also added an assert in write routine, to make sure that when we're about to perform
a write operation, we're really allowed to do so.

This will avoid volume corruptions when a simple "chkdsk" is issued from cmd.
To put it simple: check will really check now, and won't attempt any repair.

CORE-14119

6 years ago[COMCTL32_WINETEST] Add a PCH.
Amine Khaldi [Sun, 17 Dec 2017 12:40:43 +0000 (13:40 +0100)]
[COMCTL32_WINETEST] Add a PCH.

6 years ago[SHELL32_APITEST] Improve the existing PCH and make use of it. Convert AddCommas...
Amine Khaldi [Sun, 17 Dec 2017 12:31:22 +0000 (13:31 +0100)]
[SHELL32_APITEST] Improve the existing PCH and make use of it. Convert AddCommas.c to c++ in order to have it benefit from the PCH.

6 years ago[GDI32_WINETEST] Add a PCH.
Amine Khaldi [Sun, 17 Dec 2017 12:20:00 +0000 (13:20 +0100)]
[GDI32_WINETEST] Add a PCH.

6 years ago[GDIPLUS_WINETEST] Add a PCH.
Amine Khaldi [Sun, 17 Dec 2017 12:14:57 +0000 (13:14 +0100)]
[GDIPLUS_WINETEST] Add a PCH.

6 years ago[CRYPT32_WINETEST] Add a PCH.
Amine Khaldi [Sun, 17 Dec 2017 11:33:39 +0000 (12:33 +0100)]
[CRYPT32_WINETEST] Add a PCH.

6 years ago[COMDLG32_WINETEST] Add a PCH.
Amine Khaldi [Sun, 17 Dec 2017 11:28:41 +0000 (12:28 +0100)]
[COMDLG32_WINETEST] Add a PCH.

6 years ago[ADVAPI32_WINETEST] Add a PCH.
Amine Khaldi [Sun, 17 Dec 2017 11:24:27 +0000 (12:24 +0100)]
[ADVAPI32_WINETEST] Add a PCH.

6 years ago[WIN32KNT_APITEST] Improve the existing PCH and make use of it.
Amine Khaldi [Sun, 17 Dec 2017 11:17:19 +0000 (12:17 +0100)]
[WIN32KNT_APITEST] Improve the existing PCH and make use of it.

6 years ago[HALX86] Deduplicate initialization of legacy PICs and remove EOI in I/O APIC initial...
Colin Finck [Sun, 17 Dec 2017 08:51:37 +0000 (09:51 +0100)]
[HALX86] Deduplicate initialization of legacy PICs and remove EOI in I/O APIC initialization, which causes an unexpected interrupt

6 years ago[SWENUM] Add version information. CORE-14112
Jason Wendt [Thu, 14 Dec 2017 19:48:48 +0000 (12:48 -0700)]
[SWENUM] Add version information. CORE-14112

Improves setup of DirectX 9.0b 4.09.00.0902 (which the game Halo wants
to install) after manually lowering DirectX version in registry.

6 years ago[GDI32] Fix TextOutA multibyte text length overgoing. CORE-14070
Katayama Hirofumi MZ [Thu, 7 Dec 2017 06:43:22 +0000 (15:43 +0900)]
[GDI32] Fix TextOutA multibyte text length overgoing. CORE-14070

6 years ago[VFD] Remove no longer required ReactOS specific change
Pierre Schweitzer [Sat, 16 Dec 2017 21:53:32 +0000 (22:53 +0100)]
[VFD] Remove no longer required ReactOS specific change

CORE-14090

6 years ago[VFDLIB] Fix preprocessor directive compilation error when being used inside a macro...
Hermès Bélusca-Maïto [Sat, 16 Dec 2017 21:48:11 +0000 (22:48 +0100)]
[VFDLIB] Fix preprocessor directive compilation error when being used inside a macro expansion on MSVC.

6 years ago[VFD] Fix build on MSVC2010.
Hermès Bélusca-Maïto [Sat, 16 Dec 2017 21:34:20 +0000 (22:34 +0100)]
[VFD] Fix build on MSVC2010.

6 years ago[VFD] Fix build
Pierre Schweitzer [Sat, 16 Dec 2017 21:00:41 +0000 (22:00 +0100)]
[VFD] Fix build

6 years ago[VFD] Build with debug information on debug builds
Pierre Schweitzer [Sat, 16 Dec 2017 20:57:11 +0000 (21:57 +0100)]
[VFD] Build with debug information on debug builds

CORE-14090

6 years ago[VFD] Import the VFD project (Virtual Floppy Drive) which allows creating virtual
Pierre Schweitzer [Sat, 16 Dec 2017 20:48:17 +0000 (21:48 +0100)]
[VFD] Import the VFD project (Virtual Floppy Drive) which allows creating virtual
floppy drives in ReactOS and mount images on them.
Only the cmd got imported. The GUI interface may come later on.
Note that, as for vcdrom, the driver is left disabled and you need to explicitely
start it through vfd command line interface.

CORE-14090

6 years ago[PSDK] Add some missing defines
Pierre Schweitzer [Sat, 16 Dec 2017 20:43:49 +0000 (21:43 +0100)]
[PSDK] Add some missing defines

CORE-14090

6 years ago[DOSKEY] Resource files: remove trailing whitespace.
Hermès Bélusca-Maïto [Sat, 16 Dec 2017 20:09:59 +0000 (21:09 +0100)]
[DOSKEY] Resource files: remove trailing whitespace.

6 years ago[DOSKEY] Improvements when importing aliases definition files.
Hermès Bélusca-Maïto [Sat, 16 Dec 2017 20:01:08 +0000 (21:01 +0100)]
[DOSKEY] Improvements when importing aliases definition files.

- The aliases ("macros") definition files have the same format as what
  is output by DosKey when one displays the list of defined aliases with
  the /macros: command-line switch. It should then, in particular,
  understand the format where executable names are also specified:

[exename1]
    alias1=command1
    ...

[exename2]
    aliasN=commandN
    ...

  We now behave similarly as Windows' version of this utility in that
  regard.

- Use ARRAYSIZE() when needed.
- Take the opportunity to add a license header to the source file.

6 years ago[KERNEL32] Improve the definition of EXENAME_LENGTH.
Hermès Bélusca-Maïto [Sat, 16 Dec 2017 19:58:08 +0000 (20:58 +0100)]
[KERNEL32] Improve the definition of EXENAME_LENGTH.

6 years ago[KERNEL32_APITEST] Add a test for FormatMessage backed with MC file.
Pierre Schweitzer [Sat, 16 Dec 2017 18:39:37 +0000 (19:39 +0100)]
[KERNEL32_APITEST] Add a test for FormatMessage backed with MC file.

6 years ago[SDK] pnp.idl: Add a reminder comment about removed Vista/+ functions. CORE-12580 164/head
Serge Gautherie [Tue, 5 Dec 2017 05:32:25 +0000 (06:32 +0100)]
[SDK] pnp.idl: Add a reminder comment about removed Vista/+ functions. CORE-12580

6 years ago[NTOS:MM] Fix NtFreeVirtualMemory() FreeType parameter checks. CORE-13126 182/head
Serge Gautherie [Sat, 9 Dec 2017 11:16:44 +0000 (12:16 +0100)]
[NTOS:MM] Fix NtFreeVirtualMemory() FreeType parameter checks. CORE-13126

6 years ago[BOOTDATA] Start menu, shortcuts: port r61988 to LiveCD from BootCD. CORE-13994 119/head
Serge Gautherie [Sat, 11 Nov 2017 03:42:48 +0000 (04:42 +0100)]
[BOOTDATA] Start menu, shortcuts: port r61988 to LiveCD from BootCD. CORE-13994

- Move Accessibility, Entertainment and System Tools folders into Accessories.
- Move mstsc.exe shortcut into new Accessories/Communications folder.
- Rename Remote desktop to Remote Desktop Connection.
- Rename Regedit to Registry Editor.
- Plus: Sort touched lines in the list.

6 years ago[TRANSLATION] Start menu, shortcuts, r61988: update untranslated strings too. CORE... 120/head
Serge Gautherie [Sat, 11 Nov 2017 03:42:48 +0000 (04:42 +0100)]
[TRANSLATION] Start menu, shortcuts, r61988: update untranslated strings too. CORE-13994

ToDo: Translators should check already translated strings too.

6 years ago[NTOS:KD] Pass PreviousMode down to KdpPrintString, since ExGetPreviousMode is not... 188/head
Thomas Faber [Thu, 14 Dec 2017 10:43:57 +0000 (11:43 +0100)]
[NTOS:KD] Pass PreviousMode down to KdpPrintString, since ExGetPreviousMode is not accurate. CORE-14103

6 years ago[NTOS:KD] Avoid _alloca inside SEH, as it's apparently incompatible with PSEH. CORE...
Thomas Faber [Tue, 12 Dec 2017 11:44:44 +0000 (12:44 +0100)]
[NTOS:KD] Avoid _alloca inside SEH, as it's apparently incompatible with PSEH. CORE-14103

6 years ago[NTOS:KD] Don't assume null termination in KdpSerialDebugPrint and KdpScreenPrint...
Thomas Faber [Tue, 12 Dec 2017 11:38:45 +0000 (12:38 +0100)]
[NTOS:KD] Don't assume null termination in KdpSerialDebugPrint and KdpScreenPrint. CORE-14057 CORE-14103

6 years ago[SYSDM] Extend build string to fit commit hash
Stanislav Motylkov [Wed, 13 Dec 2017 09:50:22 +0000 (12:50 +0300)]
[SYSDM] Extend build string to fit commit hash

6 years ago[ASM][NDK][NTOS] Rename Self to SelfPcr in the KIPCR structure.
Amine Khaldi [Tue, 12 Dec 2017 11:50:58 +0000 (12:50 +0100)]
[ASM][NDK][NTOS] Rename Self to SelfPcr in the KIPCR structure.

6 years ago[KERNEL32_APITEST] Add a PCH.
Amine Khaldi [Wed, 13 Dec 2017 12:48:26 +0000 (13:48 +0100)]
[KERNEL32_APITEST] Add a PCH.

6 years ago[COM_APITEST] Improve the existing PCH and make use of it.
Amine Khaldi [Tue, 12 Dec 2017 12:01:03 +0000 (13:01 +0100)]
[COM_APITEST] Improve the existing PCH and make use of it.

6 years ago[ADVAPI32_APITEST] Add a PCH.
Amine Khaldi [Tue, 12 Dec 2017 11:44:32 +0000 (12:44 +0100)]
[ADVAPI32_APITEST] Add a PCH.

6 years ago[NTOS] Add some header guards.
Amine Khaldi [Tue, 12 Dec 2017 11:42:13 +0000 (12:42 +0100)]
[NTOS] Add some header guards.

6 years ago[TRANSLATION] Fix Simplified Chinese Translations (#187)
Li Keqing [Mon, 11 Dec 2017 09:35:59 +0000 (17:35 +0800)]
[TRANSLATION] Fix Simplified Chinese Translations (#187)

* Fix the Simplified Translation of Rapps
* Fix the Simplified Translation of msconfig_new
* Fix the Simplified Translation of charmap_new
* Fix the Simplified Translation of winmine
* Fix the Simplified Translation of kbswitch
* Fix Simplified Chinese Translation of logoff
* Fix Simplified Chinese Translation of eventvwr
* Fix Simplified Chinese Translation of sysdm
* Update Simplified Chinese Translation for dxdiag

6 years ago[VCDCLI] Fix typo
Pierre Schweitzer [Sun, 10 Dec 2017 22:42:25 +0000 (23:42 +0100)]
[VCDCLI] Fix typo

6 years ago[KERNEL32] Update some console API prototypes.
Hermès Bélusca-Maïto [Sun, 10 Dec 2017 16:04:29 +0000 (17:04 +0100)]
[KERNEL32] Update some console API prototypes.

6 years ago[NTOS:KD] Protect against invalid user arguments for BREAKPOINT_LOAD_SYMBOLS. CORE... 160/head
Thomas Faber [Fri, 8 Dec 2017 13:45:26 +0000 (14:45 +0100)]
[NTOS:KD] Protect against invalid user arguments for BREAKPOINT_LOAD_SYMBOLS. CORE-14057

6 years ago[NTOS:KD] Protect against invalid user arguments in KdpPrintString. CORE-14057
Thomas Faber [Fri, 8 Dec 2017 13:41:41 +0000 (14:41 +0100)]
[NTOS:KD] Protect against invalid user arguments in KdpPrintString. CORE-14057

6 years ago[NTOS:KD] Protect against invalid user arguments in KdpPrompt. CORE-14057
Thomas Faber [Fri, 8 Dec 2017 13:39:31 +0000 (14:39 +0100)]
[NTOS:KD] Protect against invalid user arguments in KdpPrompt. CORE-14057

6 years ago[SERVMAN] fix status-bar text truncation, update german localization CORE-14092
Joachim Henze [Sun, 10 Dec 2017 13:08:29 +0000 (14:08 +0100)]
[SERVMAN] fix status-bar text truncation, update german localization CORE-14092

6 years agoMerge branch 'ntfs_rebase' 186/head
Thomas Faber [Sun, 10 Dec 2017 11:46:33 +0000 (12:46 +0100)]
Merge branch 'ntfs_rebase'

6 years ago[PRINTING] Fix GetPrinterW, add tests for it and GetDefaultPrinterA/W, and add a...
Colin Finck [Sun, 10 Dec 2017 11:28:08 +0000 (12:28 +0100)]
[PRINTING] Fix GetPrinterW, add tests for it and GetDefaultPrinterA/W, and add a proper stub for GetPrinterDriverDirectoryA.

* Pass the correct handle to _RpcGetPrinter in GetPrinterW.
* Pass an empty string instead of a NULL pointer as wszComputerName to the GetPrinterLevel* functions, because this variable is later used as source for StringCbCopyExW.
* Don't check for GetLastError() == ERROR_SUCCESS in tests. Windows apparently only sets the last error in case of failure.
  The Printing code should probably be changed similarly in a future commit.

Should fix CORE-14072

6 years ago[NTFS] Fix the FileNamesInformation/FileNameInformation class confusion that was...
Pierre Schweitzer [Sun, 10 Dec 2017 10:25:48 +0000 (11:25 +0100)]
[NTFS] Fix the FileNamesInformation/FileNameInformation class confusion that was spotted on FastFAT.
What should also be fixed is the partial return of data on first entry enumeration.

6 years ago[NTFS] - Respect NTFS' file ordering when enumerating a directory. Split off part...
Trevor Thompson [Sat, 9 Sep 2017 23:10:52 +0000 (23:10 +0000)]
[NTFS] - Respect NTFS' file ordering when enumerating a directory. Split off part of BrowseIndexEntries() into a separate function to simplify the code.
AddNewMftEntry() - Zero the (larger) buffer for the bitmap prior to reading the bitmap.
BrowseIndexEntries() - Check sub-nodes before checking an index entry. Read and use the index bitmap when checking sub-nodes.
+BrowseSubNodeIndexEntries() - Called for sub-nodes of an index when browsing index entries.
+NtfsDumpData() - Diagnostic function which allows for visualizing a series of bytes.

svn path=/branches/GSoC_2016/NTFS/; revision=75817

6 years ago[NTFS] - Fix some errors that break building in C89 mode, and remove an extraneous...
Trevor Thompson [Fri, 1 Sep 2017 00:27:34 +0000 (00:27 +0000)]
[NTFS] - Fix some errors that break building in C89 mode, and remove an extraneous "ninja livecd" that got inserted in a comment. Thanks to Doug Lyons for spotting these errors.
SplitBTree() - comment-out redundant code for finding the median key and improve comments.

svn path=/branches/GSoC_2016/NTFS/; revision=75727

6 years ago[NTFS] - Add some helper functions for new features. Add some fixes. Add support...
Trevor Thompson [Tue, 29 Aug 2017 15:51:14 +0000 (15:51 +0000)]
[NTFS] - Add some helper functions for new features. Add some fixes. Add support for creating an index allocation, splitting a b-tree node, or "demoting" the index root. This allows for file creation without functional limitations.
+AddBitmap() - adds a $BITMAP attribute to a file record.
+AddIndexAllocation() - adds an $INDEX_ALLOCATION attribute to a file record.
+CountBTreeKeys() - Counts the number of linked B-Tree keys.
CreateIndexBufferFromBTreeNode() - Set INDEX_NODE_LARGE if the node has sub-nodes.
CreateIndexRootFromBTree() - Simplify the usage and math of MaxIndexSize; make it only account for the cumulative size of the index entries.
+DemoteBTreeRoot() - Replaces the contents of an index root with a dummy key, and puts those contents in a new node, which is made a child of the dummy key. This is done when an index root grows too large.
+GetIndexEntryVCN() - Retrieves the VCN from an index entry.
NtfsAddFilenameToDirectory() - Fix math for MaxIndexRootSize.
NtfsInsertKey() - Add support for splitting a B-Tree node. Don't check size of index root (that will be handled later).
+SplitBTreeNode() - Called when a B-Tree node grows too large.
UpdateIndexAllocation() - Create an $I30 index allocation attribute and bitmap attribute if needed.
UpdateIndexNode() - Update children before updating the current node. Store VCN of child nodes in the index entries of their respective keys.

svn path=/branches/GSoC_2016/NTFS/; revision=75707

6 years ago[NTFS] - Fix increasing the mft size, to keep chkdsk happy.
Trevor Thompson [Mon, 28 Aug 2017 03:11:38 +0000 (03:11 +0000)]
[NTFS] - Fix increasing the mft size, to keep chkdsk happy.
IncreaseMftSize() - Add some fixes. Write blank records to newly-allocated mft entries, and update $MFTMirr when finished; these changes are needed for chkdsk.  Increase size by 64 records instead of 8.
+UpdateMftMirror() - Backs up the first ~4 master file table entries to the $MFTMirr file.

svn path=/branches/GSoC_2016/NTFS/; revision=75694

6 years ago[NTFS] - Fix for C89 compliance.
Trevor Thompson [Sun, 27 Aug 2017 14:43:35 +0000 (14:43 +0000)]
[NTFS] - Fix for C89 compliance.

svn path=/branches/GSoC_2016/NTFS/; revision=75693

6 years ago[NTFS] - Add support for directory creation. Add some helper functions, some comments...
Trevor Thompson [Sun, 27 Aug 2017 14:37:17 +0000 (14:37 +0000)]
[NTFS] - Add support for directory creation. Add some helper functions, some comments, and some fixes.
+AddIndexRoot() - Creates an $INDEX_ROOT attribute and adds it to a file record.
AddNewMftEntry() - Make sure the buffer used by RtlInitializeBitmap() is ULONG-aligned, and a ULONG-multiple in size, per MSDN.
AllocateIndexNode() - Calculate BytesNeeded correctly. Read $BITMAP attribute before increasing its length, in anticipation of a future commit that will check for a free bit before assigning a new index record to the end of the allocation. Use appropriate Set*AttributeDataLength() function, as $BITMAP can be resident or non-resident.
B_TREE_FILENAME_NODE - Give two members more accurate names: change "ExistsOnDisk" member to "HasValidVCN" and rename "NodeNumber" member "VCN."
+CreateEmptyBTree() - Creates a B-Tree to represent an empty directory (for AddIndexRoot).
+NtfsCreateEmptyFileRecord() - Creates an empty file record in memory, with no attributes.
CreateIndexRootFromBTree() - Fix TotalSizeOfEntries calculation.
+NtfsCreateDirectory() - Creates a file record for an empty directory and adds it to the mft.

svn path=/branches/GSoC_2016/NTFS/; revision=75692

6 years ago[NTFS] - When creating files:
Trevor Thompson [Fri, 25 Aug 2017 17:16:04 +0000 (17:16 +0000)]
[NTFS] - When creating files:
-Don't add a preceding backslash when creating files on root.
-Use NTFS_FILE_NAME_POSIX name type if CaseSensitive option is specified.
-Don't try to create a file when a folder is requested (folder creation is still TODO).

svn path=/branches/GSoC_2016/NTFS/; revision=75671

6 years ago[NTFS] - Allow for creating a file when the index root gets too large and needs to...
Trevor Thompson [Tue, 15 Aug 2017 19:57:55 +0000 (19:57 +0000)]
[NTFS] - Allow for creating a file when the index root gets too large and needs to be moved into an index record. Add some helper functions.
+AllocateIndexNode() - Allocates a new index record in an index allocation.
+CreateDummyKey() - Creates the final B_TREE_KEY for a B_TREE_FILENAME_NODE. Also creates the associated index entry.
GetSizeOfIndexEntries() - Sums the size of each index entry in every key in a B-Tree node.
+SetIndexEntryVCN() - Sets the VCN of a given IndexEntry.
NtfsInsertKey() - Handle instance when the index root grows too large. If it does, add its contents to a new sub-node, and replace contents with a dummy-key whose child is the new node.
UpdateIndexAllocation() - Update index entry if a key has just been assigned a child allocation.
UpdateIndexNode() - Make sure the node exists on disk, and allocate an index record for it if it doesn't.

svn path=/branches/GSoC_2016/NTFS/; revision=75557

6 years ago[NTFS] - Allow for resizing an attribute in the middle of a file record. Add a helper...
Trevor Thompson [Tue, 15 Aug 2017 19:32:20 +0000 (19:32 +0000)]
[NTFS] - Allow for resizing an attribute in the middle of a file record. Add a helper function and minor improvements:
AddRun() - Allow for resizing the size of the data runs when the attribute isn't the last in the file record. Fix some comments.
CreateIndexBufferFromBTreeNode(), CreateIndexRootFromBTree - Fix math of IndexSize when checking if the index buffer is too large.
InternalSetResidentAttributeLength() - Allow changing the length of an attribute in the middle of a file record. Adjust the position of every attribute after the one being resized.
+MoveAttributes() - Moves a block of attributes to a new location in the file Record.
PrintAllVCNs() - Add consideration for an index allocation with a size of 0.
WriteAttribute() - Add optional parameter for a pointer to the file record being written to. If passed a file record, WriteAttribute() will skip reading the file record from disk, and will update the file record in memory before returning. This helps callers that use the file record after writing an attribute to stay in-sync with what's on disk.

svn path=/branches/GSoC_2016/NTFS/; revision=75554

6 years ago[NTFS] - Refactor to allow the copy of the attribute stored in NTFS_ATTR_CONTEXT...
Trevor Thompson [Sun, 6 Aug 2017 02:54:15 +0000 (02:54 +0000)]
[NTFS] - Refactor to allow the copy of the attribute stored in NTFS_ATTR_CONTEXT to have a dynamic length; change Record member from an NTFS_ATTR_RECORD to a PNTFS_ATTR_RECORD.  Rename it pRecord to reinforce the change. Fix some bugs related to the record size changing.
-PrepareAttributeContext() - update to allocate memory for pRecord. Don't assume allocations are succeeding.
-ReleaseAttributeContext() - update to free memory for pRecord.
-InternalSetResidentAttributeLength() - Increase size of AttrContext->pRecord as needed. Update to return an NTSTATUS.
-SetResidentAttributeDataLength() - Fix bug that could occur when migrating resident attributes to non-resident if AttrContext->pRecord is too small for the new attribute.
-AddRun() - Fix a bug by reallocating AttrContext->pRecord if the record needs to be enlarged.

svn path=/branches/GSoC_2016/NTFS/; revision=75493

6 years ago[NTFS] - Fix index entries storing the wrong allocated file size when the file is...
Trevor Thompson [Fri, 4 Aug 2017 17:58:06 +0000 (17:58 +0000)]
[NTFS] - Fix index entries storing the wrong allocated file size when the file is resident. Fix a typo in a DPRINT.

svn path=/branches/GSoC_2016/NTFS/; revision=75479

6 years ago[NTFS] - Add some improvements to B-Tree support. Add preliminary support for trees...
Trevor Thompson [Thu, 27 Jul 2017 19:52:33 +0000 (19:52 +0000)]
[NTFS] - Add some improvements to B-Tree support. Add preliminary support for trees of arbitrary depth. Add support for creating files in directories which have an index allocation, provided there aren't too many files and the node doesn't need to be split.
-CreateBTreeFromIndex() - Fix memory allocation; allocate sizeof(B_TREE_KEY) bytes for the key, not the size of the pointer. Add support for child nodes. Update parameter list.
-CreateIndexRootFromBTree() - Update Header->Flags if any of index root's keys have sub-nodes.
+CreateIndexBufferFromBTreeNode() - Converts a B-Tree node to an index buffer to be written to the index allocation.
+UpdateIndexAllocation() - Updates all of the stale nodes in an index allocation based on a PB_TREE.
+UpdateIndexNode() - Writes a B-Tree node into the index allocation.
+CreateBTreeKeyFromFilename() - Creates a PB_TREE_KEY based on a FILENAME_ATTRIBUTE.
-DestroyBTreeKey() - Destroy a child node, if present.
-DumpBTreeKey() - Dump a child node, if present.
-DumpBTreeNode() - Include Node->KeyCount in output.
-NtfsAddFilenameToDirectory() - Call UpdateIndexAllocation() prior to CreateIndexRootFromBTree().
-Update B_TREE_FILENAME_NODE with members to keep track of its existence on disk.

svn path=/branches/GSoC_2016/NTFS/; revision=75428

6 years ago[NTFS] - Add GetAllocationOffsetFromVCN() function, which was mistakenly left out...
Trevor Thompson [Thu, 27 Jul 2017 18:34:23 +0000 (18:34 +0000)]
[NTFS] - Add GetAllocationOffsetFromVCN() function, which was mistakenly left out of the last commit.

svn path=/branches/GSoC_2016/NTFS/; revision=75425

6 years ago[NTFS] - Add some utility functions and improve some comments. Improve NtfsAddFilenam...
Trevor Thompson [Thu, 27 Jul 2017 18:22:24 +0000 (18:22 +0000)]
[NTFS] - Add some utility functions and improve some comments. Improve NtfsAddFilenameToDirectory().
+PrintAllVCNs() - Diagnostic function which prints VCN of every node in an index allocation.
+GetAllocationOffsetFromVCN() - Calculates location of an index buffer from the node's VCN.
+GetInfoClassName() - Gets a string representation of an info class enumeration, to speed up development of unimplemented classes.
-NtfsSetInformation() & NtfsQueryInformation() - Use GetInfoClassName to report unhandled information classes.
-CompareTreeKeys() - Add a comment and clarify some comments.
-NtfsAddFilenameToDirectory() - Don't try to update the size of Index Root on disk if the attribute length hasn't changed.

svn path=/branches/GSoC_2016/NTFS/; revision=75424

6 years ago[NTFS] - After creating a new file, update creation disposition before calling NtfsCr...
Trevor Thompson [Thu, 27 Jul 2017 11:35:50 +0000 (11:35 +0000)]
[NTFS] - After creating a new file, update creation disposition before calling NtfsCreateFile() recursively. This fixes creating a file via right-clicking in a folder.

svn path=/branches/GSoC_2016/NTFS/; revision=75423

6 years ago[NTFS] - Fix some more issues, including remaining issues marked as "unresolved"...
Trevor Thompson [Tue, 18 Jul 2017 19:59:36 +0000 (19:59 +0000)]
[NTFS] - Fix some more issues, including remaining issues marked as "unresolved" from CR-123:
-Add define for indexed flag for resident attributes, RA_INDEXED.
-CreateBTreeFromIndex() - Don't try to read index entries beyond attribute length.
-Move NtfsAddFileNameToDirectory() from dirctl.c to mft.c (no changes to function).
-SetResidentAttributeDataLength() - Don't try to free AttribData if it hasn't been allocated. Cast IndexRecord to PUCHAR for WriteAttribute(), and cast BitmapData to PCHAR for ReadAttribute() (make gcc happy).
-Replace magic number 16 with a define, NTFS_FILE_FIRST_USER_FILE.

svn path=/branches/GSoC_2016/NTFS/; revision=75371

6 years ago[NTFS] - Fix some formatting / style issues, per CR-123.
Trevor Thompson [Wed, 5 Jul 2017 22:10:22 +0000 (22:10 +0000)]
[NTFS] - Fix some formatting / style issues, per CR-123.

svn path=/branches/GSoC_2016/NTFS/; revision=75290

6 years ago[NTFS] - Add a few fixes and improvements, most from CR-123:
Trevor Thompson [Wed, 5 Jul 2017 16:29:16 +0000 (16:29 +0000)]
[NTFS] - Add a few fixes and improvements, most from CR-123:
-Add ATTR_RECORD_ALIGNMENT define to replace magic value of 8 when we need to adjust an attribute's beginning or length.
-Don't use int's.
-GetPackedByteCount() - Remove unused "bytes" variable.

svn path=/branches/GSoC_2016/NTFS/; revision=75288

6 years ago[NTFS] - Add some fixes and improvements to mft.c from CR-123:
Trevor Thompson [Wed, 5 Jul 2017 05:09:51 +0000 (05:09 +0000)]
[NTFS] - Add some fixes and improvements to mft.c from CR-123:
FindAttribute() - Use * sizeof(WCHAR) in place bit-shifting wizardry.
IncreaseMftSize() - Remove two useless casts. Return error code if WriteAttribute() fails.
SetNonResidentAttributeDataLength() - Assert that AttrContext parameter describes a NonResident attribute. When migrating a resident attribute to non-resident, don't leak memory if FsRtlInitializeLargeMcb() throws an exception, and don't mark the attribute as non-resident until after the Mcb is initialized.
InternalSetResidentAttributeLength() and SetResidentAttributeLength() - Assert that AttrContext parameter describes a resident attribute.
AddNewMftEntry() - Simplify math of backing up and restoring reserved bits by changing BitmapData to PUCHAR type. Don't attempt to modify a volume with more than 2^32 clusters.
AddFixupArray() - Use ULONG in place of int.

svn path=/branches/GSoC_2016/NTFS/; revision=75284

6 years ago[NTFS] - Add some fixes and improvements to finfo.c from CR-123:
Trevor Thompson [Wed, 5 Jul 2017 03:11:13 +0000 (03:11 +0000)]
[NTFS] - Add some fixes and improvements to finfo.c from CR-123:
NtfsSetEndOfFile() - Make fileNameAttribute and filename variables uppercase. Don't leak FileRecord if we can't truncate the file. Don't leak memory if there's no FileName attribute.

svn path=/branches/GSoC_2016/NTFS/; revision=75283

6 years ago[NTFS] - Add some fixes and improvements to create.c, dirctl.c and fcb.c from CR...
Trevor Thompson [Tue, 4 Jul 2017 22:34:17 +0000 (22:34 +0000)]
[NTFS] - Add some fixes and improvements to create.c, dirctl.c and fcb.c from CR-123:
-NtfsOpenFile() - Replace an ExFreePool() with ExFreePoolWithTag().
-NtfsCreateFile() - Fix broken cast with BooleanFlagOn() macro.
-NtfsAddFilenameToDirectory() - Remove an extra cast. Return an error if we fail to allocate I30IndexRoot.
-NtfsGetNextPathElement(), NtfsWSubString(), NtfsGetFCBForFile() - Use PCWSTR in place of const PWCHAR or PWCHAR  where it makes sense.

svn path=/branches/GSoC_2016/NTFS/; revision=75281

6 years ago[NTFS] - Add some fixes and improvements to btree.c from CR-123:
Trevor Thompson [Tue, 4 Jul 2017 21:47:43 +0000 (21:47 +0000)]
[NTFS] - Add some fixes and improvements to btree.c from CR-123:
-CompareTreeKeys() - Assert that the first key isn't the dummy key.
-CreateIndexRootFromBTree() - Assert that CurrentKey->IndexEntry->Length isn't 0.
-DumpBTreeKey() - Use sizeof(WCHAR) in place of magic 2.
-NtfsInsertKey() - Check for allocation failure of NewKey.

svn path=/branches/GSoC_2016/NTFS/; revision=75280