[PATCH] please commit this FCI work

Detlef Riekenberg wine.dev at web.de
Fri Feb 24 15:57:21 CST 2006


Am Freitag, den 24.02.2006, 14:28 +0100 schrieb Gerold J. Wucherpfennig:
> Please commit.

I have no knowledge about fci, but some code is strange:

+#define fci_set_error(A,B,C) \
+    p_fci_internal->perf->erfOper = A; \
+    p_fci_internal->perf->erfType = B; \
+    p_fci_internal->perf->fError =  C;
+

You use SetLastError() for B almost everywhere following the Macro.
Why not add this statement to the Macro?

Exceptions where you did not use SetLastError(): Macro-Parameter B is 0
- Did you mean NO_ERROR / ERROR_SUCCESS?
- Does Windows use a SetLastError(NO_ERROR) in this case?
  (Tests for cabinet.dll are only in one file: "extract.c". 
   can you add tests for fci/compress?)

When windows does a SetLastError(NO_ERROR):
   append "SetLastError(B)" to the Macro

When windows does not do a SetLastError(NO_ERROR):
   append "if (B) SetLastError(B)" to the Macro

+    /* write error */
+    fci_set_error( FCIERR_TEMP_FILE, ERROR_WRITE_FAULT, TRUE );
+    p_fci_internal->perf->erfType = ERROR_WRITE_FAULT;
+    p_fci_internal->perf->fError = TRUE;
+    SetLastError(ERROR_WRITE_FAULT);

the two p_pci_* - lines are duplicates (already done in the Macro)

btw: What should be added to the changelog?
cabinet/fci: cleanup error-handling with a MACRO


-- 
By By ...
      ... Detlef




More information about the wine-devel mailing list