Implementation of OleConvert routines.

Thuy Nguyen <thuy@macadamian.com>
Don't allow to resize stream open in read only mode
Allow write access for stream/storage open with STGM_READWRITE.
StgOpenStorage return values are now more detailed.
Don't rely on STGM_CREATE flag in the Storage constructor.
Preventing to write out of date property.

Owen Wang <owenw@corel.ca>
Allow both positive & negative 32-bit integers as with MFC assumption.
This patch improves the 32bit limit on IStream::*_Seek operations.

John Li <johnl@corel.ca>
When WP opens a linked file, the malloc function in
OLECONVERT_LoadOLE10(...) returns a NULL. This causes a later Wine
crash. The actual problem is the function reading a large data length.

diff --git a/include/ole2.h b/include/ole2.h
index 3f9511f..83aa585 100644
--- a/include/ole2.h
+++ b/include/ole2.h
@@ -105,6 +105,24 @@
 					   LPVOID*   ppvObj);
 HRESULT     WINAPI CreateOleAdviseHolder (LPOLEADVISEHOLDER *ppOAHolder);
 
+/*
+ *  OLE version conversion declarations
+ */
+
+
+typedef struct _OLESTREAM* LPOLESTREAM;
+typedef struct _OLESTREAMVTBL {
+	DWORD	(CALLBACK *Get)(LPOLESTREAM,LPSTR,DWORD);
+	DWORD	(CALLBACK *Put)(LPOLESTREAM,LPSTR,DWORD);
+} OLESTREAMVTBL;
+typedef OLESTREAMVTBL*	LPOLESTREAMVTBL;
+typedef struct _OLESTREAM {
+	LPOLESTREAMVTBL	lpstbl;
+} OLESTREAM;
+
+HRESULT     WINAPI OleConvertOLESTREAMToIStorage( LPOLESTREAM lpolestream, LPSTORAGE pstg, const DVTARGETDEVICE* ptd);
+HRESULT     WINAPI OleConvertIStorageToOLESTREAM( LPSTORAGE pstg, LPOLESTREAM lpolestream);
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif /* defined(__cplusplus) */
diff --git a/include/wine/obj_base.h b/include/wine/obj_base.h
index f7c097d..a294524 100644
--- a/include/wine/obj_base.h
+++ b/include/wine/obj_base.h
@@ -67,6 +67,9 @@
 HRESULT WINAPI CLSIDFromProgID16(LPCOLESTR16 progid, LPCLSID riid);
 HRESULT WINAPI CLSIDFromProgID(LPCOLESTR progid, LPCLSID riid);
 
+HRESULT WINAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *lplpszProgID);
+
+
 INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax);
 
 BOOL16 WINAPI IsEqualGUID16(GUID* g1,GUID* g2);
diff --git a/include/winerror.h b/include/winerror.h
index b2b4535..bf93b34 100644
--- a/include/winerror.h
+++ b/include/winerror.h
@@ -1608,6 +1608,14 @@
 #define STG_E_NOTFILEBASEDSTORAGE	0x80030107
 #define STG_E_EXTANTMARSHALLINGS	0x80030108
 
+#define CONVERT10_E_OLESTREAM_GET       0x800401C0
+#define CONVERT10_E_OLESTREAM_PUT       0x800401C1
+#define CONVERT10_E_OLESTREAM_FMT       0x800401C2
+#define CONVERT10_E_OLESTREAM_BITMAP_TO_DIB 0x800401C3
+#define CONVERT10_E_STG_FMT             0x800401C4
+#define CONVERT10_E_STG_NO_STD_STREAM   0x800401C5
+#define CONVERT10_E_STG_DIB_TO_BITMAP   0x800401C6
+
 /* alten versionen
 #define E_NOTIMPL			0x80000001
 #define E_OUTOFMEMORY			0x80000002