Index: trunk/src/msvfw32/COPYING.LIB
===================================================================
--- trunk/src/msvfw32/COPYING.LIB	(revision 9140)
+++ trunk/src/msvfw32/COPYING.LIB	(revision 9140)
@@ -0,0 +1,511 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
Index: trunk/src/msvfw32/LICENSE.TXT
===================================================================
--- trunk/src/msvfw32/LICENSE.TXT	(revision 9126)
+++ trunk/src/msvfw32/LICENSE.TXT	(revision 9140)
@@ -1,28 +1,22 @@
-$Id: LICENSE.TXT,v 1.1 2001-07-21 08:57:44 sandervl Exp $
-@c This is an additional Odin license agreement.
-@c It supercedes the main Odin license, but is only valid in 
-@c the source directory in which it is present.
+$Id: LICENSE.TXT,v 1.2 2002-08-27 08:31:47 sandervl Exp $
+This is an additional Odin license agreement.
+It supercedes the main Odin license, but is only valid in 
+the source directory in which it is present.
 
-@c This file is processed by GNU's TeXinfo
-@c If you modify it or move it to another location, make sure that
-@c TeXinfo works (type `make' in directory documentation).
-
-Copyright (c) 1993-2000 the Wine project authors (see the file AUTHORS
+Copyright (c) 1993-2002 the Wine project authors (see the file AUTHORS
 for a complete list)
 
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
+Wine 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. 
 
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
+This program 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.
 
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+A copy of the GNU Lesser General Public License is included in the
+Wine distribution in the file COPYING.LIB. If you did not receive this
+copy, write to the Free Software Foundation, Inc., 59 Temple Place,
+Suite 330, Boston, MA 02111-1307 USA.
Index: trunk/src/msvfw32/drawdib.c
===================================================================
--- trunk/src/msvfw32/drawdib.c	(revision 9126)
+++ trunk/src/msvfw32/drawdib.c	(revision 9140)
@@ -1,6 +1,20 @@
-/* 
+/*
  * Copyright 2000 Bradley Baetz
  *
- * Fixme: Some flags are ignored
+ * 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
+ *
+ * FIXME: Some flags are ignored
  *
  * Handle palettes
@@ -13,10 +27,10 @@
 #include "winuser.h"
 #include "wine/winbase16.h"
-#include "debugtools.h"
+#include "wine/debug.h"
 #include "vfw.h"
 #include "vfw16.h"
 #include "windef.h"
 
-DEFAULT_DEBUG_CHANNEL(msvideo);
+WINE_DEFAULT_DEBUG_CHANNEL(msvideo);
 
 typedef struct {
@@ -37,13 +51,12 @@
 } WINE_HDD;
 
-#ifdef __WIN32OS2__
-#include <heapstring.h>
-
-#define GlobalAlloc16 GlobalAlloc
-#define GlobalLock16 GlobalLock
-#define GlobalUnlock16 GlobalUnlock
-#define GlobalFree16 GlobalFree
-
-#endif
+int num_colours(LPBITMAPINFOHEADER lpbi)
+{
+	if(lpbi->biClrUsed)
+		return lpbi->biClrUsed;
+	if(lpbi->biBitCount<=8)
+		return 1<<lpbi->biBitCount;
+	return 0;
+}
 
 /***********************************************************************
@@ -60,11 +73,4 @@
 
 /***********************************************************************
- *		DrawDibOpen		[MSVIDEO.102]
- */
-HDRAWDIB16 VFWAPI DrawDibOpen16(void) {
-	return (HDRAWDIB16)DrawDibOpen();
-}
-
-/***********************************************************************
  *		DrawDibClose		[MSVFW32.@]
  */
@@ -83,11 +89,4 @@
 	GlobalFree16(hdd);
 	return TRUE;
-}
-
-/***********************************************************************
- *		DrawDibClose		[MSVIDEO.103]
- */
-BOOL16 VFWAPI DrawDibClose16(HDRAWDIB16 hdd) {
-	return DrawDibClose(hdd);
 }
 
@@ -98,5 +97,5 @@
 	BOOL ret = TRUE;
 	WINE_HDD *whdd = GlobalLock16(hdd);
-	
+
 	TRACE("(0x%08lx)\n",(DWORD)hdd);
 
@@ -124,5 +123,5 @@
 	if (whdd->hDib)
 		DeleteObject(whdd->hDib);
-	
+
 	if (whdd->hic) {
 		ICDecompressEnd(whdd->hic);
@@ -134,11 +133,4 @@
 	GlobalUnlock16(hdd);
 	return ret;
-}
-
-/***********************************************************************
- *		DrawDibEnd		[MSVIDEO.105]
- */
-BOOL16 VFWAPI DrawDibEnd16(HDRAWDIB16 hdd) {
-	return DrawDibEnd(hdd);
 }
 
@@ -161,7 +153,7 @@
 	);
 	TRACE("lpbi: %ld,%ld/%ld,%d,%d,%ld,%ld,%ld,%ld,%ld,%ld\n",
-		  lpbi->biSize, lpbi->biWidth, lpbi->biHeight, lpbi->biPlanes, 
-		  lpbi->biBitCount, lpbi->biCompression, lpbi->biSizeImage, 
-		  lpbi->biXPelsPerMeter, lpbi->biYPelsPerMeter, lpbi->biClrUsed, 
+		  lpbi->biSize, lpbi->biWidth, lpbi->biHeight, lpbi->biPlanes,
+		  lpbi->biBitCount, lpbi->biCompression, lpbi->biSizeImage,
+		  lpbi->biXPelsPerMeter, lpbi->biYPelsPerMeter, lpbi->biClrUsed,
 		  lpbi->biClrImportant);
 
@@ -212,5 +204,5 @@
 		/* No compression */
 		TRACE("Not compressed!\n");
-		dwSize = lpbi->biSize + lpbi->biClrUsed*sizeof(RGBQUAD);
+		dwSize = lpbi->biSize + num_colours(lpbi)*sizeof(RGBQUAD);
 		whdd->lpbiOut = HeapAlloc(GetProcessHeap(),0,dwSize);
 		memcpy(whdd->lpbiOut,lpbi,dwSize);
@@ -219,5 +211,5 @@
 	if (ret) {
 		/*whdd->lpvbuf = HeapAlloc(GetProcessHeap(),0,whdd->lpbiOut->biSizeImage);*/
-		
+
 		whdd->hMemDC = CreateCompatibleDC(hdc);
 		TRACE("Creating: %ld,%p\n",whdd->lpbiOut->biSize,whdd->lpvbits);
@@ -254,18 +246,4 @@
 }
 
-/************************************************************************
- *		DrawDibBegin		[MSVIDEO.104]
- */
-BOOL16 VFWAPI DrawDibBegin16(HDRAWDIB16 hdd,
-						   HDC16      hdc,
-						   INT16      dxDst,
-						   INT16      dyDst,
-						   LPBITMAPINFOHEADER lpbi,
-						   INT16      dxSrc,
-						   INT16      dySrc,
-						   UINT16     wFlags) {
-	return DrawDibBegin(hdd,hdc,dxDst,dyDst,lpbi,dxSrc,dySrc,wFlags);
-}
-
 /**********************************************************************
  *		DrawDibDraw		[MSVFW32.@]
@@ -285,5 +263,5 @@
 	);
 
-	if (wFlags & ~(DDF_SAME_HDC | DDF_SAME_DRAW | DDF_NOTKEYFRAME | 
+	if (wFlags & ~(DDF_SAME_HDC | DDF_SAME_DRAW | DDF_NOTKEYFRAME |
 				   DDF_UPDATE | DDF_DONTDRAW))
 		FIXME("wFlags == 0x%08lx not handled\n",(DWORD)wFlags);
@@ -291,5 +269,5 @@
 	if (!lpBits) {
 		/* Undocumented? */
-		lpBits = (LPSTR)lpbi + (WORD)(lpbi->biSize) + (WORD)(lpbi->biClrUsed*sizeof(RGBQUAD));
+		lpBits = (LPSTR)lpbi + (WORD)(lpbi->biSize) + (WORD)(num_colours(lpbi)*sizeof(RGBQUAD));
 	}
 
@@ -318,14 +296,14 @@
 		if (lpbi->biCompression) {
 		    DWORD flags = 0;
-		
+
 			TRACE("Compression == 0x%08lx\n",lpbi->biCompression);
-		
+
 			if (wFlags & DDF_NOTKEYFRAME)
 			    flags |= ICDECOMPRESS_NOTKEYFRAME;
-		
+
 			ICDecompress(whdd->hic,flags,lpbi,lpBits,whdd->lpbiOut,whdd->lpvbits);
 		} else {
 		    memcpy(whdd->lpvbits,lpBits,lpbi->biSizeImage);
-		}	
+		}
 	}
 	if (!(wFlags & DDF_DONTDRAW) && whdd->hpal)
@@ -337,23 +315,4 @@
 	GlobalUnlock16(hdd);
 	return ret;
-}
-
-/**********************************************************************
- *		DrawDibDraw		[MSVIDEO.106]
- */
-BOOL16 VFWAPI DrawDibDraw16(HDRAWDIB16 hdd,             
-						  HDC16 hdc,
-						  INT16 xDst,
-						  INT16 yDst,
-						  INT16 dxDst,
-						  INT16 dyDst,
-						  LPBITMAPINFOHEADER lpbi,
-						  LPVOID lpBits,
-						  INT16 xSrc,
-						  INT16 ySrc,
-						  INT16 dxSrc,
-						  INT16 dySrc,
-						  UINT16 wFlags) {
-	return DrawDibDraw(hdd,hdc,xDst,yDst,dxDst,dyDst,lpbi,lpBits,xSrc,ySrc,dxSrc,dySrc,wFlags);
 }
 
@@ -367,11 +326,4 @@
 
 /*************************************************************************
- *		DrawDibStart		[MSVIDEO.118]
- */
-BOOL16 VFWAPI DrawDibStart16(HDRAWDIB16 hdd, DWORD rate) {
-	return DrawDibStart(hdd,rate);
-}
-
-/*************************************************************************
  *		DrawDibStop		[MSVFW32.@]
  */
@@ -381,11 +333,4 @@
 }
 
-/*************************************************************************
- *		DrawDibStop		[MSVIDEO.119]
- */
-BOOL16 DrawDibStop16(HDRAWDIB16 hdd) {
-	return DrawDibStop(hdd);
-}
-
 /***********************************************************************
  *              DrawDibSetPalette       [MSVFW32.@]
@@ -398,5 +343,5 @@
 	whdd = GlobalLock16(hdd);
 	whdd->hpal = hpal;
-	
+
 	if (whdd->begun) {
 		SelectPalette(whdd->hdc,hpal,0);
@@ -408,11 +353,4 @@
 
 /***********************************************************************
- *              DrawDibSetPalette       [MSVIDEO.110]
- */
-BOOL16 VFWAPI DrawDibSetPalette16(HDRAWDIB16 hdd, HPALETTE16 hpal) {
-	return DrawDibSetPalette(hdd,hpal);
-}
-
-/***********************************************************************
  *              DrawDibGetPalette       [MSVFW32.@]
  */
@@ -430,11 +368,4 @@
 
 /***********************************************************************
- *              DrawDibGetPalette       [MSVIDEO.108]
- */
-HPALETTE16 VFWAPI DrawDibGetPalette16(HDRAWDIB16 hdd) {
-	return (HPALETTE16)DrawDibGetPalette(hdd);
-}
-
-/***********************************************************************
  *              DrawDibRealize          [MSVFW32.@]
  */
@@ -445,5 +376,5 @@
 
 	FIXME("(%d,0x%08lx,%d), stub\n",hdd,(DWORD)hdc,fBackground);
-	
+
 	whdd = GlobalLock16(hdd);
 
@@ -452,5 +383,5 @@
 		goto out;
 	}
-	
+
 	if (!whdd->hpal)
 		whdd->hpal = CreateHalftonePalette(hdc);
@@ -458,5 +389,5 @@
 	oldPal = SelectPalette(hdc,whdd->hpal,fBackground);
 	ret = RealizePalette(hdc);
-	
+
  out:
 	GlobalUnlock16(hdd);
@@ -465,9 +396,2 @@
 	return ret;
 }
-
-/***********************************************************************
- *              DrawDibRealize          [MSVIDEO.112]
- */
-UINT16 VFWAPI DrawDibRealize16(HDRAWDIB16 hdd, HDC16 hdc, BOOL16 fBackground) {
-	return (UINT16)DrawDibRealize(hdd,hdc,fBackground);
-}
Index: trunk/src/msvfw32/makefile
===================================================================
--- trunk/src/msvfw32/makefile	(revision 9126)
+++ trunk/src/msvfw32/makefile	(revision 9140)
@@ -1,3 +1,3 @@
-# $Id: makefile,v 1.12 2001-07-21 17:39:44 sandervl Exp $
+# $Id: makefile,v 1.13 2002-08-27 08:31:48 sandervl Exp $
 
 #
@@ -21,4 +21,5 @@
 $(OBJDIR)\drawdib.obj \
 $(OBJDIR)\msvideo_main.obj \
+$(OBJDIR)\mciwnd.obj \
 $(OBJDIR)\msvfw32rsrc.obj \
 $(DLLENTRY)
@@ -31,4 +32,5 @@
 $(ODIN32_LIB)/kernel32.lib \
 $(ODIN32_LIB)/user32.lib \
+$(ODIN32_LIB)/comctl32.lib \
 $(ODIN32_LIB)/version.lib \
 $(ODIN32_LIB)/gdi32.lib \
Index: trunk/src/msvfw32/mciwnd.c
===================================================================
--- trunk/src/msvfw32/mciwnd.c	(revision 9140)
+++ trunk/src/msvfw32/mciwnd.c	(revision 9140)
@@ -0,0 +1,346 @@
+/*
+ * Copyright 2000 Eric Pouech
+ *
+ *
+ * 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 <stdio.h>
+#include <string.h>
+
+#include "winbase.h"
+#include "windef.h"
+#include "winnls.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "vfw.h"
+#include "wine/mmsystem16.h"
+#include "digitalv.h"
+#include "commctrl.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(mci);
+
+typedef struct {
+   DWORD	dwStyle;
+   MCIDEVICEID	mci;
+   LPSTR	lpName;
+   HWND		hWnd;
+   UINT		uTimer;
+} MCIWndInfo;
+
+static LRESULT WINAPI	MCIWndProc(HWND hWnd, UINT wMsg, WPARAM lParam1, LPARAM lParam2);
+
+#define CTL_PLAYSTOP	0x3200
+#define CTL_MENU	0x3201
+#define CTL_TRACKBAR	0x3202
+
+/***********************************************************************
+ *		MCIWndRegisterClass		[MSVFW32.@]
+ */
+BOOL WINAPI MCIWndRegisterClass(HINSTANCE hInst)
+{
+   WNDCLASSA		wc;
+
+   /* since window creation will also require some common controls, init them */
+   InitCommonControls();
+
+   wc.style = 0;
+   wc.lpfnWndProc = MCIWndProc;
+   wc.cbClsExtra = 0;
+   wc.cbWndExtra = sizeof(MCIWndInfo*);
+   wc.hInstance = hInst;
+   wc.hIcon = 0;
+   wc.hCursor = 0;
+   wc.hbrBackground = 0;
+   wc.lpszMenuName = NULL;
+   wc.lpszClassName = "MCIWndClass";
+
+   return RegisterClassA(&wc);
+
+}
+
+/***********************************************************************
+ *		MCIWndCreate		[MSVFW32.@]
+ *		MCIWndCreateA		[MSVFW32.@]
+ */
+HWND VFWAPIV MCIWndCreateA(HWND hwndParent, HINSTANCE hInstance,
+			   DWORD dwStyle, LPCSTR szFile)
+{
+   DWORD	wndStyle;
+   MCIWndInfo*	mwi;
+
+   TRACE("%x %x %lx %s\n", hwndParent, hInstance, dwStyle, szFile);
+
+   MCIWndRegisterClass(hInstance);
+
+   mwi = HeapAlloc(GetProcessHeap(), 0, sizeof(*mwi));
+   if (!mwi) return 0;
+
+   mwi->dwStyle = dwStyle;
+   if (szFile)
+     mwi->lpName = strcpy(HeapAlloc(GetProcessHeap(), 0, strlen(szFile) + 1), szFile);
+   else
+     mwi->lpName = NULL;
+   mwi->uTimer = 0;
+
+   wndStyle = ((hwndParent) ? (WS_CHILD|WS_BORDER) : WS_OVERLAPPEDWINDOW) |
+              WS_VISIBLE | (dwStyle & 0xFFFF0000);
+
+   if (CreateWindowExA(0, "MCIWndClass", NULL, wndStyle,
+		       CW_USEDEFAULT, CW_USEDEFAULT,
+		       CW_USEDEFAULT, CW_USEDEFAULT,
+		       hwndParent, (HMENU)0, hInstance, mwi))
+      return mwi->hWnd;
+
+   if(mwi->lpName) HeapFree(GetProcessHeap(), 0, mwi->lpName);
+   HeapFree(GetProcessHeap(), 0, mwi);
+   return 0;
+}
+
+/***********************************************************************
+ *		MCIWndCreateW				[MSVFW32.@]
+ */
+HWND VFWAPIV MCIWndCreateW(HWND hwndParent, HINSTANCE hInstance,
+			   DWORD dwStyle, LPCWSTR szFile)
+{
+   FIXME("%x %x %lx %s\n", hwndParent, hInstance, dwStyle, debugstr_w(szFile));
+
+   MCIWndRegisterClass(hInstance);
+
+   return 0;
+}
+
+static DWORD MCIWND_GetStatus(MCIWndInfo* mwi)
+{
+   MCI_DGV_STATUS_PARMSA	mdsp;
+
+   memset(&mdsp, 0, sizeof(mdsp));
+   mdsp.dwItem = MCI_STATUS_MODE;
+   if (mciSendCommandA(mwi->mci, MCI_STATUS, MCI_WAIT|MCI_STATUS_ITEM, (DWORD)&mdsp))
+      return MCI_MODE_NOT_READY;
+   if (mdsp.dwReturn == MCI_MODE_STOP && mwi->uTimer) {
+      TRACE("Killing timer\n");
+      KillTimer(mwi->hWnd, 0);
+      mwi->uTimer = 0;
+   }
+   return mdsp.dwReturn;
+}
+
+static DWORD MCIWND_Get(MCIWndInfo* mwi, DWORD what)
+{
+   MCI_DGV_STATUS_PARMSA	mdsp;
+
+   memset(&mdsp, 0, sizeof(mdsp));
+   mdsp.dwItem = what;
+   if (mciSendCommandA(mwi->mci, MCI_STATUS, MCI_WAIT|MCI_STATUS_ITEM, (DWORD)&mdsp))
+      return 0;
+   return mdsp.dwReturn;
+}
+
+static void MCIWND_SetText(MCIWndInfo* mwi)
+{
+   char	buffer[1024];
+
+   if (mwi->dwStyle & MCIWNDF_SHOWNAME) {
+      strcpy(buffer, mwi->lpName);
+   } else {
+      *buffer = 0;
+   }
+
+   if (mwi->dwStyle & (MCIWNDF_SHOWPOS|MCIWNDF_SHOWMODE)) {
+      if (*buffer) strcat(buffer, " ");
+      strcat(buffer, "(");
+   }
+
+   if (mwi->dwStyle & MCIWNDF_SHOWPOS) {
+      sprintf(buffer + strlen(buffer), "%ld", MCIWND_Get(mwi, MCI_STATUS_POSITION));
+   }
+
+   if ((mwi->dwStyle & (MCIWNDF_SHOWPOS|MCIWNDF_SHOWMODE)) == (MCIWNDF_SHOWPOS|MCIWNDF_SHOWMODE)) {
+      strcat(buffer, " - ");
+   }
+
+   if (mwi->dwStyle & MCIWNDF_SHOWMODE) {
+      switch (MCIWND_GetStatus(mwi)) {
+      case MCI_MODE_NOT_READY: 	strcat(buffer, "not ready");	break;
+      case MCI_MODE_PAUSE:	strcat(buffer, "paused");	break;
+      case MCI_MODE_PLAY:	strcat(buffer, "playing");	break;
+      case MCI_MODE_STOP:	strcat(buffer, "stopped");	break;
+      case MCI_MODE_OPEN:	strcat(buffer, "open");		break;
+      case MCI_MODE_RECORD:	strcat(buffer, "recording");	break;
+      case MCI_MODE_SEEK:	strcat(buffer, "seeking");	break;
+      default:			strcat(buffer, "???");		break;
+      }
+   }
+   if (mwi->dwStyle & (MCIWNDF_SHOWPOS|MCIWNDF_SHOWMODE)) {
+      strcat(buffer, " )");
+   }
+   TRACE("=> '%s'\n", buffer);
+   SetWindowTextA(mwi->hWnd, buffer);
+}
+
+static void MCIWND_Create(HWND hWnd, LPCREATESTRUCTA cs)
+{
+   MCI_DGV_OPEN_PARMSA	mdopn;
+   MCI_DGV_RECT_PARMS	mdrct;
+   MMRESULT		mmr;
+   int			cx, cy;
+   HWND			hChld;
+   MCIWndInfo* 		mwi = (MCIWndInfo*)cs->lpCreateParams;
+
+   SetWindowLongA(hWnd, 0, (LPARAM)mwi);
+   mwi->hWnd = hWnd;
+
+   /* now open MCI player for AVI file */
+   memset(&mdopn, 0, sizeof(mdopn));
+   mdopn.lpstrElementName = mwi->lpName;
+   mdopn.dwStyle = WS_VISIBLE|WS_CHILD;
+   mdopn.hWndParent = hWnd;
+
+   mmr = mciSendCommandA(0,  MCI_OPEN, MCI_OPEN_ELEMENT|MCI_DGV_OPEN_PARENT|MCI_DGV_OPEN_WS, (LPARAM)&mdopn);
+   if (mmr) {
+      MessageBoxA(GetTopWindow(hWnd), "Cannot open file", "MciWnd", MB_OK);
+      return;
+   }
+   mwi->mci = mdopn.wDeviceID;
+
+   /* grab AVI window size */
+   memset(&mdrct, 0, sizeof(mdrct));
+   mmr = mciSendCommandA(mwi->mci,  MCI_WHERE, MCI_DGV_WHERE_DESTINATION, (LPARAM)&mdrct);
+   if (mmr) {
+      WARN("Cannot get window rect\n");
+      return;
+   }
+   cx = mdrct.rc.right - mdrct.rc.left;
+   cy = mdrct.rc.bottom - mdrct.rc.top;
+
+   AdjustWindowRect(&mdrct.rc, GetWindowLongA(hWnd, GWL_STYLE), FALSE);
+   SetWindowPos(hWnd, 0, 0, 0, mdrct.rc.right - mdrct.rc.left,
+		mdrct.rc.bottom - mdrct.rc.top + 32, SWP_NOMOVE|SWP_NOZORDER);
+
+   /* adding the other elements: play/stop button, menu button, status */
+   hChld = CreateWindowExA(0, "BUTTON", "Play", WS_CHILD|WS_VISIBLE, 0, cy, 32, 32,
+			   hWnd, (HMENU)CTL_PLAYSTOP, GetWindowLongA(hWnd, GWL_HINSTANCE), 0L);
+   TRACE("Get Button1: %04x\n", hChld);
+   hChld = CreateWindowExA(0, "BUTTON", "Menu", WS_CHILD|WS_VISIBLE, 32, cy, 32, 32,
+			   hWnd, (HMENU)CTL_MENU, GetWindowLongA(hWnd, GWL_HINSTANCE), 0L);
+   TRACE("Get Button2: %04x\n", hChld);
+   hChld = CreateWindowExA(0, TRACKBAR_CLASSA, "", WS_CHILD|WS_VISIBLE, 64, cy, cx - 64, 32,
+			   hWnd, (HMENU)CTL_TRACKBAR, GetWindowLongA(hWnd, GWL_HINSTANCE), 0L);
+   TRACE("Get status: %04x\n", hChld);
+   SendMessageA(hChld, TBM_SETRANGEMIN, 0L, 0L);
+   SendMessageA(hChld, TBM_SETRANGEMAX, 1L, MCIWND_Get(mwi, MCI_STATUS_LENGTH));
+
+   /* FIXME: no need to set it if child window */
+   MCIWND_SetText(mwi);
+}
+
+static void MCIWND_Paint(MCIWndInfo* mwi, WPARAM wParam)
+{
+   HDC 		hdc;
+   PAINTSTRUCT	ps;
+
+   hdc = (wParam) ? (HDC)wParam : BeginPaint(mwi->hWnd, &ps);
+   /* something to do ? */
+   if (!wParam) EndPaint(mwi->hWnd, &ps);
+}
+
+static void MCIWND_ToggleState(MCIWndInfo* mwi)
+{
+   MCI_GENERIC_PARMS	mgp;
+   MCI_DGV_PLAY_PARMS	mdply;
+
+   memset(&mgp, 0, sizeof(mgp));
+   memset(&mdply, 0, sizeof(mdply));
+
+   switch (MCIWND_GetStatus(mwi)) {
+   case MCI_MODE_NOT_READY:
+   case MCI_MODE_RECORD:
+   case MCI_MODE_SEEK:
+   case MCI_MODE_OPEN:
+      TRACE("Cannot do much...\n");
+      break;
+   case MCI_MODE_PAUSE:
+      mciSendCommandA(mwi->mci, MCI_RESUME, MCI_WAIT, (LPARAM)&mgp);
+      break;
+   case MCI_MODE_PLAY:
+      mciSendCommandA(mwi->mci, MCI_PAUSE, MCI_WAIT, (LPARAM)&mgp);
+      break;
+   case MCI_MODE_STOP:
+      mdply.dwFrom = 0L;
+      mciSendCommandA(mwi->mci, MCI_PLAY, MCI_FROM, (LPARAM)&mdply);
+      mwi->uTimer = SetTimer(mwi->hWnd, 0, 333, 0L);
+      TRACE("Timer=%u\n", mwi->uTimer);
+      break;
+   }
+}
+
+static LRESULT MCIWND_Command(MCIWndInfo* mwi, WPARAM wParam, LPARAM lParam)
+{
+   switch (LOWORD(wParam)) {
+   case CTL_PLAYSTOP:	MCIWND_ToggleState(mwi);	break;
+   case CTL_MENU:
+   case CTL_TRACKBAR:
+   default:
+      MessageBoxA(0, "ooch", "NIY", MB_OK);
+   }
+   return 0L;
+}
+
+static void MCIWND_Timer(MCIWndInfo* mwi, WPARAM wParam, LPARAM lParam)
+{
+   TRACE("%ld\n", MCIWND_Get(mwi, MCI_STATUS_POSITION));
+   SendDlgItemMessageA(mwi->hWnd, CTL_TRACKBAR, TBM_SETPOS, 1, MCIWND_Get(mwi, MCI_STATUS_POSITION));
+   MCIWND_SetText(mwi);
+}
+
+static void MCIWND_Close(MCIWndInfo* mwi)
+{
+   MCI_GENERIC_PARMS	mgp;
+
+   memset(&mgp, 0, sizeof(mgp));
+
+   mciSendCommandA(mwi->mci, MCI_CLOSE, 0, (LPARAM)&mgp);
+}
+
+static LRESULT WINAPI	MCIWndProc(HWND hWnd, UINT wMsg, WPARAM lParam1, LPARAM lParam2)
+{
+   MCIWndInfo*	mwi = (MCIWndInfo*)GetWindowLongA(hWnd, 0);
+
+   if (mwi || wMsg == WM_CREATE) {
+      switch (wMsg) {
+      case WM_CREATE:
+	 MCIWND_Create(hWnd, (CREATESTRUCTA*)lParam2);
+	 return 0;
+      case WM_DESTROY:
+	 MCIWND_Close(mwi);
+	 HeapFree(GetProcessHeap(), 0, mwi->lpName);
+	 HeapFree(GetProcessHeap(), 0, mwi);
+	 break;
+      case WM_PAINT:
+	 MCIWND_Paint(mwi, lParam1);
+	 break;
+      case WM_COMMAND:
+	 return MCIWND_Command(mwi, lParam1, lParam2);
+      case WM_TIMER:
+	 MCIWND_Timer(mwi, lParam1, lParam2);
+	 return TRUE;
+      }
+   }
+
+   return DefWindowProcA(hWnd, wMsg, lParam1, lParam2);
+}
+
Index: trunk/src/msvfw32/msvfw32.cpp
===================================================================
--- trunk/src/msvfw32/msvfw32.cpp	(revision 9126)
+++ trunk/src/msvfw32/msvfw32.cpp	(revision 9140)
@@ -1,3 +1,3 @@
-/* $Id: msvfw32.cpp,v 1.8 2001-07-21 17:39:44 sandervl Exp $ */
+/* $Id: msvfw32.cpp,v 1.9 2002-08-27 08:31:48 sandervl Exp $ */
 /*
  * Copyright 1998 Marcus Meissner
@@ -160,40 +160,4 @@
 
 /****************************************************************************
- *    ICImageCompress     [MSVFW.31]
- */
-HANDLE VFWAPI ICImageCompress(
-        HIC                 hic,        // compressor to use
-        UINT                uiFlags,    // flags (none yet)
-        LPBITMAPINFO      lpbiIn,     // format to compress from
-        LPVOID              lpBits,     // data to compress
-        LPBITMAPINFO        lpbiOut,    // compress to this (NULL ==> default)
-        LONG                lQuality,   // quality to use
-        LONG  *             plSize)     // compress to this size (0=whatever)
-{
-#ifdef DEBUG
-    dprintf(("MSVFW32: ICImageCompress not implemented\n"));
-#endif
-  return 0;
-}
-
-
-/****************************************************************************
- *    ICImageDecompress   [MSVFW.32]
- */
-HANDLE VFWAPI ICImageDecompress(
-        HIC                 hic,        // compressor to use
-        UINT                uiFlags,    // flags (none yet)
-        LPBITMAPINFO        lpbiIn,     // format to decompress from
-        LPVOID              lpBits,     // data to decompress
-        LPBITMAPINFO        lpbiOut)    // decompress to this (NULL ==> default)
-{
-#ifdef DEBUG
-    dprintf(("MSVFW32: ICImageDecompress not implemented\n"));
-#endif
-  return 0;
-}
-
-
-/****************************************************************************
  *    ICInstall     [MSVFW.34]
  */
Index: trunk/src/msvfw32/msvideo_main.c
===================================================================
--- trunk/src/msvfw32/msvideo_main.c	(revision 9126)
+++ trunk/src/msvfw32/msvideo_main.c	(revision 9140)
@@ -1,5 +1,19 @@
 /*
  * Copyright 1998 Marcus Meissner
- * Copyright 2000 Bradley Baetz 
+ * Copyright 2000 Bradley Baetz
+ *
+ * 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
  *
  * FIXME: This all assumes 32 bit codecs
@@ -20,31 +34,23 @@
 #include "vfw16.h"
 #include "wine/winbase16.h"
-#include "debugtools.h"
-#include "heap.h"
+#include "wine/debug.h"
 #include "stackframe.h"
 
-DEFAULT_DEBUG_CHANNEL(msvideo);
+WINE_DEFAULT_DEBUG_CHANNEL(msvideo);
 
 #ifdef __WIN32OS2__
-#include <heapstring.h>
-
-#define GlobalAlloc16 GlobalAlloc
-#define GlobalLock16 GlobalLock
-#define GlobalUnlock16 GlobalUnlock
-#define GlobalFree16 GlobalFree
-#undef SEGPTR_NEW
-#define SEGPTR_NEW(a)	malloc(sizeof(a))
-#define SEGPTR_FREE(a)  free(a)
-#define SEGPTR_GET(a)   a
-
-#endif
-
+#define MSVIDEO_CallTo16_long_lwwll(a,b,c,d,e,f) 0
+#else
 /* ### start build ### */
 extern LONG CALLBACK MSVIDEO_CallTo16_long_lwwll(FARPROC16,LONG,WORD,WORD,LONG,LONG);
 /* ### stop build ### */
+#endif
 
 LPVOID MSVIDEO_MapMsg16To32(UINT msg, LPDWORD lParam1, LPDWORD lParam2);
 void MSVIDEO_UnmapMsg16To32(UINT msg, LPVOID lpv, LPDWORD lParam1, LPDWORD lParam2);
 LRESULT MSVIDEO_SendMessage(HIC hic, UINT msg, DWORD lParam1, DWORD lParam2, BOOL bFrom32);
+
+#define HDRVR_16(h32)		(LOWORD(h32))
+
 
 /***********************************************************************
@@ -162,5 +168,5 @@
 	return FALSE;
 }
-#ifndef __WIN32OS2__
+
 /***********************************************************************
  *		ICInfo				[MSVIDEO.200]
@@ -182,8 +188,8 @@
 
 	MSVIDEO_UnmapMsg16To32(ICM_GETINFO,lpv,&lParam,&size);
-	
+
 	return ret;
 }
-#endif
+
 /***********************************************************************
  *		ICOpen				[MSVFW32.@]
@@ -203,5 +209,5 @@
 	sprintf(codecname,"%s.%s",type,handler);
 
-	/* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the 
+	/* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the
 	 * same layout as ICOPEN
 	 */
@@ -239,5 +245,6 @@
 	char	type[5],handler[5],codecname[20];
 	HIC16	hic;
-	ICOPEN*  icopen = SEGPTR_NEW(ICOPEN);
+        ICOPEN icopen;
+        SEGPTR seg_icopen;
 	WINE_HIC	*whic;
 
@@ -245,11 +252,11 @@
 	memcpy(handler,&fccHandler,4);handler[4]=0;
 	TRACE("(%s,%s,%d,%p,%d)\n",type,handler,wMode,lpfnHandler,bFrom32?32:16);
-	
-	icopen->fccType		= fccType;
-	icopen->fccHandler	= fccHandler;
-	icopen->dwSize		= sizeof(ICOPEN);
-	icopen->dwFlags		= wMode;
-	
-	sprintf(codecname,"%s.%s",type,handler);
+
+        icopen.fccType    = fccType;
+        icopen.fccHandler = fccHandler;
+        icopen.dwSize     = sizeof(ICOPEN);
+        icopen.dwFlags    = wMode;
+
+        sprintf(codecname,"%s.%s",type,handler);
 
 	hic = GlobalAlloc16(GHND,sizeof(WINE_HIC));
@@ -258,5 +265,5 @@
 	whic = GlobalLock16(hic);
 	whic->driverproc = lpfnHandler;
-	
+
 #ifdef __WIN32OS2__
 	whic->privatevfw	= bFrom32;
@@ -264,8 +271,7 @@
 	whic->private = bFrom32;
 #endif
-	
 	/* Now try opening/loading the driver. Taken from DRIVER_AddToList */
 	/* What if the function is used more than once? */
-	
+
 	if (MSVIDEO_SendMessage(hic,DRV_LOAD,0L,0L,bFrom32) != DRV_SUCCESS) {
 		WARN("DRV_LOAD failed for hic 0x%08lx\n",(DWORD)hic);
@@ -276,5 +282,7 @@
 	MSVIDEO_SendMessage(hic,DRV_ENABLE,0L,0L,bFrom32);
 
-	whic->hdrv = MSVIDEO_SendMessage(hic,DRV_OPEN,0,(LPARAM)(SEGPTR_GET(icopen)),FALSE);
+        seg_icopen = MapLS( &icopen );
+        whic->hdrv = (HDRVR)MSVIDEO_SendMessage(hic,DRV_OPEN,0,seg_icopen,FALSE);
+        UnMapLS( seg_icopen );
 	if (whic->hdrv == 0) {
 		WARN("DRV_OPEN failed for hic 0x%08lx\n",(DWORD)hic);
@@ -295,12 +303,4 @@
 }
 
-#ifndef __WIN32OS2__
-/***********************************************************************
- *		ICOpen				[MSVIDEO.203]
- */
-HIC16 VFWAPI ICOpen16(DWORD fccType, DWORD fccHandler, UINT16 wMode) {
-	return (HIC16)ICOpen(fccType, fccHandler, wMode);
-}
-
 /***********************************************************************
  *		ICOpenFunction			[MSVIDEO.206]
@@ -310,5 +310,4 @@
 	return MSVIDEO_OpenFunc(fccType, fccHandler, wMode, (FARPROC)lpfnHandler,FALSE);
 }
-#endif
 
 /***********************************************************************
@@ -323,18 +322,4 @@
 	return ret;
 }
-
-#ifndef __WIN32OS2__
-/***********************************************************************
- *		ICGetInfo			[MSVIDEO.212]
- */
-LRESULT VFWAPI ICGetInfo16(HIC16 hic, ICINFO16 *picinfo,DWORD cb) {
-	LRESULT		ret;
-
-	TRACE("(0x%08lx,%p,%ld)\n",(DWORD)hic,picinfo,cb);
-	ret = ICSendMessage16(hic,ICM_GETINFO,(DWORD)picinfo,cb);
-	TRACE("	-> 0x%08lx\n",ret);
-	return ret;
-}
-#endif
 
 /***********************************************************************
@@ -357,5 +342,5 @@
 	switch (wMode) {
 	case ICMODE_FASTCOMPRESS:
-	case ICMODE_COMPRESS: 
+	case ICMODE_COMPRESS:
 		querymsg = ICM_COMPRESS_QUERY;
 		break;
@@ -385,5 +370,5 @@
 	/* Now try each driver in turn. 32 bit codecs only. */
 	/* FIXME: Move this to an init routine? */
-	
+
 	pszBuffer = (LPSTR)HeapAlloc(GetProcessHeap(),0,1024);
 	if (GetPrivateProfileSectionA("drivers32",pszBuffer,1024,"system.ini")) {
@@ -408,5 +393,5 @@
 	}
 	HeapFree(GetProcessHeap(),0,pszBuffer);
-	
+
 	if (fccType==streamtypeVIDEO) {
 		hic = ICLocate(ICTYPE_VIDEO,fccHandler,lpbiIn,lpbiOut,wMode);
@@ -420,14 +405,4 @@
 }
 
-#ifndef __WIN32OS2__
-/***********************************************************************
- *		ICLocate			[MSVIDEO.213]
- */
-HIC16 VFWAPI ICLocate16(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn,
-						LPBITMAPINFOHEADER lpbiOut, WORD wFlags) {
-	return (HIC16)ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, wFlags);
-}
-#endif
-
 /***********************************************************************
  *		ICGetDisplayFormat			[MSVFW32.@]
@@ -437,5 +412,5 @@
 	INT depth,INT dx,INT dy)
 {
-	HIC	tmphic = hic; 
+	HIC	tmphic = hic;
 
 	FIXME("(0x%08lx,%p,%p,%d,%d,%d),stub!\n",(DWORD)hic,lpbiIn,lpbiOut,depth,dx,dy);
@@ -474,5 +449,5 @@
 	if (lpbiIn->biBitCount == 8)
 		depth = 8;
-	
+
 	TRACE("=> 0x%08lx\n",(DWORD)tmphic);
 	return tmphic;
@@ -484,14 +459,4 @@
 	return 0;
 }
-
-#ifndef __WIN32OS2__
-/***********************************************************************
- *		ICGetDisplayFormat			[MSVIDEO.239]
- */
-HIC16 VFWAPI ICGetDisplayFormat16(HIC16 hic, LPBITMAPINFOHEADER lpbiIn,
-								  LPBITMAPINFOHEADER lpbiOut, INT16 depth, INT16 dx, INT16 dy) {
-	return (HIC16)ICGetDisplayFormat(hic,lpbiIn,lpbiOut,depth,dx,dy);
-}
-#endif
 
 /***********************************************************************
@@ -526,38 +491,4 @@
 }
 
-#ifndef __WIN32OS2__
-/***********************************************************************
- *		_ICCompress			[MSVIDEO.224]
- */
-DWORD VFWAPIV ICCompress16(HIC16 hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiOutput, LPVOID lpData,
-						   LPBITMAPINFOHEADER lpbiInput, LPVOID lpBits, LPDWORD lpckid,
-						   LPDWORD lpdwFlags, LONG lFrameNum, DWORD dwFrameSize, DWORD dwQuality,
-						   LPBITMAPINFOHEADER lpbiPrev, LPVOID lpPrev) {
-
-	DWORD ret;
-	ICCOMPRESS *iccmp = SEGPTR_NEW(ICCOMPRESS);
-
-	TRACE("(0x%08lx,%ld,%p,%p,%p,%p,...)\n",(DWORD)hic,dwFlags,lpbiOutput,lpData,lpbiInput,lpBits);
-
-	iccmp->dwFlags		= dwFlags;
-
-	iccmp->lpbiOutput	= lpbiOutput;
-	iccmp->lpOutput		= lpData;
-	iccmp->lpbiInput		= lpbiInput;
-	iccmp->lpInput		= lpBits;
-
-	iccmp->lpckid		= lpckid;
-	iccmp->lpdwFlags		= lpdwFlags;
-	iccmp->lFrameNum		= lFrameNum;
-	iccmp->dwFrameSize	= dwFrameSize;
-	iccmp->dwQuality		= dwQuality;
-	iccmp->lpbiPrev		= lpbiPrev;
-	iccmp->lpPrev		= lpPrev;
-	ret = ICSendMessage16(hic,ICM_COMPRESS,(DWORD)SEGPTR_GET(iccmp),sizeof(ICCOMPRESS));
-	SEGPTR_FREE(iccmp);
-	return ret;
-}
-#endif
-
 /***********************************************************************
  *		ICDecompress			[MSVFW32.@]
@@ -589,29 +520,4 @@
 }
 
-#ifndef __WIN32OS2__
-/***********************************************************************
- *		_ICDecompress			[MSVIDEO.230]
- */
-DWORD VFWAPIV ICDecompress16(HIC16 hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiFormat,
-							 LPVOID lpData, LPBITMAPINFOHEADER lpbi, LPVOID lpBits) {
-
-	ICDECOMPRESS *icd = SEGPTR_NEW(ICDECOMPRESS);
-	DWORD ret;
-	
-	TRACE("(0x%08lx,%ld,%p,%p,%p,%p)\n",(DWORD)hic,dwFlags,lpbiFormat,lpData,lpbi,lpBits);
-
-	icd->dwFlags = dwFlags;
-	icd->lpbiInput = lpbiFormat;
-	icd->lpInput = lpData;
-	icd->lpbiOutput = lpbi;
-	icd->lpOutput = lpBits;
-	icd->ckid = 0;
-
-	ret = ICSendMessage16(hic,ICM_DECOMPRESS,(DWORD)SEGPTR_GET(icd),sizeof(ICDECOMPRESS));
-
-	SEGPTR_FREE(icd);
-	return ret;
-}
-
 #define COPY(x,y) (x->y = x##16->y);
 #define COPYPTR(x,y) (x->y = MapSL((SEGPTR)x##16->y));
@@ -623,5 +529,5 @@
 	ICDECOMPRESSEX16 *icdx16 = MapSL(*lParam);
 	ret = icdx16;
-	
+
 	COPY(icdx,dwFlags);
 	COPYPTR(icdx,lpbiSrc);
@@ -637,5 +543,5 @@
 	COPY(icdx,dxSrc);
 	COPY(icdx,dySrc);
-	
+
 	*lParam = (DWORD)(icdx);
 	return ret;
@@ -644,5 +550,5 @@
 LPVOID MSVIDEO_MapMsg16To32(UINT msg, LPDWORD lParam1, LPDWORD lParam2) {
 	LPVOID ret = 0;
-	
+
 	TRACE("Mapping %d\n",msg);
 
@@ -714,5 +620,5 @@
 			COPYPTR(icc,lpbiPrev);
 			COPYPTR(icc,lpPrev);
-			
+
 			*lParam1 = (DWORD)(icc);
 			*lParam2 = sizeof(ICCOMPRESS);
@@ -723,8 +629,8 @@
 			ICDECOMPRESS *icd = HeapAlloc(GetProcessHeap(),0,sizeof(ICDECOMPRESS));
 			ICDECOMPRESS *icd16; /* Same structure except for the pointers */
-			
+
 			icd16 = MapSL(*lParam1);
 			ret = icd16;
-			
+
 			COPY(icd,dwFlags);
 			COPYPTR(icd,lpbiInput);
@@ -733,5 +639,5 @@
 			COPYPTR(icd,lpOutput);
 			COPY(icd,ckid);
-			
+
 			*lParam1 = (DWORD)(icd);
 			*lParam2 = sizeof(ICDECOMPRESS);
@@ -762,5 +668,5 @@
 		 else
 		 addr[1] = 0;
-		 
+
 		 ret = addr;
 		 }
@@ -801,5 +707,5 @@
 			ICDRAWSUGGEST *icds = HeapAlloc(GetProcessHeap(),0,sizeof(ICDRAWSUGGEST));
 			ICDRAWSUGGEST16 *icds16 = MapSL(*lParam1);
-			
+
 			ret = icds16;
 
@@ -894,7 +800,6 @@
 		ERR("Unmapping unmapped msg %d\n",msg);
 	}
-#undef UNCOPY		
-}
-#endif
+#undef UNCOPY
+}
 
 LRESULT MSVIDEO_SendMessage(HIC hic,UINT msg,DWORD lParam1,DWORD lParam2, BOOL bFrom32) {
@@ -974,5 +879,5 @@
 	if (whic->driverproc) { /* IC is a function */
 #ifdef __WIN32OS2__
-         	bDrv32 = whic->privatevfw;
+		bDrv32 = whic->privatevfw;
 #else
 		bDrv32 = whic->private;
@@ -982,5 +887,4 @@
 	}
 
-#ifndef __WIN32OS2__
 	if (!bFrom32) {
 		if (bDrv32)
@@ -993,28 +897,21 @@
 		}
 	}
-#endif
-	
+
 	if (whic->driverproc) {
-#ifdef __WIN32OS2__
-  	        ret = whic->driverproc(whic->hdrv,hic,msg,lParam1,lParam2);
-#else
 		if (bDrv32) {
 			ret = whic->driverproc(whic->hdrv,hic,msg,lParam1,lParam2);
 		} else {
-			ret = MSVIDEO_CallTo16_long_lwwll((FARPROC16)whic->driverproc,whic->hdrv,hic,msg,lParam1,lParam2);
-		}
-#endif
+			ret = MSVIDEO_CallTo16_long_lwwll((FARPROC16)whic->driverproc,HDRVR_16(whic->hdrv),hic,msg,lParam1,lParam2);
+		}
 	} else {
 		ret = SendDriverMessage(whic->hdrv,msg,lParam1,lParam2);
 	}
 
-#ifndef __WIN32OS2__
 	if (data16)
 		MSVIDEO_UnmapMsg16To32(msg,data16,&lParam1,&lParam2);
-#endif
- 
+
  out:
 	GlobalUnlock16(hic);
-	
+
 	TRACE("	-> 0x%08lx\n",ret);
 	return ret;
@@ -1027,5 +924,5 @@
 	return MSVIDEO_SendMessage(hic,msg,lParam1,lParam2,TRUE);
 }
-#ifndef __WIN32OS2__
+
 /***********************************************************************
  *		ICSendMessage			[MSVIDEO.205]
@@ -1035,37 +932,4 @@
 }
 
-/***********************************************************************
- *		_ICMessage			[MSVIDEO.207]
- */
-LRESULT VFWAPIV ICMessage16(void) {
-	HIC16 hic;
-	UINT16 msg;
-	UINT16 cb;
-	LPWORD lpData;
-	LRESULT ret;
-	UINT16 i;
-
-	VA_LIST16 valist;
-	
-	VA_START16(valist);
-	hic = VA_ARG16(valist, HIC16);
-	msg = VA_ARG16(valist, UINT16);
-	cb  = VA_ARG16(valist, UINT16);
-
-	lpData = SEGPTR_ALLOC(cb);
-
-	TRACE("0x%08lx, %u, %u, ...)\n",(DWORD)hic,msg,cb);
-
-	for(i=0;i<cb/sizeof(WORD);i++) {
-		lpData[i] = VA_ARG16(valist, WORD);
-	}
-		
-	VA_END16(valist);
-	ret = ICSendMessage16(hic, msg, (DWORD)(SEGPTR_GET(lpData)), (DWORD)cb);
-
-	SEGPTR_FREE(lpData);
-	return ret;
-}
-#endif
 /***********************************************************************
  *		ICDrawBegin		[MSVFW32.@]
@@ -1089,5 +953,5 @@
 	DWORD              dwScale) /* [in] */
 {
-	
+
 	ICDRAWBEGIN	icdb;
 
@@ -1114,55 +978,4 @@
 }
 
-#ifndef __WIN32OS2__
-/***********************************************************************
- *		_ICDrawBegin		[MSVIDEO.232]
- */
-DWORD VFWAPIV ICDrawBegin16(
-	HIC16               hic,     /* [in] */
-	DWORD               dwFlags, /* [in] flags */
-	HPALETTE16          hpal,    /* [in] palette to draw with */
-	HWND16              hwnd,    /* [in] window to draw to */
-	HDC16               hdc,     /* [in] HDC to draw to */
-	INT16               xDst,    /* [in] destination rectangle */
-	INT16               yDst,    /* [in] */
-	INT16               dxDst,   /* [in] */
-	INT16               dyDst,   /* [in] */
-	LPBITMAPINFOHEADER  lpbi,    /* [in] format of frame to draw NOTE: SEGPTR */
-	INT16		    xSrc,    /* [in] source rectangle */
-	INT16		    ySrc,    /* [in] */
-	INT16		    dxSrc,   /* [in] */
-	INT16		    dySrc,   /* [in] */
-	DWORD		    dwRate,  /* [in] frames/second = (dwRate/dwScale) */
-	DWORD		    dwScale) /* [in] */
-{
-	DWORD ret;
-	ICDRAWBEGIN16* icdb = SEGPTR_NEW(ICDRAWBEGIN16); /* SEGPTR for mapper to deal with */
-
-	TRACE("(0x%08lx,%ld,0x%08lx,0x%08lx,0x%08lx,%u,%u,%u,%u,%p,%u,%u,%u,%u,%ld,%ld)\n",
-		  (DWORD)hic, dwFlags, (DWORD)hpal, (DWORD)hwnd, (DWORD)hdc, xDst, yDst, dxDst, dyDst,
-		  lpbi, xSrc, ySrc, dxSrc, dySrc, dwRate, dwScale);
-
-	icdb->dwFlags = dwFlags;
-	icdb->hpal = hpal;
-	icdb->hwnd = hwnd;
-	icdb->hdc = hdc;
-	icdb->xDst = xDst;
-	icdb->yDst = yDst;
-	icdb->dxDst = dxDst;
-	icdb->dyDst = dyDst;
-	icdb->lpbi = lpbi; /* Keep this as SEGPTR for the mapping code to deal with */
-	icdb->xSrc = xSrc;
-	icdb->ySrc = ySrc;
-	icdb->dxSrc = dxSrc;
-	icdb->dySrc = dySrc;
-	icdb->dwRate = dwRate;
-	icdb->dwScale = dwScale;
-	
-	ret = (DWORD)ICSendMessage16(hic,ICM_DRAW_BEGIN,(DWORD)SEGPTR_GET(icdb),sizeof(ICDRAWBEGIN16));
-	SEGPTR_FREE(icdb);
-	return ret;
-}
-#endif
-
 /***********************************************************************
  *		ICDraw			[MSVFW32.@]
@@ -1181,29 +994,4 @@
 	return ICSendMessage(hic,ICM_DRAW,(DWORD)&icd,sizeof(icd));
 }
-
-#ifndef __WIN32OS2__
-/***********************************************************************
- *		_ICDraw			[MSVIDEO.234]
- */
-DWORD VFWAPIV ICDraw16(
-	HIC16 hic,
-	DWORD dwFlags,
-	LPVOID lpFormat, /* [???] NOTE: SEGPTR */
-	LPVOID lpData,   /* [???] NOTE: SEGPTR */
-	DWORD cbData, 
-	LONG lTime) 
-{
-	ICDRAW* icd = SEGPTR_NEW(ICDRAW); /* SEGPTR for mapper to deal with */
-
-	TRACE("(0x%08lx,0x%08lx,%p,%p,%ld,%ld)\n",(DWORD)hic,dwFlags,lpFormat,lpData,cbData,lTime);
-	icd->dwFlags = dwFlags;
-	icd->lpFormat = lpFormat;
-	icd->lpData = lpData;
-	icd->cbData = cbData;
-	icd->lTime = lTime;
-
-	return ICSendMessage16(hic,ICM_DRAW,(DWORD)SEGPTR_GET(icd),sizeof(ICDRAW));
-}
-#endif
 
 /***********************************************************************
@@ -1226,31 +1014,151 @@
 }
 
-#ifndef __WIN32OS2__
-/***********************************************************************
- *		ICClose			[MSVIDEO.204]
- */
-LRESULT WINAPI ICClose16(HIC16 hic) {
-	return ICClose(hic);
-}
-#endif
-
-/***********************************************************************
- *		MCIWndCreate		[MSVFW32.@]
- *		MCIWndCreateA		[MSVFW32.@]
- */
-HWND VFWAPIV MCIWndCreateA(HWND hwndParent, HINSTANCE hInstance,
-                      DWORD dwStyle,LPCSTR szFile)
+
+
+/***********************************************************************
+ *		ICImageCompress	[MSVFW32.@]
+ */
+HANDLE VFWAPI ICImageCompress(
+	HIC hic, UINT uiFlags,
+	LPBITMAPINFO lpbiIn, LPVOID lpBits,
+	LPBITMAPINFO lpbiOut, LONG lQuality,
+	LONG* plSize)
 {
-	FIXME("%x %x %lx %s\n",hwndParent, hInstance, dwStyle, szFile);
-	return 0;
-}
-
-/***********************************************************************
- *		MCIWndCreateW		[MSVFW32.@]
- */
-HWND VFWAPIV MCIWndCreateW(HWND hwndParent, HINSTANCE hInstance,
-                      DWORD dwStyle,LPCWSTR szFile)
+	FIXME("(%08x,%08x,%p,%p,%p,%ld,%p)\n",
+		hic, uiFlags, lpbiIn, lpBits, lpbiOut, lQuality, plSize);
+
+	return (HANDLE)NULL;
+}
+
+/***********************************************************************
+ *		ICImageDecompress	[MSVFW32.@]
+ */
+
+HANDLE VFWAPI ICImageDecompress(
+	HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn,
+	LPVOID lpBits, LPBITMAPINFO lpbiOut)
 {
-	FIXME("%x %x %lx %s\n",hwndParent, hInstance, dwStyle, debugstr_w(szFile));
-	return 0;
-}
+	HGLOBAL	hMem = (HGLOBAL)NULL;
+	BYTE*	pMem = NULL;
+	BOOL	bReleaseIC = FALSE;
+	BYTE*	pHdr = NULL;
+	LONG	cbHdr = 0;
+	BOOL	bSucceeded = FALSE;
+	BOOL	bInDecompress = FALSE;
+	DWORD	biSizeImage;
+
+	TRACE("(%08x,%08x,%p,%p,%p)\n",
+		hic, uiFlags, lpbiIn, lpBits, lpbiOut);
+
+	if ( hic == (HIC)NULL )
+	{
+		hic = ICDecompressOpen( mmioFOURCC('V','I','D','C'), 0, &lpbiIn->bmiHeader, (lpbiOut != NULL) ? &lpbiOut->bmiHeader : NULL );
+		if ( hic == (HIC)NULL )
+		{
+			WARN("no handler\n" );
+			goto err;
+		}
+		bReleaseIC = TRUE;
+	}
+	if ( uiFlags != 0 )
+	{
+		FIXME( "unknown flag %08x\n", uiFlags );
+		goto err;
+	}
+	if ( lpbiIn == NULL || lpBits == NULL )
+	{
+		WARN("invalid argument\n");
+		goto err;
+	}
+
+	if ( lpbiOut != NULL )
+	{
+		if ( lpbiOut->bmiHeader.biSize != sizeof(BITMAPINFOHEADER) )
+			goto err;
+		cbHdr = sizeof(BITMAPINFOHEADER);
+		if ( lpbiOut->bmiHeader.biCompression == 3 )
+			cbHdr += sizeof(DWORD)*3;
+		else
+		if ( lpbiOut->bmiHeader.biBitCount <= 8 )
+		{
+			if ( lpbiOut->bmiHeader.biClrUsed == 0 )
+				cbHdr += sizeof(RGBQUAD) * (1<<lpbiOut->bmiHeader.biBitCount);
+			else
+				cbHdr += sizeof(RGBQUAD) * lpbiOut->bmiHeader.biClrUsed;
+		}
+	}
+	else
+	{
+		TRACE( "get format\n" );
+
+		cbHdr = ICDecompressGetFormatSize(hic,lpbiIn);
+		if ( cbHdr < sizeof(BITMAPINFOHEADER) )
+			goto err;
+		pHdr = (BYTE*)HeapAlloc(GetProcessHeap(),0,cbHdr+sizeof(RGBQUAD)*256);
+		if ( pHdr == NULL )
+			goto err;
+		ZeroMemory( pHdr, cbHdr+sizeof(RGBQUAD)*256 );
+		if ( ICDecompressGetFormat( hic, lpbiIn, (BITMAPINFO*)pHdr ) != ICERR_OK )
+			goto err;
+		lpbiOut = (BITMAPINFO*)pHdr;
+		if ( lpbiOut->bmiHeader.biBitCount <= 8 &&
+			 ICDecompressGetPalette( hic, lpbiIn, lpbiOut ) != ICERR_OK &&
+			 lpbiIn->bmiHeader.biBitCount == lpbiOut->bmiHeader.biBitCount )
+		{
+			if ( lpbiIn->bmiHeader.biClrUsed == 0 )
+				memcpy( lpbiOut->bmiColors, lpbiIn->bmiColors, sizeof(RGBQUAD)*(1<<lpbiOut->bmiHeader.biBitCount) );
+			else
+				memcpy( lpbiOut->bmiColors, lpbiIn->bmiColors, sizeof(RGBQUAD)*lpbiIn->bmiHeader.biClrUsed );
+		}
+		if ( lpbiOut->bmiHeader.biBitCount <= 8 &&
+			 lpbiOut->bmiHeader.biClrUsed == 0 )
+			lpbiOut->bmiHeader.biClrUsed = 1<<lpbiOut->bmiHeader.biBitCount;
+
+		lpbiOut->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+		cbHdr = sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD)*lpbiOut->bmiHeader.biClrUsed;
+	}
+
+	biSizeImage = lpbiOut->bmiHeader.biSizeImage;
+	if ( biSizeImage == 0 )
+		biSizeImage = ((((lpbiOut->bmiHeader.biWidth * lpbiOut->bmiHeader.biBitCount + 7) >> 3) + 3) & (~3)) * abs(lpbiOut->bmiHeader.biHeight);
+
+	TRACE( "call ICDecompressBegin\n" );
+
+	if ( ICDecompressBegin( hic, lpbiIn, lpbiOut ) != ICERR_OK )
+		goto err;
+	bInDecompress = TRUE;
+
+	TRACE( "cbHdr %ld, biSizeImage %ld\n", cbHdr, biSizeImage );
+
+	hMem = GlobalAlloc( GMEM_MOVEABLE|GMEM_ZEROINIT, cbHdr + biSizeImage );
+	if ( hMem == (HGLOBAL)NULL )
+	{
+		WARN( "out of memory\n" );
+		goto err;
+	}
+	pMem = (BYTE*)GlobalLock( hMem );
+	if ( pMem == NULL )
+		goto err;
+	memcpy( pMem, lpbiOut, cbHdr );
+
+	TRACE( "call ICDecompress\n" );
+	if ( ICDecompress( hic, 0, &lpbiIn->bmiHeader, lpBits, &lpbiOut->bmiHeader, pMem+cbHdr ) != ICERR_OK )
+		goto err;
+
+	bSucceeded = TRUE;
+err:
+	if ( bInDecompress )
+		ICDecompressEnd( hic );
+	if ( bReleaseIC )
+		ICClose(hic);
+	if ( pHdr != NULL )
+		HeapFree(GetProcessHeap(),0,pHdr);
+	if ( pMem != NULL )
+		GlobalUnlock( hMem );
+	if ( !bSucceeded && hMem != (HGLOBAL)NULL )
+	{
+		GlobalFree(hMem); hMem = (HGLOBAL)NULL;
+	}
+
+	return (HANDLE)hMem;
+}
Index: trunk/src/msvfw32/vfw16.h
===================================================================
--- trunk/src/msvfw32/vfw16.h	(revision 9126)
+++ trunk/src/msvfw32/vfw16.h	(revision 9140)
@@ -1,2 +1,20 @@
+/*
+ * Copyright 1999 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
+ */
+
 #ifndef __WINE_VFW16_H
 #define __WINE_VFW16_H
@@ -8,4 +26,19 @@
 extern "C" {
 #endif  /* __cplusplus */
+
+#ifdef __WIN32OS2__
+#include <heapstring.h>
+
+#define GlobalAlloc16 GlobalAlloc
+#define GlobalLock16 GlobalLock
+#define GlobalUnlock16 GlobalUnlock
+#define GlobalFree16 GlobalFree
+
+#define MapLS(a)	a
+#define UnMapLS(a)
+
+#define HIC16	DWORD
+
+#endif
 
 typedef HANDLE16 HDRAWDIB16;
