[ros-diffs] [mjansen] 75549: [ATL] Use the AtlThrow helper so we can disable exceptions by defining _ATL_NO_EXCEPTIONS

2017-08-15 Thread mjansen
Author: mjansen
Date: Tue Aug 15 09:02:17 2017
New Revision: 75549

URL: http://svn.reactos.org/svn/reactos?rev=75549&view=rev
Log:
[ATL] Use the AtlThrow helper so we can disable exceptions by defining 
_ATL_NO_EXCEPTIONS

Modified:
trunk/reactos/sdk/lib/atl/atlsimpstr.h

Modified: trunk/reactos/sdk/lib/atl/atlsimpstr.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/atl/atlsimpstr.h?rev=75549&r1=75548&r2=75549&view=diff
==
--- trunk/reactos/sdk/lib/atl/atlsimpstr.h  [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/atl/atlsimpstr.h  [iso-8859-1] Tue Aug 15 
09:02:17 2017
@@ -162,9 +162,8 @@
 int nLength = StringLength(pszSrc);
 CStringData* pData = pStringMgr->Allocate(nLength, sizeof(XCHAR));
 if (pData == NULL)
-{
-throw; // ThrowMemoryException();
-}
+ThrowMemoryException();
+
 Attach(pData);
 SetLength(nLength);
 CopyChars(m_pszData, nLength, pszSrc, nLength);
@@ -176,12 +175,12 @@
 _Inout_ IAtlStringMgr* pStringMgr)
 {
 if (pchSrc == NULL && nLength != 0)
-throw;
+ThrowInvalidArgException();
 
 CStringData* pData = pStringMgr->Allocate(nLength, sizeof(XCHAR));
 if (pData == NULL)
 {
-throw; // ThrowMemoryException();
+ThrowMemoryException();
 }
 Attach(pData);
 SetLength(nLength);
@@ -615,6 +614,11 @@
 AtlThrow(E_OUTOFMEMORY);
 }
 
+static void ThrowInvalidArgException()
+{
+AtlThrow(E_INVALIDARG);
+}
+
 };
 
 #ifdef UNICODE




[ros-diffs] [gadamopoulos] 75550: [SHELL32] -Greatly optimize the already hacky implementations of ILIsEqual, ILIsParent and ILFindChild by not using the crappy _ILSimpleGetText but the new one _ILHAC

2017-08-15 Thread gadamopoulos
Author: gadamopoulos
Date: Tue Aug 15 12:13:19 2017
New Revision: 75550

URL: http://svn.reactos.org/svn/reactos?rev=75550&view=rev
Log:
[SHELL32] -Greatly optimize the already hacky implementations of ILIsEqual, 
ILIsParent and ILFindChild by not using the crappy _ILSimpleGetText but the new 
one _ILHACKCompareSimpleIds. CORE-13681

Modified:
trunk/reactos/dll/win32/shell32/wine/pidl.c

Modified: trunk/reactos/dll/win32/shell32/wine/pidl.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/wine/pidl.c?rev=75550&r1=75549&r2=75550&view=diff
==
--- trunk/reactos/dll/win32/shell32/wine/pidl.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/wine/pidl.c [iso-8859-1] Tue Aug 15 
12:13:19 2017
@@ -476,15 +476,64 @@
 return newpidl;
 }
 
+BOOL _ILHACKCompareSimpleIds(LPCITEMIDLIST pidltemp1, LPCITEMIDLIST pidltemp2)
+{
+LPPIDLDATA pdata1 = _ILGetDataPointer(pidltemp1);
+LPPIDLDATA pdata2 = _ILGetDataPointer(pidltemp2);
+
+IID *iid1 = _ILGetGUIDPointer(pidltemp1);
+IID *iid2 = _ILGetGUIDPointer(pidltemp2);
+
+FileStructW* pDataW1 = _ILGetFileStructW(pidltemp1);
+FileStructW* pDataW2 = _ILGetFileStructW(pidltemp2);
+
+if (_ILIsDesktop(pidltemp1) && _ILIsDesktop(pidltemp2))
+{
+return TRUE;
+}
+else if (_ILIsDesktop(pidltemp1) || _ILIsDesktop(pidltemp2))
+{
+return FALSE;
+}
+else if (iid1 || iid2)
+{
+if (!iid1 || !iid2 || memcmp(iid1, iid2, sizeof(GUID)))
+return FALSE;
+}
+else if (pDataW1 || pDataW2)
+{
+if (!pDataW1 || !pDataW2 || wcsicmp(pDataW1->wszName, 
pDataW2->wszName))
+return FALSE;
+}
+else if (_ILIsFolder(pidltemp1) || _ILIsFolder(pidltemp2))
+{
+if (!_ILIsFolder(pidltemp1) || !_ILIsFolder(pidltemp2) || 
strcmp(pdata1->u.file.szNames, pdata2->u.file.szNames))
+return FALSE;
+}
+else if (_ILIsValue(pidltemp1) || _ILIsValue(pidltemp2))
+{
+if (!_ILIsValue(pidltemp1) || !_ILIsValue(pidltemp2) || 
strcmp(pdata1->u.file.szNames, pdata2->u.file.szNames))
+return FALSE;
+}
+else if (_ILIsDrive(pidltemp1) || _ILIsDrive(pidltemp2))
+{
+if (!_ILIsDrive(pidltemp1) || !_ILIsDrive(pidltemp2) || 
pdata1->u.drive.szDriveName[0] != pdata2->u.drive.szDriveName[0])
+return FALSE;
+}
+else
+{
+return FALSE;
+}
+
+return TRUE;
+}
+
 /*
  * ILIsEqual [SHELL32.21]
  *
  */
 BOOL WINAPI ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
 {
-charszData1[MAX_PATH];
-charszData2[MAX_PATH];
-
 LPCITEMIDLIST pidltemp1 = pidl1;
 LPCITEMIDLIST pidltemp2 = pidl2;
 
@@ -505,10 +554,7 @@
 
 while (pidltemp1->mkid.cb && pidltemp2->mkid.cb)
 {
-_ILSimpleGetText(pidltemp1, szData1, MAX_PATH);
-_ILSimpleGetText(pidltemp2, szData2, MAX_PATH);
-
-if (strcasecmp( szData1, szData2 ))
+if (!_ILHACKCompareSimpleIds(pidltemp1, pidltemp2))
 return FALSE;
 
 pidltemp1 = ILGetNext(pidltemp1);
@@ -545,8 +591,6 @@
  */
 BOOL WINAPI ILIsParent(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild, BOOL 
bImmediate)
 {
-charszData1[MAX_PATH];
-charszData2[MAX_PATH];
 LPCITEMIDLIST pParent = pidlParent;
 LPCITEMIDLIST pChild = pidlChild;
 
@@ -557,10 +601,7 @@
 
 while (pParent->mkid.cb && pChild->mkid.cb)
 {
-_ILSimpleGetText(pParent, szData1, MAX_PATH);
-_ILSimpleGetText(pChild, szData2, MAX_PATH);
-
-if (strcasecmp( szData1, szData2 ))
+if (!_ILHACKCompareSimpleIds(pParent, pChild))
 return FALSE;
 
 pParent = ILGetNext(pParent);
@@ -599,9 +640,6 @@
  */
 LPITEMIDLIST WINAPI ILFindChild(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
 {
-charszData1[MAX_PATH];
-charszData2[MAX_PATH];
-
 LPCITEMIDLIST pidltemp1 = pidl1;
 LPCITEMIDLIST pidltemp2 = pidl2;
 LPCITEMIDLIST ret=NULL;
@@ -624,11 +662,8 @@
 {
 while (pidltemp1->mkid.cb && pidltemp2->mkid.cb)
 {
-_ILSimpleGetText(pidltemp1, szData1, MAX_PATH);
-_ILSimpleGetText(pidltemp2, szData2, MAX_PATH);
-
-if (strcasecmp(szData1,szData2))
-break;
+if (!_ILHACKCompareSimpleIds(pidltemp1, pidltemp2))
+return FALSE;
 
 pidltemp1 = ILGetNext(pidltemp1);
 pidltemp2 = ILGetNext(pidltemp2);




[ros-diffs] [tfaber] 75551: [DDK] - Fix calling convention for NDIS_PROC. Fixes stack corruption when running 3rd party network drivers CORE-13685 #resolve

2017-08-15 Thread tfaber
Author: tfaber
Date: Tue Aug 15 12:32:05 2017
New Revision: 75551

URL: http://svn.reactos.org/svn/reactos?rev=75551&view=rev
Log:
[DDK]
- Fix calling convention for NDIS_PROC. Fixes stack corruption when running 3rd 
party network drivers
CORE-13685 #resolve

Modified:
trunk/reactos/sdk/include/ddk/ndis.h

Modified: trunk/reactos/sdk/include/ddk/ndis.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/ddk/ndis.h?rev=75551&r1=75550&r2=75551&view=diff
==
--- trunk/reactos/sdk/include/ddk/ndis.h[iso-8859-1] (original)
+++ trunk/reactos/sdk/include/ddk/ndis.h[iso-8859-1] Tue Aug 15 
12:32:05 2017
@@ -2293,7 +2293,7 @@
 } NDIS_MINIPORT_WORK_ITEM, *PNDIS_MINIPORT_WORK_ITEM;
 
 struct _NDIS_WORK_ITEM;
-typedef VOID (*NDIS_PROC)(struct _NDIS_WORK_ITEM *, PVOID);
+typedef VOID (NTAPI *NDIS_PROC)(struct _NDIS_WORK_ITEM *, PVOID);
 
 typedef struct _NDIS_WORK_ITEM {
   PVOID Context;




[ros-diffs] [mjansen] 75552: [ACPPAGE] Do not allow shims to be applied to files in System32/WinSxs. CORE-13618

2017-08-15 Thread mjansen
Author: mjansen
Date: Tue Aug 15 12:37:25 2017
New Revision: 75552

URL: http://svn.reactos.org/svn/reactos?rev=75552&view=rev
Log:
[ACPPAGE] Do not allow shims to be applied to files in System32/WinSxs.
CORE-13618

Modified:
trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp

Modified: trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp?rev=75552&r1=75551&r2=75552&view=diff
==
--- trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp [iso-8859-1] 
(original)
+++ trunk/reactos/dll/shellext/acppage/CLayerUIPropPage.cpp [iso-8859-1] 
Tue Aug 15 12:37:25 2017
@@ -158,6 +158,27 @@
 }
 return InitFile(Buffer);
 }
+
+CString tmp;
+if (tmp.GetEnvironmentVariable(L"SystemRoot"))
+{
+tmp += L"\\System32";
+if (ExpandedFilename.GetLength() >= tmp.GetLength() &&
+ExpandedFilename.Left(tmp.GetLength()).MakeLower() == 
tmp.MakeLower())
+{
+ACDBG(L"Ignoring System32: %s\r\n", (PCWSTR)ExpandedFilename);
+return E_FAIL;
+}
+tmp.GetEnvironmentVariable(L"SystemRoot");
+tmp += L"\\WinSxs";
+if (ExpandedFilename.GetLength() >= tmp.GetLength() &&
+ExpandedFilename.Left(tmp.GetLength()).MakeLower() == 
tmp.MakeLower())
+{
+ACDBG(L"Ignoring WinSxs: %s\r\n", (PCWSTR)ExpandedFilename);
+return E_FAIL;
+}
+}
+
 for (size_t n = 0; g_AllowedExtensions[n]; ++n)
 {
 if (!wcsicmp(g_AllowedExtensions[n], pwszExt))




[ros-diffs] [tkreuzer] 75553: [WIN32K] IntEngBitBlt returns BOOL, not NTSTATUS! Fix usage in NtGdiSetDIBitsToDeviceInternal accordingly and get rid of NTSTATUS variable entirely.

2017-08-15 Thread tkreuzer
Author: tkreuzer
Date: Tue Aug 15 18:13:14 2017
New Revision: 75553

URL: http://svn.reactos.org/svn/reactos?rev=75553&view=rev
Log:
[WIN32K] IntEngBitBlt returns BOOL, not NTSTATUS!
Fix usage in NtGdiSetDIBitsToDeviceInternal accordingly and get rid of NTSTATUS 
variable entirely.

Modified:
trunk/reactos/win32ss/gdi/ntgdi/dibobj.c

Modified: trunk/reactos/win32ss/gdi/ntgdi/dibobj.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dibobj.c?rev=75553&r1=75552&r2=75553&view=diff
==
--- trunk/reactos/win32ss/gdi/ntgdi/dibobj.c[iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/dibobj.c[iso-8859-1] Tue Aug 15 
18:13:14 2017
@@ -470,8 +470,7 @@
 IN BOOL bTransformCoordinates,
 IN OPTIONAL HANDLE hcmXform)
 {
-INT ret = 0;
-NTSTATUS Status = STATUS_SUCCESS;
+INT ret;
 PDC pDC = NULL;
 HBITMAP hSourceBitmap = NULL, hMaskBitmap = NULL;
 SURFOBJ *pDestSurf, *pSourceSurf = NULL, *pMaskSurf = NULL;
@@ -483,6 +482,7 @@
 EXLATEOBJ exlo;
 PPALETTE ppalDIB = NULL;
 LPBITMAPINFO pbmiSafe;
+BOOL bResult;
 
 if (!Bits) return 0;
 
@@ -498,19 +498,16 @@
 }
 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
 {
-Status = _SEH2_GetExceptionCode();
+ret = 0;
+goto Exit;
 }
 _SEH2_END
-
-if (!NT_SUCCESS(Status))
-{
-goto Exit;
-}
 
 ScanLines = min(ScanLines, abs(bmi->bmiHeader.biHeight) - StartScan);
 if (ScanLines == 0)
 {
 DPRINT1("ScanLines == 0\n");
+ret = 0;
 goto Exit;
 }
 
@@ -518,11 +515,13 @@
 if (!pDC)
 {
 EngSetLastError(ERROR_INVALID_HANDLE);
+ret = 0;
 goto Exit;
 }
 
 if (pDC->dctype == DC_TYPE_INFO)
 {
+ret = 0;
 goto Exit;
 }
 
@@ -564,14 +563,14 @@
 if (!hSourceBitmap)
 {
 EngSetLastError(ERROR_NO_SYSTEM_RESOURCES);
-Status = STATUS_NO_MEMORY;
+ret = 0;
 goto Exit;
 }
 
 pSourceSurf = EngLockSurface((HSURF)hSourceBitmap);
 if (!pSourceSurf)
 {
-Status = STATUS_UNSUCCESSFUL;
+ret = 0;
 goto Exit;
 }
 
@@ -586,13 +585,13 @@
 if (!hMaskBitmap)
 {
 EngSetLastError(ERROR_NO_SYSTEM_RESOURCES);
-Status = STATUS_NO_MEMORY;
+ret = 0;
 goto Exit;
 }
 pMaskSurf = EngLockSurface((HSURF)hMaskBitmap);
 if (!pMaskSurf)
 {
-Status = STATUS_UNSUCCESSFUL;
+ret = 0;
 goto Exit;
 }
 }
@@ -602,7 +601,7 @@
 if (!ppalDIB)
 {
 EngSetLastError(ERROR_NO_SYSTEM_RESOURCES);
-Status = STATUS_NO_MEMORY;
+ret = 0;
 goto Exit;
 }
 
@@ -632,7 +631,7 @@
 DPRINT("BitsToDev with dstsurf=(%d|%d) (%d|%d), src=(%d|%d) w=%d h=%d\n",
rcDest.left, rcDest.top, rcDest.right, rcDest.bottom,
ptSource.x, ptSource.y, SourceSize.cx, SourceSize.cy);
-Status = IntEngBitBlt(pDestSurf,
+bResult = IntEngBitBlt(pDestSurf,
   pSourceSurf,
   pMaskSurf,
   (CLIPOBJ *)&pDC->co,
@@ -650,11 +649,9 @@
 /* We're done */
 DC_vFinishBlit(pDC, NULL);
 
+ret = bResult ? ScanLines : 0;
+
 Exit:
-if (NT_SUCCESS(Status))
-{
-ret = ScanLines;
-}
 
 if (ppalDIB) PALETTE_ShareUnlockPalette(ppalDIB);
 if (pSourceSurf) EngUnlockSurface(pSourceSurf);




[ros-diffs] [tthompson] 75554: [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

2017-08-15 Thread tthompson
Author: tthompson
Date: Tue Aug 15 19:32:20 2017
New Revision: 75554

URL: http://svn.reactos.org/svn/reactos?rev=75554&view=rev
Log:
[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.

Modified:
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/btree.c
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/rw.c
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/volinfo.c

Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c
URL: 
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c?rev=75554&r1=75553&r2=75554&view=diff
==
--- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c   [iso-8859-1] 
(original)
+++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c   [iso-8859-1] 
Tue Aug 15 19:32:20 2017
@@ -352,16 +352,33 @@
 PNTFS_ATTR_RECORD NextAttribute = 
(PNTFS_ATTR_RECORD)((ULONG_PTR)FileRecord + NextAttributeOffset);
 PNTFS_ATTR_RECORD NewRecord;
 
-DataRunMaxLength += Vcb->NtfsInfo.BytesPerFileRecord - 
NextAttributeOffset - (sizeof(ULONG) * 2);
-
-// Can we move the end of the attribute?
-if (NextAttribute->Type != AttributeEnd || DataRunMaxLength < 
RunBufferSize - 1)
-{
-DPRINT1("FIXME: Need to create attribute list! Max Data Run Length 
available: %d\n", DataRunMaxLength);
-if (NextAttribute->Type != AttributeEnd)
-DPRINT1("There's another attribute after this one with type 
%0xlx\n", NextAttribute->Type);
+// Add free space at the end of the file record to DataRunMaxLength
+DataRunMaxLength += Vcb->NtfsInfo.BytesPerFileRecord - 
FileRecord->BytesInUse;
+
+// Can we resize the attribute?
+if (DataRunMaxLength < RunBufferSize)
+{
+DPRINT1("FIXME: Need to create attribute list! Max Data Run Length 
available: %d, RunBufferSize: %d\n", DataRunMaxLength, RunBufferSize);
 ExFreePoolWithTag(RunBuffer, TAG_NTFS);
 return STATUS_NOT_IMPLEMENTED;
+}
+
+// Are there more attributes after the one we're resizing?
+if (NextAttribute->Type != AttributeEnd)
+{
+PNTFS_ATTR_RECORD FinalAttribute;
+
+// Calculate where to move the trailing attributes
+ULONG_PTR MoveTo = (ULONG_PTR)DestinationAttribute + 
AttrContext->pRecord->NonResident.MappingPairsOffset + RunBufferSize;
+MoveTo = ALIGN_UP_BY(MoveTo, ATTR_RECORD_ALIGNMENT);
+
+DPRINT1("Moving attribute(s) after this one starting with type 
0x%lx\n", NextAttribute->Type);
+
+// Move the trailing attributes; FinalAttribute will point to the 
end marker
+FinalAttribute = MoveAttributes(Vcb, NextAttribute, 
NextAttributeOffset, MoveTo);
+
+// set the file record end
+SetFileRecordEnd(FileRecord, FinalAttribute, FILE_RECORD_END);
 }
 
 // calculate position of end markers
@@ -371,20 +388,24 @@
 // Update the length of the destination attribute
 DestinationAttribute->Length = NextAttributeOffset - AttrOffset;
 
-// Create a new copy of the attribute
+// Create a new copy of the attribute record
 NewRecord = ExAllocatePoolWithTag(NonPagedPool, 
DestinationAttribute->Length, TAG_NTFS);
 RtlCopyMemory(NewRecord, AttrContext->pRecord, 
AttrContext->pRecord->Length);
 NewRecord->Length = DestinationAttribute->Length;
 
-// Free the old copy of the attribute, which won't be large enough
+// Free the old copy of the attribute record, which won't be large 
enough
 ExFreePoolWithTag(AttrContext->pRecord, TAG_NTFS);
 
 // Set the attribute context'

[ros-diffs] [ashaposhnikov] 75555: [RAPPS] - Changed "/SETUP" key to "/INSTALL" - Added support for multiple apps install by "/INSTALL" rapps /INSTALL 7-Zip AkelPad [...] - Added INF based batch insta

2017-08-15 Thread ashaposhnikov
Author: ashaposhnikov
Date: Tue Aug 15 19:36:23 2017
New Revision: 7

URL: http://svn.reactos.org/svn/reactos?rev=7&view=rev
Log:
[RAPPS]
- Changed "/SETUP" key to "/INSTALL"
- Added support for multiple apps install by "/INSTALL"
  rapps /INSTALL 7-Zip AkelPad [...]
- Added INF based batch install with the "/SETUP" key
  Works for the full path for the .inf file
  TODO: detect if user entered the relative path for the inf and correct it
- Moved CmdParser to include/unattended.h and unattended.cpp

Added:

branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/unattended.h   
(with props)
branches/GSoC_2017/rapps/reactos/base/applications/rapps/unattended.cpp   
(with props)
Modified:
branches/GSoC_2017/rapps/reactos/base/applications/rapps/CMakeLists.txt
branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/available.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/dialogs.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/misc.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/loaddlg.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/misc.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/winmain.cpp

Modified: 
branches/GSoC_2017/rapps/reactos/base/applications/rapps/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/applications/rapps/CMakeLists.txt?rev=7&r1=75554&r2=7&view=diff
==
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/CMakeLists.txt 
[iso-8859-1] (original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/CMakeLists.txt 
[iso-8859-1] Tue Aug 15 19:36:23 2017
@@ -17,6 +17,7 @@
 misc.cpp
 settingsdlg.cpp
 winmain.cpp
+unattended.cpp
 include/rapps.h
 include/available.h
 include/gui.h
@@ -28,6 +29,7 @@
 include/resource.h
 include/rosui.h
 include/winmain.h
+include/unattended.h
 )
 
 add_definitions(-DUSE_CERT_PINNING)
@@ -36,7 +38,7 @@
 add_executable(rapps ${SOURCE} rapps.rc)
 set_module_type(rapps win32gui UNICODE)
 target_link_libraries(rapps atlnew uuid wine)
-add_importlibs(rapps advapi32 comctl32 gdi32 wininet user32 shell32 shlwapi 
ole32 msvcrt kernel32 ntdll)
+add_importlibs(rapps advapi32 comctl32 gdi32 wininet user32 shell32 shlwapi 
ole32 msvcrt kernel32 ntdll setupapi)
 add_pch(rapps include/rapps.h SOURCE)
 add_dependencies(rapps rappsmsg)
 add_message_headers(ANSI rappsmsg.mc)

Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp?rev=7&r1=75554&r2=7&view=diff
==
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp  
[iso-8859-1] (original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp  
[iso-8859-1] Tue Aug 15 19:36:23 2017
@@ -379,6 +379,20 @@
 return NULL;
 }
 
+ATL::CSimpleArray CAvailableApps::FindInfoList(const 
ATL::CSimpleArray &arrAppsNames)
+{
+ATL::CSimpleArray result;
+for (int i = 0; i < arrAppsNames.GetSize(); ++i)
+{
+PAPPLICATION_INFO Info = FindInfo(arrAppsNames[i]);
+if (Info)
+{
+result.Add(Info);
+}
+}
+return result;
+}
+
 const ATL::CStringW & CAvailableApps::GetFolderPath()
 {
 return m_szPath;
@@ -409,109 +423,3 @@
 return m_szPath.GetString();
 }
 // CAvailableApps
-
-// CConfigParser
-ATL::CStringW CConfigParser::m_szLocaleID;
-ATL::CStringW CConfigParser::m_szCachedINISectionLocale;
-ATL::CStringW CConfigParser::m_szCachedINISectionLocaleNeutral;
-
-CConfigParser::CConfigParser(const ATL::CStringW& FileName) : 
szConfigPath(GetINIFullPath(FileName))
-{
-// we don't have cached section strings for the current system language, 
create them, lazy
-CacheINILocaleLazy();
-}
-
-ATL::CStringW CConfigParser::GetINIFullPath(const ATL::CStringW& FileName)
-{
-ATL::CStringW szDir;
-ATL::CStringW szBuffer;
-
-GetStorageDirectory(szDir);
-szBuffer.Format(L"%ls\\rapps\\%ls", szDir, FileName);
-
-return szBuffer;
-}
-
-VOID CConfigParser::CacheINILocaleLazy()
-{
-if (m_szLocaleID.IsEmpty())
-{
-// TODO: Set default locale if call fails
-// find out what is the current system lang code (e.g. "0a") and 
append it to SectionLocale
-GetLocaleInfoW(GetUserDefaultLCID(), LOCALE_ILANGUAGE,
-   m_szLocaleID.GetBuffer(m_cchLocaleSize), 
m_cchLocaleSize);
-
-m_szLocaleID.ReleaseBuffer();
-m_szCachedINISectionLocale = L"Section." + m_szLocaleID;
-
-// turn "Section.0c0a" into "Section.0a", keeping just the neutral 
lang par

[ros-diffs] [ashaposhnikov] 75556: [RAPPS] - Added the icon provided by Pi_User5

2017-08-15 Thread ashaposhnikov
Author: ashaposhnikov
Date: Tue Aug 15 19:39:20 2017
New Revision: 75556

URL: http://svn.reactos.org/svn/reactos?rev=75556&view=rev
Log:
[RAPPS]
- Added the icon provided by Pi_User5

Added:
branches/GSoC_2017/rapps/reactos/base/applications/rapps/res/select.ico   
(with props)
Modified:
branches/GSoC_2017/rapps/reactos/base/applications/rapps/rapps.rc

Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/rapps.rc
URL: 
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/applications/rapps/rapps.rc?rev=75556&r1=7&r2=75556&view=diff
==
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/rapps.rc   
[iso-8859-1] (original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/rapps.rc   
[iso-8859-1] Tue Aug 15 19:39:20 2017
@@ -22,7 +22,7 @@
 IDI_APPUPD ICON "res/appupd.ico"
 IDI_CATEGORY ICON "res/cat.ico"
 IDI_UPDATE_DB ICON "res/updatedb.ico"
-IDI_CHECK_ALL ICON "res/checksheet.ico"
+IDI_CHECK_ALL ICON "res/select.ico"
 
 /* Categories */
 IDI_CAT_AUDIO ICON "res/cats/audio.ico"

Added: branches/GSoC_2017/rapps/reactos/base/applications/rapps/res/select.ico
URL: 
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/applications/rapps/res/select.ico?rev=75556
==
Binary file - no diff available.

Propchange: 
branches/GSoC_2017/rapps/reactos/base/applications/rapps/res/select.ico
--
svn:mime-type = application/octet-stream




[ros-diffs] [tthompson] 75557: [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() - Alloc

2017-08-15 Thread tthompson
Author: tthompson
Date: Tue Aug 15 19:57:55 2017
New Revision: 75557

URL: http://svn.reactos.org/svn/reactos?rev=75557&view=rev
Log:
[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.

Modified:
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/btree.c
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h

Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/btree.c
URL: 
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/btree.c?rev=75557&r1=75556&r2=75557&view=diff
==
--- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/btree.c[iso-8859-1] 
(original)
+++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/btree.c[iso-8859-1] 
Tue Aug 15 19:57:55 2017
@@ -78,6 +78,237 @@
 }
 
 ExFreePoolWithTag(Buffer, TAG_NTFS);
+}
+
+/**
+* @name AllocateIndexNode
+* @implemented
+*
+* Allocates a new index record in an index allocation.
+*
+* @param DeviceExt
+* Pointer to the target DEVICE_EXTENSION describing the volume the node will 
be created on.
+*
+* @param FileRecord
+* Pointer to a copy of the file record containing the index.
+*
+* @param IndexBufferSize
+* Size of an index record for this index, in bytes. Commonly defined as 4096.
+*
+* @param IndexAllocationCtx
+* Pointer to an NTFS_ATTR_CONTEXT describing the index allocation attribute 
the node will be assigned to.
+*
+* @param IndexAllocationOffset
+* Offset of the index allocation attribute relative to the file record.
+*
+* @param NewVCN
+* Pointer to a ULONGLONG which will receive the VCN of the newly-assigned 
index record
+*
+* @returns
+* STATUS_SUCCESS in case of success.
+* STATUS_NOT_IMPLEMENTED if there's no $I30 bitmap attribute in the file 
record.
+* 
+* @remarks
+* AllocateIndexNode() doesn't write any data to the index record it creates. 
Called by UpdateIndexNode().
+* Don't call PrintAllVCNs() or NtfsDumpFileRecord() after calling 
AllocateIndexNode() before UpdateIndexNode() finishes.
+*/
+NTSTATUS
+AllocateIndexNode(PDEVICE_EXTENSION DeviceExt,
+  PFILE_RECORD_HEADER FileRecord,
+  ULONG IndexBufferSize,
+  PNTFS_ATTR_CONTEXT IndexAllocationCtx,
+  ULONG IndexAllocationOffset,
+  PULONGLONG NewVCN)
+{
+NTSTATUS Status;
+PNTFS_ATTR_CONTEXT BitmapCtx;
+ULONGLONG IndexAllocationLength, BitmapLength;
+ULONG BitmapOffset;
+ULONGLONG NextNodeNumber;
+PCHAR *BitmapMem;
+ULONG *BitmapPtr;
+RTL_BITMAP Bitmap;
+ULONG BytesWritten;
+ULONG BytesNeeded;
+LARGE_INTEGER DataSize;
+
+DPRINT1("AllocateIndexNode(%p, %p, %lu, %p, %lu, %p) called.\n", DeviceExt,
+FileRecord,
+IndexBufferSize,
+IndexAllocationCtx,
+IndexAllocationOffset,
+NewVCN);
+
+// Get the length of the attribute allocation
+IndexAllocationLength = AttributeDataLength(IndexAllocationCtx->pRecord);
+
+// Find the bitmap attribute for the index
+Status = FindAttribute(DeviceExt,
+   FileRecord,
+   AttributeBitmap,
+   L"$I30",
+   4,
+   &BitmapCtx,
+   &BitmapOffset);
+if (!NT_SUCCESS(Status))
+{
+DPRINT1("FIXME: Need to add bitmap attribute!\n");
+return STATUS_NOT_IMPLEMENTED;
+}
+
+// Get the length of the bitmap attribute
+BitmapLength = AttributeDataLength(BitmapCtx->pRecord);
+
+NextNodeNumber = IndexAllocationLength / 
DeviceExt->NtfsInfo.BytesPerIndexRecord;
+
+// TODO: Find unused allocation in bitmap and use that space first
+
+// Add another bit to bitmap
+
+// See how many bytes we need to store the amount of bits we'll have
+BytesNeeded = NextNodeNumber / 8;
+if (NextNodeNumber % 8 != 0)
+BytesNeeded++;
+
+// Windows seems to allocate the bitmap in 8-byte chunks to keep any bytes 
from being wasted on padding
+ALIGN_UP(BytesNeeded, ATTR_RECORD_ALIGN

[ros-diffs] [ashaposhnikov] 75558: [RAPPS] - Close the INF file after loading the info

2017-08-15 Thread ashaposhnikov
Author: ashaposhnikov
Date: Tue Aug 15 20:47:10 2017
New Revision: 75558

URL: http://svn.reactos.org/svn/reactos?rev=75558&view=rev
Log:
[RAPPS]
- Close the INF file after loading the info

Modified:
branches/GSoC_2017/rapps/reactos/base/applications/rapps/unattended.cpp

Modified: 
branches/GSoC_2017/rapps/reactos/base/applications/rapps/unattended.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/applications/rapps/unattended.cpp?rev=75558&r1=75557&r2=75558&view=diff
==
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/unattended.cpp 
[iso-8859-1] (original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/unattended.cpp 
[iso-8859-1] Tue Aug 15 20:47:10 2017
@@ -54,6 +54,7 @@
 }
 } 
 while (SetupFindNextLine(&Context, &Context));
+SetupCloseInfFile(InfHandle);
 }
 
 CAvailableApps apps;




[ros-diffs] [ashaposhnikov] 75559: [RAPPS] - Quit CmdParser() as soon as no valid key supplied

2017-08-15 Thread ashaposhnikov
Author: ashaposhnikov
Date: Tue Aug 15 21:39:21 2017
New Revision: 75559

URL: http://svn.reactos.org/svn/reactos?rev=75559&view=rev
Log:
[RAPPS]
- Quit CmdParser() as soon as no valid key supplied

Modified:
branches/GSoC_2017/rapps/reactos/base/applications/rapps/unattended.cpp

Modified: 
branches/GSoC_2017/rapps/reactos/base/applications/rapps/unattended.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/applications/rapps/unattended.cpp?rev=75559&r1=75558&r2=75559&view=diff
==
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/unattended.cpp 
[iso-8859-1] (original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/unattended.cpp 
[iso-8859-1] Tue Aug 15 21:39:21 2017
@@ -56,6 +56,8 @@
 while (SetupFindNextLine(&Context, &Context));
 SetupCloseInfFile(InfHandle);
 }
+else
+return FALSE;
 
 CAvailableApps apps;
 apps.EnumAvailableApplications(ENUM_ALL_AVAILABLE, NULL);




[ros-diffs] [ashaposhnikov] 75560: [RAPPS] - Style changes, typo fixes etc.

2017-08-15 Thread ashaposhnikov
Author: ashaposhnikov
Date: Tue Aug 15 22:35:45 2017
New Revision: 75560

URL: http://svn.reactos.org/svn/reactos?rev=75560&view=rev
Log:
[RAPPS]
- Style changes, typo fixes etc.

Modified:
branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/available.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/crichedit.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/defines.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/dialogs.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/gui.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/misc.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/rosui.h

branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/unattended.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/winmain.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/installdlg.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/installed.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/integrity.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/loaddlg.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/misc.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/unattended.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/winmain.cpp

Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp?rev=75560&r1=75559&r2=75560&view=diff
==
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp  
[iso-8859-1] (original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp  
[iso-8859-1] Tue Aug 15 22:35:45 2017
@@ -91,7 +91,7 @@
 
 // Parse parameter string
 ATL::CStringW m_szLocale;
-int iLCID;
+INT iLCID;
 for (INT i = 0; szBuffer[i] != UNICODE_NULL; ++i)
 {
 if (szBuffer[i] != cDelimiter && szBuffer[i] != L'\n')
@@ -382,7 +382,7 @@
 ATL::CSimpleArray CAvailableApps::FindInfoList(const 
ATL::CSimpleArray &arrAppsNames)
 {
 ATL::CSimpleArray result;
-for (int i = 0; i < arrAppsNames.GetSize(); ++i)
+for (INT i = 0; i < arrAppsNames.GetSize(); ++i)
 {
 PAPPLICATION_INFO Info = FindInfo(arrAppsNames[i]);
 if (Info)
@@ -393,17 +393,17 @@
 return result;
 }
 
-const ATL::CStringW & CAvailableApps::GetFolderPath()
+const ATL::CStringW& CAvailableApps::GetFolderPath()
 {
 return m_szPath;
 }
 
-const ATL::CStringW & CAvailableApps::GetAppPath()
+const ATL::CStringW& CAvailableApps::GetAppPath()
 {
 return m_szAppsPath;
 }
 
-const ATL::CStringW & CAvailableApps::GetCabPath()
+const ATL::CStringW& CAvailableApps::GetCabPath()
 {
 return m_szCabPath;
 }

Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp?rev=75560&r1=75559&r2=75560&view=diff
==
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp
[iso-8859-1] (original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp
[iso-8859-1] Tue Aug 15 22:35:45 2017
@@ -26,7 +26,7 @@
 HWND hListView = NULL;
 
 INT
-GetSystemColorDepth(VOID)
+GetSystemColorDepth()
 {
 DEVMODEW pDevMode;
 INT ColorDepth;
@@ -236,8 +236,7 @@
 hImageList = 
ImageList_Create(TOOLBAR_HEIGHT,//GetSystemMetrics(SM_CXSMICON),
   
TOOLBAR_HEIGHT,//GetSystemMetrics(SM_CYSMICON),
   ILC_MASK | GetSystemColorDepth(),
-  1,
-  1);
+  1, 1);
 if (!hImageList)
 {
 /* TODO: Error message */
@@ -354,7 +353,7 @@
 struct SortContext
 {
 CAppsListView * lvw;
-int iSubItem;
+INT iSubItem;
 };
 
 BOOL bHasAllChecked;
@@ -845,7 +844,7 @@
 
 RECT r = {0, 0, LOWORD(lParam), HIWORD(lParam)};
 HDWP hdwp = NULL;
-int count = m_ClientPanel->CountSizableChildren();
+INT count = m_ClientPanel->CountSizableChildren();
 
 hdwp = BeginDeferWindowPos(count);
 if (hdwp)

Modified: 
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/available.h
URL: 
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/available.h?rev=75560&r1=75559&r2=75560&view=diff
==

[ros-diffs] [gadamopoulos] 75561: [SHLWAPI] -Addendum to 75533. Pass the id offset to IContextMenu::InvokeCommand. Fixes launching applications from the start menu. CORE-13680

2017-08-15 Thread gadamopoulos
Author: gadamopoulos
Date: Tue Aug 15 23:02:45 2017
New Revision: 75561

URL: http://svn.reactos.org/svn/reactos?rev=75561&view=rev
Log:
[SHLWAPI] -Addendum to 75533. Pass the id offset to 
IContextMenu::InvokeCommand. Fixes launching applications from the start menu. 
CORE-13680

Modified:
trunk/reactos/dll/win32/shlwapi/ordinal.c

Modified: trunk/reactos/dll/win32/shlwapi/ordinal.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/ordinal.c?rev=75561&r1=75560&r2=75561&view=diff
==
--- trunk/reactos/dll/win32/shlwapi/ordinal.c   [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/ordinal.c   [iso-8859-1] Tue Aug 15 
23:02:45 2017
@@ -3501,7 +3501,7 @@
   cmIci.cbSize = sizeof(cmIci);
   cmIci.fMask = CMIC_MASK_ASYNCOK;
   cmIci.hwnd = hWnd;
-  cmIci.lpVerb = MAKEINTRESOURCEA(dwCommandId);
+  cmIci.lpVerb = MAKEINTRESOURCEA(dwCommandId - 1);
   cmIci.nShow = SW_SHOWNORMAL;
 
   hRet = IContextMenu_InvokeCommand(iContext, &cmIci);