Re: [ros-dev] [ros-diffs] [tfaber] 63928: [FASTFAT] - Properly handle errors in CcInitializeCacheMap, CcCopyRead and CcCopyWrite CORE-8410

2014-08-24 Thread Jérôme Gardou

Hey Thomas

I think that you want to use _SEH2_YIELD in a few places here, that is, 
unless we want to completely ditch pseh2 in favor of pseh3 ;-)


Regards
Jérôme

Le 24/08/2014 05:28, tfa...@svn.reactos.org a écrit :

Author: tfaber
Date: Sun Aug 24 03:28:01 2014
New Revision: 63928

URL: http://svn.reactos.org/svn/reactos?rev=63928&view=rev
Log:
[FASTFAT]
- Properly handle errors in CcInitializeCacheMap, CcCopyRead and CcCopyWrite
CORE-8410

Modified:
 trunk/reactos/drivers/filesystems/fastfat/CMakeLists.txt
 trunk/reactos/drivers/filesystems/fastfat/fcb.c
 trunk/reactos/drivers/filesystems/fastfat/fsctl.c
 trunk/reactos/drivers/filesystems/fastfat/rw.c
 trunk/reactos/drivers/filesystems/fastfat/vfat.h

Modified: trunk/reactos/drivers/filesystems/fastfat/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat/CMakeLists.txt?rev=63928&r1=63927&r2=63928&view=diff
==
--- trunk/reactos/drivers/filesystems/fastfat/CMakeLists.txt[iso-8859-1] 
(original)
+++ trunk/reactos/drivers/filesystems/fastfat/CMakeLists.txt[iso-8859-1] 
Sun Aug 24 03:28:01 2014
@@ -26,6 +26,7 @@
  add_library(fastfat SHARED ${SOURCE} vfatfs.rc)
  
  set_module_type(fastfat kernelmodedriver)

+target_link_libraries(fastfat ${PSEH_LIB})
  add_importlibs(fastfat ntoskrnl hal)
  
  add_pch(fastfat vfat.h SOURCE)


Modified: trunk/reactos/drivers/filesystems/fastfat/fcb.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat/fcb.c?rev=63928&r1=63927&r2=63928&view=diff
==
--- trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] Sun Aug 24 
03:28:01 2014
@@ -340,12 +340,14 @@
  {
  PFILE_OBJECT fileObject;
  PVFATCCB newCCB;
+NTSTATUS status;
  
  fileObject = IoCreateStreamFileObject (NULL, vcb->StorageDevice);
  
  newCCB = ExAllocateFromNPagedLookasideList(&VfatGlobalData->CcbLookasideList);

  if (newCCB == NULL)
  {
+ObDereferenceObject(fileObject);
  return STATUS_INSUFFICIENT_RESOURCES;
  }
  RtlZeroMemory(newCCB, sizeof (VFATCCB));
@@ -356,11 +358,24 @@
  fcb->FileObject = fileObject;
  fcb->RefCount++;
  
-CcInitializeCacheMap(fileObject,

- (PCC_FILE_SIZES)(&fcb->RFCB.AllocationSize),
- TRUE,
- &VfatGlobalData->CacheMgrCallbacks,
- fcb);
+_SEH2_TRY
+{
+CcInitializeCacheMap(fileObject,
+ (PCC_FILE_SIZES)(&fcb->RFCB.AllocationSize),
+ TRUE,
+ &VfatGlobalData->CacheMgrCallbacks,
+ fcb);
+}
+_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+{
+status = _SEH2_GetExceptionCode();
+fcb->RefCount--;
+fcb->FileObject = NULL;
+ExFreeToNPagedLookasideList(&VfatGlobalData->CcbLookasideList, newCCB);
+ObDereferenceObject(fileObject);
+return status;
+}
+_SEH2_END;
  
  fcb->Flags |= FCB_CACHE_INITIALIZED;

  return STATUS_SUCCESS;

Modified: trunk/reactos/drivers/filesystems/fastfat/fsctl.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat/fsctl.c?rev=63928&r1=63927&r2=63928&view=diff
==
--- trunk/reactos/drivers/filesystems/fastfat/fsctl.c   [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/fsctl.c   [iso-8859-1] Sun Aug 24 
03:28:01 2014
@@ -550,11 +550,20 @@
  Fcb->RFCB.ValidDataLength = Fcb->RFCB.FileSize;
  Fcb->RFCB.AllocationSize = Fcb->RFCB.FileSize;
  
-CcInitializeCacheMap(DeviceExt->FATFileObject,

- (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
- TRUE,
- &VfatGlobalData->CacheMgrCallbacks,
- Fcb);
+_SEH2_TRY
+{
+CcInitializeCacheMap(DeviceExt->FATFileObject,
+ (PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
+ TRUE,
+ &VfatGlobalData->CacheMgrCallbacks,
+ Fcb);
+}
+_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+{
+Status = _SEH2_GetExceptionCode();
+goto ByeBye;
+}
+_SEH2_END;
  
  DeviceExt->LastAvailableCluster = 2;

  ExInitializeResourceLite(&DeviceExt->FatResource);

Modified: trunk/reactos/drivers/filesystems/fastfat/rw.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat/rw.c?rev=63928&r1=63927&r2=63928&view=diff
==
--- trunk/reactos/drivers/fil

Re: [ros-dev] [ros-diffs] [hbelusca] 63940: [MPLAY32] Implement a single-window mode for videos. Patch by Ricardo Hanke. TO ALL TRANSLATORS: Update the translations! CORE-7910 #resolve #comment Commit

2014-08-24 Thread Thomas Faber
On 2014-08-24 17:40, hbelu...@svn.reactos.org wrote:
> +mciSendCommand(wDeviceId, MCI_PUT, 
> MCI_DGV_PUT_DESTINATION | MCI_DGV_RECT | MCI_WAIT, (DWORD)&mciPut);

A DWORD cannot fit a pointer. This function takes DWORD_PTR.

___
Ros-dev mailing list
Ros-dev@reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev


Re: [ros-dev] [ros-diffs] [jgardou] 63933: [WIN32K] - Enable commented freetype call: set font face size and coordinate transformation matrix Patch by Huw Campbell, reviewed by a gazillion of people.

2014-08-24 Thread Thomas Faber
On 2014-08-24 15:28, jgar...@svn.reactos.org wrote:
> -//  FT_Set_Pixel_Sizes(ft_face,
> -// TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
> +FT_Set_Pixel_Sizes(ft_face,
> +   TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,

The abs() was added in the second version of the patch because this
way it breaks tests.
See 
https://jira.reactos.org/browse/CORE-4657?focusedCommentId=60379&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-60379

___
Ros-dev mailing list
Ros-dev@reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev


Re: [ros-dev] [ros-diffs] [tfaber] 63928: [FASTFAT] - Properly handle errors in CcInitializeCacheMap, CcCopyRead and CcCopyWrite CORE-8410

2014-08-24 Thread Thomas Faber
I can add them, but I thought PSEH2 was dead, yes.

On 2014-08-24 12:04, Jérôme Gardou wrote:
> Hey Thomas
> 
> I think that you want to use _SEH2_YIELD in a few places here, that is, 
> unless we want to completely ditch pseh2 in favor of pseh3 ;-)
> 
> Regards
> Jérôme

___
Ros-dev mailing list
Ros-dev@reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev