ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2005
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
26 participants
609 discussions
Start a n
N
ew thread
[gvg] 14085: Sync to Wine-20050310:
by gvg@svn.reactos.com
Sync to Wine-20050310: Jacek Caban <jack(a)itma.pwr.wroc.pl> - Implemented GetRecordInfoFromTypeInfo and GetRecordInfoFromGuid. - Beginnig implementation of IRecordInfo. - More implementation of IRecordInfo. Maxime Bellenge <maxime.bellenge(a)laposte.net> - Implements OleLoadPicturePath. Jon Griffiths <jon_p_griffiths(a)yahoo.com> - Use variant macros instead of accessing the union directly. - Documentation spelling fixes. Alex Villacis Lasso <a_villacis(a)palosanto.com> - Implement OleFontImpl_QueryTextMetrics. - Change SUBLANG_DEFAULT to SUBLANG_NEUTRAL for LANG_SPANISH in all resources, so that Spanish locales other than Spain also use Spanish resources. Marcelo Duarte <wine-devel(a)bol.com.br> - Update the resources for Portuguese. Francois Gouget <fgouget(a)free.fr> - Assorted spelling fixes. Vincent Beron <vberon(a)mecano.gme.usherb.ca> - Add a stub for OleLoadPicturePath(). Huw Davies <huw(a)codeweavers.com> - The typelib cache should take the typelib resource index into account. Mike Hearn <mh(a)codeweavers.com> - Allow loading of builtin typelibs. Marcus Meissner <marcus(a)jet.franken.de> - Check for overflows with ClrUsed. Modified: trunk/reactos/lib/oleaut32/Makefile.in Modified: trunk/reactos/lib/oleaut32/Makefile.ros-template Modified: trunk/reactos/lib/oleaut32/oleaut.c Modified: trunk/reactos/lib/oleaut32/oleaut32.rc Modified: trunk/reactos/lib/oleaut32/oleaut32.spec Modified: trunk/reactos/lib/oleaut32/oleaut32_Es.rc Modified: trunk/reactos/lib/oleaut32/olefont.c Modified: trunk/reactos/lib/oleaut32/olepicture.c Added: trunk/reactos/lib/oleaut32/recinfo.c Modified: trunk/reactos/lib/oleaut32/typelib.c Modified: trunk/reactos/lib/oleaut32/typelib2.c Modified: trunk/reactos/lib/oleaut32/usrmarshal.c Modified: trunk/reactos/lib/oleaut32/varformat.c Modified: trunk/reactos/lib/oleaut32/variant.c Modified: trunk/reactos/w32api/include/oleauto.h Modified: trunk/reactos/w32api/include/winerror.h _____ Modified: trunk/reactos/lib/oleaut32/Makefile.in --- trunk/reactos/lib/oleaut32/Makefile.in 2005-03-14 23:25:39 UTC (rev 14084) +++ trunk/reactos/lib/oleaut32/Makefile.in 2005-03-14 23:44:13 UTC (rev 14085) @@ -5,7 +5,7 @@ VPATH = @srcdir@ MODULE = oleaut32.dll IMPORTS = ole32 rpcrt4 user32 gdi32 advapi32 kernel32 ntdll -DELAYIMPORTS = comctl32 +DELAYIMPORTS = comctl32 urlmon EXTRALIBS = $(LIBUNICODE) -luuid C_SRCS = \ @@ -16,6 +16,7 @@ oleaut.c \ olefont.c \ olepicture.c \ + recinfo.c \ regsvr.c \ safearray.c \ stubs.c \ _____ Modified: trunk/reactos/lib/oleaut32/Makefile.ros-template --- trunk/reactos/lib/oleaut32/Makefile.ros-template 2005-03-14 23:25:39 UTC (rev 14084) +++ trunk/reactos/lib/oleaut32/Makefile.ros-template 2005-03-14 23:44:13 UTC (rev 14085) @@ -6,7 +6,7 @@ TARGET_CFLAGS = @EXTRADEFS@ -D__REACTOS__ -TARGET_SDKLIBS = @IMPORTS@ winmm.a wine.a wine_uuid.a ntdll.a +TARGET_SDKLIBS = @IMPORTS@ urlmon.a winmm.a wine.a wine_uuid.a ntdll.a TARGET_BASE = $(TARGET_BASE_LIB_OLEAUT32) _____ Modified: trunk/reactos/lib/oleaut32/oleaut.c --- trunk/reactos/lib/oleaut32/oleaut.c 2005-03-14 23:25:39 UTC (rev 14084) +++ trunk/reactos/lib/oleaut32/oleaut.c 2005-03-14 23:44:13 UTC (rev 14085) @@ -572,28 +572,6 @@ } /*********************************************************************** ******* - * GetRecordInfoFromGuids [OLEAUT32.322] - * - * RETURNS - * Success: S_OK - * Failure: E_INVALIDARG, if any argument is invalid. - * - * BUGS - * Unimplemented - */ -HRESULT WINAPI GetRecordInfoFromGuids( - REFGUID rGuidTypeLib, - ULONG uVerMajor, - ULONG uVerMinor, - LCID lcid, - REFGUID rGuidTypeInfo, - IRecordInfo** ppRecInfo) -{ - FIXME("(%p,%ld,%ld,%ld,%p,%p),stub!\n",rGuidTypeLib, uVerMajor, uVerMinor, lcid, rGuidTypeInfo, ppRecInfo); - return E_NOTIMPL; -} - -/********************************************************************** ******** * OleTranslateColor [OLEAUT32.421] * * Convert an OLE_COLOR to a COLORREF. _____ Modified: trunk/reactos/lib/oleaut32/oleaut32.rc --- trunk/reactos/lib/oleaut32/oleaut32.rc 2005-03-14 23:25:39 UTC (rev 14084) +++ trunk/reactos/lib/oleaut32/oleaut32.rc 2005-03-14 23:44:13 UTC (rev 14085) @@ -42,7 +42,7 @@ /* * FIXME: - * Finnish, Greek, Hebrew, Japanese, Korean, Portuguese, + * Finnish, Greek, Hebrew, Japanese, Korean, * Turkish, Slovenian (at least) are localised in XP Home. * I expect Chinese etc are localised in Asian Editions also. */ _____ Modified: trunk/reactos/lib/oleaut32/oleaut32.spec --- trunk/reactos/lib/oleaut32/oleaut32.spec 2005-03-14 23:25:39 UTC (rev 14084) +++ trunk/reactos/lib/oleaut32/oleaut32.spec 2005-03-14 23:44:13 UTC (rev 14085) @@ -315,7 +315,7 @@ 320 stdcall -private DllRegisterServer() OLEAUT32_DllRegisterServer 321 stdcall -private DllUnregisterServer() OLEAUT32_DllUnregisterServer 322 stdcall GetRecordInfoFromGuids(ptr long long long ptr ptr) -323 stub GetRecordInfoFromTypeInfo # stdcall (ptr ptr) +323 stdcall GetRecordInfoFromTypeInfo(ptr ptr) 325 stub SetVarConversionLocaleSetting 326 stub GetVarConversionLocaleSetting 327 stdcall SetOaNoCache() @@ -396,7 +396,7 @@ 421 stdcall OleTranslateColor(long long long) 422 stub OleLoadPictureFile 423 stub OleSavePictureFile -424 stub OleLoadPicturePath +424 stdcall OleLoadPicturePath(wstr ptr long long ptr ptr) 425 stdcall VarUI4FromI8(long long ptr) 426 stdcall VarUI4FromUI8(long long ptr) 427 stdcall VarI8FromUI8(long long ptr) _____ Modified: trunk/reactos/lib/oleaut32/oleaut32_Es.rc --- trunk/reactos/lib/oleaut32/oleaut32_Es.rc 2005-03-14 23:25:39 UTC (rev 14084) +++ trunk/reactos/lib/oleaut32/oleaut32_Es.rc 2005-03-14 23:44:13 UTC (rev 14085) @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -LANGUAGE LANG_SPANISH, SUBLANG_DEFAULT +LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL STRINGTABLE DISCARDABLE { _____ Modified: trunk/reactos/lib/oleaut32/olefont.c --- trunk/reactos/lib/oleaut32/olefont.c 2005-03-14 23:25:39 UTC (rev 14084) +++ trunk/reactos/lib/oleaut32/olefont.c 2005-03-14 23:44:13 UTC (rev 14085) @@ -1068,8 +1068,16 @@ IFont* iface, TEXTMETRICOLE* ptm) { - FIXME("(%p, %p), stub!\n",iface,ptm); - return E_NOTIMPL; + HDC hdcRef; + HFONT hOldFont, hNewFont; + + hdcRef = GetDC(0); + OLEFontImpl_get_hFont(iface, &hNewFont); + hOldFont = SelectObject(hdcRef, hNewFont); + GetTextMetricsW(hdcRef, ptm); + SelectObject(hdcRef, hOldFont); + ReleaseDC(0, hdcRef); + return S_OK; } /*********************************************************************** * _____ Modified: trunk/reactos/lib/oleaut32/olepicture.c --- trunk/reactos/lib/oleaut32/olepicture.c 2005-03-14 23:25:39 UTC (rev 14084) +++ trunk/reactos/lib/oleaut32/olepicture.c 2005-03-14 23:44:13 UTC (rev 14085) @@ -71,7 +71,9 @@ #include "olectl.h" #include "oleauto.h" #include "connpt.h" +#include "urlmon.h" #include "wine/debug.h" +#include "wine/unicode.h" #include "wine/wingdi16.h" #include "cursoricon.h" @@ -106,7 +108,7 @@ IPersistStreamVtbl *lpvtbl3; IConnectionPointContainerVtbl *lpvtbl4; - /* Object referenece count */ + /* Object reference count */ DWORD ref; /* We own the object and must destroy it ourselves */ @@ -705,7 +707,7 @@ TRACE("(%p)->(%p).\n", This, pdwAttr); *pdwAttr = 0; switch (This->desc.picType) { - case PICTYPE_BITMAP: break; /* not 'truely' scalable, see MSDN. */ + case PICTYPE_BITMAP: break; /* not 'truly' scalable, see MSDN. */ case PICTYPE_ICON: *pdwAttr = PICTURE_TRANSPARENT;break; case PICTYPE_METAFILE: *pdwAttr = PICTURE_TRANSPARENT|PICTURE_SCALABLE;break; default:FIXME("Unknown pictype %d\n",This->desc.picType);break; @@ -1514,9 +1516,15 @@ GetDIBits(hDC, hBitmap, 0, pInfoBitmap->bmiHeader.biHeight, pPixelData, pInfoBitmap, DIB_RGB_COLORS); /* Calculate the total length required for the BMP data */ - if (pInfoBitmap->bmiHeader.biClrUsed != 0) iNumPaletteEntries = pInfoBitmap->bmiHeader.biClrUsed; - else if (pInfoBitmap->bmiHeader.biBitCount <= 8) iNumPaletteEntries = 1 << pInfoBitmap->bmiHeader.biBitCount; - else iNumPaletteEntries = 0; + if (pInfoBitmap->bmiHeader.biClrUsed != 0) { + iNumPaletteEntries = pInfoBitmap->bmiHeader.biClrUsed; + if (iNumPaletteEntries > 256) iNumPaletteEntries = 256; + } else { + if (pInfoBitmap->bmiHeader.biBitCount <= 8) + iNumPaletteEntries = 1 << pInfoBitmap->bmiHeader.biBitCount; + else + iNumPaletteEntries = 0; + } *pLength = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + @@ -1624,6 +1632,7 @@ || (pInfoBitmap->bmiHeader.biBitCount == 24) || (pInfoBitmap->bmiHeader.biBitCount == 32 && pInfoBitmap->bmiHeader.biCompression == BI_RGB)) { iNumEntriesPalette = pInfoBitmap->bmiHeader.biClrUsed; + if (iNumEntriesPalette > 256) iNumEntriesPalette = 256; } else if ((pInfoBitmap->bmiHeader.biBitCount == 16 || pInfoBitmap->bmiHeader.biBitCount == 32) && pInfoBitmap->bmiHeader.biCompression == BI_BITFIELDS) { iNumEntriesPalette = 3; @@ -1820,7 +1829,7 @@ VariantInit(pVarResult); V_VT(pVarResult) = VT_BOOL; - V_UNION(pVarResult,boolVal) = FALSE; + V_BOOL(pVarResult) = FALSE; return S_OK; } @@ -1984,6 +1993,113 @@ return hr; } +/********************************************************************** * + * OleLoadPicturePath (OLEAUT32.424) + */ +HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, + DWORD dwReserved, OLE_COLOR clrReserved, REFIID riid, + LPVOID *ppvRet ) +{ + static const WCHAR file[] = { 'f','i','l','e',':','/','/',0 }; + IPicture *ipicture; + HANDLE hFile; + DWORD dwFileSize; + HGLOBAL hGlobal = NULL; + DWORD dwBytesRead = 0; + IStream *stream; + BOOL bRead; + IPersistStream *pStream; + HRESULT hRes; + + TRACE("(%s,%p,%ld,%08lx,%s,%p): stub\n", + debugstr_w(szURLorPath), punkCaller, dwReserved, clrReserved, + debugstr_guid(riid), ppvRet); + + if (!ppvRet) return E_POINTER; + + if (strncmpW(szURLorPath, file, 7) == 0) { + szURLorPath += 7; + + hFile = CreateFileW(szURLorPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, + 0, NULL); + if (hFile == INVALID_HANDLE_VALUE) + return E_UNEXPECTED; + + dwFileSize = GetFileSize(hFile, NULL); + if (dwFileSize != INVALID_FILE_SIZE ) + { + hGlobal = GlobalAlloc(GMEM_FIXED,dwFileSize); + if ( hGlobal) + { + bRead = ReadFile(hFile, hGlobal, dwFileSize, &dwBytesRead, NULL); + if (!bRead) + { + GlobalFree(hGlobal); + hGlobal = 0; + } + } + } + CloseHandle(hFile); + + if (!hGlobal) + return E_UNEXPECTED; + + hRes = CreateStreamOnHGlobal(hGlobal, TRUE, &stream); + if (FAILED(hRes)) + { + GlobalFree(hGlobal); + return hRes; + } + } else { + IMoniker *pmnk; + IBindCtx *pbc; + + hRes = CreateBindCtx(0, &pbc); + if (SUCCEEDED(hRes)) + { + hRes = CreateURLMoniker(NULL, szURLorPath, &pmnk); + if (SUCCEEDED(hRes)) + { + hRes = IMoniker_BindToStorage(pmnk, pbc, NULL, &IID_IStream, (LPVOID*)&stream); + IMoniker_Release(pmnk); + } + IBindCtx_Release(pbc); + } + if (FAILED(hRes)) + return hRes; + } + + hRes = CoCreateInstance(&CLSID_StdPicture, punkCaller, CLSCTX_INPROC_SERVER, + &IID_IPicture, (LPVOID*)&ipicture); + if (hRes != S_OK) { + IStream_Release(stream); + return hRes; + } + + hRes = IPicture_QueryInterface(ipicture, &IID_IPersistStream, (LPVOID*)&pStream); + if (hRes) { + IStream_Release(stream); + IPicture_Release(ipicture); + return hRes; + } + + hRes = IPersistStream_Load(pStream, stream); + IPersistStream_Release(pStream); + IStream_Release(stream); + + if (hRes) { + IPicture_Release(ipicture); + return hRes; + } + + hRes = IPicture_QueryInterface(ipicture,riid,ppvRet); + if (hRes) + FIXME("Failed to get interface %s from IPicture.\n",debugstr_guid(riid)); + + IPicture_Release(ipicture); + return hRes; +} + /*********************************************************************** ******** * StdPic ClassFactory */ @@ -2017,13 +2133,9 @@ static HRESULT WINAPI SPCF_CreateInstance( LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj ) { - PICTDESC pd; + /* Creates an uninitialized picture */ + return OleCreatePictureIndirect(NULL,riid,TRUE,ppobj); - FIXME("(%p,%p,%s,%p), creating stdpic with PICTYPE_NONE.\n",iface,pOuter,debugstr_guid(riid),ppobj); - pd.cbSizeofstruct = sizeof(pd); - pd.picType = PICTYPE_NONE; - return OleCreatePictureIndirect(&pd,riid,TRUE,ppobj); - } static HRESULT WINAPI SPCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { _____ Copied: trunk/reactos/lib/oleaut32/recinfo.c (from rev 14083, vendor/wine/dlls/oleaut32/current/recinfo.c) Property changes on: trunk/reactos/lib/oleaut32/recinfo.c ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____ Modified: trunk/reactos/lib/oleaut32/typelib.c --- trunk/reactos/lib/oleaut32/typelib.c 2005-03-14 23:25:39 UTC (rev 14084) +++ trunk/reactos/lib/oleaut32/typelib.c 2005-03-14 23:44:13 UTC (rev 14085) @@ -315,6 +315,9 @@ TRACE("(%s,%d,%p)\n",debugstr_w(szFile), regkind, pptLib); + /* by default try and load using LoadLibrary (for builtin stdole32.tlb) */ + memcpy(szPath, szFile, (strlenW(szFile)+1)*sizeof(WCHAR)); + *pptLib = NULL; if(!SearchPathW(NULL,szFile,NULL,sizeof(szPath)/sizeof(WCHAR),szPath, NULL)) { @@ -331,9 +334,6 @@ return TYPE_E_CANTLOADLIBRARY; if (GetFileAttributesW(szFileCopy) & FILE_ATTRIBUTE_DIRECTORY) return TYPE_E_CANTLOADLIBRARY; - } else { - TRACE("Wanted to load %s as typelib, but file was not found.\n",debugstr_w(szFile)); - return TYPE_E_CANTLOADLIBRARY; } } @@ -848,9 +848,10 @@ libary. Only used while read MSFT typelibs */ - /* typelibs are cached, keyed by path, so store the linked list info within them */ + /* typelibs are cached, keyed by path and index, so store the linked list info within them */ struct tagITypeLibImpl *next, *prev; WCHAR *path; + INT index; } ITypeLibImpl; static struct ITypeLib2Vtbl tlbvt; @@ -865,7 +866,7 @@ /*======================= ITypeInfo implementation =======================*/ -/* data for refernced types */ +/* data for referenced types */ typedef struct tagTLBRefType { INT index; /* Type index for internal ref or for external ref @@ -1497,7 +1498,7 @@ if(offset <0) { /* data are packed in here */ V_VT(pVar) = (offset & 0x7c000000 )>> 26; - V_UNION(pVar, iVal) = offset & 0x3ffffff; + V_I2(pVar) = offset & 0x3ffffff; return; } MSFT_ReadLEWords(&(V_VT(pVar)), sizeof(VARTYPE), pcx, @@ -1537,7 +1538,7 @@ } else { ptr=TLB_Alloc(size);/* allocate temp buffer */ MSFT_Read(ptr, size, pcx, DO_NOT_SEEK);/* read string (ANSI) */ - V_UNION(pVar, bstrVal)=SysAllocStringLen(NULL,size); + V_BSTR(pVar)=SysAllocStringLen(NULL,size); /* FIXME: do we need a AtoW conversion here? */ V_UNION(pVar, bstrVal[size])=L'\0'; while(size--) V_UNION(pVar, bstrVal[size])=ptr[size]; @@ -1570,7 +1571,7 @@ } if(size>0) /* (big|small) endian correct? */ - MSFT_Read(&(V_UNION(pVar, iVal)), size, pcx, DO_NOT_SEEK ); + MSFT_Read(&(V_I2(pVar)), size, pcx, DO_NOT_SEEK ); return; } /* @@ -1924,7 +1925,7 @@ recoffset += reclength; } } -/* fill in data for a hreftype (offset). When the refernced type is contained +/* fill in data for a hreftype (offset). When the referenced type is contained * in the typelib, it's just an (file) offset in the type info base dir. * If comes from import, it's an offset+1 in the ImpInfo table * */ @@ -2169,7 +2170,7 @@ EnterCriticalSection(&cache_section); for (entry = tlb_cache_first; entry != NULL; entry = entry->next) { - if (!strcmpiW(entry->path, pszFileName)) + if (!strcmpiW(entry->path, pszFileName) && entry->index == index) { TRACE("cache hit\n"); *ppTypeLib = (ITypeLib2*)entry; @@ -2209,8 +2210,13 @@ } CloseHandle(hFile); } + else + { + TRACE("not found, trying to load %s as library\n", debugstr_w(pszFileName)); + } - if( (WORD)dwSignature == IMAGE_DOS_SIGNATURE ) + /* if the file is a DLL or not found, try loading it with LoadLibrary */ + if (((WORD)dwSignature == IMAGE_DOS_SIGNATURE) || (dwSignature == 0)) { /* find the typelibrary resource*/ HINSTANCE hinstDLL = LoadLibraryExW(pszFileName, 0, DONT_RESOLVE_DLL_REFERENCES| @@ -2258,6 +2264,7 @@ impl->path = HeapAlloc(GetProcessHeap(), 0, (strlenW(pszFileName)+1) * sizeof(WCHAR)); lstrcpyW(impl->path, pszFileName); /* We should really canonicalise the path here. */ + impl->index = index; /* FIXME: check if it has added already in the meantime */ EnterCriticalSection(&cache_section); @@ -3074,7 +3081,7 @@ return (SLTG_TypeInfoTail*)(pFirstItem + pMemHeader->cbExtra); } -/* Because SLTG_OtherTypeInfo is such a painfull struct, we make a more +/* Because SLTG_OtherTypeInfo is such a painful struct, we make a more managable copy of it into this */ typedef struct { WORD small_no; @@ -4109,8 +4116,8 @@ TRACE("(%p)->(%lu)\n",This, ref); if (ref) { - /* We don't release ITypeLib when ref=0 becouse - it means that funtion is called by ITypeLi2_Release */ + /* We don't release ITypeLib when ref=0 because + it means that function is called by ITypeLib2_Release */ ITypeLib2_Release((ITypeLib2*)This->pTypeLib); } else { FIXME("destroy child objects\n"); @@ -4518,12 +4525,12 @@ } if (V_VT(arg) == vt) { - memcpy(argpos, &V_UNION(arg,lVal), arglen); + memcpy(argpos, &V_I4(arg), arglen); return S_OK; } if (V_ISARRAY(arg) && (vt == VT_SAFEARRAY)) { - memcpy(argpos, &V_UNION(arg,parray), sizeof(SAFEARRAY*)); + memcpy(argpos, &V_ARRAY(arg), sizeof(SAFEARRAY*)); return S_OK; } @@ -4533,13 +4540,13 @@ } /* Deref BYREF vars if there is need */ if(V_ISBYREF(arg) && ((V_VT(arg) & ~VT_BYREF)==vt)) { - memcpy(argpos,(void*)V_UNION(arg,lVal), arglen); + memcpy(argpos,(void*)V_I4(arg), arglen); return S_OK; } if (vt==VT_UNKNOWN && V_VT(arg)==VT_DISPATCH) { /* in this context, if the type lib specifies IUnknown*, giving an IDispatch* is correct; so, don't invoke VariantChangeType */ - memcpy(argpos,&V_UNION(arg,lVal), arglen); + memcpy(argpos,&V_I4(arg), arglen); return S_OK; } if ((vt == VT_PTR) && tdesc) @@ -4555,7 +4562,7 @@ FIXME("Could not get typeinfo of hreftype %lx for VT_USERDEFINED, " "while coercing from vt 0x%x. Copying 4 byte.\n", tdesc->u.hreftype,V_VT(arg)); - memcpy(argpos, &V_UNION(arg,lVal), 4); + memcpy(argpos, &V_I4(arg), 4); return S_OK; } hres = ITypeInfo_GetTypeAttr(tinfo2,&tattr); @@ -4569,11 +4576,11 @@ case TKIND_ENUM: switch ( V_VT( arg ) ) { case VT_I2: - *argpos = V_UNION(arg,iVal); + *argpos = V_I2(arg); hres = S_OK; break; case VT_I4: - memcpy(argpos, &V_UNION(arg,lVal), 4); + memcpy(argpos, &V_I4(arg), 4); hres = S_OK; break; default: @@ -4592,15 +4599,15 @@ if (V_VT(arg) == VT_DISPATCH) { IDispatch *disp; if (IsEqualIID(&IID_IDispatch,&(tattr->guid))) { - memcpy(argpos, &V_UNION(arg,pdispVal), 4); + memcpy(argpos, &V_DISPATCH(arg), 4); hres = S_OK; break; } - hres=IUnknown_QueryInterface(V_UNION(arg,pdispVal), + hres=IUnknown_QueryInterface(V_DISPATCH(arg), &IID_IDispatch,(LPVOID*)&disp); if (SUCCEEDED(hres)) { memcpy(argpos,&disp,4); - IUnknown_Release(V_UNION(arg,pdispVal)); + IUnknown_Release(V_DISPATCH(arg)); hres = S_OK; break; } @@ -4610,7 +4617,7 @@ break; } if (V_VT(arg) == VT_UNKNOWN) { - memcpy(argpos, &V_UNION(arg,punkVal), 4); + memcpy(argpos, &V_UNKNOWN(arg), 4); hres = S_OK; break; } @@ -4621,7 +4628,7 @@ case TKIND_DISPATCH: if (V_VT(arg) == VT_DISPATCH) { - memcpy(argpos, &V_UNION(arg,pdispVal), 4); + memcpy(argpos, &V_DISPATCH(arg), 4); hres = S_OK; } else { @@ -4646,7 +4653,7 @@ oldvt = V_VT(arg); VariantInit(&va); if (VariantChangeType(&va,arg,0,vt)==S_OK) { - memcpy(argpos,&V_UNION(&va,lVal), arglen); + memcpy(argpos,&V_I4(&va), arglen); FIXME("Should not use VariantChangeType here." " (conversion from 0x%x -> 0x%x) %08lx\n", V_VT(arg), vt, *argpos @@ -4768,7 +4775,7 @@ if(i < func_desc->cParams - func_desc->cParamsOpt) ERR("Parameter has PARAMFLAG_FOPT flag but is not one of last cParamOpt parameters\n"); if(V_VT(arg) == VT_EMPTY - || ((V_VT(arg) & VT_BYREF) && !V_BYREF(arg))) { + || ((V_ISBYREF(arg)) && !V_BYREF(arg))) { /* FIXME: Documentation says that we do this when parameter is left unspecified. How to determine it? */ @@ -4834,7 +4841,7 @@ continue; VariantInit(pVarResult); - memcpy(&V_UNION(pVarResult,intVal),&args2[args2pos],arglen*sizeof(DWORD) ); + memcpy(&V_INT(pVarResult),&args2[args2pos],arglen*sizeof(DWORD)); if (tdesc->vt == VT_PTR) tdesc = tdesc->u.lptdesc; _____ Modified: trunk/reactos/lib/oleaut32/typelib2.c --- trunk/reactos/lib/oleaut32/typelib2.c 2005-03-14 23:25:39 UTC (rev 14084) +++ trunk/reactos/lib/oleaut32/typelib2.c 2005-03-14 23:44:13 UTC (rev 14085) @@ -140,7 +140,7 @@ int guid; LCID lcid; int version; - char filename[0]; /* preceeded by two bytes of encoded (length << 2) + flags in the low two bits. */ + char filename[0]; /* preceded by two bytes of encoded (length << 2) + flags in the low two bits. */ } MSFT_ImpFile; typedef struct tagICreateTypeLib2Impl @@ -2055,7 +2055,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetParamCustData( ICreateTypeInfo2* iface, /* [I] The typeinfo in which to set the custom data. */ UINT indexFunc, /* [I] The index of the function on which the parameter resides. */ - UINT indexParam, /* [I] The index of the paramter on which to set the custom data. */ + UINT indexParam, /* [I] The index of the parameter on which to set the custom data. */ REFGUID guid, /* [I] The GUID used as a key to retrieve the custom data. */ VARIANT* pVarVal) /* [I] The custom data. */ { _____ Modified: trunk/reactos/lib/oleaut32/usrmarshal.c --- trunk/reactos/lib/oleaut32/usrmarshal.c 2005-03-14 23:25:39 UTC (rev 14084) +++ trunk/reactos/lib/oleaut32/usrmarshal.c 2005-03-14 23:44:13 UTC (rev 14085) @@ -190,7 +190,7 @@ ULONG size; HRESULT hr; - if (V_VT(pvar) & VT_ARRAY) { + if (V_ISARRAY(pvar)) { FIXME("wire-size safearray\n"); return 0; } @@ -527,7 +527,7 @@ /* count by-ref args */ for (cVarRef=0,u=0; u<pDispParams->cArgs; u++) { VARIANTARG* arg = &pDispParams->rgvarg[u]; - if (V_VT(arg) & VT_BYREF) { + if (V_ISBYREF(arg)) { cVarRef++; } } @@ -537,7 +537,7 @@ /* make list of by-ref args */ for (cVarRef=0,u=0; u<pDispParams->cArgs; u++) { VARIANTARG* arg = &pDispParams->rgvarg[u]; - if (V_VT(arg) & VT_BYREF) { + if (V_ISBYREF(arg)) { rgVarRefIdx[cVarRef] = u; VariantInit(&rgVarRef[cVarRef]); cVarRef++; _____ Modified: trunk/reactos/lib/oleaut32/varformat.c --- trunk/reactos/lib/oleaut32/varformat.c 2005-03-14 23:25:39 UTC (rev 14084) +++ trunk/reactos/lib/oleaut32/varformat.c 2005-03-14 23:44:13 UTC (rev 14085) @@ -94,7 +94,7 @@ * characters. Literal characters are copied unmodified to the formatted * output at the position they occupy in the format string. Any character * that is not recognised as a token is treated as a literal. A literal can - * also be specified by preceeding it with a backslash character + * also be specified by preceding it with a backslash character * (e.g. "\L\i\t\e\r\a\l") or enclosing it in double quotes. * * A user-defined format can have up to 4 sections, depending on the type of @@ -885,7 +885,7 @@ TRACE("h\n"); } fmt_state &= ~FMT_STATE_OPEN_COPY; - /* Note that now we have seen an hours token, the next occurence of + /* Note that now we have seen an hours token, the next occurrence of * 'mm' indicates minutes, not months. */ fmt_state |= FMT_STATE_SEEN_HOURS; _____ Modified: trunk/reactos/lib/oleaut32/variant.c --- trunk/reactos/lib/oleaut32/variant.c 2005-03-14 23:25:39 UTC (rev 14084) +++ trunk/reactos/lib/oleaut32/variant.c 2005-03-14 23:44:13 UTC (rev 14085) @@ -984,7 +984,7 @@ { VARIANTARG vTmp, vSrcDeref; - if(V_VT(pvargSrc)&VT_BYREF && !V_BYREF(pvargSrc)) + if(V_ISBYREF(pvargSrc) && !V_BYREF(pvargSrc)) res = DISP_E_TYPEMISMATCH; else { @@ -2531,7 +2531,7 @@ } xmask = (1<<(V_VT(left)&VT_TYPEMASK))|(1<<(V_VT(right)&VT_TYPEMASK)); - if (xmask & (1<<VT_R8)) { + if (xmask & VTBIT_R8) { rc = VariantChangeType(&lv,left,0,VT_R8); if (FAILED(rc)) return rc; rc = VariantChangeType(&rv,right,0,VT_R8); @@ -2542,7 +2542,7 @@ if (V_R8(&lv) > V_R8(&rv)) return VARCMP_GT; return E_FAIL; /* can't get here */ } - if (xmask & (1<<VT_R4)) { + if (xmask & VTBIT_R4) { rc = VariantChangeType(&lv,left,0,VT_R4); if (FAILED(rc)) return rc; rc = VariantChangeType(&rv,right,0,VT_R4); @@ -2558,29 +2558,29 @@ Use LONGLONG to maximize ranges */ lOk = TRUE; switch (V_VT(left)&VT_TYPEMASK) { - case VT_I1 : lVal = V_UNION(left,cVal); break; - case VT_I2 : lVal = V_UNION(left,iVal); break; - case VT_I4 : lVal = V_UNION(left,lVal); break; - case VT_INT : lVal = V_UNION(left,lVal); break; - case VT_UI1 : lVal = V_UNION(left,bVal); break; - case VT_UI2 : lVal = V_UNION(left,uiVal); break; - case VT_UI4 : lVal = V_UNION(left,ulVal); break; - case VT_UINT : lVal = V_UNION(left,ulVal); break; - case VT_BOOL : lVal = V_UNION(left,boolVal); break; + case VT_I1 : lVal = V_I1(left); break; + case VT_I2 : lVal = V_I2(left); break; + case VT_I4 : + case VT_INT : lVal = V_I4(left); break; + case VT_UI1 : lVal = V_UI1(left); break; + case VT_UI2 : lVal = V_UI2(left); break; + case VT_UI4 : + case VT_UINT : lVal = V_UI4(left); break; + case VT_BOOL : lVal = V_BOOL(left); break; default: lOk = FALSE; } rOk = TRUE; switch (V_VT(right)&VT_TYPEMASK) { - case VT_I1 : rVal = V_UNION(right,cVal); break; - case VT_I2 : rVal = V_UNION(right,iVal); break; - case VT_I4 : rVal = V_UNION(right,lVal); break; - case VT_INT : rVal = V_UNION(right,lVal); break; - case VT_UI1 : rVal = V_UNION(right,bVal); break; - case VT_UI2 : rVal = V_UNION(right,uiVal); break; - case VT_UI4 : rVal = V_UNION(right,ulVal); break; - case VT_UINT : rVal = V_UNION(right,ulVal); break; - case VT_BOOL : rVal = V_UNION(right,boolVal); break; + case VT_I1 : rVal = V_I1(right); break; + case VT_I2 : rVal = V_I2(right); break; + case VT_I4 : + case VT_INT : rVal = V_I4(right); break; + case VT_UI1 : rVal = V_UI1(right); break; + case VT_UI2 : rVal = V_UI2(right); break; + case VT_UI4 : + case VT_UINT : rVal = V_UI4(right); break; + case VT_BOOL : rVal = V_BOOL(right); break; default: rOk = FALSE; } @@ -2598,20 +2598,20 @@ if ((V_VT(left)&VT_TYPEMASK) == VT_DATE && (V_VT(right)&VT_TYPEMASK) == VT_DATE) { - if (floor(V_UNION(left,date)) == floor(V_UNION(right,date))) { + if (floor(V_DATE(left)) == floor(V_DATE(right))) { /* Due to floating point rounding errors, calculate varDate in whole numbers) */ double wholePart = 0.0; double leftR; double rightR; /* Get the fraction * 24*60*60 to make it into whole seconds */ - wholePart = (double) floor( V_UNION(left,date) ); + wholePart = (double) floor( V_DATE(left) ); if (wholePart == 0) wholePart = 1; - leftR = floor(fmod( V_UNION(left,date), wholePart ) * (24*60*60)); + leftR = floor(fmod( V_DATE(left), wholePart ) * (24*60*60)); - wholePart = (double) floor( V_UNION(right,date) ); + wholePart = (double) floor( V_DATE(right) ); if (wholePart == 0) wholePart = 1; - rightR = floor(fmod( V_UNION(right,date), wholePart ) * (24*60*60)); + rightR = floor(fmod( V_DATE(right), wholePart ) * (24*60*60)); if (leftR < rightR) { return VARCMP_LT; @@ -2621,9 +2621,9 @@ return VARCMP_EQ; } - } else if (V_UNION(left,date) < V_UNION(right,date)) { + } else if (V_DATE(left) < V_DATE(right)) { return VARCMP_LT; - } else if (V_UNION(left,date) > V_UNION(right,date)) { + } else if (V_DATE(left) > V_DATE(right)) { return VARCMP_GT; } } @@ -2665,29 +2665,29 @@ lOk = TRUE; switch (V_VT(left)&VT_TYPEMASK) { - case VT_I1 : lVal = V_UNION(left,cVal); resT=VT_I4; break; - case VT_I2 : lVal = V_UNION(left,iVal); resT=VT_I2; break; - case VT_I4 : lVal = V_UNION(left,lVal); resT=VT_I4; break; - case VT_INT : lVal = V_UNION(left,lVal); resT=VT_I4; break; - case VT_UI1 : lVal = V_UNION(left,bVal); resT=VT_I4; break; - case VT_UI2 : lVal = V_UNION(left,uiVal); resT=VT_I4; break; - case VT_UI4 : lVal = V_UNION(left,ulVal); resT=VT_I4; break; - case VT_UINT : lVal = V_UNION(left,ulVal); resT=VT_I4; break; - case VT_BOOL : rVal = V_UNION(left,boolVal); resT=VT_I4; break; + case VT_I1 : lVal = V_I1(left); resT=VT_I4; break; + case VT_I2 : lVal = V_I2(left); resT=VT_I2; break; + case VT_I4 : + case VT_INT : lVal = V_I4(left); resT=VT_I4; break; + case VT_UI1 : lVal = V_UI1(left); resT=VT_I4; break; + case VT_UI2 : lVal = V_UI2(left); resT=VT_I4; break; + case VT_UI4 : + case VT_UINT : lVal = V_UI4(left); resT=VT_I4; break; + case VT_BOOL : rVal = V_BOOL(left); resT=VT_I4; break; default: lOk = FALSE; } rOk = TRUE; switch (V_VT(right)&VT_TYPEMASK) { - case VT_I1 : rVal = V_UNION(right,cVal); resT=VT_I4; break; - case VT_I2 : rVal = V_UNION(right,iVal); resT=max(VT_I2, resT); break; - case VT_I4 : rVal = V_UNION(right,lVal); resT=VT_I4; break; - case VT_INT : rVal = V_UNION(right,lVal); resT=VT_I4; break; - case VT_UI1 : rVal = V_UNION(right,bVal); resT=VT_I4; break; - case VT_UI2 : rVal = V_UNION(right,uiVal); resT=VT_I4; break; - case VT_UI4 : rVal = V_UNION(right,ulVal); resT=VT_I4; break; - case VT_UINT : rVal = V_UNION(right,ulVal); resT=VT_I4; break; - case VT_BOOL : rVal = V_UNION(right,boolVal); resT=VT_I4; break; + case VT_I1 : rVal = V_I1(right); resT=VT_I4; break; + case VT_I2 : rVal = V_I2(right); resT=max(VT_I2, resT); break; + case VT_I4 : + case VT_INT : rVal = V_I4(right); resT=VT_I4; break; + case VT_UI1 : rVal = V_UI1(right); resT=VT_I4; break; + case VT_UI2 : rVal = V_UI2(right); resT=VT_I4; break; + case VT_UI4 : + case VT_UINT : rVal = V_UI4(right); resT=VT_I4; break; + case VT_BOOL : rVal = V_BOOL(right); resT=VT_I4; break; default: rOk = FALSE; } @@ -2695,11 +2695,11 @@ res = (lVal & rVal); V_VT(result) = resT; switch (resT) { - case VT_I2 : V_UNION(result,iVal) = res; break; - case VT_I4 : V_UNION(result,lVal) = res; break; + case VT_I2 : V_I2(result) = res; break; + case VT_I4 : V_I4(result) = res; break; default: FIXME("Unexpected result variant type %x\n", resT); - V_UNION(result,lVal) = res; + V_I4(result) = res; } rc = S_OK; @@ -2747,32 +2747,32 @@ lOk = TRUE; switch (V_VT(left)&VT_TYPEMASK) { - case VT_I1 : lVal = V_UNION(left,cVal); break; - case VT_I2 : lVal = V_UNION(left,iVal); break; - case VT_I4 : lVal = V_UNION(left,lVal); break; - case VT_INT : lVal = V_UNION(left,lVal); break; - case VT_UI1 : lVal = V_UNION(left,bVal); break; - case VT_UI2 : lVal = V_UNION(left,uiVal); break; - case VT_UI4 : lVal = V_UNION(left,ulVal); break; - case VT_UINT : lVal = V_UNION(left,ulVal); break; - case VT_R4 : lVal = V_UNION(left,fltVal); break; - case VT_R8 : lVal = V_UNION(left,dblVal); break; + case VT_I1 : lVal = V_I1(left); break; + case VT_I2 : lVal = V_I2(left); break; + case VT_I4 : + case VT_INT : lVal = V_I4(left); break; + case VT_UI1 : lVal = V_UI1(left); break; + case VT_UI2 : lVal = V_UI2(left); break; + case VT_UI4 : + case VT_UINT : lVal = V_UI4(left); break; + case VT_R4 : lVal = V_R4(left); break; + case VT_R8 : lVal = V_R8(left); break; case VT_NULL : lVal = 0.0; break; default: lOk = FALSE; } rOk = TRUE; switch (V_VT(right)&VT_TYPEMASK) { - case VT_I1 : rVal = V_UNION(right,cVal); break; - case VT_I2 : rVal = V_UNION(right,iVal); break; - case VT_I4 : rVal = V_UNION(right,lVal); break; - case VT_INT : rVal = V_UNION(right,lVal); break; - case VT_UI1 : rVal = V_UNION(right,bVal); break; - case VT_UI2 : rVal = V_UNION(right,uiVal); break; - case VT_UI4 : rVal = V_UNION(right,ulVal); break; - case VT_UINT : rVal = V_UNION(right,ulVal); break; - case VT_R4 : rVal = V_UNION(right,fltVal);break; - case VT_R8 : rVal = V_UNION(right,dblVal);break; + case VT_I1 : rVal = V_I1(right); break; + case VT_I2 : rVal = V_I2(right); break; + case VT_I4 : + case VT_INT : rVal = V_I4(right); break; + case VT_UI1 : rVal = V_UI1(right); break; + case VT_UI2 : rVal = V_UI2(right); break; + case VT_UI4 : + case VT_UINT : rVal = V_UI4(right); break; + case VT_R4 : rVal = V_R4(right);break; + case VT_R8 : rVal = V_R8(right);break; case VT_NULL : rVal = 0.0; break; default: rOk = FALSE; } @@ -2780,7 +2780,7 @@ if (lOk && rOk) { res = (lVal + rVal); V_VT(result) = VT_R8; - V_UNION(result,dblVal) = res; + V_R8(result) = res; rc = S_OK; } else { FIXME("Unhandled type pair %d / %d in double addition.\n", @@ -2801,30 +2801,30 @@ lOk = TRUE; switch (V_VT(left)&VT_TYPEMASK) { - case VT_I1 : lVal = V_UNION(left,cVal); break; - case VT_I2 : lVal = V_UNION(left,iVal); break; - case VT_I4 : lVal = V_UNION(left,lVal); break; - case VT_INT : lVal = V_UNION(left,lVal); break; - case VT_UI1 : lVal = V_UNION(left,bVal); break; - case VT_UI2 : lVal = V_UNION(left,uiVal); break; - case VT_UI4 : lVal = V_UNION(left,ulVal); break; - case VT_UINT : lVal = V_UNION(left,ulVal); break; - case VT_R4 : lVal = V_UNION(left,fltVal); break; + case VT_I1 : lVal = V_I1(left); break; + case VT_I2 : lVal = V_I2(left); break; + case VT_I4 : + case VT_INT : lVal = V_I4(left); break; + case VT_UI1 : lVal = V_UI1(left); break; + case VT_UI2 : lVal = V_UI2(left); break; + case VT_UI4 : + case VT_UINT : lVal = V_UI4(left); break; + case VT_R4 : lVal = V_R4(left); break; case VT_NULL : lVal = 0.0; break; default: lOk = FALSE; } rOk = TRUE; switch (V_VT(right)&VT_TYPEMASK) { - case VT_I1 : rVal = V_UNION(right,cVal); break; - case VT_I2 : rVal = V_UNION(right,iVal); break; - case VT_I4 : rVal = V_UNION(right,lVal); break; - case VT_INT : rVal = V_UNION(right,lVal); break; - case VT_UI1 : rVal = V_UNION(right,bVal); break; - case VT_UI2 : rVal = V_UNION(right,uiVal); break; - case VT_UI4 : rVal = V_UNION(right,ulVal); break; - case VT_UINT : rVal = V_UNION(right,ulVal); break; - case VT_R4 : rVal = V_UNION(right,fltVal);break; + case VT_I1 : rVal = V_I1(right); break; + case VT_I2 : rVal = V_I2(right); break; + case VT_I4 : + case VT_INT : rVal = V_I4(right); break; + case VT_UI1 : rVal = V_UI1(right); break; + case VT_UI2 : rVal = V_UI2(right); break; + case VT_UI4 : + case VT_UINT : rVal = V_UI4(right); break; + case VT_R4 : rVal = V_R4(right);break; case VT_NULL : rVal = 0.0; break; default: rOk = FALSE; } @@ -2832,7 +2832,7 @@ if (lOk && rOk) { res = (lVal + rVal); V_VT(result) = VT_R4; - V_UNION(result,fltVal) = res; + V_R4(result) = res; rc = S_OK; } else { FIXME("Unhandled type pair %d / %d in float addition.\n", @@ -2861,28 +2861,28 @@ lOk = TRUE; switch (V_VT(left)&VT_TYPEMASK) { - case VT_I1 : lVal = V_UNION(left,cVal); resT=VT_I4; break; - case VT_I2 : lVal = V_UNION(left,iVal); resT=VT_I2; break; - case VT_I4 : lVal = V_UNION(left,lVal); resT=VT_I4; break; - case VT_INT : lVal = V_UNION(left,lVal); resT=VT_I4; break; - case VT_UI1 : lVal = V_UNION(left,bVal); resT=VT_I4; break; - case VT_UI2 : lVal = V_UNION(left,uiVal); resT=VT_I4; break; - case VT_UI4 : lVal = V_UNION(left,ulVal); resT=VT_I4; break; - case VT_UINT : lVal = V_UNION(left,ulVal); resT=VT_I4; break; + case VT_I1 : lVal = V_I1(left); resT=VT_I4; break; + case VT_I2 : lVal = V_I2(left); resT=VT_I2; break; + case VT_I4 : + case VT_INT : lVal = V_I4(left); resT=VT_I4; break; + case VT_UI1 : lVal = V_UI1(left); resT=VT_I4; break; + case VT_UI2 : lVal = V_UI2(left); resT=VT_I4; break; + case VT_UI4 : + case VT_UINT : lVal = V_UI4(left); resT=VT_I4; break; case VT_NULL : lVal = 0; resT = VT_I4; break; default: lOk = FALSE; } rOk = TRUE; switch (V_VT(right)&VT_TYPEMASK) { - case VT_I1 : rVal = V_UNION(right,cVal); resT=VT_I4; break; - case VT_I2 : rVal = V_UNION(right,iVal); resT=max(VT_I2, resT); break; - case VT_I4 : rVal = V_UNION(right,lVal); resT=VT_I4; break; - case VT_INT : rVal = V_UNION(right,lVal); resT=VT_I4; break; - case VT_UI1 : rVal = V_UNION(right,bVal); resT=VT_I4; break; [truncated at 1000 lines; 100 more skipped]
19 years, 9 months
1
0
0
0
[gvg] 14084: Sync to Wine-20050310
by gvg@svn.reactos.com
Sync to Wine-20050310 Modified: trunk/reactos/w32api/include/objbase.h _____ Modified: trunk/reactos/w32api/include/objbase.h --- trunk/reactos/w32api/include/objbase.h 2005-03-14 23:17:44 UTC (rev 14083) +++ trunk/reactos/w32api/include/objbase.h 2005-03-14 23:25:39 UTC (rev 14084) @@ -39,6 +39,7 @@ #define STGM_CREATE 0x1000 #define STGM_CONVERT 0x20000 #define STGM_NOSNAPSHOT 0x200000 +#define STGM_DIRECT_SWMR 0x400000 #define STGM_FAILIFTHERE 0 #define CWCSTORAGENAME 32 #define ASYNC_MODE_COMPATIBILITY 1
19 years, 9 months
1
0
0
0
[gvg] 14083: Sync to Wine-20050310:
by gvg@svn.reactos.com
Sync to Wine-20050310: Jon Griffiths <jon_p_griffiths(a)yahoo.com> - Documentation spelling fixes. Mike McCormack <mike(a)codeweavers.com> - Implement and test IPropertySetStorage. - Fix more incorrect uses of STGM_ enumerations. - Add struct StorageBaseImpl at the start of derived structures instead of trying to keep the first members the same. - StgOpenStorage shouldn't open zero length storage files. - Shared reading of storage files requires STGM_TRANSACTED. - Test and fix grfMode handling in StgOpenDocfile. - Implement StgSetTimes. Robert Shearman <rob(a)codeweavers.com> - Better tracing. - Small cleanup of creation functions. - Rename apartment functions to become more object-oriented. - Rename register_ifstub to marshal_object to more accurately describe what it does. - Add new function, apartment_getoxid, to prepare for a possible future patch where remoting is started on demand. - Move marshaling state machine into stub manager from ifstub. - Add additional needed states for table-weak marshaling, as shown by tests. - Protect external reference count from underflows/overflows. - Make COM use the RPC runtime as the backend for RPC calls. Based on a patch by Ove Ksven. - Invoke objects in STA's in the correct thread by sending messages to the hidden apartment window. - Use I_RpcGetBuffer, instead of our own buffer routines to fix an occasional test crash caused by heap corruption. - Zero the memory block passed to RpcServerRegisterIfEx so we don't pass garbage in some of the fields we don't fill in. - Return the correct error code from create_server and fix two handle leaks. - TODO update. - Remove cruft left over from previous RPC backend implementation in the apartment structure. - Don't pass an IPID by value for proxy_manager_create_ifproxy. - Disable more of RPC_UnregisterInterface to prevent the RPC runtime using freed memory. - Rename various external RPC backend functions so that they all have the same "RPC_" prefix. - Reduce the timeout of the function that connects to a local server to 30s, like native. - Make each ifproxy have its own channel buffer to fix a bug where a proxy with multiple interfaces could invoke the wrong stub buffer on the server. - The Global Interface Table should do table-strong marshaling instead of normal marshaling so that an interface can be retrieved more than one time. Mike Hearn <mh(a)codeweavers.com> - Avoid infinite loop when doing a typelib marshalled IUnknown::QueryInterface by only doing an extra QI if requested IID is not equal to marshalled IID. Rob Shearman <rob(a)codeweavers.com> Mike Hearn <mh(a)codeweavers.com> - Add re-entrancy tests to the test suite. - Run RPCs on a new thread client side so we can pump the message loop. Juan Lang <juan_lang(a)yahoo.com> - Fix the calling convention of DllCanUnloadNow. - Move vtbl to end of file and get rid of unnecessary prototypes. - Implement StgCreatePropSetStg. Joris Huizer <jorishuizer(a)planet.nl> - A few memory checks avoiding memory leaks. Francois Gouget <fgouget(a)free.fr> - Assorted spelling fixes. Paul Vriens <Paul.Vriens(a)xs4all.nl> - Added some TRACE statements. Modified: trunk/reactos/lib/ole32/Makefile.in Modified: trunk/reactos/lib/ole32/clipboard.c Modified: trunk/reactos/lib/ole32/compobj.c Modified: trunk/reactos/lib/ole32/compobj_private.h Modified: trunk/reactos/lib/ole32/errorinfo.c Modified: trunk/reactos/lib/ole32/filemoniker.c Modified: trunk/reactos/lib/ole32/git.c Modified: trunk/reactos/lib/ole32/itemmoniker.c Modified: trunk/reactos/lib/ole32/marshal.c Modified: trunk/reactos/lib/ole32/ole2.c Modified: trunk/reactos/lib/ole32/ole32.spec Modified: trunk/reactos/lib/ole32/oleproxy.c Modified: trunk/reactos/lib/ole32/rpc.c Modified: trunk/reactos/lib/ole32/stg_bigblockfile.c Added: trunk/reactos/lib/ole32/stg_prop.c Modified: trunk/reactos/lib/ole32/stg_stream.c Modified: trunk/reactos/lib/ole32/storage32.c Modified: trunk/reactos/lib/ole32/storage32.h Modified: trunk/reactos/lib/ole32/stubmanager.c _____ Modified: trunk/reactos/lib/ole32/Makefile.in --- trunk/reactos/lib/ole32/Makefile.in 2005-03-14 22:56:02 UTC (rev 14082) +++ trunk/reactos/lib/ole32/Makefile.in 2005-03-14 23:17:44 UTC (rev 14083) @@ -34,6 +34,7 @@ regsvr.c \ rpc.c \ stg_bigblockfile.c \ + stg_prop.c \ stg_stream.c \ storage32.c \ stubmanager.c _____ Modified: trunk/reactos/lib/ole32/clipboard.c --- trunk/reactos/lib/ole32/clipboard.c 2005-03-14 22:56:02 UTC (rev 14082) +++ trunk/reactos/lib/ole32/clipboard.c 2005-03-14 23:17:44 UTC (rev 14083) @@ -82,7 +82,7 @@ /* For CoGetMalloc (MEMCTX_TASK is currently ignored) */ #ifndef MEMCTX_TASK - #define MEMCTX_TASK -1 +# define MEMCTX_TASK -1 #endif WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -799,7 +799,7 @@ * (Recall that in OleSetClipboard, we used SetClipboardData to * make all HGLOBAL formats supported by the source IDataObject * available using delayed rendering) - * On receiving this mesage we must actually render the data in the + * On receiving this message we must actually render the data in the * specified format and place it on the clipboard by calling the * SetClipboardData function. */ _____ Modified: trunk/reactos/lib/ole32/compobj.c --- trunk/reactos/lib/ole32/compobj.c 2005-03-14 22:56:02 UTC (rev 14082) +++ trunk/reactos/lib/ole32/compobj.c 2005-03-14 23:17:44 UTC (rev 14083) @@ -30,13 +30,12 @@ * * - Implement the service control manager (in rpcss) to keep track * of registered class objects: ISCM::ServerRegisterClsid et al - * - Implement the OXID resolver so we don't need magic pipe names for + * - Implement the OXID resolver so we don't need magic endpoint names for * clients and servers to meet up - * - Flip our marshalling on top of the RPC runtime transport API, - * so we no longer use named pipes to communicate - * - Implement RPC thread affinity (should fix InstallShield painting - * problems) * + * - Pump the message loop during RPC calls. + * - Call IMessageFilter functions. + * * - Make all ole interface marshaling use NDR to be wire compatible with * native DCOM * - Use & interpret ORPCTHIS & ORPCTHAT. @@ -163,7 +162,7 @@ }; static CRITICAL_SECTION csOpenDllList = { &dll_cs_debug, -1, 0, 0, 0, 0 }; -static const char aptWinClass[] = "WINE_OLE32_APT_CLASS"; +static const WCHAR wszAptWinClass[] = {'W','I','N','E','_','O','L','E','3','2','_','A','P','T','_','C','L','A' ,'S','S',0}; static LRESULT CALLBACK COM_AptWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); static void COMPOBJ_DLLList_Add(HANDLE hLibrary); @@ -171,7 +170,7 @@ void COMPOBJ_InitProcess( void ) { - WNDCLASSA wclass; + WNDCLASSW wclass; /* Dispatching to the correct thread in an apartment is done through * window messages rather than RPC transports. When an interface is @@ -183,15 +182,15 @@ * was unmarshalled. */ memset(&wclass, 0, sizeof(wclass)); - wclass.lpfnWndProc = &COM_AptWndProc; + wclass.lpfnWndProc = COM_AptWndProc; wclass.hInstance = OLE32_hInstance; - wclass.lpszClassName = aptWinClass; - RegisterClassA(&wclass); + wclass.lpszClassName = wszAptWinClass; + RegisterClassW(&wclass); } void COMPOBJ_UninitProcess( void ) { - UnregisterClassA(aptWinClass, OLE32_hInstance); + UnregisterClassW(wszAptWinClass, OLE32_hInstance); } void COM_TlsDestroy() @@ -239,7 +238,7 @@ { /* FIXME: should be randomly generated by in an RPC call to rpcss */ apt->oxid = ((OXID)GetCurrentProcessId() << 32) | GetCurrentThreadId(); - apt->win = CreateWindowA(aptWinClass, NULL, 0, + apt->win = CreateWindowW(wszAptWinClass, NULL, 0, 0, 0, 0, 0, 0, 0, OLE32_hInstance, NULL); } @@ -249,8 +248,6 @@ apt->oxid = ((OXID)GetCurrentProcessId() << 32) | 0xcafe; } - apt->shutdown_event = CreateEventW(NULL, TRUE, FALSE, NULL); - TRACE("Created apartment on OXID %s\n", wine_dbgstr_longlong(apt->oxid)); /* the locking here is not currently needed for the MTA case, but it @@ -354,8 +351,6 @@ if (apt->filter) IUnknown_Release(apt->filter); DeleteCriticalSection(&apt->cs); - SetEvent(apt->shutdown_event); - CloseHandle(apt->shutdown_event); CloseHandle(apt->thread); HeapFree(GetProcessHeap(), 0, apt); } @@ -425,10 +420,15 @@ return apt->win; } -/* Currently inter-thread marshalling is not fully implemented, so this does nothing */ static LRESULT CALLBACK COM_AptWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { - return DefWindowProcA(hWnd, msg, wParam, lParam); + switch (msg) + { + case DM_EXECUTERPC: + return RPC_ExecuteCall((RPCOLEMESSAGE *)wParam, (IRpcStubBuffer *)lParam); + default: + return DefWindowProcW(hWnd, msg, wParam, lParam); + } } /*********************************************************************** ****** @@ -473,7 +473,7 @@ static void COMPOBJ_DllList_FreeUnused(int Timeout) { OpenDll *curr, *next, *prev = NULL; - typedef HRESULT(*DllCanUnloadNowFunc)(void); + typedef HRESULT (WINAPI *DllCanUnloadNowFunc)(void); DllCanUnloadNowFunc DllCanUnloadNow; TRACE("\n"); @@ -1629,7 +1629,7 @@ /* Next try out of process */ if (CLSCTX_LOCAL_SERVER & dwClsContext) { - return create_marshalled_proxy(rclsid,iid,ppv); + return RPC_GetLocalClassObject(rclsid,iid,ppv); } /* Finally try remote: this requires networked DCOM (a lot of work) */ _____ Modified: trunk/reactos/lib/ole32/compobj_private.h --- trunk/reactos/lib/ole32/compobj_private.h 2005-03-14 22:56:02 UTC (rev 14082) +++ trunk/reactos/lib/ole32/compobj_private.h 2005-03-14 23:17:44 UTC (rev 14083) @@ -53,10 +53,12 @@ typedef enum ifstub_state { - IFSTUB_STATE_NORMAL_MARSHALED, - IFSTUB_STATE_NORMAL_UNMARSHALED, - IFSTUB_STATE_TABLE_MARSHALED -} IFSTUB_STATE; + STUBSTATE_NORMAL_MARSHALED, + STUBSTATE_NORMAL_UNMARSHALED, + STUBSTATE_TABLE_WEAK_MARSHALED, + STUBSTATE_TABLE_WEAK_UNMARSHALED, + STUBSTATE_TABLE_STRONG, +} STUB_STATE; /* an interface stub */ struct ifstub @@ -66,7 +68,6 @@ IID iid; /* RO */ IPID ipid; /* RO */ IUnknown *iface; /* RO */ - IFSTUB_STATE state; /* CS stub_manager->lock */ }; @@ -78,11 +79,12 @@ CRITICAL_SECTION lock; APARTMENT *apt; /* owning apt (RO) */ - ULONG extrefs; /* number of 'external' references (LOCK) */ + ULONG extrefs; /* number of 'external' references (CS lock) */ ULONG refs; /* internal reference count (CS apt->cs) */ OID oid; /* apartment-scoped unique identifier (RO) */ IUnknown *object; /* the object we are managing the stub for (RO) */ ULONG next_ipid; /* currently unused (LOCK) */ + STUB_STATE state; /* state machine (CS lock) */ }; /* imported interface proxy */ @@ -95,6 +97,7 @@ IPID ipid; /* imported interface ID (RO) */ LPRPCPROXYBUFFER proxy; /* interface proxy (RO) */ DWORD refs; /* imported (public) references (CS parent->cs) */ + IRpcChannelBuffer *chan; /* channel to object (CS parent->cs) */ }; /* imported object / proxy manager */ @@ -103,7 +106,6 @@ const IMultiQIVtbl *lpVtbl; struct apartment *parent; /* owning apartment (RO) */ struct list entry; /* entry in apartment (CS parent->cs) */ - LPRPCCHANNELBUFFER chan; /* channel to object (CS cs) */ OXID oxid; /* object exported ID (RO) */ OID oid; /* object ID (RO) */ struct list interfaces; /* imported interfaces (CS cs) */ @@ -130,11 +132,10 @@ struct list proxies; /* imported objects (CS cs) */ struct list stubmgrs; /* stub managers for exported objects (CS cs) */ BOOL remunk_exported; /* has the IRemUnknown interface for this apartment been created yet? (CS cs) */ + LONG remoting_started; /* has the RPC system been started for this apartment? (LOCK) */ - /* FIXME: These should all be removed long term as they leak information that should be encapsulated */ + /* FIXME: OID's should be given out by RPCSS */ OID oidc; /* object ID counter, starts at 1, zero is invalid OID (CS cs) */ - DWORD listenertid; /* id of apartment_listener_thread */ - HANDLE shutdown_event; /* event used to tell the client_dispatch_thread to shut down */ }; /* this is what is stored in TEB->ReservedForOle */ @@ -146,60 +147,50 @@ DWORD inits; /* number of times CoInitializeEx called */ }; + +/* Global Interface Table Functions */ + extern void* StdGlobalInterfaceTable_Construct(void); extern void StdGlobalInterfaceTable_Destroy(void* self); extern HRESULT StdGlobalInterfaceTable_GetFactory(LPVOID *ppv); +extern void* StdGlobalInterfaceTableInstance; /* FIXME: these shouldn't be needed, except for 16-bit functions */ extern HRESULT WINE_StringFromCLSID(const CLSID *id,LPSTR idstr); HRESULT WINAPI __CLSIDFromStringA(LPCSTR idstr, CLSID *id); -extern HRESULT create_marshalled_proxy(REFCLSID rclsid, REFIID iid, LPVOID *ppv); - -extern void* StdGlobalInterfaceTableInstance; - -/* Standard Marshalling definitions */ -typedef struct _wine_marshal_id { - OXID oxid; /* id of apartment */ - OID oid; /* id of stub manager */ - IPID ipid; /* id of interface pointer */ -} wine_marshal_id; - -inline static BOOL -MARSHAL_Compare_Mids(wine_marshal_id *mid1,wine_marshal_id *mid2) { - return - (mid1->oxid == mid2->oxid) && - (mid1->oid == mid2->oid) && - IsEqualGUID(&(mid1->ipid),&(mid2->ipid)) - ; -} - HRESULT MARSHAL_Disconnect_Proxies(APARTMENT *apt); HRESULT MARSHAL_GetStandardMarshalCF(LPVOID *ppv); +/* Stub Manager */ + ULONG stub_manager_int_addref(struct stub_manager *This); ULONG stub_manager_int_release(struct stub_manager *This); -struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object); +struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object, MSHLFLAGS mshlflags); ULONG stub_manager_ext_addref(struct stub_manager *m, ULONG refs); ULONG stub_manager_ext_release(struct stub_manager *m, ULONG refs); -struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *sb, IUnknown *iptr, REFIID iid, BOOL tablemarshal); +struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *sb, IUnknown *iptr, REFIID iid); struct stub_manager *get_stub_manager(APARTMENT *apt, OID oid); struct stub_manager *get_stub_manager_from_object(APARTMENT *apt, void *object); void apartment_disconnect_object(APARTMENT *apt, void *object); -BOOL stub_manager_notify_unmarshal(struct stub_manager *m, const IPID *ipid); -BOOL stub_manager_is_table_marshaled(struct stub_manager *m, const IPID *ipid); +BOOL stub_manager_notify_unmarshal(struct stub_manager *m); +BOOL stub_manager_is_table_marshaled(struct stub_manager *m); +void stub_manager_release_marshal_data(struct stub_manager *m, ULONG refs); HRESULT register_ifstub(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnknown *obj, MSHLFLAGS mshlflags); HRESULT ipid_to_stub_manager(const IPID *ipid, APARTMENT **stub_apt, struct stub_manager **stubmgr_ret); -IRpcStubBuffer *ipid_to_stubbuffer(const IPID *ipid); +IRpcStubBuffer *ipid_to_apt_and_stubbuffer(const IPID *ipid, APARTMENT **stub_apt); HRESULT start_apartment_remote_unknown(void); -IRpcStubBuffer *mid_to_stubbuffer(wine_marshal_id *mid); +/* RPC Backend */ -void start_apartment_listener_thread(void); +void RPC_StartRemoting(struct apartment *apt); +HRESULT RPC_CreateClientChannel(const OXID *oxid, const IPID *ipid, IRpcChannelBuffer **pipebuf); +HRESULT RPC_ExecuteCall(RPCOLEMESSAGE *msg, IRpcStubBuffer *stub); +HRESULT RPC_RegisterInterface(REFIID riid); +void RPC_UnregisterInterface(REFIID riid); +void RPC_StartLocalServer(REFCLSID clsid, IStream *stream); +HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv); -extern HRESULT PIPE_GetNewPipeBuf(wine_marshal_id *mid, IRpcChannelBuffer **pipebuf); -void RPC_StartLocalServer(REFCLSID clsid, IStream *stream); - /* This function initialize the Running Object Table */ HRESULT WINAPI RunningObjectTableImpl_Initialize(void); @@ -209,12 +200,17 @@ /* This function decomposes a String path to a String Table containing all the elements ("\" or "subDirectory" or "Directory" or "FileName") of the path */ int WINAPI FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable); -/* compobj.c */ + +/* Apartment Functions */ + APARTMENT *COM_ApartmentFromOXID(OXID oxid, BOOL ref); APARTMENT *COM_ApartmentFromTID(DWORD tid); DWORD COM_ApartmentAddRef(struct apartment *apt); DWORD COM_ApartmentRelease(struct apartment *apt); +/* messages used by the apartment window (not compatible with native) */ +#define DM_EXECUTERPC (WM_USER + 0) /* WPARAM = (RPCOLEMESSAGE *), LPARAM = (IRpcStubBuffer *) */ + /* * Per-thread values are stored in the TEB on offset 0xF80, * see
http://www.microsoft.com/msj/1099/bugslayer/bugslayer1099.htm
_____ Modified: trunk/reactos/lib/ole32/errorinfo.c --- trunk/reactos/lib/ole32/errorinfo.c 2005-03-14 22:56:02 UTC (rev 14082) +++ trunk/reactos/lib/ole32/errorinfo.c 2005-03-14 23:17:44 UTC (rev 14083) @@ -386,11 +386,10 @@ LPOLESTR szHelpFile) { _ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface); - TRACE("(%p)\n",This); + TRACE("(%p,%s)\n",This,debugstr_w(szHelpFile)); if (This->bstrHelpFile != NULL) ERRORINFO_SysFreeString(This->bstrHelpFile); This->bstrHelpFile = ERRORINFO_SysAllocString(szHelpFile); - return S_OK; } @@ -399,9 +398,8 @@ DWORD dwHelpContext) { _ICOM_THIS_From_ICreateErrorInfo(ErrorInfoImpl, iface); - TRACE("(%p)\n",This); + TRACE("(%p,%ld)\n",This,dwHelpContext); This->m_dwHelpContext = dwHelpContext; - return S_OK; } _____ Modified: trunk/reactos/lib/ole32/filemoniker.c --- trunk/reactos/lib/ole32/filemoniker.c 2005-03-14 22:56:02 UTC (rev 14082) +++ trunk/reactos/lib/ole32/filemoniker.c 2005-03-14 23:17:44 UTC (rev 14083) @@ -157,7 +157,7 @@ { FileMonikerImpl *This = (FileMonikerImpl *)iface; - TRACE("(%p,%p,%p)\n",This,riid,ppvObject); + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject); /* Perform a sanity check on the parameters.*/ if ( (This==0) || (ppvObject==0) ) @@ -223,7 +223,7 @@ HRESULT WINAPI FileMonikerImpl_GetClassID(IMoniker* iface, CLSID *pClassID)/* Pointer to CLSID of object */ { - TRACE("(%p,%p),stub!\n",iface,pClassID); + TRACE("(%p,%p)\n",iface,pClassID); if (pClassID==NULL) return E_POINTER; @@ -473,7 +473,7 @@ static const WCHAR bkSlash[]={'\\',0}; BYTE addBkSlash; - TRACE("(%p,%p)\n",This,lpszPathName); + TRACE("(%p,%s)\n",This,debugstr_w(lpszPathName)); /* Initialize the virtual fgunction table. */ This->lpvtbl1 = &VT_FileMonikerImpl; @@ -566,7 +566,7 @@ *ppvResult=0; - TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult); + TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvRe sult); if(pmkToLeft==NULL){ @@ -673,7 +673,7 @@ IStorage *pstg=0; HRESULT res; - TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvObject); + TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvOb ject); if (pmkToLeft==NULL){ @@ -708,7 +708,7 @@ } else { - FIXME("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvObject); + FIXME("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvOb ject); return E_NOTIMPL; } @@ -1243,6 +1243,8 @@ strcpyW(*ppszDisplayName,This->filePathName); + TRACE("-- %s\n", debugstr_w(*ppszDisplayName)); + return S_OK; } @@ -1283,7 +1285,7 @@ ICOM_THIS_From_IROTData(IMoniker, iface); - TRACE("(%p,%p,%p)\n",This,riid,ppvObject); + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject); return FileMonikerImpl_QueryInterface(This, riid, ppvObject); } @@ -1329,29 +1331,28 @@ ************************************************************************ ******/ HRESULT WINAPI CreateFileMoniker(LPCOLESTR lpszPathName, LPMONIKER * ppmk) { - FileMonikerImpl* newFileMoniker = 0; - HRESULT hr = E_FAIL; - IID riid=IID_IMoniker; + FileMonikerImpl* newFileMoniker; + HRESULT hr; - TRACE("(%p,%p)\n",lpszPathName,ppmk); + TRACE("(%s,%p)\n",debugstr_w(lpszPathName),ppmk); - if (ppmk==NULL) + if (!ppmk) return E_POINTER; - if(lpszPathName==NULL) + if(!lpszPathName) return MK_E_SYNTAX; - *ppmk=0; + *ppmk=NULL; newFileMoniker = HeapAlloc(GetProcessHeap(), 0, sizeof(FileMonikerImpl)); - if (newFileMoniker == 0) + if (!newFileMoniker) return E_OUTOFMEMORY; hr = FileMonikerImpl_Construct(newFileMoniker,lpszPathName); if (SUCCEEDED(hr)) - hr = FileMonikerImpl_QueryInterface((IMoniker*)newFileMoniker,&riid,(void**)p pmk); + hr = FileMonikerImpl_QueryInterface((IMoniker*)newFileMoniker,&IID_IMoniker,( void**)ppmk); else HeapFree(GetProcessHeap(),0,newFileMoniker); _____ Modified: trunk/reactos/lib/ole32/git.c --- trunk/reactos/lib/ole32/git.c 2005-03-14 22:56:02 UTC (rev 14082) +++ trunk/reactos/lib/ole32/git.c 2005-03-14 23:17:44 UTC (rev 14083) @@ -223,6 +223,7 @@ IStream* stream = NULL; HRESULT hres; StdGITEntry* entry; + static const LARGE_INTEGER zero; TRACE("iface=%p, pUnk=%p, riid=%s, pdwCookie=0x%p\n", iface, pUnk, debugstr_guid(riid), pdwCookie); @@ -230,8 +231,18 @@ /* marshal the interface */ TRACE("About to marshal the interface\n"); - hres = CoMarshalInterThreadInterfaceInStream(riid, pUnk, &stream); + + hres = CreateStreamOnHGlobal(0, TRUE, &stream); if (hres) return hres; + hres = CoMarshalInterface(stream, riid, pUnk, MSHCTX_INPROC, NULL, MSHLFLAGS_TABLESTRONG); + if (hres) + { + IStream_Release(stream); + return hres; + } + + IStream_Seek(stream, zero, SEEK_SET, NULL); + entry = HeapAlloc(GetProcessHeap(), 0, sizeof(StdGITEntry)); if (entry == NULL) return E_OUTOFMEMORY; @@ -261,6 +272,7 @@ HRESULT WINAPI StdGlobalInterfaceTable_RevokeInterfaceFromGlobal(IGlobalInterfaceTable* iface, DWORD dwCookie) { StdGlobalInterfaceTableImpl* const self = (StdGlobalInterfaceTableImpl*) iface; StdGITEntry* entry; + HRESULT hr; TRACE("iface=%p, dwCookie=0x%x\n", iface, (UINT)dwCookie); @@ -271,6 +283,12 @@ } /* Free the stream */ + hr = CoReleaseMarshalData(entry->stream); + if (hr != S_OK) + { + WARN("Failed to release marshal data, hr = 0x%08lx\n", hr); + return hr; + } IStream_Release(entry->stream); /* chop entry out of the list, and free the memory */ _____ Modified: trunk/reactos/lib/ole32/itemmoniker.c --- trunk/reactos/lib/ole32/itemmoniker.c 2005-03-14 22:56:02 UTC (rev 14082) +++ trunk/reactos/lib/ole32/itemmoniker.c 2005-03-14 23:17:44 UTC (rev 14083) @@ -156,7 +156,7 @@ { ItemMonikerImpl *This = (ItemMonikerImpl *)iface; - TRACE("(%p,%p,%p)\n",This,riid,ppvObject); + TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject); /* Perform a sanity check on the parameters.*/ if ( (This==0) || (ppvObject==0) ) @@ -221,7 +221,7 @@ ************************************************************************ ******/ HRESULT WINAPI ItemMonikerImpl_GetClassID(IMoniker* iface,CLSID *pClassID) { - TRACE("(%p,%p),stub!\n",iface,pClassID); + TRACE("(%p,%p)\n",iface,pClassID); if (pClassID==NULL) return E_POINTER; @@ -257,6 +257,8 @@ CHAR *itemNameA,*itemDelimiterA; ULONG bread; + TRACE("\n"); + /* for more details about data read by this function see coments of ItemMonikerImpl_Save function */ /* read item delimiter string length + 1 */ @@ -335,6 +337,8 @@ WideCharToMultiByte( CP_ACP, 0, This->itemName, -1, itemNameA, nameLength, NULL, NULL); WideCharToMultiByte( CP_ACP, 0, This->itemDelimiter, -1, itemDelimiterA, delimiterLength, NULL, NULL); + TRACE("%p, %s\n", pStm, fClearDirty ? "TRUE" : "FALSE"); + res=IStream_Write(pStm,&delimiterLength,sizeof(DWORD),NULL); res=IStream_Write(pStm,itemDelimiterA,delimiterLength * sizeof(CHAR),NULL); res=IStream_Write(pStm,&nameLength,sizeof(DWORD),NULL); @@ -381,7 +385,7 @@ static const OLECHAR emptystr[1]; LPCOLESTR delim; - TRACE("(%p,%p)\n",This,lpszItem); + TRACE("(%p,%s,%s)\n",This,debugstr_w(lpszDelim),debugstr_w(lpszItem)); /* Initialize the virtual fgunction table. */ This->lpvtbl1 = &VT_ItemMonikerImpl; @@ -437,7 +441,7 @@ IID refid=IID_IOleItemContainer; IOleItemContainer *poic=0; - TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult); + TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvRe sult); if(ppvResult ==NULL) return E_POINTER; @@ -473,7 +477,7 @@ HRESULT res; IOleItemContainer *poic=0; - TRACE("(%p,%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,riid,ppvResult); + TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvRe sult); *ppvResult=0; @@ -781,6 +785,9 @@ HRESULT WINAPI ItemMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix) { DWORD mkSys; + + TRACE("(%p,%p)\n", pmkOther, ppmkPrefix); + IMoniker_IsSystemMoniker(pmkOther,&mkSys); /* If the other moniker is an item moniker that is equal to this moniker, this method sets *ppmkPrefix */ /* to this moniker and returns MK_S_US */ @@ -841,6 +848,8 @@ lstrcpyW(*ppszDisplayName,This->itemDelimiter); lstrcatW(*ppszDisplayName,This->itemName); + TRACE("-- %s\n", debugstr_w(*ppszDisplayName)); + return S_OK; } @@ -860,6 +869,8 @@ HRESULT res; ItemMonikerImpl *This = (ItemMonikerImpl *)iface; + TRACE("%s\n", debugstr_w(pszDisplayName)); + /* If pmkToLeft is NULL, this method returns MK_E_SYNTAX */ if (pmkToLeft==NULL) @@ -955,15 +966,14 @@ ************************************************************************ ******/ HRESULT WINAPI CreateItemMoniker(LPCOLESTR lpszDelim,LPCOLESTR lpszItem, LPMONIKER * ppmk) { - ItemMonikerImpl* newItemMoniker = 0; - HRESULT hr = S_OK; - IID riid=IID_IMoniker; + ItemMonikerImpl* newItemMoniker; + HRESULT hr; - TRACE("(%p,%p,%p)\n",lpszDelim,lpszItem,ppmk); + TRACE("(%s,%s,%p)\n",debugstr_w(lpszDelim),debugstr_w(lpszItem),ppmk); newItemMoniker = HeapAlloc(GetProcessHeap(), 0, sizeof(ItemMonikerImpl)); - if (newItemMoniker == 0) + if (!newItemMoniker) return STG_E_INSUFFICIENTMEMORY; hr = ItemMonikerImpl_Construct(newItemMoniker,lpszDelim,lpszItem); @@ -974,5 +984,5 @@ return hr; } - return ItemMonikerImpl_QueryInterface((IMoniker*)newItemMoniker,&riid,(void**)p pmk); + return ItemMonikerImpl_QueryInterface((IMoniker*)newItemMoniker,&IID_IMoniker,( void**)ppmk); } _____ Modified: trunk/reactos/lib/ole32/marshal.c --- trunk/reactos/lib/ole32/marshal.c 2005-03-14 22:56:02 UTC (rev 14082) +++ trunk/reactos/lib/ole32/marshal.c 2005-03-14 23:17:44 UTC (rev 14083) @@ -117,13 +117,15 @@ stdobjref->oxid = apt->oxid; + /* FIXME: what happens if we register an interface twice with different + * marshaling flags? */ if ((manager = get_stub_manager_from_object(apt, obj))) TRACE("registering new ifstub on pre-existing manager\n"); else { TRACE("constructing new stub manager\n"); - manager = new_stub_manager(apt, obj); + manager = new_stub_manager(apt, obj, mshlflags); if (!manager) return E_OUTOFMEMORY; } @@ -131,7 +133,7 @@ tablemarshal = ((mshlflags & MSHLFLAGS_TABLESTRONG) || (mshlflags & MSHLFLAGS_TABLEWEAK)); - ifstub = stub_manager_new_ifstub(manager, stub, obj, riid, tablemarshal); + ifstub = stub_manager_new_ifstub(manager, stub, obj, riid); if (!ifstub) { IRpcStubBuffer_Release(stub); @@ -153,6 +155,9 @@ stub_manager_ext_addref(manager, 1); } + /* FIXME: check return value */ + RPC_RegisterInterface(riid); + stdobjref->ipid = ifstub->ipid; stub_manager_int_release(manager); @@ -372,12 +377,17 @@ return hr; } +/* should be called inside This->parent->cs critical section */ static void ifproxy_disconnect(struct ifproxy * This) { ifproxy_release_public_refs(This); if (This->proxy) IRpcProxyBuffer_Disconnect(This->proxy); + + IRpcChannelBuffer_Release(This->chan); + This->chan = NULL; } +/* should be called in This->parent->cs critical section if it is an entry in parent's list */ static void ifproxy_destroy(struct ifproxy * This) { TRACE("%p\n", This); @@ -388,6 +398,12 @@ list_remove(&This->entry); + if (This->chan) + { + IRpcChannelBuffer_Release(This->chan); + This->chan = NULL; + } + /* note: we don't call Release for This->proxy because its lifetime is * controlled by the return value from ClientIdentity_Release, which this * function is always called from */ @@ -397,7 +413,7 @@ static HRESULT proxy_manager_construct( APARTMENT * apt, ULONG sorflags, OXID oxid, OID oid, - IRpcChannelBuffer * channel, struct proxy_manager ** proxy_manager) + struct proxy_manager ** proxy_manager) { struct proxy_manager * This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); if (!This) return E_OUTOFMEMORY; @@ -423,9 +439,6 @@ * should store the STDOBJREF flags in the proxy manager. */ This->sorflags = sorflags; - assert(channel); - This->chan = channel; /* FIXME: we should take the binding strings and construct the channel in this function */ - /* we create the IRemUnknown proxy on demand */ This->remunk = NULL; @@ -473,8 +486,8 @@ } static HRESULT proxy_manager_create_ifproxy( - struct proxy_manager * This, IPID ipid, REFIID riid, ULONG cPublicRefs, - struct ifproxy ** iif_out) + struct proxy_manager * This, const IPID *ipid, REFIID riid, ULONG cPublicRefs, + IRpcChannelBuffer * channel, struct ifproxy ** iif_out) { HRESULT hr; IPSFactoryBuffer * psfb; @@ -484,11 +497,14 @@ list_init(&ifproxy->entry); ifproxy->parent = This; - ifproxy->ipid = ipid; + ifproxy->ipid = *ipid; ifproxy->iid = *riid; ifproxy->refs = cPublicRefs; ifproxy->proxy = NULL; + assert(channel); + ifproxy->chan = channel; /* FIXME: we should take the binding strings and construct the channel in this function */ + /* the IUnknown interface is special because it does not have a * proxy associated with the ifproxy as we handle IUnknown ourselves */ if (IsEqualIID(riid, &IID_IUnknown)) @@ -517,7 +533,7 @@ debugstr_guid(riid), hr); if (hr == S_OK) - hr = IRpcProxyBuffer_Connect(ifproxy->proxy, This->chan); + hr = IRpcProxyBuffer_Connect(ifproxy->proxy, ifproxy->chan); } /* get at least one external reference to the object to keep it alive */ @@ -532,7 +548,7 @@ *iif_out = ifproxy; TRACE("ifproxy %p created for IPID %s, interface %s with %lu public refs\n", - ifproxy, debugstr_guid(&ipid), debugstr_guid(riid), cPublicRefs); + ifproxy, debugstr_guid(ipid), debugstr_guid(riid), cPublicRefs); } else ifproxy_destroy(ifproxy); @@ -579,11 +595,6 @@ /* apartment is being destroyed so don't keep a pointer around to it */ This->parent = NULL; - /* FIXME: will this still be necessary if/when we use a real RPC - * channel? */ - IRpcChannelBuffer_Release(This->chan); - This->chan = NULL; - LeaveCriticalSection(&This->cs); } @@ -671,7 +682,6 @@ } if (This->remunk) IRemUnknown_Release(This->remunk); - if (This->chan) IRpcChannelBuffer_Release(This->chan); DeleteCriticalSection(&This->cs); @@ -792,8 +802,8 @@ return CO_E_NOTINITIALIZED; } - start_apartment_listener_thread(); /* just to be sure we have one running. */ - start_apartment_remote_unknown(); + /* make sure this apartment can be reached from other threads / processes */ + RPC_StartRemoting(apt); hres = IUnknown_QueryInterface((LPUNKNOWN)pv, riid, (LPVOID*)&pUnk); if (hres != S_OK) @@ -839,18 +849,9 @@ * object */ if (!find_proxy_manager(apt, stdobjref->oxid, stdobjref->oid, &proxy_manager)) { - IRpcChannelBuffer *chanbuf; - wine_marshal_id mid; - - mid.oxid = stdobjref->oxid; - mid.oid = stdobjref->oid; - mid.ipid = stdobjref->ipid; - - hr = PIPE_GetNewPipeBuf(&mid,&chanbuf); - if (hr == S_OK) - hr = proxy_manager_construct(apt, stdobjref->flags, - stdobjref->oxid, stdobjref->oid, - chanbuf, &proxy_manager); + hr = proxy_manager_construct(apt, stdobjref->flags, + stdobjref->oxid, stdobjref->oid, + &proxy_manager); } else TRACE("proxy manager already created, using\n"); @@ -860,9 +861,14 @@ struct ifproxy * ifproxy; hr = proxy_manager_find_ifproxy(proxy_manager, riid, &ifproxy); if (hr == E_NOINTERFACE) - hr = proxy_manager_create_ifproxy(proxy_manager, stdobjref->ipid, - riid, stdobjref->cPublicRefs, - &ifproxy); + { + IRpcChannelBuffer *chanbuf; + hr = RPC_CreateClientChannel(&stdobjref->oxid, &stdobjref->ipid, &chanbuf); + if (hr == S_OK) + hr = proxy_manager_create_ifproxy(proxy_manager, &stdobjref->ipid, + riid, stdobjref->cPublicRefs, + chanbuf, &ifproxy); + } if (hr == S_OK) { @@ -911,7 +917,7 @@ hres = IUnknown_QueryInterface(stubmgr->object, riid, ppv); /* unref the ifstub. FIXME: only do this on success? */ - if (!stub_manager_is_table_marshaled(stubmgr, &stdobjref.ipid)) + if (!stub_manager_is_table_marshaled(stubmgr)) stub_manager_ext_release(stubmgr, 1); stub_manager_int_release(stubmgr); @@ -927,7 +933,7 @@ { if ((stubmgr = get_stub_manager(stub_apt, stdobjref.oid))) { - if (!stub_manager_notify_unmarshal(stubmgr, &stdobjref.ipid)) + if (!stub_manager_notify_unmarshal(stubmgr)) hres = CO_E_OBJNOTCONNECTED; stub_manager_int_release(stubmgr); @@ -982,9 +988,7 @@ return RPC_E_INVALID_OBJREF; } - /* FIXME: don't release if table-weak and already unmarshaled an object */ - /* FIXME: this should also depend on stdobjref.cPublicRefs */ - stub_manager_ext_release(stubmgr, 1); + stub_manager_release_marshal_data(stubmgr, stdobjref.cPublicRefs); stub_manager_int_release(stubmgr); COM_ApartmentRelease(apt); @@ -1418,11 +1422,19 @@ if (hr == S_OK) { - hr = IUnknown_QueryInterface(object, &iid, ppv); - if (hr) - ERR("Couldn't query for interface %s, hr = 0x%08lx\n", - debugstr_guid(riid), hr); - IUnknown_Release(object); + if (!IsEqualIID(riid, &iid)) + { + TRACE("requested interface != marshalled interface, additional QI needed\n"); + hr = IUnknown_QueryInterface(object, &iid, ppv); + if (hr) + ERR("Couldn't query for interface %s, hr = 0x%08lx\n", + debugstr_guid(riid), hr); + IUnknown_Release(object); + } + else + { + *ppv = object; + } } IMarshal_Release(pMarshal); _____ Modified: trunk/reactos/lib/ole32/ole2.c --- trunk/reactos/lib/ole32/ole2.c 2005-03-14 22:56:02 UTC (rev 14082) +++ trunk/reactos/lib/ole32/ole2.c 2005-03-14 23:17:44 UTC (rev 14083) @@ -1036,7 +1036,7 @@ * All menu messages from these groups should be routed to the server. * * RETURNS: TRUE if the popup menu is part of a server owned group - * FASE if the popup menu is part of a container owned group + * FALSE if the popup menu is part of a container owned group */ BOOL OLEMenu_SetIsServerMenu( HMENU hmenu, OleMenuDescriptor *pOleMenuDescriptor ) { _____ Modified: trunk/reactos/lib/ole32/ole32.spec --- trunk/reactos/lib/ole32/ole32.spec 2005-03-14 22:56:02 UTC (rev 14082) +++ trunk/reactos/lib/ole32/ole32.spec 2005-03-14 23:17:44 UTC (rev 14083) @@ -233,6 +233,7 @@ @ stub SNB_UserUnmarshal @ stdcall StgCreateDocfile(wstr long long ptr) @ stdcall StgCreateDocfileOnILockBytes(ptr long long ptr) +@ stdcall StgCreatePropSetStg(ptr long ptr) @ stdcall StgCreateStorageEx(wstr long long long ptr ptr ptr ptr) @ stub StgGetIFillLockBytesOnFile @ stub StgGetIFillLockBytesOnILockBytes _____ Modified: trunk/reactos/lib/ole32/oleproxy.c --- trunk/reactos/lib/ole32/oleproxy.c 2005-03-14 22:56:02 UTC (rev 14082) +++ trunk/reactos/lib/ole32/oleproxy.c 2005-03-14 23:17:44 UTC (rev 14083) @@ -191,10 +191,8 @@ msg->cbBuffer = ststg.cbSize.u.LowPart; - if (msg->Buffer) - msg->Buffer = HeapReAlloc(GetProcessHeap(),0,msg->Buffer,ststg.cbSize.u.LowPart); - else - msg->Buffer = HeapAlloc(GetProcessHeap(),0,ststg.cbSize.u.LowPart); + I_RpcGetBuffer((RPC_MESSAGE *)msg); + if (hres) return hres; seekto.u.LowPart = 0;seekto.u.HighPart = 0; hres = IStream_Seek(pStm,seekto,SEEK_SET,&newpos); @@ -547,10 +545,10 @@ /* out */ pMsg->cbBuffer = cIids * sizeof(REMQIRESULT); - if (pMsg->Buffer) - pMsg->Buffer = HeapReAlloc(GetProcessHeap(), 0, pMsg->Buffer, pMsg->cbBuffer); - else - pMsg->Buffer = HeapAlloc(GetProcessHeap(), 0, pMsg->cbBuffer); + + I_RpcGetBuffer((RPC_MESSAGE *)pMsg); + if (hr) return hr; + buf = pMsg->Buffer; /* FIXME: pQIResults is a unique pointer so pQIResults can be NULL! */ memcpy(buf, pQIResults, cIids * sizeof(REMQIRESULT)); @@ -574,13 +572,14 @@ /* out */ pMsg->cbBuffer = cIids * sizeof(HRESULT); - if (pMsg->Buffer) - pMsg->Buffer = HeapReAlloc(GetProcessHeap(), 0, pMsg->Buffer, pMsg->cbBuffer); - else - pMsg->Buffer = HeapAlloc(GetProcessHeap(), 0, pMsg->cbBuffer); - buf = pMsg->Buffer; - memcpy(buf, pResults, cIids * sizeof(HRESULT)); + I_RpcGetBuffer((RPC_MESSAGE *)pMsg); + if (!hr) + { + buf = pMsg->Buffer; + memcpy(buf, pResults, cIids * sizeof(HRESULT)); + } + CoTaskMemFree(pResults); break; _____ Modified: trunk/reactos/lib/ole32/rpc.c --- trunk/reactos/lib/ole32/rpc.c 2005-03-14 22:56:02 UTC (rev 14082) +++ trunk/reactos/lib/ole32/rpc.c 2005-03-14 23:17:44 UTC (rev 14083) @@ -1,6 +1,7 @@ /* * (Local) RPC Stuff * + * Copyright 2001 Ove KÕven, TransGaming Technologies * Copyright 2002 Marcus Meissner * Copyright 2005 Mike Hearn, Rob Shearman for CodeWeavers * @@ -49,425 +50,530 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); [truncated at 1000 lines; 2487 more skipped]
19 years, 9 months
1
0
0
0
[gvg] 14082: Sync to Wine-20050310
by gvg@svn.reactos.com
Sync to Wine-20050310 Modified: trunk/reactos/include/wine/msidefs.h _____ Modified: trunk/reactos/include/wine/msidefs.h --- trunk/reactos/include/wine/msidefs.h 2005-03-14 22:54:57 UTC (rev 14081) +++ trunk/reactos/include/wine/msidefs.h 2005-03-14 22:56:02 UTC (rev 14082) @@ -89,6 +89,20 @@ msidbFeatureAttributesNoUnsupportedAdvertise = 0x00000020 }; +enum msidbComponentAttributes +{ + msidbComponentAttributesLocalOnly = 0x00000000, + msidbComponentAttributesSourceOnly = 0x00000001, + msidbComponentAttributesOptional = 0x00000002, + msidbComponentAttributesRegistryKeyPath = 0x00000004, + msidbComponentAttributesSharedDllRefCount = 0x00000008, + msidbComponentAttributesPermanent = 0x00000010, + msidbComponentAttributesODBCDataSource = 0x00000020, + msidbComponentAttributesTransitive = 0x00000040, + msidbComponentAttributesNeverOverwrite = 0x00000080, + msidbComponentAttributes64bit = 0x00000100 +}; + #ifdef __cplusplus } #endif
19 years, 9 months
1
0
0
0
[gvg] 14081: Sync to Wine-20050310:
by gvg@svn.reactos.com
Sync to Wine-20050310: Ulrich Czekalla <ulrich(a)codeweavers.com> - Add support for radio buttons. - Allocate space for terminating null. - Fix a memory leak. - Prevent accessing freed memory in failure case. Mike McCormack <mike(a)codeweavers.com> - Add a border to the edit control, add some more controls. - Implement SQL delete query. - Move product, feature and component enumeration functions to registry.c. - Make sure strings are null terminated. - Fix up the summary information code a little. - Allow MsiViewExecute to be called twice on the same query. - Implement MsiDatabaseGetPrimaryKeys. - MsiGetComponentPath should allow null pointers for pcchBuf and lpPathBuf. - Remove const declaration from non-const function. Jose Manuel Ferrer Ortiz <jmfo1982(a)yahoo.es> - Added MSI Spanish resources. Juan Lang <juan_lang(a)yahoo.com> - Implement MsiEnumRelatedProducts. - make sure msihandle2msiinfo is correctly matched with msiobj_release - don't do redundant NULL checks - Don't hardcode windows or system directories, correct a typo. - Fix a regression in AppSearch. Jonathan Ernst <Jonathan(a)ErnstFamily.ch> - Add French resources. Henning Gerhardt <henning.gerhardt(a)web.de> - Add/updated German resources. Marcelo Duarte <wine-devel(a)bol.com.br> - Update the resources for Portuguese. Francois Gouget <fgouget(a)free.fr> - Assorted spelling fixes. Alexandre Julliard <julliard(a)winehq.org> - Avoid spaces before preprocessor directives, that's not portable. Aric Stewart <aric(a)codeweavers.com> - Text reformatting patch to clean up all the static strings. - Implement the action RegisterFonts. - Add the ExecuteAction handler. - Store the keypath, and do refcounting and registration of SharedDLLs. - Fix a bug with handing dword values in the registry. - Fix bugs with writing registry keys where value == NULL. - Make use of msidefs.h. - Lay some groundwork for uninstalls. - Update the installed state for components during CostFinalize. Laying groundwork to be able to start processing uninstall logic as well. - Fixed problems with my code for finding the PackageCode. - Stubs for MsiUseFeature. - Do some basic work with registry component paths. - Make sure formats like [\\]] and [\\[] work properly. Steven Edwards <steven(a)codeweavers.com> - Correct typo. Marcus Meissner <marcus(a)jet.franken.de> - Output some more informations. - Mark one global variable static. Modified: trunk/reactos/lib/msi/Makefile.in Modified: trunk/reactos/lib/msi/action.c Deleted: trunk/reactos/lib/msi/action.h Added: trunk/reactos/lib/msi/action.h Deleted: trunk/reactos/lib/msi/appsearch.c Added: trunk/reactos/lib/msi/appsearch.c Deleted: trunk/reactos/lib/msi/custom.c Added: trunk/reactos/lib/msi/custom.c Added: trunk/reactos/lib/msi/delete.c Deleted: trunk/reactos/lib/msi/dialog.c Added: trunk/reactos/lib/msi/dialog.c Deleted: trunk/reactos/lib/msi/format.c Added: trunk/reactos/lib/msi/format.c Modified: trunk/reactos/lib/msi/msi.c Deleted: trunk/reactos/lib/msi/msi.rc Added: trunk/reactos/lib/msi/msi.rc Modified: trunk/reactos/lib/msi/msi.spec Added: trunk/reactos/lib/msi/msi_De.rc Deleted: trunk/reactos/lib/msi/msi_En.rc Added: trunk/reactos/lib/msi/msi_En.rc Added: trunk/reactos/lib/msi/msi_Es.rc Added: trunk/reactos/lib/msi/msi_Fr.rc Added: trunk/reactos/lib/msi/msi_Pt.rc Modified: trunk/reactos/lib/msi/msipriv.h Modified: trunk/reactos/lib/msi/msiquery.c Modified: trunk/reactos/lib/msi/package.c Deleted: trunk/reactos/lib/msi/preview.c Added: trunk/reactos/lib/msi/preview.c Modified: trunk/reactos/lib/msi/query.h Modified: trunk/reactos/lib/msi/record.c Deleted: trunk/reactos/lib/msi/registry.c Added: trunk/reactos/lib/msi/registry.c Modified: trunk/reactos/lib/msi/sql.tab.c Modified: trunk/reactos/lib/msi/sql.y Modified: trunk/reactos/lib/msi/suminfo.c Modified: trunk/reactos/lib/msi/table.c Modified: trunk/reactos/lib/msi/where.c _____ Modified: trunk/reactos/lib/msi/Makefile.in --- trunk/reactos/lib/msi/Makefile.in 2005-03-14 22:38:12 UTC (rev 14080) +++ trunk/reactos/lib/msi/Makefile.in 2005-03-14 22:54:57 UTC (rev 14081) @@ -11,6 +11,7 @@ appsearch.c \ create.c \ custom.c \ + delete.c \ dialog.c \ distinct.c \ format.c \ _____ Modified: trunk/reactos/lib/msi/action.c --- trunk/reactos/lib/msi/action.c 2005-03-14 22:38:12 UTC (rev 14080) +++ trunk/reactos/lib/msi/action.c 2005-03-14 22:54:57 UTC (rev 14081) @@ -1,6127 +1,6715 @@ -/* - * Implementation of the Microsoft Installer (msi.dll) - * - * Copyright 2004 Aric Stewart for CodeWeavers - * - * 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 - */ - -/* - * Pages I need - * -http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/se tup/installexecutesequence_table.asp - -http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/se tup/standard_actions_reference.asp - */ - -#include <stdarg.h> -#include <stdio.h> - -#include <fcntl.h> -#define COBJMACROS - -#include "windef.h" -#include "winbase.h" -#include "winerror.h" -#include "winreg.h" -#include "wine/debug.h" -#include "fdi.h" -#include "msi.h" -#include "msiquery.h" -//#include "msvcrt/fcntl.h" -#include "objbase.h" -#include "objidl.h" -#include "msipriv.h" -#include "winnls.h" -#include "winuser.h" -#include "shlobj.h" -#include "wine/unicode.h" -#include "ver.h" -#include "action.h" - -#define REG_PROGRESS_VALUE 13200 -#define COMPONENT_PROGRESS_VALUE 24000 - -WINE_DEFAULT_DEBUG_CHANNEL(msi); - -/* - * Prototypes - */ -static UINT ACTION_ProcessExecSequence(MSIPACKAGE *package, BOOL UIran); -static UINT ACTION_ProcessUISequence(MSIPACKAGE *package); -static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq); -static UINT build_icon_path(MSIPACKAGE *package, LPCWSTR icon_name, - LPWSTR *FilePath); - -/* - * action handlers - */ -typedef UINT (*STANDARDACTIONHANDLER)(MSIPACKAGE*); - -static UINT ACTION_LaunchConditions(MSIPACKAGE *package); -static UINT ACTION_CostInitialize(MSIPACKAGE *package); -static UINT ACTION_CreateFolders(MSIPACKAGE *package); -static UINT ACTION_CostFinalize(MSIPACKAGE *package); -static UINT ACTION_FileCost(MSIPACKAGE *package); -static UINT ACTION_InstallFiles(MSIPACKAGE *package); -static UINT ACTION_DuplicateFiles(MSIPACKAGE *package); -static UINT ACTION_WriteRegistryValues(MSIPACKAGE *package); -static UINT ACTION_InstallInitialize(MSIPACKAGE *package); -static UINT ACTION_InstallValidate(MSIPACKAGE *package); -static UINT ACTION_ProcessComponents(MSIPACKAGE *package); -static UINT ACTION_RegisterTypeLibraries(MSIPACKAGE *package); -static UINT ACTION_RegisterClassInfo(MSIPACKAGE *package); -static UINT ACTION_RegisterProgIdInfo(MSIPACKAGE *package); -static UINT ACTION_RegisterExtensionInfo(MSIPACKAGE *package); -static UINT ACTION_RegisterMIMEInfo(MSIPACKAGE *package); -static UINT ACTION_RegisterUser(MSIPACKAGE *package); -static UINT ACTION_CreateShortcuts(MSIPACKAGE *package); -static UINT ACTION_PublishProduct(MSIPACKAGE *package); -static UINT ACTION_WriteIniValues(MSIPACKAGE *package); -static UINT ACTION_SelfRegModules(MSIPACKAGE *package); -static UINT ACTION_PublishFeatures(MSIPACKAGE *package); -static UINT ACTION_RegisterProduct(MSIPACKAGE *package); -static UINT ACTION_InstallExecute(MSIPACKAGE *package); -static UINT ACTION_InstallFinalize(MSIPACKAGE *package); -static UINT ACTION_ForceReboot(MSIPACKAGE *package); -static UINT ACTION_ResolveSource(MSIPACKAGE *package); - - -/* - * consts and values used - */ -static const WCHAR cszSourceDir[] = {'S','o','u','r','c','e','D','i','r',0}; -static const WCHAR cszRootDrive[] = {'R','O','O','T','D','R','I','V','E',0}; -static const WCHAR cszTargetDir[] = {'T','A','R','G','E','T','D','I','R',0}; -static const WCHAR cszTempFolder[]= {'T','e','m','p','F','o','l','d','e','r',0}; -static const WCHAR cszDatabase[]={'D','A','T','A','B','A','S','E',0}; -static const WCHAR c_collen[] = {'C',':','\\',0}; - -static const WCHAR cszbs[]={'\\',0}; - -const static WCHAR szCreateFolders[] = -{'C','r','e','a','t','e','F','o','l','d','e','r','s',0}; -const static WCHAR szCostFinalize[] = -{'C','o','s','t','F','i','n','a','l','i','z','e',0}; -const static WCHAR szInstallFiles[] = -{'I','n','s','t','a','l','l','F','i','l','e','s',0}; -const static WCHAR szDuplicateFiles[] = -{'D','u','p','l','i','c','a','t','e','F','i','l','e','s',0}; -const static WCHAR szWriteRegistryValues[] = -{'W','r','i','t','e','R','e','g','i','s','t','r','y','V','a','l','u','e ','s',0}; -const static WCHAR szCostInitialize[] = -{'C','o','s','t','I','n','i','t','i','a','l','i','z','e',0}; -const static WCHAR szFileCost[] = -{'F','i','l','e','C','o','s','t',0}; -const static WCHAR szInstallInitialize[] = -{'I','n','s','t','a','l','l','I','n','i','t','i','a','l','i','z','e',0} ; -const static WCHAR szInstallValidate[] = -{'I','n','s','t','a','l','l','V','a','l','i','d','a','t','e',0}; -const static WCHAR szLaunchConditions[] = -{'L','a','u','n','c','h','C','o','n','d','i','t','i','o','n','s',0}; -const static WCHAR szProcessComponents[] = -{'P','r','o','c','e','s','s','C','o','m','p','o','n','e','n','t','s',0} ; -const static WCHAR szRegisterTypeLibraries[] = -{'R','e','g','i','s','t','e','r','T','y','p','e','L','i','b','r','a','r ', -'i','e','s',0}; -const static WCHAR szRegisterClassInfo[] = -{'R','e','g','i','s','t','e','r','C','l','a','s','s','I','n','f','o',0} ; -const static WCHAR szRegisterProgIdInfo[] = -{'R','e','g','i','s','t','e','r','P','r','o','g','I','d','I','n','f','o ',0}; -const static WCHAR szCreateShortcuts[] = -{'C','r','e','a','t','e','S','h','o','r','t','c','u','t','s',0}; -const static WCHAR szPublishProduct[] = -{'P','u','b','l','i','s','h','P','r','o','d','u','c','t',0}; -const static WCHAR szWriteIniValues[] = -{'W','r','i','t','e','I','n','i','V','a','l','u','e','s',0}; -const static WCHAR szSelfRegModules[] = -{'S','e','l','f','R','e','g','M','o','d','u','l','e','s',0}; -const static WCHAR szPublishFeatures[] = -{'P','u','b','l','i','s','h','F','e','a','t','u','r','e','s',0}; -const static WCHAR szRegisterProduct[] = -{'R','e','g','i','s','t','e','r','P','r','o','d','u','c','t',0}; -const static WCHAR szInstallExecute[] = -{'I','n','s','t','a','l','l','E','x','e','c','u','t','e',0}; -const static WCHAR szInstallExecuteAgain[] = -{'I','n','s','t','a','l','l','E','x','e','c','u','t','e','A','g','a','i ','n',0}; -const static WCHAR szInstallFinalize[] = -{'I','n','s','t','a','l','l','F','i','n','a','l','i','z','e',0}; -const static WCHAR szForceReboot[] = -{'F','o','r','c','e','R','e','b','o','o','t',0}; -const static WCHAR szResolveSource[] = -{'R','e','s','o','l','v','e','S','o','u','r','c','e',0}; -const static WCHAR szAppSearch[] = -{'A','p','p','S','e','a','r','c','h',0}; -const static WCHAR szAllocateRegistrySpace[] = -{'A','l','l','o','c','a','t','e','R','e','g','i','s','t','r','y','S','p ','a','c','e',0}; -const static WCHAR szBindImage[] = -{'B','i','n','d','I','m','a','g','e',0}; -const static WCHAR szCCPSearch[] = -{'C','C','P','S','e','a','r','c','h',0}; -const static WCHAR szDeleteServices[] = -{'D','e','l','e','t','e','S','e','r','v','i','c','e','s',0}; -const static WCHAR szDisableRollback[] = -{'D','i','s','a','b','l','e','R','o','l','l','b','a','c','k',0}; -const static WCHAR szExecuteAction[] = -{'E','x','e','c','u','t','e','A','c','t','i','o','n',0}; -const static WCHAR szFindRelatedProducts[] = -{'F','i','n','d','R','e','l','a','t','e','d','P','r','o','d','u','c','t ','s',0}; -const static WCHAR szInstallAdminPackage[] = -{'I','n','s','t','a','l','l','A','d','m','i','n','P','a','c','k','a','g ','e',0}; -const static WCHAR szInstallSFPCatalogFile[] = -{'I','n','s','t','a','l','l','S','F','P','C','a','t','a','l','o','g','F ','i','l','e',0}; -const static WCHAR szIsolateComponents[] = -{'I','s','o','l','a','t','e','C','o','m','p','o','n','e','n','t','s',0} ; -const static WCHAR szMigrateFeatureStates[] = -{'M','i','g','r','a','t','e','F','e','a','t','u','r','e','S','t','a','t ','e','s',0}; -const static WCHAR szMoveFiles[] = -{'M','o','v','e','F','i','l','e','s',0}; -const static WCHAR szMsiPublishAssemblies[] = -{'M','s','i','P','u','b','l','i','s','h','A','s','s','e','m','b','l','i ','e','s',0}; -const static WCHAR szMsiUnpublishAssemblies[] = -{'M','s','i','U','n','p','u','b','l','i','s','h','A','s','s','e','m','b ','l','i','e','s',0}; -const static WCHAR szInstallODBC[] = -{'I','n','s','t','a','l','l','O','D','B','C',0}; -const static WCHAR szInstallServices[] = -{'I','n','s','t','a','l','l','S','e','r','v','i','c','e','s',0}; -const static WCHAR szPatchFiles[] = -{'P','a','t','c','h','F','i','l','e','s',0}; -const static WCHAR szPublishComponents[] = -{'P','u','b','l','i','s','h','C','o','m','p','o','n','e','n','t','s',0} ; -const static WCHAR szRegisterComPlus[] = -{'R','e','g','i','s','t','e','r','C','o','m','P','l','u','s',0}; -const static WCHAR szRegisterExtensionInfo[] = -{'R','e','g','i','s','t','e','r','E','x','t','e','n','s','i','o','n','I ','n','f','o',0}; -const static WCHAR szRegisterFonts[] = -{'R','e','g','i','s','t','e','r','F','o','n','t','s',0}; -const static WCHAR szRegisterMIMEInfo[] = -{'R','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o',0}; -const static WCHAR szRegisterUser[] = -{'R','e','g','i','s','t','e','r','U','s','e','r',0}; -const static WCHAR szRemoveDuplicateFiles[] = -{'R','e','m','o','v','e','D','u','p','l','i','c','a','t','e','F','i','l ','e','s',0}; -const static WCHAR szRemoveEnvironmentStrings[] = -{'R','e','m','o','v','e','E','n','v','i','r','o','n','m','e','n','t','S ','t','r','i','n','g','s',0}; -const static WCHAR szRemoveExistingProducts[] = -{'R','e','m','o','v','e','E','x','i','s','t','i','n','g','P','r','o','d ','u','c','t','s',0}; -const static WCHAR szRemoveFiles[] = -{'R','e','m','o','v','e','F','i','l','e','s',0}; -const static WCHAR szRemoveFolders[] = -{'R','e','m','o','v','e','F','o','l','d','e','r','s',0}; -const static WCHAR szRemoveIniValues[] = -{'R','e','m','o','v','e','I','n','i','V','a','l','u','e','s',0}; -const static WCHAR szRemoveODBC[] = -{'R','e','m','o','v','e','O','D','B','C',0}; -const static WCHAR szRemoveRegistryValues[] = -{'R','e','m','o','v','e','R','e','g','i','s','t','r','y','V','a','l','u ','e','s',0}; -const static WCHAR szRemoveShortcuts[] = -{'R','e','m','o','v','e','S','h','o','r','t','c','u','t','s',0}; -const static WCHAR szRMCCPSearch[] = -{'R','M','C','C','P','S','e','a','r','c','h',0}; -const static WCHAR szScheduleReboot[] = -{'S','c','h','e','d','u','l','e','R','e','b','o','o','t',0}; -const static WCHAR szSelfUnregModules[] = -{'S','e','l','f','U','n','r','e','g','M','o','d','u','l','e','s',0}; -const static WCHAR szSetODBCFolders[] = -{'S','e','t','O','D','B','C','F','o','l','d','e','r','s',0}; -const static WCHAR szStartServices[] = -{'S','t','a','r','t','S','e','r','v','i','c','e','s',0}; -const static WCHAR szStopServices[] = -{'S','t','o','p','S','e','r','v','i','c','e','s',0}; -const static WCHAR szUnpublishComponents[] = -{'U','n','p','u','b','l','i','s','h','C','o','m','p','o','n','e','n','t ','s',0}; -const static WCHAR szUnpublishFeatures[] = -{'U','n','p','u','b','l','i','s','h','F','e','a','t','u','r','e','s',0} ; -const static WCHAR szUnregisterClassInfo[] = -{'U','n','r','e','g','i','s','t','e','r','C','l','a','s','s','I','n','f ','o',0}; -const static WCHAR szUnregisterComPlus[] = -{'U','n','r','e','g','i','s','t','e','r','C','o','m','P','l','u','s',0} ; -const static WCHAR szUnregisterExtensionInfo[] = -{'U','n','r','e','g','i','s','t','e','r','E','x','t','e','n','s','i','o ','n','I','n','f','o',0}; -const static WCHAR szUnregisterFonts[] = -{'U','n','r','e','g','i','s','t','e','r','F','o','n','t','s',0}; -const static WCHAR szUnregisterMIMEInfo[] = -{'U','n','r','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o ',0}; -const static WCHAR szUnregisterProgIdInfo[] = -{'U','n','r','e','g','i','s','t','e','r','P','r','o','g','I','d','I','n ','f','o',0}; -const static WCHAR szUnregisterTypeLibraries[] = -{'U','n','r','e','g','i','s','t','e','r','T','y','p','e','L','i','b','r ','a','r','i','e','s',0}; -const static WCHAR szValidateProductID[] = -{'V','a','l','i','d','a','t','e','P','r','o','d','u','c','t','I','D',0} ; -const static WCHAR szWriteEnvironmentStrings[] = -{'W','r','i','t','e','E','n','v','i','r','o','n','m','e','n','t','S','t ','r','i','n','g','s',0}; - -struct _actions { - LPCWSTR action; - STANDARDACTIONHANDLER handler; -}; - -struct _actions StandardActions[] = { - { szAllocateRegistrySpace, NULL}, - { szAppSearch, ACTION_AppSearch }, - { szBindImage, NULL}, - { szCCPSearch, NULL}, - { szCostFinalize, ACTION_CostFinalize }, - { szCostInitialize, ACTION_CostInitialize }, - { szCreateFolders, ACTION_CreateFolders }, - { szCreateShortcuts, ACTION_CreateShortcuts }, - { szDeleteServices, NULL}, - { szDisableRollback, NULL}, - { szDuplicateFiles, ACTION_DuplicateFiles}, - { szExecuteAction, NULL}, - { szFileCost, ACTION_FileCost }, - { szFindRelatedProducts, NULL}, - { szForceReboot, ACTION_ForceReboot }, - { szInstallAdminPackage, NULL}, - { szInstallExecute, ACTION_InstallExecute }, - { szInstallExecuteAgain, ACTION_InstallExecute }, - { szInstallFiles, ACTION_InstallFiles}, - { szInstallFinalize, ACTION_InstallFinalize }, - { szInstallInitialize, ACTION_InstallInitialize }, - { szInstallSFPCatalogFile, NULL}, - { szInstallValidate, ACTION_InstallValidate }, - { szIsolateComponents, NULL}, - { szLaunchConditions, ACTION_LaunchConditions }, - { szMigrateFeatureStates, NULL}, - { szMoveFiles, NULL}, - { szMsiPublishAssemblies, NULL}, - { szMsiUnpublishAssemblies, NULL}, - { szInstallODBC, NULL}, - { szInstallServices, NULL}, - { szPatchFiles, NULL}, - { szProcessComponents, ACTION_ProcessComponents }, - { szPublishComponents, NULL}, - { szPublishFeatures, ACTION_PublishFeatures }, - { szPublishProduct, ACTION_PublishProduct }, - { szRegisterClassInfo, ACTION_RegisterClassInfo }, - { szRegisterComPlus, NULL}, - { szRegisterExtensionInfo, ACTION_RegisterExtensionInfo }, - { szRegisterFonts, NULL}, - { szRegisterMIMEInfo, ACTION_RegisterMIMEInfo }, - { szRegisterProduct, ACTION_RegisterProduct }, - { szRegisterProgIdInfo, ACTION_RegisterProgIdInfo }, - { szRegisterTypeLibraries, ACTION_RegisterTypeLibraries }, - { szRegisterUser, ACTION_RegisterUser}, - { szRemoveDuplicateFiles, NULL}, - { szRemoveEnvironmentStrings, NULL}, - { szRemoveExistingProducts, NULL}, - { szRemoveFiles, NULL}, - { szRemoveFolders, NULL}, - { szRemoveIniValues, NULL}, - { szRemoveODBC, NULL}, - { szRemoveRegistryValues, NULL}, - { szRemoveShortcuts, NULL}, - { szResolveSource, ACTION_ResolveSource}, - { szRMCCPSearch, NULL}, - { szScheduleReboot, NULL}, - { szSelfRegModules, ACTION_SelfRegModules }, - { szSelfUnregModules, NULL}, - { szSetODBCFolders, NULL}, - { szStartServices, NULL}, - { szStopServices, NULL}, - { szUnpublishComponents, NULL}, - { szUnpublishFeatures, NULL}, - { szUnregisterClassInfo, NULL}, - { szUnregisterComPlus, NULL}, - { szUnregisterExtensionInfo, NULL}, - { szUnregisterFonts, NULL}, - { szUnregisterMIMEInfo, NULL}, - { szUnregisterProgIdInfo, NULL}, - { szUnregisterTypeLibraries, NULL}, - { szValidateProductID, NULL}, - { szWriteEnvironmentStrings, NULL}, - { szWriteIniValues, ACTION_WriteIniValues }, - { szWriteRegistryValues, ACTION_WriteRegistryValues}, - { NULL, NULL}, -}; - - -/******************************************************** - * helper functions to get around current HACKS and such - ********************************************************/ -inline static void reduce_to_longfilename(WCHAR* filename) -{ - LPWSTR p = strchrW(filename,'|'); - if (p) - memmove(filename, p+1, (strlenW(p+1)+1)*sizeof(WCHAR)); -} - -WCHAR *load_dynamic_stringW(MSIRECORD *row, INT index) -{ - UINT rc; - DWORD sz; - LPWSTR ret; - - sz = 0; - if (MSI_RecordIsNull(row,index)) - return NULL; - - rc = MSI_RecordGetStringW(row,index,NULL,&sz); - - /* having an empty string is different than NULL */ - if (sz == 0) - { - ret = HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)); - ret[0] = 0; - return ret; - } - - sz ++; - ret = HeapAlloc(GetProcessHeap(),0,sz * sizeof (WCHAR)); - rc = MSI_RecordGetStringW(row,index,ret,&sz); - if (rc!=ERROR_SUCCESS) - { - ERR("Unable to load dynamic string\n"); - HeapFree(GetProcessHeap(), 0, ret); - ret = NULL; - } - return ret; -} - -LPWSTR load_dynamic_property(MSIPACKAGE *package, LPCWSTR prop, UINT* rc) -{ - DWORD sz = 0; - LPWSTR str; - UINT r; - - r = MSI_GetPropertyW(package, prop, NULL, &sz); - if (r != ERROR_SUCCESS && r != ERROR_MORE_DATA) - { - if (rc) - *rc = r; - return NULL; - } - sz++; - str = HeapAlloc(GetProcessHeap(),0,sz*sizeof(WCHAR)); - r = MSI_GetPropertyW(package, prop, str, &sz); - if (r != ERROR_SUCCESS) - { - HeapFree(GetProcessHeap(),0,str); - str = NULL; - } - if (rc) - *rc = r; - return str; -} - -int get_loaded_component(MSIPACKAGE* package, LPCWSTR Component ) -{ - int rc = -1; - DWORD i; - - for (i = 0; i < package->loaded_components; i++) - { - if (strcmpW(Component,package->components[i].Component)==0) - { - rc = i; - break; - } - } - return rc; -} - -int get_loaded_feature(MSIPACKAGE* package, LPCWSTR Feature ) -{ - int rc = -1; - DWORD i; - - for (i = 0; i < package->loaded_features; i++) - { - if (strcmpW(Feature,package->features[i].Feature)==0) - { - rc = i; - break; - } - } - return rc; -} - -int get_loaded_file(MSIPACKAGE* package, LPCWSTR file) -{ - int rc = -1; - DWORD i; - - for (i = 0; i < package->loaded_files; i++) - { - if (strcmpW(file,package->files[i].File)==0) - { - rc = i; - break; - } - } - return rc; -} - -int track_tempfile(MSIPACKAGE *package, LPCWSTR name, LPCWSTR path) -{ - DWORD i; - DWORD index; - - if (!package) - return -2; - - for (i=0; i < package->loaded_files; i++) - if (strcmpW(package->files[i].File,name)==0) - return -1; - - index = package->loaded_files; - package->loaded_files++; - if (package->loaded_files== 1) - package->files = HeapAlloc(GetProcessHeap(),0,sizeof(MSIFILE)); - else - package->files = HeapReAlloc(GetProcessHeap(),0, - package->files , package->loaded_files * sizeof(MSIFILE)); - - memset(&package->files[index],0,sizeof(MSIFILE)); - - package->files[index].File = dupstrW(name); - package->files[index].TargetPath = dupstrW(path); - package->files[index].Temporary = TRUE; - - TRACE("Tracking tempfile (%s)\n",debugstr_w(package->files[index].File)); - - return 0; -} - -static void remove_tracked_tempfiles(MSIPACKAGE* package) -{ - DWORD i; - - if (!package) - return; - - for (i = 0; i < package->loaded_files; i++) - { - if (package->files[i].Temporary) - { - TRACE("Cleaning up %s\n",debugstr_w(package->files[i].TargetPath)); - DeleteFileW(package->files[i].TargetPath); - } - - } -} - -/* wrapper to resist a need for a full rewrite right now */ -DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data ) -{ - if (ptr) - { - MSIRECORD *rec = MSI_CreateRecord(1); - DWORD size = 0; - - MSI_RecordSetStringW(rec,0,ptr); - MSI_FormatRecordW(package,rec,NULL,&size); - if (size >= 0) - { - size++; - *data = HeapAlloc(GetProcessHeap(),0,size*sizeof(WCHAR)); - if (size > 1) - MSI_FormatRecordW(package,rec,*data,&size); - else - *data[0] = 0; - msiobj_release( &rec->hdr ); - return sizeof(WCHAR)*size; - } - msiobj_release( &rec->hdr ); - } - - *data = NULL; - return 0; -} - -/* Called when the package is being closed */ -void ACTION_free_package_structures( MSIPACKAGE* package) -{ - INT i; - - TRACE("Freeing package action data\n"); - - remove_tracked_tempfiles(package); - - /* No dynamic buffers in features */ - if (package->features && package->loaded_features > 0) - HeapFree(GetProcessHeap(),0,package->features); - - for (i = 0; i < package->loaded_folders; i++) - { - HeapFree(GetProcessHeap(),0,package->folders[i].Directory); - HeapFree(GetProcessHeap(),0,package->folders[i].TargetDefault); - HeapFree(GetProcessHeap(),0,package->folders[i].SourceDefault); - HeapFree(GetProcessHeap(),0,package->folders[i].ResolvedTarget); - HeapFree(GetProcessHeap(),0,package->folders[i].ResolvedSource); - HeapFree(GetProcessHeap(),0,package->folders[i].Property); - } - if (package->folders && package->loaded_folders > 0) - HeapFree(GetProcessHeap(),0,package->folders); - - /* no dynamic buffers in components */ - if (package->components && package->loaded_components > 0) - HeapFree(GetProcessHeap(),0,package->components); - - for (i = 0; i < package->loaded_files; i++) - { - HeapFree(GetProcessHeap(),0,package->files[i].File); - HeapFree(GetProcessHeap(),0,package->files[i].FileName); - HeapFree(GetProcessHeap(),0,package->files[i].Version); - HeapFree(GetProcessHeap(),0,package->files[i].Language); - HeapFree(GetProcessHeap(),0,package->files[i].SourcePath); - HeapFree(GetProcessHeap(),0,package->files[i].TargetPath); - } - - if (package->files && package->loaded_files > 0) - HeapFree(GetProcessHeap(),0,package->files); - - for (i = 0; i < package->DeferredActionCount; i++) - HeapFree(GetProcessHeap(),0,package->DeferredAction[i]); - HeapFree(GetProcessHeap(),0,package->DeferredAction); - - for (i = 0; i < package->CommitActionCount; i++) - HeapFree(GetProcessHeap(),0,package->CommitAction[i]); - HeapFree(GetProcessHeap(),0,package->CommitAction); - - HeapFree(GetProcessHeap(),0,package->PackagePath); -} - -static void ui_progress(MSIPACKAGE *package, int a, int b, int c, int d ) -{ - MSIRECORD * row; - - row = MSI_CreateRecord(4); - MSI_RecordSetInteger(row,1,a); - MSI_RecordSetInteger(row,2,b); - MSI_RecordSetInteger(row,3,c); - MSI_RecordSetInteger(row,4,d); - MSI_ProcessMessage(package, INSTALLMESSAGE_PROGRESS, row); - msiobj_release(&row->hdr); - - msi_dialog_check_messages(package->dialog, NULL); -} - -static void ui_actiondata(MSIPACKAGE *package, LPCWSTR action, MSIRECORD * record) -{ - static const WCHAR Query_t[] = -{'S','E','L','E','C','T',' ','*',' ','f','r','o','m',' ','A','c','t','i','o', -'n','T','e','x','t',' ','w','h','e','r','e',' ','A','c','t','i','o','n',' ','=', -' ','\'','%','s','\'',0}; - WCHAR message[1024]; - UINT rc; - MSIQUERY * view; - MSIRECORD * row = 0; - DWORD size; - - if (!package->LastAction || strcmpW(package->LastAction,action)) - { - rc = MSI_OpenQuery(package->db, &view, Query_t, action); - if (rc != ERROR_SUCCESS) - return; - - rc = MSI_ViewExecute(view, 0); - if (rc != ERROR_SUCCESS) - { - MSI_ViewClose(view); - return; - } - rc = MSI_ViewFetch(view,&row); - if (rc != ERROR_SUCCESS) - { - MSI_ViewClose(view); - return; - } - - if (MSI_RecordIsNull(row,3)) - { - msiobj_release(&row->hdr); - MSI_ViewClose(view); - msiobj_release(&view->hdr); - return; - } - - /* update the cached actionformat */ - HeapFree(GetProcessHeap(),0,package->ActionFormat); - package->ActionFormat = load_dynamic_stringW(row,3); - - HeapFree(GetProcessHeap(),0,package->LastAction); - package->LastAction = dupstrW(action); - - msiobj_release(&row->hdr); - MSI_ViewClose(view); - msiobj_release(&view->hdr); - } - - MSI_RecordSetStringW(record,0,package->ActionFormat); - size = 1024; - MSI_FormatRecordW(package,record,message,&size); - - row = MSI_CreateRecord(1); - MSI_RecordSetStringW(row,1,message); - - MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, row); - msiobj_release(&row->hdr); -} - - -static void ui_actionstart(MSIPACKAGE *package, LPCWSTR action) -{ - static const WCHAR template_s[]= -{'A','c','t','i','o','n',' ','%','s',':',' ','%','s','.',' ','%','s','.',0}; - static const WCHAR format[] = -{'H','H','\'',':','\'','m','m','\'',':','\'','s','s',0}; - static const WCHAR Query_t[] = -{'S','E','L','E','C','T',' ','*',' ','f','r','o','m',' ','A','c','t','i','o', -'n','T','e','x','t',' ','w','h','e','r','e',' ','A','c','t','i','o','n',' ','=', -' ','\'','%','s','\'',0}; - WCHAR message[1024]; - WCHAR timet[0x100]; - UINT rc; - MSIQUERY * view; - MSIRECORD * row = 0; - WCHAR *ActionText=NULL; - - GetTimeFormatW(LOCALE_USER_DEFAULT, 0, NULL, format, timet, 0x100); - - rc = MSI_OpenQuery(package->db, &view, Query_t, action); - if (rc != ERROR_SUCCESS) - return; - rc = MSI_ViewExecute(view, 0); - if (rc != ERROR_SUCCESS) - { - MSI_ViewClose(view); - msiobj_release(&view->hdr); - return; - } - rc = MSI_ViewFetch(view,&row); - if (rc != ERROR_SUCCESS) - { - MSI_ViewClose(view); - msiobj_release(&view->hdr); - return; - } - - ActionText = load_dynamic_stringW(row,2); - msiobj_release(&row->hdr); - MSI_ViewClose(view); - msiobj_release(&view->hdr); - - sprintfW(message,template_s,timet,action,ActionText); - - row = MSI_CreateRecord(1); - MSI_RecordSetStringW(row,1,message); - - MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONSTART, row); - msiobj_release(&row->hdr); - HeapFree(GetProcessHeap(),0,ActionText); -} - -static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start, - UINT rc) -{ - MSIRECORD * row; - static const WCHAR template_s[]= -{'A','c','t','i','o','n',' ','s','t','a','r','t',' ','%','s',':',' ','%','s', -'.',0}; - static const WCHAR template_e[]= -{'A','c','t','i','o','n',' ','e','n','d','e','d',' ','%','s',':',' ','%','s', -'.',' ','R','e','t','u','r','n',' ','v','a','l','u','e',' ','%','i','.',0}; - static const WCHAR format[] = -{'H','H','\'',':','\'','m','m','\'',':','\'','s','s',0}; - WCHAR message[1024]; - WCHAR timet[0x100]; - - GetTimeFormatW(LOCALE_USER_DEFAULT, 0, NULL, format, timet, 0x100); - if (start) - sprintfW(message,template_s,timet,action); - else - sprintfW(message,template_e,timet,action,rc); - - row = MSI_CreateRecord(1); - MSI_RecordSetStringW(row,1,message); - - MSI_ProcessMessage(package, INSTALLMESSAGE_INFO, row); - msiobj_release(&row->hdr); -} - -/* - * build_directory_name() - * - * This function is to save messing round with directory names - * It handles adding backslashes between path segments, - * and can add \ at the end of the directory name if told to. - * - * It takes a variable number of arguments. - * It always allocates a new string for the result, so make sure - * to free the return value when finished with it. - * - * The first arg is the number of path segments that follow. - * The arguments following count are a list of path segments. - * A path segment may be NULL. - * - * Path segments will be added with a \ separating them. - * A \ will not be added after the last segment, however if the - * last segment is NULL, then the last character will be a \ - * - */ -static LPWSTR build_directory_name(DWORD count, ...) -{ - DWORD sz = 1, i; - LPWSTR dir; - va_list va; - - va_start(va,count); - for(i=0; i<count; i++) - { - LPCWSTR str = va_arg(va,LPCWSTR); - if (str) - sz += strlenW(str) + 1; - } - va_end(va); - - dir = HeapAlloc(GetProcessHeap(), 0, sz*sizeof(WCHAR)); - dir[0]=0; - - va_start(va,count); - for(i=0; i<count; i++) - { - LPCWSTR str = va_arg(va,LPCWSTR); - if (!str) - continue; - strcatW(dir, str); - if( ((i+1)!=count) && dir[strlenW(dir)-1]!='\\') - strcatW(dir, cszbs); - } - return dir; -} - - -/**************************************************** - * TOP level entry points - *****************************************************/ - -UINT ACTION_DoTopLevelINSTALL(MSIPACKAGE *package, LPCWSTR szPackagePath, - LPCWSTR szCommandLine) -{ - DWORD sz; - WCHAR buffer[10]; - UINT rc; - static const WCHAR szUILevel[] = {'U','I','L','e','v','e','l',0}; - static const WCHAR szAction[] = {'A','C','T','I','O','N',0}; - static const WCHAR szInstall[] = {'I','N','S','T','A','L','L',0}; - - MSI_SetPropertyW(package, szAction, szInstall); - - if (szPackagePath) - { - LPWSTR p, check, path; - - package->PackagePath = dupstrW(szPackagePath); - path = dupstrW(szPackagePath); - p = strrchrW(path,'\\'); - if (p) - { - p++; - *p=0; - } - else - { - HeapFree(GetProcessHeap(),0,path); - path = HeapAlloc(GetProcessHeap(),0,MAX_PATH*sizeof(WCHAR)); - GetCurrentDirectoryW(MAX_PATH,path); - strcatW(path,cszbs); - } - - check = load_dynamic_property(package, cszSourceDir,NULL); - if (!check) - MSI_SetPropertyW(package, cszSourceDir, path); - else - HeapFree(GetProcessHeap(), 0, check); - - HeapFree(GetProcessHeap(), 0, path); - } - - if (szCommandLine) - { - LPWSTR ptr,ptr2; - ptr = (LPWSTR)szCommandLine; - - while (*ptr) - { - WCHAR *prop = NULL; - WCHAR *val = NULL; - - TRACE("Looking at %s\n",debugstr_w(ptr)); - - ptr2 = strchrW(ptr,'='); - if (ptr2) - { - BOOL quote=FALSE; - DWORD len = 0; - - while (*ptr == ' ') ptr++; - len = ptr2-ptr; - prop = HeapAlloc(GetProcessHeap(),0,(len+1)*sizeof(WCHAR)); - strncpyW(prop,ptr,len); - prop[len]=0; - ptr2++; - - len = 0; - ptr = ptr2; - while (*ptr && (quote || (!quote && *ptr!=' '))) - { - if (*ptr == '"') - quote = !quote; - ptr++; - len++; - } - - if (*ptr2=='"') - { - ptr2++; - len -= 2; - } - val = HeapAlloc(GetProcessHeap(),0,(len+1)*sizeof(WCHAR)); - strncpyW(val,ptr2,len); - val[len] = 0; - - if (strlenW(prop) > 0) - { - TRACE("Found commandline property (%s) = (%s)\n", - debugstr_w(prop), debugstr_w(val)); - MSI_SetPropertyW(package,prop,val); - } - HeapFree(GetProcessHeap(),0,val); - HeapFree(GetProcessHeap(),0,prop); - } - ptr++; - } - } - - sz = 10; - if (MSI_GetPropertyW(package,szUILevel,buffer,&sz) == ERROR_SUCCESS) - { - if (atoiW(buffer) >= INSTALLUILEVEL_REDUCED) - { - rc = ACTION_ProcessUISequence(package); - if (rc == ERROR_SUCCESS) - rc = ACTION_ProcessExecSequence(package,TRUE); - } - else - rc = ACTION_ProcessExecSequence(package,FALSE); - } - else - rc = ACTION_ProcessExecSequence(package,FALSE); - - if (rc == -1) - { - /* install was halted but should be considered a success */ - rc = ERROR_SUCCESS; - } - - /* process the ending type action */ - if (rc == ERROR_SUCCESS) - ACTION_PerformActionSequence(package,-1); - else if (rc == ERROR_INSTALL_USEREXIT) - ACTION_PerformActionSequence(package,-2); - else if (rc == ERROR_FUNCTION_FAILED) - ACTION_PerformActionSequence(package,-3); - else if (rc == ERROR_INSTALL_SUSPEND) - ACTION_PerformActionSequence(package,-4); - - /* finish up running custom actions */ - ACTION_FinishCustomActions(package); - - return rc; -} - -static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq) -{ - MSIQUERY * view; - UINT rc; - WCHAR buffer[0x100]; - DWORD sz = 0x100; - MSIRECORD * row = 0; - static const WCHAR ExecSeqQuery[] = { - 's','e','l','e','c','t',' ','*',' ', - 'f','r','o','m',' ', - 'I','n','s','t','a','l','l','E','x','e','c','u','t','e', - 'S','e','q','u','e','n','c','e',' ', - 'w','h','e','r','e',' ','S','e','q','u','e','n','c','e',' ', - '=',' ','%','i',0}; - - rc = MSI_OpenQuery(package->db, &view, ExecSeqQuery, seq); - - if (rc == ERROR_SUCCESS) - { - rc = MSI_ViewExecute(view, 0); - - if (rc != ERROR_SUCCESS) - { - MSI_ViewClose(view); - msiobj_release(&view->hdr); - goto end; - } - - TRACE("Running the actions\n"); - - rc = MSI_ViewFetch(view,&row); - if (rc != ERROR_SUCCESS) - { - rc = ERROR_SUCCESS; - goto end; - } - - /* check conditions */ [truncated at 1000 lines; 19371 more skipped]
19 years, 9 months
1
0
0
0
[ea] 14080: SMDLL + SMLIB (static code in SMSS.EXE)
by ea@svn.reactos.com
SMDLL + SMLIB (static code in SMSS.EXE) SM now self registers for IMAGE_SUBSYSTEM_NATIVE. Modified: trunk/reactos/Makefile Modified: trunk/reactos/include/sm/helper.h Deleted: trunk/reactos/lib/smdll/compses.c Deleted: trunk/reactos/lib/smdll/connect.c Deleted: trunk/reactos/lib/smdll/execpgm.c Modified: trunk/reactos/lib/smdll/makefile Added: trunk/reactos/lib/smdll/query.c Modified: trunk/reactos/lib/smdll/smdll.def Added: trunk/reactos/lib/smlib/ Added: trunk/reactos/lib/smlib/compses.c Added: trunk/reactos/lib/smlib/connect.c Added: trunk/reactos/lib/smlib/execpgm.c Added: trunk/reactos/lib/smlib/makefile Modified: trunk/reactos/subsys/smss/initss.c Modified: trunk/reactos/subsys/smss/makefile _____ Modified: trunk/reactos/Makefile --- trunk/reactos/Makefile 2005-03-14 22:28:58 UTC (rev 14079) +++ trunk/reactos/Makefile 2005-03-14 22:38:12 UTC (rev 14080) @@ -61,8 +61,8 @@ DLLS = acledit aclui advapi32 advpack cabinet cards comctl32 crtdll comdlg32 d3d8thk dbghelp expat fmifs freetype \ gdi32 gdiplus glu32 hid imagehlp imm32 iphlpapi kernel32 lzexpand mesa32 midimap mmdrv mpr msacm msafd \ msgina msi msimg32 msvcrt20 msvideo mswsock netapi32 ntdll ole32 oleaut32 oledlg olepro32 opengl32 \ - packet psapi riched20 richedit rpcrt4 samlib secur32 setupapi shell32 shlwapi smdll snmpapi syssetup \ - twain user32 userenv version wininet winmm winspool ws2help ws2_32 wsock32 wshirda dnsapi \ + packet psapi riched20 richedit rpcrt4 samlib secur32 setupapi shell32 shlwapi smlib smdll snmpapi \ + syssetup twain user32 userenv version wininet winmm winspool ws2help ws2_32 wsock32 wshirda dnsapi \ urlmon shdocvw dinput dinput8 dxdiagn devenum dsound lsasrv $(DLLS_KBD) $(DLLS_CPL) $(DLLS_SHELLEXT) SUBSYS = smss win32k csrss ntvdm _____ Modified: trunk/reactos/include/sm/helper.h --- trunk/reactos/include/sm/helper.h 2005-03-14 22:28:58 UTC (rev 14079) +++ trunk/reactos/include/sm/helper.h 2005-03-14 22:38:12 UTC (rev 14080) @@ -3,21 +3,31 @@ /* $Id$ */ -/* smdll/connect.c */ +/* smlib/connect.c */ NTSTATUS STDCALL SmConnectApiPort (IN PUNICODE_STRING pSbApiPortName OPTIONAL, IN HANDLE hSbApiPort OPTIONAL, IN DWORD dwSubsystem OPTIONAL, /* pe.h */ IN OUT PHANDLE phSmApiPort); -/* smdll/compses.c */ +/* smlib/compses.c */ NTSTATUS STDCALL SmCompleteSession (IN HANDLE hSmApiPort, IN HANDLE hSbApiPort, IN HANDLE hApiPort); -/* smdll/execpgm.c */ +/* smlib/execpgm.c */ NTSTATUS STDCALL SmExecuteProgram (IN HANDLE hSmApiPort, IN PUNICODE_STRING Pgm ); +/* smdll/query.c */ +typedef enum { + SM_BASE_INFORMATION +} SM_INFORMATION_CLASS, *PSM_INFORMATION_CLASS; +NTSTATUS STDCALL +SmQuery (IN HANDLE SmApiPort, + IN SM_INFORMATION_CLASS SmInformationClass, + IN OUT PVOID Data, + IN OUT PULONG DataLength); + #endif /* ndef INCLUDE_SM_HELPER_H */ _____ Deleted: trunk/reactos/lib/smdll/compses.c --- trunk/reactos/lib/smdll/compses.c 2005-03-14 22:28:58 UTC (rev 14079) +++ trunk/reactos/lib/smdll/compses.c 2005-03-14 22:38:12 UTC (rev 14080) @@ -1,64 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * FILE: lib/smlib/compses.c - * PURPOSE: Call SM API SM_API_COMPLETE_SESSION - */ -#define NTOS_MODE_USER -#include <ntos.h> -#include <sm/api.h> -#include <sm/helper.h> - -#define NDEBUG -#include <debug.h> - -/********************************************************************** - * NAME EXPORTED - * SmCompleteSession/3 - * - * DESCRIPTION - * This function is called by an environment subsystem server to - * tell the SM it finished initialization phase and is ready to - * manage processes it registered for (SmConnectApiPort). - * - * ARGUMENTS - * hSmApiPort: port handle returned by SmConnectApiPort; - * hSbApiPort: call back API port of the subsystem (handle); - * hApiPort : API port of the subsystem (handle). - * - * RETURN VALUE - * Success status as handed by the SM reply; otherwise a failure - * status code. - */ -NTSTATUS STDCALL -SmCompleteSession (IN HANDLE hSmApiPort, - IN HANDLE hSbApiPort, - IN HANDLE hApiPort) -{ - NTSTATUS Status; - SM_PORT_MESSAGE SmReqMsg; - - DPRINT("SMDLL: %s called\n", __FUNCTION__); - - /* Marshal Ses in the LPC message */ - SmReqMsg.CompSes.hApiPort = hApiPort; - SmReqMsg.CompSes.hSbApiPort = hSbApiPort; - - /* SM API to invoke */ - SmReqMsg.ApiIndex = SM_API_COMPLETE_SESSION; - - /* Port message */ - SmReqMsg.Header.MessageType = LPC_NEW_MESSAGE; - SmReqMsg.Header.DataSize = SM_PORT_DATA_SIZE(SmReqMsg.CompSes); - SmReqMsg.Header.MessageSize = SM_PORT_MESSAGE_SIZE; - Status = NtRequestWaitReplyPort (hSmApiPort, (PLPC_MESSAGE) & SmReqMsg, (PLPC_MESSAGE) & SmReqMsg); - if (NT_SUCCESS(Status)) - { - return SmReqMsg.Status; - } - DPRINT("SMDLL: %s failed (Status=0x%08lx)\n", __FUNCTION__, Status); - return Status; -} - -/* EOF */ _____ Deleted: trunk/reactos/lib/smdll/connect.c --- trunk/reactos/lib/smdll/connect.c 2005-03-14 22:28:58 UTC (rev 14079) +++ trunk/reactos/lib/smdll/connect.c 2005-03-14 22:38:12 UTC (rev 14080) @@ -1,98 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * FILE: reactos/lib/smdll/connect.c - * PURPOSE: Connect to the API LPC port exposed by the SM - */ -#define NTOS_MODE_USER -#include <ntos.h> -#include <sm/api.h> -#include <sm/helper.h> -#include <pe.h> - -#define NDEBUG -#include <debug.h> - -/********************************************************************** - * NAME EXPORTED - * SmConnectApiPort/4 - * - * DESCRIPTION - * Connect to SM API port and register a session "begin" port (Sb) - * or to issue API requests to SmApiPort. - * - * ARGUMENTS - * pSbApiPortName: name of the Sb port the calling subsystem - * server already created in the system name space; - * hSbApiPort: LPC port handle (checked, but not used); - * dwSubsystem: a valid IMAGE_SUBSYSTEM_xxx value; - * phSmApiPort: a pointer to a HANDLE, which will be - * filled with a valid client-side LPC comm port. - * - * RETURN VALUE - * If all three optional values are omitted, an LPC status. - * STATUS_INVALID_PARAMETER_MIX if PortName is defined and - * both hSbApiPort and dwSubsystem are 0. - */ -NTSTATUS STDCALL -SmConnectApiPort (IN PUNICODE_STRING pSbApiPortName OPTIONAL, - IN HANDLE hSbApiPort OPTIONAL, - IN DWORD dwSubsystem OPTIONAL, - IN OUT PHANDLE phSmApiPort) -{ - UNICODE_STRING SmApiPortName; - SECURITY_QUALITY_OF_SERVICE SecurityQos; - NTSTATUS Status = STATUS_SUCCESS; - SM_CONNECT_DATA ConnectData = {0,{0}}; - ULONG ConnectDataLength = 0; - - DPRINT("SMDLL: %s called\n", __FUNCTION__); - - if (pSbApiPortName) - { - if (pSbApiPortName->Length > (sizeof pSbApiPortName->Buffer[0] * SM_SB_NAME_MAX_LENGTH)) - { - return STATUS_INVALID_PARAMETER_1; - } - if (NULL == hSbApiPort || IMAGE_SUBSYSTEM_UNKNOWN == dwSubsystem) - { - return STATUS_INVALID_PARAMETER_MIX; - } - RtlZeroMemory (& ConnectData, sizeof ConnectData); - ConnectData.Subsystem = dwSubsystem; - if (pSbApiPortName->Length > 0) - { - RtlCopyMemory (& ConnectData.SbName, - pSbApiPortName->Buffer, - pSbApiPortName->Length); - } - } - ConnectDataLength = sizeof ConnectData; - - SecurityQos.Length = sizeof (SecurityQos); - SecurityQos.ImpersonationLevel = SecurityIdentification; - SecurityQos.ContextTrackingMode = TRUE; - SecurityQos.EffectiveOnly = TRUE; - - RtlInitUnicodeString (& SmApiPortName, SM_API_PORT_NAME); - - Status = NtConnectPort ( - phSmApiPort, - & SmApiPortName, - & SecurityQos, - NULL, - NULL, - NULL, - & ConnectData, - & ConnectDataLength - ); - if (NT_SUCCESS(Status)) - { - return STATUS_SUCCESS; - } - DPRINT("SMDLL: %s failed (Status=0x%08lx)\n", __FUNCTION__, Status); - return Status; -} - -/* EOF */ _____ Deleted: trunk/reactos/lib/smdll/execpgm.c --- trunk/reactos/lib/smdll/execpgm.c 2005-03-14 22:28:58 UTC (rev 14079) +++ trunk/reactos/lib/smdll/execpgm.c 2005-03-14 22:38:12 UTC (rev 14080) @@ -1,76 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS system libraries - * FILE: lib/smdll/execpgm.c - * PURPOSE: Call SM API SM_API_EXECPGM - */ -#define NTOS_MODE_USER -#include <ntos.h> -#include <sm/api.h> -#include <sm/helper.h> -#include <string.h> - -#define NDEBUG -#include <debug.h> - -/********************************************************************** - * NAME EXPORTED - * SmExecuteProgram/2 - * - * DESCRIPTION - * This function is used to make the SM start an environment - * subsystem server process. - * - * ARGUMENTS - * hSmApiPort: port handle returned by SmConnectApiPort; - * Pgm : name of the subsystem (to be used by the SM to - * lookup the image name from the registry). - * Valid names are: DEBUG, WINDOWS, POSIX, OS2, - * and VMS. - * - * RETURN VALUE - * Success status as handed by the SM reply; otherwise a failure - * status code. - */ -NTSTATUS STDCALL -SmExecuteProgram (IN HANDLE hSmApiPort, - IN PUNICODE_STRING Pgm) -{ - NTSTATUS Status; - SM_PORT_MESSAGE SmReqMsg; - - - DPRINT("SMDLL: %s called\n", __FUNCTION__); - - /* Check Pgm's length */ - if (Pgm->Length > (sizeof (Pgm->Buffer[0]) * SM_EXEXPGM_MAX_LENGTH)) - { - return STATUS_INVALID_PARAMETER; - } - /* Marshal Pgm in the LPC message */ - RtlZeroMemory (& SmReqMsg, sizeof SmReqMsg); - SmReqMsg.ExecPgm.NameLength = Pgm->Length; - RtlCopyMemory (SmReqMsg.ExecPgm.Name, - Pgm->Buffer, - Pgm->Length); - - /* SM API to invoke */ - SmReqMsg.ApiIndex = SM_API_EXECUTE_PROGRAMME; - - /* LPC message */ - SmReqMsg.Header.MessageType = LPC_NEW_MESSAGE; - SmReqMsg.Header.DataSize = SM_PORT_DATA_SIZE(SmReqMsg.ExecPgm); - SmReqMsg.Header.MessageSize = SM_PORT_MESSAGE_SIZE; - - /* Call SM and wait for a reply */ - Status = NtRequestWaitReplyPort (hSmApiPort, (PLPC_MESSAGE) & SmReqMsg, (PLPC_MESSAGE) & SmReqMsg); - if (NT_SUCCESS(Status)) - { - return SmReqMsg.Status; - } - DPRINT("SMDLL: %s failed (Status=0x%08lx)\n", __FUNCTION__, Status); - return Status; -} - -/* EOF */ _____ Modified: trunk/reactos/lib/smdll/makefile --- trunk/reactos/lib/smdll/makefile 2005-03-14 22:28:58 UTC (rev 14079) +++ trunk/reactos/lib/smdll/makefile 2005-03-14 22:38:12 UTC (rev 14080) @@ -6,7 +6,7 @@ TARGET_NAME = smdll -TARGET_SDKLIBS = ntdll.a +TARGET_SDKLIBS = smlib.a ntdll.a TARGET_CFLAGS = -I./include -Wall -Werror @@ -19,9 +19,7 @@ TARGET_OBJECTS = \ dllmain.o \ - connect.o \ - execpgm.o \ - compses.o + query.o DEP_OBJECTS = $(TARGET_OBJECTS) _____ Added: trunk/reactos/lib/smdll/query.c --- trunk/reactos/lib/smdll/query.c 2005-03-14 22:28:58 UTC (rev 14079) +++ trunk/reactos/lib/smdll/query.c 2005-03-14 22:38:12 UTC (rev 14080) @@ -0,0 +1,39 @@ +/* $Id: compses.c 13731 2005-02-23 23:37:06Z ea $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/smdll/query.c + * PURPOSE: Call SM API SM_API_QUERY (not in NT) + */ +#define NTOS_MODE_USER +#include <ntos.h> +#include <sm/api.h> +#include <sm/helper.h> + +#define NDEBUG +#include <debug.h> + +/********************************************************************** + * NAME EXPORTED + * SmQuery/4 + * + * DESCRIPTION + * + * ARGUMENTS + * + * RETURN VALUE + */ +NTSTATUS STDCALL +SmQuery (IN HANDLE SmApiPort, + IN SM_INFORMATION_CLASS SmInformationClass, + IN OUT PVOID Data, + IN OUT PULONG DataLength) +{ + /* TODO */ + if(NULL != DataLength) + { + *DataLength = 0; + } + return STATUS_SUCCESS; +} +/* EOF */ _____ Modified: trunk/reactos/lib/smdll/smdll.def --- trunk/reactos/lib/smdll/smdll.def 2005-03-14 22:28:58 UTC (rev 14079) +++ trunk/reactos/lib/smdll/smdll.def 2005-03-14 22:38:12 UTC (rev 14080) @@ -3,3 +3,4 @@ SmCompleteSession@12 SmConnectApiPort@16 SmExecuteProgram@8 +SmQuery@16 _____ Added: trunk/reactos/lib/smlib/compses.c --- trunk/reactos/lib/smlib/compses.c 2005-03-14 22:28:58 UTC (rev 14079) +++ trunk/reactos/lib/smlib/compses.c 2005-03-14 22:38:12 UTC (rev 14080) @@ -0,0 +1,64 @@ +/* $Id: compses.c 13731 2005-02-23 23:37:06Z ea $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/smlib/compses.c + * PURPOSE: Call SM API SM_API_COMPLETE_SESSION + */ +#define NTOS_MODE_USER +#include <ntos.h> +#include <sm/api.h> +#include <sm/helper.h> + +#define NDEBUG +#include <debug.h> + +/********************************************************************** + * NAME EXPORTED + * SmCompleteSession/3 + * + * DESCRIPTION + * This function is called by an environment subsystem server to + * tell the SM it finished initialization phase and is ready to + * manage processes it registered for (SmConnectApiPort). + * + * ARGUMENTS + * hSmApiPort: port handle returned by SmConnectApiPort; + * hSbApiPort: call back API port of the subsystem (handle); + * hApiPort : API port of the subsystem (handle). + * + * RETURN VALUE + * Success status as handed by the SM reply; otherwise a failure + * status code. + */ +NTSTATUS STDCALL +SmCompleteSession (IN HANDLE hSmApiPort, + IN HANDLE hSbApiPort, + IN HANDLE hApiPort) +{ + NTSTATUS Status; + SM_PORT_MESSAGE SmReqMsg; + + DPRINT("SMLIB: %s called\n", __FUNCTION__); + + /* Marshal Ses in the LPC message */ + SmReqMsg.CompSes.hApiPort = hApiPort; + SmReqMsg.CompSes.hSbApiPort = hSbApiPort; + + /* SM API to invoke */ + SmReqMsg.ApiIndex = SM_API_COMPLETE_SESSION; + + /* Port message */ + SmReqMsg.Header.MessageType = LPC_NEW_MESSAGE; + SmReqMsg.Header.DataSize = SM_PORT_DATA_SIZE(SmReqMsg.CompSes); + SmReqMsg.Header.MessageSize = SM_PORT_MESSAGE_SIZE; + Status = NtRequestWaitReplyPort (hSmApiPort, (PLPC_MESSAGE) & SmReqMsg, (PLPC_MESSAGE) & SmReqMsg); + if (NT_SUCCESS(Status)) + { + return SmReqMsg.Status; + } + DPRINT("SMLIB: %s failed (Status=0x%08lx)\n", __FUNCTION__, Status); + return Status; +} + +/* EOF */ _____ Added: trunk/reactos/lib/smlib/connect.c --- trunk/reactos/lib/smlib/connect.c 2005-03-14 22:28:58 UTC (rev 14079) +++ trunk/reactos/lib/smlib/connect.c 2005-03-14 22:38:12 UTC (rev 14080) @@ -0,0 +1,98 @@ +/* $Id: connect.c 14015 2005-03-13 17:00:19Z ea $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: reactos/lib/smlib/connect.c + * PURPOSE: Connect to the API LPC port exposed by the SM + */ +#define NTOS_MODE_USER +#include <ntos.h> +#include <sm/api.h> +#include <sm/helper.h> +#include <pe.h> + +#define NDEBUG +#include <debug.h> + +/********************************************************************** + * NAME EXPORTED + * SmConnectApiPort/4 + * + * DESCRIPTION + * Connect to SM API port and register a session "begin" port (Sb) + * or to issue API requests to SmApiPort. + * + * ARGUMENTS + * pSbApiPortName: name of the Sb port the calling subsystem + * server already created in the system name space; + * hSbApiPort: LPC port handle (checked, but not used); + * dwSubsystem: a valid IMAGE_SUBSYSTEM_xxx value; + * phSmApiPort: a pointer to a HANDLE, which will be + * filled with a valid client-side LPC comm port. + * + * RETURN VALUE + * If all three optional values are omitted, an LPC status. + * STATUS_INVALID_PARAMETER_MIX if PortName is defined and + * both hSbApiPort and dwSubsystem are 0. + */ +NTSTATUS STDCALL +SmConnectApiPort (IN PUNICODE_STRING pSbApiPortName OPTIONAL, + IN HANDLE hSbApiPort OPTIONAL, + IN DWORD dwSubsystem OPTIONAL, + IN OUT PHANDLE phSmApiPort) +{ + UNICODE_STRING SmApiPortName; + SECURITY_QUALITY_OF_SERVICE SecurityQos; + NTSTATUS Status = STATUS_SUCCESS; + SM_CONNECT_DATA ConnectData = {0,{0}}; + ULONG ConnectDataLength = 0; + + DPRINT("SMLIB: %s called\n", __FUNCTION__); + + if (pSbApiPortName) + { + if (pSbApiPortName->Length > (sizeof pSbApiPortName->Buffer[0] * SM_SB_NAME_MAX_LENGTH)) + { + return STATUS_INVALID_PARAMETER_1; + } + if (NULL == hSbApiPort || IMAGE_SUBSYSTEM_UNKNOWN == dwSubsystem) + { + return STATUS_INVALID_PARAMETER_MIX; + } + RtlZeroMemory (& ConnectData, sizeof ConnectData); + ConnectData.Subsystem = dwSubsystem; + if (pSbApiPortName->Length > 0) + { + RtlCopyMemory (& ConnectData.SbName, + pSbApiPortName->Buffer, + pSbApiPortName->Length); + } + } + ConnectDataLength = sizeof ConnectData; + + SecurityQos.Length = sizeof (SecurityQos); + SecurityQos.ImpersonationLevel = SecurityIdentification; + SecurityQos.ContextTrackingMode = TRUE; + SecurityQos.EffectiveOnly = TRUE; + + RtlInitUnicodeString (& SmApiPortName, SM_API_PORT_NAME); + + Status = NtConnectPort ( + phSmApiPort, + & SmApiPortName, + & SecurityQos, + NULL, + NULL, + NULL, + & ConnectData, + & ConnectDataLength + ); + if (NT_SUCCESS(Status)) + { + return STATUS_SUCCESS; + } + DPRINT("SMLIB: %s failed (Status=0x%08lx)\n", __FUNCTION__, Status); + return Status; +} + +/* EOF */ _____ Added: trunk/reactos/lib/smlib/execpgm.c --- trunk/reactos/lib/smlib/execpgm.c 2005-03-14 22:28:58 UTC (rev 14079) +++ trunk/reactos/lib/smlib/execpgm.c 2005-03-14 22:38:12 UTC (rev 14080) @@ -0,0 +1,76 @@ +/* $Id: execpgm.c 13731 2005-02-23 23:37:06Z ea $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/smlib/execpgm.c + * PURPOSE: Call SM API SM_API_EXECPGM + */ +#define NTOS_MODE_USER +#include <ntos.h> +#include <sm/api.h> +#include <sm/helper.h> +#include <string.h> + +#define NDEBUG +#include <debug.h> + +/********************************************************************** + * NAME EXPORTED + * SmExecuteProgram/2 + * + * DESCRIPTION + * This function is used to make the SM start an environment + * subsystem server process. + * + * ARGUMENTS + * hSmApiPort: port handle returned by SmConnectApiPort; + * Pgm : name of the subsystem (to be used by the SM to + * lookup the image name from the registry). + * Valid names are: DEBUG, WINDOWS, POSIX, OS2, + * and VMS. + * + * RETURN VALUE + * Success status as handed by the SM reply; otherwise a failure + * status code. + */ +NTSTATUS STDCALL +SmExecuteProgram (IN HANDLE hSmApiPort, + IN PUNICODE_STRING Pgm) +{ + NTSTATUS Status; + SM_PORT_MESSAGE SmReqMsg; + + + DPRINT("SMLIB: %s called\n", __FUNCTION__); + + /* Check Pgm's length */ + if (Pgm->Length > (sizeof (Pgm->Buffer[0]) * SM_EXEXPGM_MAX_LENGTH)) + { + return STATUS_INVALID_PARAMETER; + } + /* Marshal Pgm in the LPC message */ + RtlZeroMemory (& SmReqMsg, sizeof SmReqMsg); + SmReqMsg.ExecPgm.NameLength = Pgm->Length; + RtlCopyMemory (SmReqMsg.ExecPgm.Name, + Pgm->Buffer, + Pgm->Length); + + /* SM API to invoke */ + SmReqMsg.ApiIndex = SM_API_EXECUTE_PROGRAMME; + + /* LPC message */ + SmReqMsg.Header.MessageType = LPC_NEW_MESSAGE; + SmReqMsg.Header.DataSize = SM_PORT_DATA_SIZE(SmReqMsg.ExecPgm); + SmReqMsg.Header.MessageSize = SM_PORT_MESSAGE_SIZE; + + /* Call SM and wait for a reply */ + Status = NtRequestWaitReplyPort (hSmApiPort, (PLPC_MESSAGE) & SmReqMsg, (PLPC_MESSAGE) & SmReqMsg); + if (NT_SUCCESS(Status)) + { + return SmReqMsg.Status; + } + DPRINT("SMLIB: %s failed (Status=0x%08lx)\n", __FUNCTION__, Status); + return Status; +} + +/* EOF */ _____ Added: trunk/reactos/lib/smlib/makefile --- trunk/reactos/lib/smlib/makefile 2005-03-14 22:28:58 UTC (rev 14079) +++ trunk/reactos/lib/smlib/makefile 2005-03-14 22:38:12 UTC (rev 14080) @@ -0,0 +1,35 @@ + +PATH_TO_TOP = ../.. + +TARGET_TYPE = library + +TARGET_NAME = smlib + +include $(PATH_TO_TOP)/config + +TARGET_CFLAGS = -Wall -Werror -ffreestanding + +# require os code to explicitly request A/W version of structs/functions +TARGET_CFLAGS += -D_DISABLE_TIDENTS + +ifneq ($(DBG), 0) +TARGET_CFLAGS += -DDBG +endif + +TARGET_OBJECTS = \ + connect.o \ + execpgm.o \ + compses.o + + +include $(PATH_TO_TOP)/rules.mak + +include $(TOOLS_PATH)/helper.mk + +DEP_OBJECTS := $(TARGET_OBJECTS) + +TARGET_CLEAN = $(DEP_FILES) + +include $(PATH_TO_TOP)/tools/depend.mk + +# EOF _____ Modified: trunk/reactos/subsys/smss/initss.c --- trunk/reactos/subsys/smss/initss.c 2005-03-14 22:28:58 UTC (rev 14079) +++ trunk/reactos/subsys/smss/initss.c 2005-03-14 22:38:12 UTC (rev 14080) @@ -60,7 +60,7 @@ * (programmatically). This also open hSmApiPort to be used * in loading required subsystems. */ -#if 0 + static NTSTATUS SmpRegisterSmss(VOID) { @@ -68,7 +68,8 @@ UNICODE_STRING SbApiPortName = {0,0,NULL}; DPRINT("SM: %s called\n",__FUNCTION__); - + + RtlInitUnicodeString (& SbApiPortName, L""); Status = SmConnectApiPort(& SbApiPortName, (HANDLE) 0, IMAGE_SUBSYSTEM_NATIVE, @@ -79,6 +80,7 @@ __FUNCTION__,Status); return Status; } + DPRINT("SM self registered\n"); /* * Note that you don't need to call complete session * because connection handling code autocompletes @@ -86,8 +88,8 @@ */ return Status; } -#endif + /********************************************************************** */ NTSTATUS @@ -103,13 +105,12 @@ DPRINT("SM: loading subsystems\n"); /* SM self registers */ -#if 0 Status = SmpRegisterSmss(); if(!NT_SUCCESS(Status)) { DPRINT1("SM: SM failed to self register: system is not secure!\n"); } -#endif + /* Load Kmode subsystem (aka win32k.sys) */ Status = SmLookupSubsystem (L"Kmode", Data, @@ -136,7 +137,7 @@ } /* TODO: load Required subsystems (Debug Windows) */ #if 0 - Status = SmExecuteProgram(L"DEBUG"); + Status = SmExecuteProgram (hSmApiPort, L"DEBUG"); if(!NT_SUCCESS(Status)) { DPRINT1("SM: DBSS failed to initialize!\n"); _____ Modified: trunk/reactos/subsys/smss/makefile --- trunk/reactos/subsys/smss/makefile 2005-03-14 22:28:58 UTC (rev 14079) +++ trunk/reactos/subsys/smss/makefile 2005-03-14 22:38:12 UTC (rev 14080) @@ -6,7 +6,7 @@ TARGET_APPTYPE = native -TARGET_SDKLIBS = ntdll.a smdll.a +TARGET_SDKLIBS = smlib.a ntdll.a TARGET_NAME = smss
19 years, 9 months
1
0
0
0
[gvg] 14079: Sync to Wine-20050310:
by gvg@svn.reactos.com
Sync to Wine-20050310: Marcelo Duarte <wine-devel(a)bol.com.br> - Use "MS Shell Dlg" everywhere except for Japanese. Alex Villacis Lasso <a_villacis(a)palosanto.com> - Change SUBLANG_DEFAULT to SUBLANG_NEUTRAL for LANG_SPANISH in all resources, so that Spanish locales other than Spain also use Spanish resources. Modified: trunk/reactos/lib/mpr/mpr_De.rc Modified: trunk/reactos/lib/mpr/mpr_En.rc Modified: trunk/reactos/lib/mpr/mpr_Es.rc Deleted: trunk/reactos/lib/mpr/mpr_Fr.rc Added: trunk/reactos/lib/mpr/mpr_Fr.rc Modified: trunk/reactos/lib/mpr/mpr_Pt.rc Deleted: trunk/reactos/lib/mpr/netspi.h Added: trunk/reactos/lib/mpr/netspi.h _____ Modified: trunk/reactos/lib/mpr/mpr_De.rc --- trunk/reactos/lib/mpr/mpr_De.rc 2005-03-14 22:24:35 UTC (rev 14078) +++ trunk/reactos/lib/mpr/mpr_De.rc 2005-03-14 22:28:58 UTC (rev 14079) @@ -28,7 +28,7 @@ IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Netzwerkkennung eingeben" -FONT 8, "Helv" +FONT 8, "MS Shell Dlg" { LTEXT "Bitte geben Sie Benutzernamen und Kennwort ein:", IDC_EXPLAIN, 40, 6, 150, 15 LTEXT "Proxy", -1, 40, 26, 50, 10 _____ Modified: trunk/reactos/lib/mpr/mpr_En.rc --- trunk/reactos/lib/mpr/mpr_En.rc 2005-03-14 22:24:35 UTC (rev 14078) +++ trunk/reactos/lib/mpr/mpr_En.rc 2005-03-14 22:28:58 UTC (rev 14079) @@ -28,7 +28,7 @@ IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Enter Network Password" -FONT 8, "Helv" +FONT 8, "MS Shell Dlg" { LTEXT "Please enter your username and password:", IDC_EXPLAIN, 40, 6, 150, 15 LTEXT "Proxy", -1, 40, 26, 50, 10 _____ Modified: trunk/reactos/lib/mpr/mpr_Es.rc --- trunk/reactos/lib/mpr/mpr_Es.rc 2005-03-14 22:24:35 UTC (rev 14078) +++ trunk/reactos/lib/mpr/mpr_Es.rc 2005-03-14 22:28:58 UTC (rev 14079) @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -LANGUAGE LANG_SPANISH, SUBLANG_DEFAULT +LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL STRINGTABLE DISCARDABLE { _____ Deleted: trunk/reactos/lib/mpr/mpr_Fr.rc --- trunk/reactos/lib/mpr/mpr_Fr.rc 2005-03-14 22:24:35 UTC (rev 14078) +++ trunk/reactos/lib/mpr/mpr_Fr.rc 2005-03-14 22:28:58 UTC (rev 14079) @@ -1,47 +0,0 @@ -/* - * MPR dll resources - * French language support - * - * Copyright (C) 2005 Jonathan Ernst - * - * 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 - */ - -LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL - -STRINGTABLE DISCARDABLE -{ - IDS_ENTIRENETWORK "Le rÚseau entier" -} - -IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Entrez le mot de passe rÚseau" -FONT 8, "Helv" -{ - LTEXT "Veuillez saisir votre nom d'utilisateur et votre mot de passe:", IDC_EXPLAIN, 40, 6, 150, 15 - LTEXT "Proxy", -1, 40, 26, 50, 10 -/* LTEXT "Realm", -1, 40, 46, 50, 10 */ - LTEXT "Utilisateur", -1, 40, 66, 50, 10 - LTEXT "Mot de passe", -1, 40, 86, 50, 10 - LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 - LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 - EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP - EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD - CHECKBOX "&Enregistrer ce mot de passe (risquÚ)", IDC_SAVEPASSWORD, - 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON - PUSHBUTTON "Annuler", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP -} _____ Copied: trunk/reactos/lib/mpr/mpr_Fr.rc (from rev 14078, vendor/wine/dlls/mpr/current/mpr_Fr.rc) _____ Modified: trunk/reactos/lib/mpr/mpr_Pt.rc --- trunk/reactos/lib/mpr/mpr_Pt.rc 2005-03-14 22:24:35 UTC (rev 14078) +++ trunk/reactos/lib/mpr/mpr_Pt.rc 2005-03-14 22:28:58 UTC (rev 14079) @@ -24,3 +24,23 @@ { IDS_ENTIRENETWORK "Toda a rede" } + +IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Entre a senha da rede" +FONT 8, "MS Shell Dlg" +{ + LTEXT "Por favor, entre como o nome de usu?írio e a senha:", IDC_EXPLAIN, 40, 6, 150, 15 + LTEXT "Proxy", -1, 40, 26, 50, 10 +/* LTEXT "Realm", -1, 40, 46, 50, 10 */ + LTEXT "Usu?írio", -1, 40, 66, 50, 10 + LTEXT "Senha", -1, 40, 86, 50, 10 + LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 + LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + CHECKBOX "&Salvar esta senha (Inseguro)", IDC_SAVEPASSWORD, + 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON + PUSHBUTTON "Cancelar", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP +} _____ Deleted: trunk/reactos/lib/mpr/netspi.h --- trunk/reactos/lib/mpr/netspi.h 2005-03-14 22:24:35 UTC (rev 14078) +++ trunk/reactos/lib/mpr/netspi.h 2005-03-14 22:28:58 UTC (rev 14079) @@ -1,153 +0,0 @@ -/* - * MPR - Network provider services - * Warning: this file apparently existed as part of the Win98 DDK. Some of - * the declarations in it conflict with those in the Platform SDK's npapi.h, - * therefore this header was made private. Don't try to include both headers. - * - * Copyright (C) 1999 Ulrich Weigand - * - * 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 _NETSPI_H_ -#define _NETSPI_H_ - -#include "windef.h" -#include "winnetwk.h" - -/* - * Note: The Unicode variants of all these routines/structures - * apparently don't exist, at least not in Win95 ... - */ - -#define HPROVIDER LPVOID -typedef HPROVIDER *PHPROVIDER; - -typedef struct -{ - DWORD cbStructure; - HWND hwndOwner; - LPCSTR lpResource; - LPSTR lpUsername; - DWORD cbUsername; - LPSTR lpPassword; - DWORD cbPassword; - LPSTR lpOrgUnit; - DWORD cbOrgUnit; - LPCSTR lpOUTitle; - LPCSTR lpExplainText; - LPCSTR lpDefaultUserName; - DWORD dwFlags; - -} AUTHDLGSTRUCTA, *LPAUTHDLGSTRUCTA; - -DECL_WINELIB_TYPE_AW(AUTHDLGSTRUCT) -DECL_WINELIB_TYPE_AW(LPAUTHDLGSTRUCT) - -#define AUTHDLG_ENABLECACHE 0x00000001 -#define AUTHDLG_CHECKCACHE 0x00000002 -#define AUTHDLG_CACHEINVALID 0x00000004 -#define AUTHDLG_USE_DEFAULT_NAME 0x00000008 -#define AUTHDLG_CHECKDEFAULT_NAME 0x00000010 -#define AUTHDLG_LOGON 0x00000020 - -#define AUTHDLG_ENABLECACHE 0x00000001 -#define AUTHDLG_CHECKCACHE 0x00000002 -#define AUTHDLG_CACHEINVALID 0x00000004 -#define AUTHDLG_USE_DEFAULT_NAME 0x00000008 -#define AUTHDLG_CHECKDEFAULT_NAME 0x00000010 -#define AUTHDLG_LOGON 0x00000020 - -DWORD WINAPI NPSAuthenticationDialogA(LPAUTHDLGSTRUCTA); -#define NPSAuthenticationDialog WINELIB_NAME_AW(NPSAuthenticationDialog) -DWORD WINAPI NPSGetProviderHandleA(PHPROVIDER); -#define NPSGetProviderHandle WINELIB_NAME_AW(NPSGetProviderHandle) -DWORD WINAPI NPSGetProviderNameA(HPROVIDER,LPCSTR *); -#define NPSGetProviderName WINELIB_NAME_AW(NPSGetProviderName) -DWORD WINAPI NPSGetSectionNameA(HPROVIDER,LPCSTR *lpszSectionName); -#define NPSGetSectionName WINELIB_NAME_AW(NPSGetSectionName) -DWORD WINAPI NPSSetExtendedErrorA(DWORD,LPSTR); -#define NPSSetExtendedError WINELIB_NAME_AW(NPSSetExtendedError) -VOID WINAPI NPSSetCustomTextA(LPSTR); -#define NPSSetCustomText WINELIB_NAME_AW(NPSSetCustomText) -DWORD WINAPI NPSCopyStringA(LPCSTR,LPVOID,LPDWORD); -#define NPSCopyString WINELIB_NAME_AW(NPSCopyString) -DWORD WINAPI NPSDeviceGetNumberA(LPSTR,LPDWORD,LPDWORD); -#define NPSDeviceGetNumber WINELIB_NAME_AW(NPSDeviceGetNumber) -DWORD WINAPI NPSDeviceGetStringA(DWORD,DWORD,LPSTR,LPDWORD); -#define NPSDeviceGetString WINELIB_NAME_AW(NPSDeviceGetString) - - -enum NOTIFYTYPE { NotifyAddConnection, - NotifyCancelConnection, - NotifyGetConnectionPerformance }; - -#define NOTIFY_PRE 0x00 -#define NOTIFY_POST 0x01 - -typedef struct -{ - DWORD cbStructure; - DWORD dwNotifyStatus; - DWORD dwOperationStatus; - LPVOID lpNPContext; - -} NOTIFYINFO, *LPNOTIFYINFO; - -typedef struct -{ - DWORD cbStructure; - HWND hwndOwner; - NETRESOURCEA NetResource; - DWORD dwAddFlags; - LPSTR lpAccessName; - LPDWORD lpBufferSize; - DWORD dwResult; - DWORD dwAddContext; - -} NOTIFYADDA, *LPNOTIFYADDA; - -#define CONNECT_CTXT_RESTORE 0x00000001 -#define CONNECT_CTXT_GLOBAL 0x00000002 -#define CONNECT_CTXT_PROVIDER 0x00000004 -#define CONNECT_CTXT_SINGLE 0x00000008 - -typedef struct -{ - DWORD cbStructure; - LPSTR lpName; - LPSTR lpProvider; - DWORD dwFlags; - BOOL fForce; - -} NOTIFYCANCELA, *LPNOTIFYCANCELA; - -typedef struct -{ - DWORD cbStructure; - LPSTR lpRemoteName; - LPSTR lpProviderName; - LPNETCONNECTINFOSTRUCT lpNetConnectInfo; - -} NOTIFYPERFORMANCEA, *LPNOTIFYPERFORMANCEA; - -typedef DWORD (CALLBACK *NOTIFYCALLBACK)(LPNOTIFYINFO,LPVOID); - -DWORD WINAPI NPSNotifyRegisterA(enum NOTIFYTYPE,NOTIFYCALLBACK); -#define NPSNotifyRegister WINELIB_NAME_AW(NPSNotifyRegister) -LPVOID WINAPI NPSNotifyGetContextA(NOTIFYCALLBACK); -#define NPSNotifyGetContext WINELIB_NAME_AW(NPSNotifyGetContext) - -#endif /* _NETSPI_H_ */ _____ Copied: trunk/reactos/lib/mpr/netspi.h (from rev 14078, vendor/wine/dlls/mpr/current/netspi.h) Property changes on: trunk/reactos/lib/mpr/netspi.h ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native
19 years, 9 months
1
0
0
0
[gvg] 14078: Sync to Wine-20050310:
by gvg@svn.reactos.com
Sync to Wine-20050310: Alexandre Julliard <julliard(a)winehq.org> - Make sure to always pass valid QS_* flags to MsgWaitForMultipleObjects. Christian Costa <titan.costa(a)wanadoo.fr> - Implemented GetProperty method for keyboard device. Modified: trunk/reactos/lib/dinput/joystick_linuxinput.c Modified: trunk/reactos/lib/dinput/keyboard.c Modified: trunk/reactos/lib/dinput/mouse.c _____ Modified: trunk/reactos/lib/dinput/joystick_linuxinput.c --- trunk/reactos/lib/dinput/joystick_linuxinput.c 2005-03-14 22:21:18 UTC (rev 14077) +++ trunk/reactos/lib/dinput/joystick_linuxinput.c 2005-03-14 22:24:35 UTC (rev 14078) @@ -978,7 +978,7 @@ { JoystickImpl *This = (JoystickImpl *)iface; - TRACE("(this=%p,%s,%p): stub!\n", + TRACE("(this=%p,%s,%p)\n", iface, debugstr_guid(rguid), pdiph); if (TRACE_ON(dinput)) _____ Modified: trunk/reactos/lib/dinput/keyboard.c --- trunk/reactos/lib/dinput/keyboard.c 2005-03-14 22:21:18 UTC (rev 14077) +++ trunk/reactos/lib/dinput/keyboard.c 2005-03-14 22:24:35 UTC (rev 14078) @@ -426,7 +426,37 @@ return DI_OK; } +static HRESULT WINAPI SysKeyboardAImpl_GetProperty( + LPDIRECTINPUTDEVICE8A iface,REFGUID rguid,LPDIPROPHEADER ph +) +{ + SysKeyboardImpl *This = (SysKeyboardImpl *)iface; + TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(rguid),ph); + TRACE("(size=%ld,headersize=%ld,obj=%ld,how=%ld\n", + ph->dwSize,ph->dwHeaderSize,ph->dwObj,ph->dwHow); + if (!HIWORD(rguid)) { + switch ((DWORD)rguid) { + case (DWORD) DIPROP_BUFFERSIZE: { + LPDIPROPDWORD pd = (LPDIPROPDWORD)ph; + + TRACE("(buffersize=%ld)\n",pd->dwData); + + if (This->acquired) + return DIERR_INVALIDPARAM; + + pd->dwData = This->buffersize; + + break; + } + default: + WARN("Unknown type %ld\n",(DWORD)rguid); + break; + } + } + return DI_OK; +} + static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState( LPDIRECTINPUTDEVICE8A iface,DWORD len,LPVOID ptr ) @@ -441,7 +471,7 @@ if (len != 256) return DIERR_INVALIDPARAM; - MsgWaitForMultipleObjectsEx(0, NULL, 0, 0, 0); + MsgWaitForMultipleObjectsEx(0, NULL, 0, QS_ALLINPUT, 0); if (TRACE_ON(dinput)) { int i; @@ -480,7 +510,7 @@ if (dodsize < sizeof(DIDEVICEOBJECTDATA_DX3)) return DIERR_INVALIDPARAM; - MsgWaitForMultipleObjectsEx(0, NULL, 0, 0, 0); + MsgWaitForMultipleObjectsEx(0, NULL, 0, QS_ALLINPUT, 0); EnterCriticalSection(&(This->crit)); @@ -792,7 +822,7 @@ SysKeyboardAImpl_Release, SysKeyboardAImpl_GetCapabilities, SysKeyboardAImpl_EnumObjects, - IDirectInputDevice2AImpl_GetProperty, + SysKeyboardAImpl_GetProperty, SysKeyboardAImpl_SetProperty, SysKeyboardAImpl_Acquire, SysKeyboardAImpl_Unacquire, @@ -834,7 +864,7 @@ XCAST(Release)SysKeyboardAImpl_Release, XCAST(GetCapabilities)SysKeyboardAImpl_GetCapabilities, SysKeyboardWImpl_EnumObjects, - XCAST(GetProperty)IDirectInputDevice2AImpl_GetProperty, + XCAST(GetProperty)SysKeyboardAImpl_GetProperty, XCAST(SetProperty)SysKeyboardAImpl_SetProperty, XCAST(Acquire)SysKeyboardAImpl_Acquire, XCAST(Unacquire)SysKeyboardAImpl_Unacquire, _____ Modified: trunk/reactos/lib/dinput/mouse.c --- trunk/reactos/lib/dinput/mouse.c 2005-03-14 22:21:18 UTC (rev 14077) +++ trunk/reactos/lib/dinput/mouse.c 2005-03-14 22:24:35 UTC (rev 14078) @@ -1136,7 +1136,7 @@ { SysMouseImpl *This = (SysMouseImpl *)iface; - TRACE("(this=%p,%s,%p): stub!\n", + TRACE("(this=%p,%s,%p)\n", iface, debugstr_guid(rguid), pdiph); if (TRACE_ON(dinput))
19 years, 9 months
1
0
0
0
[gvg] 14077: Sync to Wine-20050310:
by gvg@svn.reactos.com
Sync to Wine-20050310: Marcelo Duarte <wine-devel(a)bol.com.br> - Update the resources for Portuguese. Dmitry Timoshkov <dmitry(a)codeweavers.com> - Fix prototypes of GetClassLongA/W, GetClassLongPtrA/W and SetClassLongA/W according to SDK definitions. - Add prototypes for SetClassLongPtrA/W, protect some GWL_ and GCL_ constants from using in Wine or in _WIN64 mode. - Fix all places in Wine affected by the above changes. Jon Griffiths <jon_p_griffiths(a)yahoo.com> - Documentation spelling fixes. Alex Villacis Lasso <a_villacis(a)palosanto.com> - Change SUBLANG_DEFAULT to SUBLANG_NEUTRAL for LANG_SPANISH in all resources, so that Spanish locales other than Spain also use Spanish resources. Troy Rollo <wine(a)troy.rollo.name> - Fix stack object overrun when an application calls ChooseFontA. Mike Hearn <mh(a)codeweavers.com> - Respect the flags member of the CHOOSEFONT structure, and don't attempt to process bogus strings. Modified: trunk/reactos/lib/comdlg32/cdlg32.c Modified: trunk/reactos/lib/comdlg32/cdlg_En.rc Modified: trunk/reactos/lib/comdlg32/cdlg_Es.rc Modified: trunk/reactos/lib/comdlg32/cdlg_Pt.rc Modified: trunk/reactos/lib/comdlg32/cdlg_xx.rc Modified: trunk/reactos/lib/comdlg32/colordlg.c Modified: trunk/reactos/lib/comdlg32/colordlg16.c Modified: trunk/reactos/lib/comdlg32/filedlg.c Modified: trunk/reactos/lib/comdlg32/finddlg.c Modified: trunk/reactos/lib/comdlg32/fontdlg.c Modified: trunk/reactos/lib/comdlg32/fontdlg16.c _____ Modified: trunk/reactos/lib/comdlg32/cdlg32.c --- trunk/reactos/lib/comdlg32/cdlg32.c 2005-03-14 21:59:25 UTC (rev 14076) +++ trunk/reactos/lib/comdlg32/cdlg32.c 2005-03-14 22:21:18 UTC (rev 14077) @@ -131,8 +131,8 @@ * COMDLG32_AllocMem (internal) * Get memory for internal datastructure plus stringspace etc. * RETURNS - * Pointer to a heap block: Succes - * NULL: Failure + * Success: Pointer to a heap block + * Failure: null */ LPVOID COMDLG32_AllocMem( int size /* [in] Block size to allocate */ _____ Modified: trunk/reactos/lib/comdlg32/cdlg_En.rc --- trunk/reactos/lib/comdlg32/cdlg_En.rc 2005-03-14 21:59:25 UTC (rev 14076) +++ trunk/reactos/lib/comdlg32/cdlg_En.rc 2005-03-14 22:21:18 UTC (rev 14077) @@ -470,33 +470,6 @@ IDS_OPEN_FILE "Open File" } -/* Translators do not need to translate this text, unless the language uses a - * different character set or if the distribution of characters looks wrong. - * It is rendered illegibly small and is used to make a mock-up of a document. - */ -STRINGTABLE DISCARDABLE -{ - IDS_FAKEDOCTEXT - "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. \ - Nulla a tortor. Etiam aliquet libero venenatis nunc. \n \ - \n \ - Sed augue ante, fermentum sit amet, imperdiet et, gravida eu, enim. \ - Donec nibh quam, sodales in, commodo vel, facilisis id, neque. \n \ - \n \ - Nunc eleifend bibendum nibh. Phasellus in lorem. Ut vel odio quis \ - libero adipiscing consequat. Donec consectetuer laoreet mauris. \n \ - \n \ - Maecenas tempor, ligula sed congue nonummy, arcu dolor ornare erat, \ - egestas iaculis magna purus sed turpis. \n \ - \n \ - Morbi ultricies est non ipsum. Cum sociis natoque penatibus et magnis \ - dis parturient montes, nascetur ridiculus mus. \n \ - \n \ - Duis sit amet nibh quis purus sollicitudin blandit. Curabitur justo. \ - Phasellus varius, erat eu luctus pharetra, odio elit fringilla leo, \ - non vulputate turpis elit id neque. Vestibulum sit amet tellus sed \ - tortor fermentum consectetuer." -} /****************************************************************/ /* English neutral resources _____ Modified: trunk/reactos/lib/comdlg32/cdlg_Es.rc --- trunk/reactos/lib/comdlg32/cdlg_Es.rc 2005-03-14 21:59:25 UTC (rev 14076) +++ trunk/reactos/lib/comdlg32/cdlg_Es.rc 2005-03-14 22:21:18 UTC (rev 14077) @@ -21,7 +21,7 @@ * WARNING: DO NOT CHANGE THE SIZE OF THE STANDARD DIALOG TEMPLATES. */ -LANGUAGE LANG_SPANISH, SUBLANG_DEFAULT +LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL OPEN_FILE DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU _____ Modified: trunk/reactos/lib/comdlg32/cdlg_Pt.rc --- trunk/reactos/lib/comdlg32/cdlg_Pt.rc 2005-03-14 21:59:25 UTC (rev 14076) +++ trunk/reactos/lib/comdlg32/cdlg_Pt.rc 2005-03-14 22:21:18 UTC (rev 14077) @@ -458,3 +458,13 @@ IDS_COLOR_AQUA "Azul-piscina" IDS_COLOR_WHITE "Branco" } + +STRINGTABLE DISCARDABLE +{ + IDS_FONT_SIZE "Selecione o tamanho da fonte entre %d e %d pontos." + IDS_SAVE_BUTTON "&Salvar" + IDS_SAVE_IN "Salvar &em:" + IDS_SAVE "Salvar" + IDS_SAVE_AS "Salvar como" + IDS_OPEN_FILE "Abrir Arquivo" +} _____ Modified: trunk/reactos/lib/comdlg32/cdlg_xx.rc --- trunk/reactos/lib/comdlg32/cdlg_xx.rc 2005-03-14 21:59:25 UTC (rev 14076) +++ trunk/reactos/lib/comdlg32/cdlg_xx.rc 2005-03-14 22:21:18 UTC (rev 14077) @@ -32,6 +32,35 @@ #include "wine/wine_common_ver.rc" +/* Translators do not need to translate this text, unless the language uses a + * different character set or if the distribution of characters looks wrong. + * It is rendered illegibly small and is used to make a mock-up of a document. + */ +STRINGTABLE DISCARDABLE +{ + IDS_FAKEDOCTEXT + "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. \ + Nulla a tortor. Etiam aliquet libero venenatis nunc. \n \ + \n \ + Sed augue ante, fermentum sit amet, imperdiet et, gravida eu, enim. \ + Donec nibh quam, sodales in, commodo vel, facilisis id, neque. \n \ + \n \ + Nunc eleifend bibendum nibh. Phasellus in lorem. Ut vel odio quis \ + libero adipiscing consequat. Donec consectetuer laoreet mauris. \n \ + \n \ + Maecenas tempor, ligula sed congue nonummy, arcu dolor ornare erat, \ + egestas iaculis magna purus sed turpis. \n \ + \n \ + Morbi ultricies est non ipsum. Cum sociis natoque penatibus et magnis \ + dis parturient montes, nascetur ridiculus mus. \n \ + \n \ + Duis sit amet nibh quis purus sollicitudin blandit. Curabitur justo. \ + Phasellus varius, erat eu luctus pharetra, odio elit fringilla leo, \ + non vulputate turpis elit id neque. Vestibulum sit amet tellus sed \ + tortor fermentum consectetuer." +} + + /* BINRES pd32_collate.ico */ PD32_COLLATE ICON DISCARDABLE LOADONCALL pd32_collate.ico /* { _____ Modified: trunk/reactos/lib/comdlg32/colordlg.c --- trunk/reactos/lib/comdlg32/colordlg.c 2005-03-14 21:59:25 UTC (rev 14076) +++ trunk/reactos/lib/comdlg32/colordlg.c 2005-03-14 22:21:18 UTC (rev 14077) @@ -461,7 +461,7 @@ int oben; RECT rect; HWND hwnd = GetDlgItem(hDlg, 0x2be); - LCCPRIV lpp = (LCCPRIV)GetWindowLongA( hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW( hDlg, DWLP_USER); if (IsWindowVisible( GetDlgItem(hDlg, 0x2c6))) /* if full size */ { @@ -480,7 +480,7 @@ points[2].y = points[0].y - w; points[2].x = points[1].x = points[0].x + w; - FillRect(hDC, &lpp->old3angle, (HBRUSH)GetClassLongA( hwnd, GCL_HBRBACKGROUND)); + FillRect(hDC, &lpp->old3angle, (HBRUSH)GetClassLongPtrW( hwnd, GCLP_HBRBACKGROUND)); lpp->old3angle.left = points[0].x; lpp->old3angle.right = points[1].x + 1; lpp->old3angle.top = points[2].y - 1; @@ -499,7 +499,7 @@ HDC hDC; int w = GetDialogBaseUnits(); HWND hwnd = GetDlgItem(hDlg, 0x2c6); - LCCPRIV lpp = (LCCPRIV)GetWindowLongA( hDlg, DWL_USER ); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW( hDlg, DWLP_USER ); RECT rect; POINT point, p; HPEN hPen; @@ -544,11 +544,11 @@ { int sdif, hdif, xdif, ydif, r, g, b, hue, sat; HWND hwnd = GetDlgItem(hDlg, 0x2c6); - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); HBRUSH hbrush; HDC hdc ; RECT rect, client; - HCURSOR hcursor = SetCursor( LoadCursorA(0, (LPSTR)IDC_WAIT) ); + HCURSOR hcursor = SetCursor( LoadCursorW(0, (LPCWSTR)IDC_WAIT) ); GetClientRect(hwnd, &client); hdc = GetDC(hwnd); @@ -587,7 +587,7 @@ static void CC_PaintColorGraph( HWND hDlg ) { HWND hwnd = GetDlgItem( hDlg, 0x2c6 ); - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); HDC hDC; RECT rect; if (IsWindowVisible(hwnd)) /* if full size */ @@ -647,7 +647,7 @@ void CC_EditSetRGB( HWND hDlg, COLORREF cr ) { char buffer[10]; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); int r = GetRValue(cr); int g = GetGValue(cr); int b = GetBValue(cr); @@ -670,7 +670,7 @@ void CC_EditSetHSL( HWND hDlg, int h, int s, int l ) { char buffer[10]; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); lpp->updating = TRUE; if (IsWindowVisible( GetDlgItem(hDlg, 0x2c6) )) /* if full size */ { @@ -692,7 +692,7 @@ void CC_SwitchToFullSize( HWND hDlg, COLORREF result, LPRECT lprect ) { int i; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); EnableWindow( GetDlgItem(hDlg, 0x2cf), FALSE); CC_PrepareColorGraph(hDlg); @@ -728,7 +728,7 @@ HDC hdc; HBRUSH hBrush; int dx, dy, i, j, k; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); GetClientRect(hwnd, &rect); dx = rect.right / cols; @@ -737,7 +737,7 @@ hdc = GetDC(hwnd); GetClientRect(hwnd, &rect); - FillRect(hdc, &rect, (HBRUSH)GetClassLongA(hwnd, GCL_HBRBACKGROUND)); + FillRect(hdc, &rect, (HBRUSH)GetClassLongPtrW(hwnd, GCLP_HBRBACKGROUND)); for ( j = 0; j < rows; j++ ) { for ( i = 0; i < cols; i++ ) @@ -770,7 +770,7 @@ HDC hdc; HBRUSH hBrush; int dx, dy, i, j, k; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); GetClientRect(hwnd, &rect); @@ -781,7 +781,7 @@ hdc = GetDC(hwnd); if (hdc) { - FillRect(hdc, &rect, (HBRUSH)GetClassLongA(hwnd, GCL_HBRBACKGROUND) ); + FillRect(hdc, &rect, (HBRUSH)GetClassLongPtrW(hwnd, GCLP_HBRBACKGROUND) ); for (j = 0; j < rows; j++) { for (i = 0; i < cols; i++) @@ -842,7 +842,7 @@ return FALSE; } - SetWindowLongA(hDlg, DWL_USER, (LONG)lpp); + SetWindowLongPtrW(hDlg, DWLP_USER, (LONG_PTR)lpp); if (!(lpp->lpcc->Flags & CC_SHOWHELP)) ShowWindow( GetDlgItem(hDlg,0x40e), SW_HIDE); @@ -936,7 +936,7 @@ UINT cokmsg; HDC hdc; COLORREF *cr; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); TRACE("CC_WMCommand wParam=%x lParam=%lx\n", wParam, lParam); switch (wParam) { @@ -1058,7 +1058,7 @@ LRESULT CC_WMPaint( HWND hDlg, WPARAM wParam, LPARAM lParam ) { PAINTSTRUCT ps; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); BeginPaint(hDlg, &ps); /* we have to paint dialog children except text and buttons */ @@ -1079,7 +1079,7 @@ */ LRESULT CC_WMLButtonUp( HWND hDlg, WPARAM wParam, LPARAM lParam ) { - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); if (lpp->capturedGraph) { lpp->capturedGraph = 0; @@ -1095,7 +1095,7 @@ */ LRESULT CC_WMMouseMove( HWND hDlg, LPARAM lParam ) { - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); int r, g, b; if (lpp->capturedGraph) @@ -1133,7 +1133,7 @@ */ LRESULT CC_WMLButtonDown( HWND hDlg, WPARAM wParam, LPARAM lParam ) { - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); int r, g, b, i; i = 0; @@ -1192,7 +1192,7 @@ { int res; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); if (message != WM_INITDIALOG) { if (!lpp) @@ -1217,7 +1217,7 @@ DeleteDC(lpp->hdcMem); DeleteObject(lpp->hbmMem); HeapFree(GetProcessHeap(), 0, lpp); - SetWindowLongA(hDlg, DWL_USER, 0L); /* we don't need it anymore */ + SetWindowLongPtrW(hDlg, DWLP_USER, 0); /* we don't need it anymore */ break; case WM_COMMAND: if (CC_WMCommand( hDlg, wParam, lParam, HIWORD(wParam), (HWND) lParam)) _____ Modified: trunk/reactos/lib/comdlg32/colordlg16.c --- trunk/reactos/lib/comdlg32/colordlg16.c 2005-03-14 21:59:25 UTC (rev 14076) +++ trunk/reactos/lib/comdlg32/colordlg16.c 2005-03-14 22:21:18 UTC (rev 14077) @@ -102,7 +102,7 @@ ch32->lpfnHook = (LPCCHOOKPROC) ch16->lpfnHook; /* only used as flag */ ch32->Flags = ch16->Flags; - SetWindowLongA(hDlg, DWL_USER, (LONG)lpp); + SetWindowLongPtrW(hDlg, DWLP_USER, (LONG_PTR)lpp); if (!(lpp->lpcc->Flags & CC_SHOWHELP)) ShowWindow( GetDlgItem(hDlg,0x40e), SW_HIDE); @@ -196,7 +196,7 @@ UINT cokmsg; HDC hdc; COLORREF *cr; - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); TRACE("CC_WMCommand wParam=%x lParam=%lx\n", wParam, lParam); switch (wParam) { @@ -334,7 +334,7 @@ BOOL16 res; HWND hDlg = HWND_32(hDlg16); - LCCPRIV lpp = (LCCPRIV)GetWindowLongA(hDlg, DWL_USER); + LCCPRIV lpp = (LCCPRIV)GetWindowLongPtrW(hDlg, DWLP_USER); if (message != WM_INITDIALOG) { if (!lpp) @@ -360,7 +360,7 @@ DeleteObject(lpp->hbmMem); HeapFree(GetProcessHeap(), 0, lpp->lpcc); HeapFree(GetProcessHeap(), 0, lpp); - SetWindowLongA(hDlg, DWL_USER, 0L); /* we don't need it anymore */ + SetWindowLongPtrW(hDlg, DWLP_USER, 0); /* we don't need it anymore */ break; case WM_COMMAND: if (CC_WMCommand16(hDlg, wParam, lParam, _____ Modified: trunk/reactos/lib/comdlg32/filedlg.c --- trunk/reactos/lib/comdlg32/filedlg.c 2005-03-14 21:59:25 UTC (rev 14076) +++ trunk/reactos/lib/comdlg32/filedlg.c 2005-03-14 22:21:18 UTC (rev 14077) @@ -1528,7 +1528,7 @@ TRACE("\n"); - SetWindowLongA(hwnd,DWL_MSGRESULT,(LONG)fodInfos->Shell.FOIShellBrowser) ; + SetWindowLongPtrW(hwnd,DWLP_MSGRESULT,(LONG_PTR)fodInfos->Shell.FOIShell Browser); return TRUE; } @@ -1551,7 +1551,7 @@ TRACE("---\n"); /* First send CDN_FILEOK as MSDN doc says */ SendCustomDlgNotificationMessage(hwnd,CDN_FILEOK); - if (GetWindowLongW(fodInfos->DlgInfos.hwndCustomDlg, DWL_MSGRESULT)) + if (GetWindowLongPtrW(fodInfos->DlgInfos.hwndCustomDlg, DWLP_MSGRESULT)) { TRACE("canceled\n"); return FALSE; @@ -1560,7 +1560,7 @@ /* fodInfos->ofnInfos points to an ASCII or UNICODE structure as appropriate */ SendMessageW(fodInfos->DlgInfos.hwndCustomDlg, fodInfos->HookMsg.fileokstring, 0, (LPARAM)fodInfos->ofnInfos); - if (GetWindowLongW(fodInfos->DlgInfos.hwndCustomDlg, DWL_MSGRESULT)) + if (GetWindowLongPtrW(fodInfos->DlgInfos.hwndCustomDlg, DWLP_MSGRESULT)) { TRACE("canceled\n"); return FALSE; _____ Modified: trunk/reactos/lib/comdlg32/finddlg.c --- trunk/reactos/lib/comdlg32/finddlg.c 2005-03-14 21:59:25 UTC (rev 14076) +++ trunk/reactos/lib/comdlg32/finddlg.c 2005-03-14 22:21:18 UTC (rev 14077) @@ -230,7 +230,7 @@ static LRESULT FINDDLG_WMInitDialog(HWND hWnd, LPARAM lParam, LPDWORD lpFlags, LPSTR lpstrFindWhat, BOOL fUnicode) { - SetWindowLongA(hWnd, DWL_USER, lParam); + SetWindowLongPtrW(hWnd, DWLP_USER, lParam); *lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM); /* * FIXME : If the initial FindWhat string is empty, we should disable the @@ -295,14 +295,14 @@ else *lpFlags &= ~FR_MATCHCASE; *lpFlags &= ~(FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM); *lpFlags |= FR_FINDNEXT; - SendMessageA(hwndOwner, uFindReplaceMessage, 0, - GetWindowLongA(hWnd, DWL_USER) ); + SendMessageW( hwndOwner, uFindReplaceMessage, 0, + GetWindowLongPtrW(hWnd, DWLP_USER) ); return TRUE; case IDCANCEL: *lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL); *lpFlags |= FR_DIALOGTERM; - SendMessageA(hwndOwner, uFindReplaceMessage, 0, - GetWindowLongA(hWnd, DWL_USER) ); + SendMessageW( hwndOwner, uFindReplaceMessage, 0, + GetWindowLongPtrW(hWnd, DWLP_USER) ); DestroyWindow(hWnd); return TRUE; case pshHelp: @@ -328,7 +328,7 @@ return FINDDLG_WMInitDialog(hWnd, lParam, &(lpfr->Flags), MapSL(lpfr->lpstrFindWhat), FALSE); case WM_COMMAND: - lpfr=MapSL(GetWindowLongA(hWnd, DWL_USER)); + lpfr=MapSL(GetWindowLongPtrW(hWnd, DWLP_USER)); return FINDDLG_WMCommand(hWnd, wParam, HWND_32(lpfr->hwndOwner), &lpfr->Flags, MapSL(lpfr->lpstrFindWhat), lpfr->wFindWhatLen, FALSE); @@ -344,7 +344,7 @@ LPDWORD lpFlags, LPSTR lpstrFindWhat, LPSTR lpstrReplaceWith, BOOL fUnicode) { - SetWindowLongA(hWnd, DWL_USER, lParam); + SetWindowLongPtrW(hWnd, DWLP_USER, lParam); *lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM); /* * FIXME : If the initial FindWhat string is empty, we should disable the FinNext / @@ -410,14 +410,14 @@ else *lpFlags &= ~FR_MATCHCASE; *lpFlags &= ~(FR_REPLACE | FR_REPLACEALL | FR_DIALOGTERM); *lpFlags |= FR_FINDNEXT; - SendMessageA(hwndOwner, uFindReplaceMessage, 0, - GetWindowLongA(hWnd, DWL_USER) ); + SendMessageW( hwndOwner, uFindReplaceMessage, 0, + GetWindowLongPtrW(hWnd, DWLP_USER) ); return TRUE; case IDCANCEL: *lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_REPLACEALL); *lpFlags |= FR_DIALOGTERM; - SendMessageA(hwndOwner, uFindReplaceMessage, 0, - GetWindowLongA(hWnd, DWL_USER) ); + SendMessageW( hwndOwner, uFindReplaceMessage, 0, + GetWindowLongPtrW(hWnd, DWLP_USER) ); DestroyWindow(hWnd); return TRUE; case psh1: @@ -438,8 +438,8 @@ else *lpFlags &= ~FR_MATCHCASE; *lpFlags &= ~(FR_FINDNEXT | FR_REPLACEALL | FR_DIALOGTERM); *lpFlags |= FR_REPLACE; - SendMessageA(hwndOwner, uFindReplaceMessage, 0, - GetWindowLongA(hWnd, DWL_USER) ); + SendMessageW( hwndOwner, uFindReplaceMessage, 0, + GetWindowLongPtrW(hWnd, DWLP_USER) ); return TRUE; case psh2: if (fUnicode) @@ -459,8 +459,8 @@ else *lpFlags &= ~FR_MATCHCASE; *lpFlags &= ~(FR_FINDNEXT | FR_REPLACE | FR_DIALOGTERM); *lpFlags |= FR_REPLACEALL; - SendMessageA(hwndOwner, uFindReplaceMessage, 0, - GetWindowLongA(hWnd, DWL_USER) ); + SendMessageW( hwndOwner, uFindReplaceMessage, 0, + GetWindowLongPtrW(hWnd, DWLP_USER) ); return TRUE; case pshHelp: /* FIXME : should lpfr structure be passed as an argument ??? */ @@ -486,7 +486,7 @@ MapSL(lpfr->lpstrFindWhat), MapSL(lpfr->lpstrReplaceWith), FALSE); case WM_COMMAND: - lpfr=MapSL(GetWindowLongA(hWnd, DWL_USER)); + lpfr=MapSL(GetWindowLongPtrW(hWnd, DWLP_USER)); return REPLACEDLG_WMCommand(hWnd, wParam, HWND_32(lpfr->hwndOwner), &lpfr->Flags, MapSL(lpfr->lpstrFindWhat), lpfr->wFindWhatLen, MapSL(lpfr->lpstrReplaceWith), _____ Modified: trunk/reactos/lib/comdlg32/fontdlg.c --- trunk/reactos/lib/comdlg32/fontdlg.c 2005-03-14 21:59:25 UTC (rev 14076) +++ trunk/reactos/lib/comdlg32/fontdlg.c 2005-03-14 22:21:18 UTC (rev 14077) @@ -590,7 +590,7 @@ HCURSOR hcursor=SetCursor(LoadCursorW(0,(LPWSTR)IDC_WAIT)); static const WCHAR strColorName[] = {'[','c','o','l','o','r',' ','n','a','m','e',']',0}; - SetPropW(hDlg, strWineFontData, (HANDLE)lParam); + SetPropW(hDlg, strWineFontData, (HANDLE)lpcf); lpxx=lpcf->lpLogFont; TRACE("WM_INITDIALOG lParam=%08lX\n", lParam); @@ -697,7 +697,7 @@ SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb1, CBN_SELCHANGE), (LPARAM)GetDlgItem(hDlg,cmb1)); } - if (lpcf->Flags & CF_USESTYLE && lpcf->lpszStyle) + if ((lpcf->Flags & CF_USESTYLE) && lpcf->lpszStyle) { j=SendDlgItemMessageW(hDlg,cmb2,CB_FINDSTRING,-1,(LONG)lpcf->lpszStyle); if (j!=CB_ERR) @@ -1041,7 +1041,7 @@ WideCharToMultiByte(CP_ACP, 0, lpcfw->lpLogFont->lfFaceName, LF_FACESIZE, lpcfa->lpLogFont->lfFaceName, LF_FACESIZE, 0, 0); - if(lpcfw->lpszStyle) { + if((lpcfw->Flags & CF_USESTYLE) && lpcfw->lpszStyle) { len = WideCharToMultiByte(CP_ACP, 0, lpcfw->lpszStyle, -1, NULL, -1, 0, 0); WideCharToMultiByte(CP_ACP, 0, lpcfw->lpszStyle, -1, lpcfa->lpszStyle, len, 0, 0); HeapFree(GetProcessHeap(), 0, lpcfw->lpszStyle); @@ -1135,13 +1135,13 @@ MultiByteToWideChar(CP_ACP, 0, lpcfa->lpLogFont->lfFaceName, LF_FACESIZE, lpcfw->lpLogFont->lfFaceName, LF_FACESIZE); - if(lpcfa->lpszStyle) { + if((lpcfa->Flags & CF_USESTYLE) && lpcfa->lpszStyle) { len = MultiByteToWideChar(CP_ACP, 0, lpcfa->lpszStyle, -1, NULL, 0); lpcfw->lpszStyle = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); MultiByteToWideChar(CP_ACP, 0, lpcfa->lpszStyle, -1, lpcfw->lpszStyle, len); } - if(lpcfa->lpTemplateName) { + if((lpcfa->Flags & CF_ENABLETEMPLATE) && lpcfa->lpTemplateName) { len = MultiByteToWideChar(CP_ACP, 0, lpcfa->lpTemplateName, -1, NULL, 0); lpcfw->lpTemplateName = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); MultiByteToWideChar(CP_ACP, 0, lpcfa->lpTemplateName, _____ Modified: trunk/reactos/lib/comdlg32/fontdlg16.c --- trunk/reactos/lib/comdlg32/fontdlg16.c 2005-03-14 21:59:25 UTC (rev 14076) +++ trunk/reactos/lib/comdlg32/fontdlg16.c 2005-03-14 22:21:18 UTC (rev 14077) @@ -122,7 +122,7 @@ { HWND hwnd=HWND_32(LOWORD(lParam)); HWND hDlg=GetParent(hwnd); - LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER); + LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongPtrW(hDlg, DWLP_USER); LOGFONT16 *lplf = MapSL( logfont ); TEXTMETRIC16 *lpmtrx16 = MapSL(metrics); ENUMLOGFONTEXW elf32w; @@ -142,7 +142,7 @@ HWND hcmb2=HWND_32(LOWORD(lParam)); HWND hcmb3=HWND_32(HIWORD(lParam)); HWND hDlg=GetParent(hcmb3); - LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER); + LPCHOOSEFONT16 lpcf=(LPCHOOSEFONT16)GetWindowLongPtrW(hDlg, DWLP_USER); LOGFONT16 *lplf = MapSL(logfont); TEXTMETRIC16 *lpmtrx16 = MapSL(metrics); ENUMLOGFONTEXW elf32w; @@ -300,7 +300,7 @@ BOOL16 res=0; if (message!=WM_INITDIALOG) { - lpcf=(LPCHOOSEFONT16)GetWindowLongA(hDlg, DWL_USER); + lpcf=(LPCHOOSEFONT16)GetWindowLongPtrW(hDlg, DWLP_USER); if (!lpcf && message != WM_MEASUREITEM) return FALSE; if (CFn_HookCallChk(lpcf))
19 years, 9 months
1
0
0
0
[royce] 14076: reformat and simplify before adding functionality
by royce@svn.reactos.com
reformat and simplify before adding functionality Modified: branches/xmlbuildsystem/reactos/tools/rmkdir.c _____ Modified: branches/xmlbuildsystem/reactos/tools/rmkdir.c --- branches/xmlbuildsystem/reactos/tools/rmkdir.c 2005-03-14 21:30:25 UTC (rev 14075) +++ branches/xmlbuildsystem/reactos/tools/rmkdir.c 2005-03-14 21:59:25 UTC (rev 14076) @@ -10,112 +10,101 @@ #include <sys/types.h> #endif -#if defined(WIN32) -#define DIR_SEPARATOR_CHAR '\\' -#define DIR_SEPARATOR_STRING "\\" -#define DOS_PATHS +#define WIN_SEPARATOR_CHAR '\\' +#define WIN_SEPARATOR_STRING "\\" +#define NIX_SEPARATOR_CHAR '/' +#define NIX_SEPARATOR_STRING "/" + +#ifdef WIN32 +#define DIR_SEPARATOR_CHAR WIN_SEPARATOR_CHAR +#define DIR_SEPARATOR_STRING WIN_SEPARATOR_STRING +#define BAD_SEPARATOR_CHAR NIX_SEPARATOR_CHAR +#define MKDIR(s) mkdir(s) #else -#define DIR_SEPARATOR_CHAR '/' -#define DIR_SEPARATOR_STRING "/" -#define UNIX_PATHS -#endif +#define DIR_SEPARATOR_CHAR NIX_SEPARATOR_CHAR +#define DIR_SEPARATOR_STRING NIX_SEPARATOR_STRING +#define BAD_SEPARATOR_CHAR WIN_SEPARATOR_CHAR +#define MKDIR(s) mkdir(s,0755) +#endif -char* convert_path(char* origpath) +char* +convert_path(char* origpath) { - char* newpath; - int i; - - //newpath = strdup(origpath); - newpath=malloc(strlen(origpath)+1); - strcpy(newpath,origpath); - - i = 0; - while (newpath[i] != 0) - { -#ifdef UNIX_PATHS - if (newpath[i] == '\\') - { - newpath[i] = '/'; - } -#else -#ifdef DOS_PATHS - if (newpath[i] == '/') - { - newpath[i] = '\\'; - } -#endif -#endif - i++; - } - return(newpath); + char* newpath; + int i; + + newpath=malloc(strlen(origpath)+1); + strcpy(newpath,origpath); + + i = 0; + while (newpath[i] != 0) + { + if (newpath[i] == BAD_SEPARATOR_CHAR) + { + newpath[i] = DIR_SEPARATOR_CHAR; + } + i++; + } + return(newpath); } #define TRANSFER_SIZE (65536) int mkdir_p(char* path) { - if (chdir(path) == 0) - { + if (chdir(path) == 0) + { + return(0); + } + if (MKDIR(path) != 0) + { + perror("Failed to create directory"); + exit(1); + } + if (chdir(path) != 0) + { + perror("Failed to change directory"); + exit(1); + } return(0); - } -#ifdef UNIX_PATHS - if (mkdir(path, 0755) != 0) - { - perror("Failed to create directory"); - exit(1); - } -#else - if (mkdir(path) != 0) - { - perror("Failed to create directory"); - exit(1); - } -#endif - - if (chdir(path) != 0) - { - perror("Failed to change directory"); - exit(1); - } - return(0); } int main(int argc, char* argv[]) { - char* path1; - char* csec; - char buf[256]; - - if (argc != 2) - { - fprintf(stderr, "Too many arguments\n"); - exit(1); - } - - path1 = convert_path(argv[1]); - - if (isalpha(path1[0]) && path1[1] == ':' && path1[2] == DIR_SEPARATOR_CHAR) - { - csec = strtok(path1, DIR_SEPARATOR_STRING); - sprintf(buf, "%s\\", csec); - chdir(buf); - csec = strtok(NULL, DIR_SEPARATOR_STRING); - } - else if (path1[0] == DIR_SEPARATOR_CHAR) - { - chdir(DIR_SEPARATOR_STRING); - csec = strtok(path1, DIR_SEPARATOR_STRING); - } - else - { - csec = strtok(path1, DIR_SEPARATOR_STRING); - } - - while (csec != NULL) - { - mkdir_p(csec); - csec = strtok(NULL, DIR_SEPARATOR_STRING); - } - - exit(0); + char* path1; + char* csec; + char buf[256]; + + if (argc != 2) + { + fprintf(stderr, "Too many arguments\n"); + exit(1); + } + + path1 = convert_path(argv[1]); + + if (isalpha(path1[0]) && path1[1] == ':' && path1[2] == DIR_SEPARATOR_CHAR) + { + csec = strtok(path1, DIR_SEPARATOR_STRING); + sprintf(buf, "%s\\", csec); + chdir(buf); + csec = strtok(NULL, DIR_SEPARATOR_STRING); + } + else if (path1[0] == DIR_SEPARATOR_CHAR) + { + chdir(DIR_SEPARATOR_STRING); + csec = strtok(path1, DIR_SEPARATOR_STRING); + } + else + { + csec = strtok(path1, DIR_SEPARATOR_STRING); + } + + while (csec != NULL) + { + mkdir_p(csec); + csec = strtok(NULL, DIR_SEPARATOR_STRING); + } + + exit(0); }
19 years, 9 months
1
0
0
0
← Newer
1
...
29
30
31
32
33
34
35
...
61
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Results per page:
10
25
50
100
200