Autosyncing with Wine
authorThe Wine Synchronizer <winesync@svn.reactos.org>
Tue, 4 Jul 2006 13:58:40 +0000 (13:58 +0000)
committerThe Wine Synchronizer <winesync@svn.reactos.org>
Tue, 4 Jul 2006 13:58:40 +0000 (13:58 +0000)
svn path=/trunk/; revision=22828

reactos/dll/win32/lz32/lz32.def [deleted file]
reactos/dll/win32/lz32/lz32.rbuild
reactos/dll/win32/lz32/lz32.rc [deleted file]
reactos/dll/win32/lz32/lz32.spec [new file with mode: 0644]
reactos/dll/win32/lz32/lzexpand.spec [new file with mode: 0644]
reactos/dll/win32/lz32/lzexpand16.c [new file with mode: 0644]
reactos/dll/win32/lz32/lzexpand_main.c

diff --git a/reactos/dll/win32/lz32/lz32.def b/reactos/dll/win32/lz32/lz32.def
deleted file mode 100644 (file)
index 6ecbbbe..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-; File generated automatically from lzexpand/lz32.spec; do not edit!
-
-LIBRARY lz32.dll
-
-EXPORTS
-CopyLZFile@8=KERNEL32.CopyLZFile
-GetExpandedNameA@8=KERNEL32.GetExpandedNameA
-GetExpandedNameW@8=KERNEL32.GetExpandedNameW
-LZClose@4=KERNEL32.LZClose
-;LZCloseFile
-LZCopy@8=KERNEL32.LZCopy
-;LZCreateFileW
-LZDone@0=KERNEL32.LZDone
-LZInit@4=KERNEL32.LZInit
-LZOpenFileA@12=KERNEL32.LZOpenFileA
-LZOpenFileW@12=KERNEL32.LZOpenFileW
-LZRead@12=KERNEL32.LZRead
-LZSeek@12=KERNEL32.LZSeek
-LZStart@0=KERNEL32.LZStart
index 67cd488..ec9470a 100644 (file)
@@ -1,10 +1,16 @@
-<module name="lz32" type="win32dll" baseaddress="${BASEADDRESS_LZ32}" installbase="system32" installname="lz32.dll">
-       <importlibrary definition="lz32.def" />
+<module name="lz32" type="win32dll" baseaddress="${BASEADDRESS_LZ32}" installbase="system32" installname="lz32.dll" allowwarnings="true">
+       <importlibrary definition="lz32.spec.def" />
        <include base="lz32">.</include>
-       <define name="_DISABLE_TIDENTS" />
+       <include base="ReactOS">include/reactos/wine</include>
+       <define name="__REACTOS__" />
+       <define name="__WINESRC__" />
        <define name="__USE_W32API" />
-       <library>ntdll</library>
+       <define name="_WIN32_IE">0x600</define>
+       <define name="_WIN32_WINNT">0x501</define>
+       <define name="WINVER">0x501</define>
+       <library>wine</library>
        <library>kernel32</library>
+       <library>ntdll</library>
        <file>lzexpand_main.c</file>
-       <file>lz32.rc</file>
+       <file>lz32.spec</file>
 </module>
diff --git a/reactos/dll/win32/lz32/lz32.rc b/reactos/dll/win32/lz32/lz32.rc
deleted file mode 100644 (file)
index e1a9dac..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#define REACTOS_VERSION_DLL
-#define REACTOS_STR_FILE_DESCRIPTION   "Lempel-Ziv Expander\0"
-#define REACTOS_STR_INTERNAL_NAME      "lz32\0"
-#define REACTOS_STR_ORIGINAL_FILENAME  "lz32.dll\0"
-#include <reactos/version.rc>
diff --git a/reactos/dll/win32/lz32/lz32.spec b/reactos/dll/win32/lz32/lz32.spec
new file mode 100644 (file)
index 0000000..9a89a9d
--- /dev/null
@@ -0,0 +1,12 @@
+@ stdcall CopyLZFile(long long) kernel32.CopyLZFile
+@ stdcall GetExpandedNameA(str ptr) kernel32.GetExpandedNameA
+@ stdcall GetExpandedNameW(wstr ptr) kernel32.GetExpandedNameW
+@ stdcall LZClose(long) kernel32.LZClose
+@ stdcall LZCopy(long long) kernel32.LZCopy
+@ stdcall LZDone() kernel32.LZDone
+@ stdcall LZInit(long) kernel32.LZInit
+@ stdcall LZOpenFileA(str ptr long) kernel32.LZOpenFileA
+@ stdcall LZOpenFileW(wstr ptr long) kernel32.LZOpenFileW
+@ stdcall LZRead(long ptr long) kernel32.LZRead
+@ stdcall LZSeek(long long long) kernel32.LZSeek
+@ stdcall LZStart() kernel32.LZStart
diff --git a/reactos/dll/win32/lz32/lzexpand.spec b/reactos/dll/win32/lz32/lzexpand.spec
new file mode 100644 (file)
index 0000000..51d6cca
--- /dev/null
@@ -0,0 +1,12 @@
+1  pascal   LZCopy(word word) LZCopy16
+2  pascal -ret16 LZOpenFile(str ptr word) LZOpenFile16
+3  pascal -ret16 LZInit(word) LZInit16
+4  pascal   LZSeek(word long word) LZSeek16
+5  pascal -ret16 LZRead(word ptr word) LZRead16
+6  pascal -ret16 LZClose(word) LZClose16
+7  pascal -ret16 LZStart() LZStart16
+8  pascal   CopyLZFile(word word) CopyLZFile16
+9  pascal -ret16 LZDone() LZDone16
+10 pascal -ret16 GetExpandedName(str ptr) GetExpandedName16
+#11 WEP
+#12 ___EXPORTEDSTUB
diff --git a/reactos/dll/win32/lz32/lzexpand16.c b/reactos/dll/win32/lz32/lzexpand16.c
new file mode 100644 (file)
index 0000000..5ad5284
--- /dev/null
@@ -0,0 +1,152 @@
+/*
+ * LZ Decompression functions
+ *
+ * Copyright 1996 Marcus Meissner
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "lzexpand.h"
+
+#include "wine/winbase16.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(file);
+
+#define MAX_LZSTATES 16
+
+#define IS_LZ_HANDLE(h) (((h) >= 0x400) && ((h) < 0x400+MAX_LZSTATES))
+
+
+/***********************************************************************
+ *           LZStart   (LZEXPAND.7)
+ */
+INT16 WINAPI LZStart16(void)
+{
+    TRACE("(void)\n");
+    return 1;
+}
+
+
+/***********************************************************************
+ *           LZInit   (LZEXPAND.3)
+ */
+HFILE16 WINAPI LZInit16( HFILE16 hfSrc )
+{
+    HFILE ret = LZInit( (HFILE)DosFileHandleToWin32Handle(hfSrc) );
+    if (IS_LZ_HANDLE(ret)) return ret;
+    if ((INT)ret <= 0) return ret;
+    return hfSrc;
+}
+
+
+/***********************************************************************
+ *           GetExpandedName   (LZEXPAND.10)
+ */
+INT16 WINAPI GetExpandedName16( LPSTR in, LPSTR out )
+{
+    return (INT16)GetExpandedNameA( in, out );
+}
+
+
+/***********************************************************************
+ *           LZRead   (LZEXPAND.5)
+ */
+INT16 WINAPI LZRead16( HFILE16 fd, LPVOID buf, UINT16 toread )
+{
+    if (IS_LZ_HANDLE(fd)) return LZRead( fd, buf, toread );
+    return _lread( (HFILE)DosFileHandleToWin32Handle(fd), buf, toread );
+}
+
+
+/***********************************************************************
+ *           LZSeek   (LZEXPAND.4)
+ */
+LONG WINAPI LZSeek16( HFILE16 fd, LONG off, INT16 type )
+{
+    if (IS_LZ_HANDLE(fd)) return LZSeek( fd, off, type );
+    return _llseek( (HFILE)DosFileHandleToWin32Handle(fd), off, type );
+}
+
+
+/***********************************************************************
+ *           LZCopy   (LZEXPAND.1)
+ *
+ */
+LONG WINAPI LZCopy16( HFILE16 src, HFILE16 dest )
+{
+    /* already a LZ handle? */
+    if (IS_LZ_HANDLE(src)) return LZCopy( src, (HFILE)DosFileHandleToWin32Handle(dest) );
+
+    /* no, try to open one */
+    src = LZInit16(src);
+    if ((INT16)src <= 0) return 0;
+    if (IS_LZ_HANDLE(src))
+    {
+        LONG ret = LZCopy( src, (HFILE)DosFileHandleToWin32Handle(dest) );
+        LZClose( src );
+        return ret;
+    }
+    /* it was not a compressed file */
+    return LZCopy( (HFILE)DosFileHandleToWin32Handle(src), (HFILE)DosFileHandleToWin32Handle(dest) );
+}
+
+
+/***********************************************************************
+ *           LZOpenFile   (LZEXPAND.2)
+ */
+HFILE16 WINAPI LZOpenFile16( LPSTR fn, LPOFSTRUCT ofs, UINT16 mode )
+{
+    HFILE hfret = LZOpenFileA( fn, ofs, mode );
+    /* return errors and LZ handles unmodified */
+    if ((INT)hfret <= 0) return hfret;
+    if (IS_LZ_HANDLE(hfret)) return hfret;
+    /* but allocate a dos handle for 'normal' files */
+    return Win32HandleToDosFileHandle((HANDLE)hfret);
+}
+
+
+/***********************************************************************
+ *           LZClose   (LZEXPAND.6)
+ */
+void WINAPI LZClose16( HFILE16 fd )
+{
+    if (IS_LZ_HANDLE(fd)) LZClose( fd );
+    else DisposeLZ32Handle( DosFileHandleToWin32Handle((HFILE)fd) );
+}
+
+
+/***********************************************************************
+ *           CopyLZFile   (LZEXPAND.8)
+ */
+LONG WINAPI CopyLZFile16( HFILE16 src, HFILE16 dest )
+{
+    TRACE("(%d,%d)\n",src,dest);
+    return LZCopy16(src,dest);
+}
+
+
+/***********************************************************************
+ *           LZDone   (LZEXPAND.9)
+ */
+void WINAPI LZDone16(void)
+{
+    TRACE("(void)\n");
+}
index 0d71cdb..355c97a 100644 (file)
@@ -1,29 +1 @@
-/*
- * LZ Decompression functions
- *
- * Copyright 1996 Marcus Meissner
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include "windows.h"
-
-BOOL STDCALL
-DllMain(HANDLE hDll,
-       DWORD dwReason,
-       LPVOID lpReserved)
-{
-   return TRUE;
-}
+/* Nothing here - See lzexpand.c in kernel32 */