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
November 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
27 participants
875 discussions
Start a n
N
ew thread
[arty] 19322: Fixed skipped events from keyboard:
by arty@svn.reactos.com
Fixed skipped events from keyboard: - Wait for IO if it would be pending - Don't copy into UserBuffer directly in read because it'll be overwritten. Use Irp->AssociatedIrp.SystemBuffer. Modified: trunk/reactos/drivers/input/kbdclass/kbdclass.c Modified: trunk/reactos/subsys/win32k/ntuser/input.c _____ Modified: trunk/reactos/drivers/input/kbdclass/kbdclass.c --- trunk/reactos/drivers/input/kbdclass/kbdclass.c 2005-11-18 06:15:24 UTC (rev 19321) +++ trunk/reactos/drivers/input/kbdclass/kbdclass.c 2005-11-18 10:53:32 UTC (rev 19322) @@ -369,6 +369,8 @@ ASSERT(ClassDeviceExtension->Common.IsClassDO); + KeAcquireSpinLock(&ClassDeviceExtension->SpinLock, &OldIrql); + DPRINT("ClassCallback()\n"); /* A filter driver might have consumed all the data already; I'm * not sure if they are supposed to move the packets when they @@ -382,6 +384,8 @@ /* A read request is waiting for input, so go straight to it */ /* FIXME: use SEH */ + DPRINT("Immediate Completion: %x\n", DataStart->MakeCode); + RtlCopyMemory( Irp->MdlAddress ? MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority) : Irp->AssociatedIrp.SystemBuffer, DataStart, @@ -403,8 +407,6 @@ /* If we have data from the port driver and a higher service to send the data to */ if (InputCount != 0) { - KeAcquireSpinLock(&ClassDeviceExtension->SpinLock, &OldIrql); - if (ClassDeviceExtension->InputCount + InputCount > ClassDeviceExtension->DriverExtension->DataQueueSize) ReadSize = ClassDeviceExtension->DriverExtension->DataQueueSize - ClassDeviceExtension->InputCount; else @@ -428,7 +430,6 @@ ClassDeviceExtension->PortData += ReadSize; ClassDeviceExtension->InputCount += ReadSize; - KeReleaseSpinLock(&ClassDeviceExtension->SpinLock, OldIrql); (*ConsumedCount) += ReadSize; } else @@ -436,6 +437,8 @@ DPRINT("ClassCallBack() entered, InputCount = %lu - DOING NOTHING\n", InputCount); } + KeReleaseSpinLock(&ClassDeviceExtension->SpinLock, OldIrql); + if (Irp != NULL) { IoStartNextPacket(ClassDeviceObject, FALSE); @@ -575,11 +578,17 @@ KeAcquireSpinLock(&DeviceExtension->SpinLock, &oldIrql); + DPRINT("Mdl: %x, UserBuffer: %x, InputCount: %d, Data: %x\n", + Irp->MdlAddress, + Irp->UserBuffer, + DeviceExtension->InputCount, + (DeviceExtension->PortData-DeviceExtension->InputCount)->MakeCode); + /* FIXME: use SEH */ RtlCopyMemory( - Irp->MdlAddress ? MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority) : Irp->UserBuffer, - DeviceExtension->PortData - DeviceExtension->InputCount, - sizeof(KEYBOARD_INPUT_DATA)); + Irp->AssociatedIrp.SystemBuffer, + DeviceExtension->PortData - DeviceExtension->InputCount, + sizeof(KEYBOARD_INPUT_DATA)); if (DeviceExtension->InputCount > 1) { _____ Modified: trunk/reactos/subsys/win32k/ntuser/input.c --- trunk/reactos/subsys/win32k/ntuser/input.c 2005-11-18 06:15:24 UTC (rev 19321) +++ trunk/reactos/subsys/win32k/ntuser/input.c 2005-11-18 10:53:32 UTC (rev 19322) @@ -413,7 +413,6 @@ struct _ETHREAD *FocusThread; extern NTSTATUS Win32kInitWin32Thread(PETHREAD Thread); - PKEYBOARD_INDICATOR_TRANSLATION IndicatorTrans = NULL; UINT ModifierState = 0; USHORT LastMakeCode = 0; @@ -486,15 +485,33 @@ HWND hWnd; int id; + DPRINT("KeyInput @ %08x\n", &KeyInput); + Status = NtReadFile (KeyboardDeviceHandle, + NULL, NULL, NULL, - NULL, &Iosb, &KeyInput, sizeof(KEYBOARD_INPUT_DATA), NULL, NULL); + + if(Status == STATUS_ALERTED && !InputThreadsRunning) + { + break; + } + if(Status == STATUS_PENDING) + { + NtWaitForSingleObject(KeyboardDeviceHandle, FALSE, NULL); + Status = Iosb.Status; + } + if(!NT_SUCCESS(Status)) + { + DPRINT1("Win32K: Failed to read from mouse.\n"); + return; //(Status); + } + DPRINT("KeyRaw: %s %04x\n", (KeyInput.Flags & KEY_BREAK) ? "up" : "down", KeyInput.MakeCode );
19 years, 1 month
1
0
0
0
[cwittich] 19321: export some more Crypto-API functions
by cwittich@svn.reactos.com
export some more Crypto-API functions Modified: trunk/reactos/lib/advapi32/advapi32.def _____ Modified: trunk/reactos/lib/advapi32/advapi32.def --- trunk/reactos/lib/advapi32/advapi32.def 2005-11-18 02:08:46 UTC (rev 19320) +++ trunk/reactos/lib/advapi32/advapi32.def 2005-11-18 06:15:24 UTC (rev 19321) @@ -148,18 +148,18 @@ CryptDeriveKey@20 CryptDestroyHash@4 CryptDestroyKey@4 -;CryptDuplicateHash@16 -;CryptDuplicateKey@16 +CryptDuplicateHash@16 +CryptDuplicateKey@16 CryptEncrypt@28 -;CryptEnumProviderTypesA@24 -;CryptEnumProviderTypesW@24 -;CryptEnumProvidersA@24 +CryptEnumProviderTypesA@24 +CryptEnumProviderTypesW@24 +CryptEnumProvidersA@24 CryptEnumProvidersW@24 CryptExportKey@24 CryptGenKey@16 CryptGenRandom@12 -;CryptGetDefaultProviderA@20 -;CryptGetDefaultProviderW@20 +CryptGetDefaultProviderA@20 +CryptGetDefaultProviderW@20 CryptGetHashParam@20 CryptGetKeyParam@20 CryptGetProvParam@20 @@ -172,8 +172,8 @@ CryptSetKeyParam@16 CryptSetProvParam@16 CryptSetProviderA@8 -;CryptSetProviderExA@16 -;CryptSetProviderExW@16 +CryptSetProviderExA@16 +CryptSetProviderExW@16 CryptSetProviderW@8 CryptSignHashA@24 CryptSignHashW@24
19 years, 1 month
1
0
0
0
[cwittich] 19320: got a lot of crypt32 stuff working
by cwittich@svn.reactos.com
got a lot of crypt32 stuff working Modified: trunk/reactos/baseaddress.xml Modified: trunk/reactos/lib/advapi32/advapi32.def Modified: trunk/reactos/lib/crypt32/cert.c Modified: trunk/reactos/lib/crypt32/crypt32.def Modified: trunk/reactos/lib/crypt32/crypt32.xml Modified: trunk/reactos/lib/crypt32/crypt32_private.h Modified: trunk/reactos/lib/crypt32/encode.c Modified: trunk/reactos/lib/crypt32/precomp.h Modified: trunk/reactos/w32api/include/wincrypt.h _____ Modified: trunk/reactos/baseaddress.xml --- trunk/reactos/baseaddress.xml 2005-11-17 23:19:36 UTC (rev 19319) +++ trunk/reactos/baseaddress.xml 2005-11-18 02:08:46 UTC (rev 19320) @@ -104,7 +104,7 @@ <property name="BASEADDRESS_OLE32" value="0x77a50000" /> <property name="BASEADDRESS_WS2_32" value="0x77aa0000" /> <property name="BASEADDRESS_OLEPRO32" value="0x77aa0000" /> -<property name="BASEADDRESS_CRYPT32" value="0x77aa1000" /> +<property name="BASEADDRESS_CRYPT32" value="0x77ab0000" /> <property name="BASEADDRESS_ADVAPI32" value="0x77dc0000" /> <property name="BASEADDRESS_USER32" value="0x77e50000" /> <property name="BASEADDRESS_GDI32" value="0x77f10000" /> _____ Modified: trunk/reactos/lib/advapi32/advapi32.def --- trunk/reactos/lib/advapi32/advapi32.def 2005-11-17 23:19:36 UTC (rev 19319) +++ trunk/reactos/lib/advapi32/advapi32.def 2005-11-18 02:08:46 UTC (rev 19320) @@ -176,7 +176,7 @@ ;CryptSetProviderExW@16 CryptSetProviderW@8 CryptSignHashA@24 -;CryptSignHashW@24 +CryptSignHashW@24 CryptVerifySignatureA@24 CryptVerifySignatureW@24 DecryptFileA@8 _____ Modified: trunk/reactos/lib/crypt32/cert.c --- trunk/reactos/lib/crypt32/cert.c 2005-11-17 23:19:36 UTC (rev 19319) +++ trunk/reactos/lib/crypt32/cert.c 2005-11-18 02:08:46 UTC (rev 19320) @@ -31,6 +31,15 @@ #include "precomp.h" +#define NONAMELESSUNION + +static _SEH_FILTER(page_fault) +{ + if (_SEH_GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION) + return _SEH_EXECUTE_HANDLER; + return _SEH_CONTINUE_SEARCH; +} + WINE_DEFAULT_DEBUG_CHANNEL(crypt); #define WINE_CRYPTCERTSTORE_MAGIC 0x74726563 @@ -304,12 +313,14 @@ DWORD cbElement, DWORD dwContextTypeFlags, DWORD *pdwContentType); /* filter for page-fault exceptions */ +/* static WINE_EXCEPTION_FILTER(page_fault) { if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION) return EXCEPTION_EXECUTE_HANDLER; return EXCEPTION_CONTINUE_SEARCH; } +*/ static void CRYPT_InitStore(WINECRYPT_CERTSTORE *store, HCRYPTPROV hCryptProv, DWORD dwFlags, CertStoreType type) @@ -330,6 +341,7 @@ * be a PWINE_CERT_CONTEXT, and increments pCertContext's reference count. * Also sets the hCertStore member of the reference to store. */ + static void CRYPT_InitCertRef(PWINE_CERT_CONTEXT_REF ref, PWINE_CERT_CONTEXT context, HCERTSTORE store) { @@ -3301,6 +3313,15 @@ return ret; } +BOOL WINAPI CryptEncryptMessage( PCRYPT_ENCRYPT_MESSAGE_PARA pEncryptMessagePara, + DWORD dwCert, PCCERT_CONTEXT pccertCert[], + const BYTE* pbEncrypted, DWORD dwEncrypted, + BYTE* pbBlob, DWORD* dwEncryptedBlob) +{ + UNIMPLEMENTED; + return FALSE; +} + HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR pszFuncName, DWORD dwFlags) { FIXME("stub: %s %lx\n", debugstr_a(pszFuncName), dwFlags); @@ -3313,3 +3334,42 @@ FIXME("stub: %lx %s %s\n", dwEncodingType, debugstr_a(pszFuncName), debugstr_w(pwszDll)); return FALSE; } + +DWORD WINAPI CertGetNameStringW(PCCERT_CONTEXT pCertContext, + DWORD dwType, DWORD dwFlags, + LPVOID pvType, LPWSTR pszName, + DWORD dwName) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + +DWORD WINAPI CertGetNameStringA(PCCERT_CONTEXT pCertContext, + DWORD dwType, DWORD dwFlags, + LPVOID pvType, LPSTR pszName, + DWORD dwName) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + +DWORD WINAPI CertNameToStrA(DWORD dwCertEncoding, + PCERT_NAME_BLOB pCertName, + DWORD dwType, LPSTR psz, + DWORD dwSZ) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + +DWORD WINAPI CertNameToStrW(DWORD dwCertEncoding, + PCERT_NAME_BLOB pCertName, + DWORD dwType, LPWSTR psz, + DWORD dwSZ) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + _____ Modified: trunk/reactos/lib/crypt32/crypt32.def --- trunk/reactos/lib/crypt32/crypt32.def 2005-11-17 23:19:36 UTC (rev 19319) +++ trunk/reactos/lib/crypt32/crypt32.def 2005-11-18 02:08:46 UTC (rev 19320) @@ -1,10 +1,68 @@ LIBRARY CRYPT32.DLL EXPORTS +CertAddEncodedCRLToStore@24 @1022 + +CertAddSerializedElementToStore@32 @1028 +CertAddStoreToCollection@16 @1029 CertAlgIdToOID@4 @1030 +CertCloseStore@8 @1031 +CertDeleteCRLFromStore@4 @1044 + +CertDeleteCertificateFromStore@4 @1046 + +CertFindAttribute@12 @1062 + +CertFindCertificateInStore@24 @1066 + +CertFindExtension@12 @1068 +CertFindRDNAttr@8 @1069 + +CertFreeCRLContext@4 @1072 +CertFreeCTLContext@4 @1073 + +CertFreeCertificateContext@4 @1076 + +CertGetCTLContextProperty@16 @1079 + +CertGetCertificateContextProperty@16 @1081 + +CertGetNameStringA@24 @1085 +CertGetNameStringW@24 @1086 + +CertNameToStrA@20 @1093 +CertNameToStrW@20 @1094 CertOIDToAlgId@4 @1095 +CertOpenSystemStoreA@8 @1097 +CertOpenSystemStoreW@8 @1098 + +CertRemoveStoreFromCollection@8 @1104 + +CertSerializeCTLStoreElement@16 @1108 +CertSerializeCertificateStoreElement@16 @1109 + +CertSetCTLContextProperty@16 @1111 +CertSetCertificateContextProperty@16 @1113 + +CertVerifyTimeValidity@8 @1126 + +CryptDecodeObjectEx@32 @1138 + +CryptEncodeObject@20 @1141 + +CryptEncryptMessage@28 @1143 + +CryptExportPublicKeyInfo@20 @1149 +CryptExportPublicKeyInfoEx@32 @1150 + +CryptGetOIDFunctionValue@28 @1163 +CryptHashCertificate@28 @1164 + +CryptImportPublicKeyInfo@16 @1169 +CryptImportPublicKeyInfoEx@28 @1170 + CryptMemAlloc@4 @1175 CryptMemFree@4 @1176 CryptMemRealloc@8 @1177 @@ -12,6 +70,8 @@ CryptProtectData@28 @1193 CryptRegisterDefaultOIDFunction@16 @1195 +CryptRegisterOIDFunction@20 @1196 + CryptSIPAddProvider@4 @1198 CryptSIPLoad@12 @1201 @@ -19,8 +79,17 @@ CryptSIPRetrieveSubjectGuid@12 @1205 +CryptSetOIDFunctionValue@28 @1210 + +CryptSignCertificate@36 @1214 + CryptUnprotectData@28 @1221 +CryptUnregisterOIDFunction@12 @1223 + +CryptVerifyCertificateSignature@20 +CryptVerifyCertificateSignatureEx@32 @1226 + I_CryptCreateLruCache@8 @1240 I_CryptDetachTls@4 @1242 _____ Modified: trunk/reactos/lib/crypt32/crypt32.xml --- trunk/reactos/lib/crypt32/crypt32.xml 2005-11-17 23:19:36 UTC (rev 19319) +++ trunk/reactos/lib/crypt32/crypt32.xml 2005-11-18 02:08:46 UTC (rev 19320) @@ -3,11 +3,14 @@ <include base="crypt32">.</include> <define name="__USE_W32API" /> <define name="_WIN32_WINNT">0x501</define> + <library>pseh</library> <library>ntdll</library> <library>kernel32</library> <library>wine</library> <library>advapi32</library> <file>main.c</file> + <file>encode.c</file> + <file>cert.c</file> <file>protectdata.c</file> <file>crypt32.rc</file> <pch>precomp.h</pch> _____ Modified: trunk/reactos/lib/crypt32/crypt32_private.h --- trunk/reactos/lib/crypt32/crypt32_private.h 2005-11-17 23:19:36 UTC (rev 19319) +++ trunk/reactos/lib/crypt32/crypt32_private.h 2005-11-18 02:08:46 UTC (rev 19320) @@ -19,6 +19,8 @@ #ifndef __CRYPT32_PRIVATE_H__ #define __CRYPT32_PRIVATE_H__ +#define STATUS_ACCESS_VIOLATION 0xC0000005 + /* Returns a handle to the default crypto provider; loads it if necessary. * Returns NULL on failure. */ _____ Modified: trunk/reactos/lib/crypt32/encode.c --- trunk/reactos/lib/crypt32/encode.c 2005-11-17 23:19:36 UTC (rev 19319) +++ trunk/reactos/lib/crypt32/encode.c 2005-11-18 02:08:46 UTC (rev 19320) @@ -34,13 +34,20 @@ #include "precomp.h" +static _SEH_FILTER(page_fault) +{ + if (_SEH_GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION) + return _SEH_EXECUTE_HANDLER; + return _SEH_CONTINUE_SEARCH; +} + /* This is a bit arbitrary, but to set some limit: */ #define MAX_ENCODED_LEN 0x02000000 /* a few asn.1 tags we need */ #define ASN_BOOL (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x01) #define ASN_BITSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x03) -#define ASN_OCTETSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x04) +//#define ASN_OCTETSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x04) #define ASN_ENUMERATED (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x0a) #define ASN_SETOF (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x11) #define ASN_NUMERICSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x12) @@ -161,14 +168,6 @@ DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo); -/* filter for page-fault exceptions */ -static WINE_EXCEPTION_FILTER(page_fault) -{ - if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION) - return EXCEPTION_EXECUTE_HANDLER; - return EXCEPTION_CONTINUE_SEARCH; -} - static char *CRYPT_GetKeyName(DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID) { @@ -1491,15 +1490,15 @@ case CERT_ALT_NAME_RFC822_NAME: case CERT_ALT_NAME_DNS_NAME: case CERT_ALT_NAME_URL: - if (entry->u.pwszURL) + if (entry->pwszURL) { DWORD i; /* Not + 1: don't encode the NULL-terminator */ - dataLen = lstrlenW(entry->u.pwszURL); + dataLen = lstrlenW(entry->pwszURL); for (i = 0; ret && i < dataLen; i++) { - if (entry->u.pwszURL[i] > 0x7f) + if (entry->pwszURL[i] > 0x7f) { SetLastError(CRYPT_E_INVALID_IA5_STRING); ret = FALSE; @@ -1511,7 +1510,7 @@ dataLen = 0; break; case CERT_ALT_NAME_IP_ADDRESS: - dataLen = entry->u.IPAddress.cbData; + dataLen = entry->IPAddress.cbData; break; case CERT_ALT_NAME_REGISTERED_ID: /* FIXME: encode OID */ @@ -1551,11 +1550,11 @@ DWORD i; for (i = 0; i < dataLen; i++) - *pbEncoded++ = (BYTE)entry->u.pwszURL[i]; + *pbEncoded++ = (BYTE)entry->pwszURL[i]; break; } case CERT_ALT_NAME_IP_ADDRESS: - memcpy(pbEncoded, entry->u.IPAddress.pbData, dataLen); + memcpy(pbEncoded, entry->IPAddress.pbData, dataLen); break; } if (ret) @@ -4146,18 +4145,18 @@ DWORD i; for (i = 0; i < dataLen; i++) - entry->u.pwszURL[i] = + entry->pwszURL[i] = (WCHAR)pbEncoded[1 + lenBytes + i]; - entry->u.pwszURL[i] = 0; + entry->pwszURL[i] = 0; break; } case 7: /* iPAddress */ /* The next data pointer is in the pwszURL spot, that is, * the first 4 bytes. Need to move it to the next spot. */ - entry->u.IPAddress.pbData = (LPBYTE)entry->u.pwszURL; - entry->u.IPAddress.cbData = dataLen; - memcpy(entry->u.IPAddress.pbData, pbEncoded + 1 + lenBytes, + entry->IPAddress.pbData = (LPBYTE)entry->pwszURL; + entry->IPAddress.cbData = dataLen; + memcpy(entry->IPAddress.pbData, pbEncoded + 1 + lenBytes, dataLen); break; } @@ -4239,7 +4238,7 @@ i < cEntry && ptr - pbEncoded - 1 - lenBytes < dataLen; i++) { - info->rgAltEntry[i].u.pwszURL = + info->rgAltEntry[i].pwszURL = (LPWSTR)nextData; size = bytesNeeded; ret = CRYPT_AsnDecodeAltNameEntry(ptr, _____ Modified: trunk/reactos/lib/crypt32/precomp.h --- trunk/reactos/lib/crypt32/precomp.h 2005-11-17 23:19:36 UTC (rev 19319) +++ trunk/reactos/lib/crypt32/precomp.h 2005-11-18 02:08:46 UTC (rev 19320) @@ -8,6 +8,7 @@ #include <libs/pseh/pseh.h> #include "windef.h" +#include "winnt.h" #include "winbase.h" #include "wincrypt.h" #include "winreg.h" @@ -16,6 +17,5 @@ #include "mssip.h" #include "crypt32_private.h" #include "wine/debug.h" +#include "wine/list.h" -#define NTOS_MODE_USER -#include <ndk/ntndk.h> _____ Modified: trunk/reactos/w32api/include/wincrypt.h --- trunk/reactos/w32api/include/wincrypt.h 2005-11-17 23:19:36 UTC (rev 19319) +++ trunk/reactos/w32api/include/wincrypt.h 2005-11-18 02:08:46 UTC (rev 19320) @@ -111,6 +111,45 @@ #define CALG_DESX (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_DESX) #define CALG_TLS1PRF (ALG_CLASS_DHASH|ALG_TYPE_ANY|ALG_SID_TLS1PRF) +typedef struct _CERT_PRIVATE_KEY_VALIDITY { + FILETIME NotBefore; + FILETIME NotAfter; +} CERT_PRIVATE_KEY_VALIDITY, *PCERT_PRIVATE_KEY_VALIDITY; + + +/* access state flags */ +#define CERT_ACCESS_STATE_WRITE_PERSIST_FLAG 0x1 +#define CERT_ACCESS_STATE_SYSTEM_STORE_FLAG 0x2 +#define CERT_ACCESS_STATE_LM_SYSTEM_STORE_FLAG 0x4 + +/* CERT_RDN attribute dwValueType types */ +#define CERT_RDN_TYPE_MASK 0x000000ff +#define CERT_RDN_ANY_TYPE 0 +#define CERT_RDN_ENCODED_BLOB 1 +#define CERT_RDN_OCTET_STRING 2 +#define CERT_RDN_NUMERIC_STRING 3 +#define CERT_RDN_PRINTABLE_STRING 4 +#define CERT_RDN_TELETEX_STRING 5 +#define CERT_RDN_T61_STRING 5 +#define CERT_RDN_VIDEOTEX_STRING 6 +#define CERT_RDN_IA5_STRING 7 +#define CERT_RDN_GRAPHIC_STRING 8 +#define CERT_RDN_VISIBLE_STRING 9 +#define CERT_RDN_ISO646_STRING 9 +#define CERT_RDN_GENERAL_STRING 10 +#define CERT_RDN_UNIVERSAL_STRING 11 +#define CERT_RDN_INT4_STRING 11 +#define CERT_RDN_BMP_STRING 12 +#define CERT_RDN_UNICODE_STRING 12 +#define CERT_RDN_UTF8_STRING 13 + +/* CERT_RDN attribute dwValueType flags */ +#define CERT_RDN_FLAGS_MASK 0xff000000 +#define CERT_RDN_ENABLE_T61_UNICODE_FLAG 0x80000000 +#define CERT_RDN_DISABLE_CHECK_TYPE_FLAG 0x4000000 +#define CERT_RDN_ENABLE_UTF8_UNICODE_FLAG 0x2000000 +#define CERT_RDN_DISABLE_IE4_UTF8_FLAG 0x0100000 + /* physical store dwFlags, also used by CertAddStoreToCollection as * dwUpdateFlags */ @@ -1363,6 +1402,15 @@ typedef LPVOID (WINAPI *PFN_CRYPT_ALLOC)(size_t cbsize); typedef VOID (WINAPI *PFN_CRYPT_FREE)(LPVOID pv); +typedef struct _CRYPT_ENCRYPT_MESSAGE_PARA { + DWORD cbSize; + DWORD dwMsgEncodingType; + HCRYPTPROV hCryptProv; + CRYPT_ALGORITHM_IDENTIFIER ContentEncryptionAlgorithm; + void* pvEncryptionAuxInfo; + DWORD dwFlags; + DWORD dwInnerContentType; +} CRYPT_ENCRYPT_MESSAGE_PARA, *PCRYPT_ENCRYPT_MESSAGE_PARA; typedef struct _CRYPT_DECODE_PARA { DWORD cbSize; PFN_CRYPT_ALLOC pfnAlloc; @@ -1512,12 +1560,22 @@ CRYPT_BIT_BLOB Signature; } CERT_SIGNED_CONTENT_INFO, *PCERT_SIGNED_CONTENT_INFO; +typedef struct _CERT_EXTENSIONS { + DWORD cExtension; + PCERT_EXTENSION rgExtension; +} CERT_EXTENSIONS, *PCERT_EXTENSIONS; + typedef struct _CERT_RDN_ATTR { LPSTR pszObjId; DWORD dwValueType; CERT_RDN_VALUE_BLOB Value; } CERT_RDN_ATTR, *PCERT_RDN_ATTR; +typedef struct _CERT_NAME_VALUE { + DWORD dwValueType; + CERT_RDN_VALUE_BLOB Value; +} CERT_NAME_VALUE, *PCERT_NAME_VALUE; + typedef struct _CERT_RDN { DWORD cRDNAttr; PCERT_RDN_ATTR rgRDNAttr; @@ -1557,6 +1615,22 @@ HCRYPTOIDFUNCADDR hStoreProvFuncAddr2; } CERT_STORE_PROV_INFO, *PCERT_STORE_PROV_INFO; +#define CERT_ALT_NAME_ENTRY_ERR_INDEX_MASK 0xff +#define CERT_ALT_NAME_ENTRY_ERR_INDEX_SHIFT 16 +#define CERT_ALT_NAME_VALUE_ERR_INDEX_MASK 0x0000ffff +#define CERT_ALT_NAME_VALUE_ERR_INDEX_SHIFT 0 +#define GET_CERT_ALT_NAME_ENTRY_ERR_INDEX(x) \ + (((x) >> CERT_ALT_NAME_ENTRY_ERR_INDEX_SHIFT) & \ + CERT_ALT_NAME_ENTRY_ERR_INDEX_MASK) +#define GET_CERT_ALT_NAME_VALUE_ERR_INDEX(x) \ + ((x) & CERT_ALT_NAME_VALUE_ERR_INDEX_MASK) + +typedef struct _CERT_BASIC_CONSTRAINTS2_INFO { + BOOL fCA; + BOOL fPathLenConstraint; + DWORD dwPathLenConstraint; +} CERT_BASIC_CONSTRAINTS2_INFO, *PCERT_BASIC_CONSTRAINTS2_INFO; + typedef BOOL (WINAPI *PFN_CERT_ENUM_SYSTEM_STORE_LOCATION)( LPCWSTR pwszStoreLocation, DWORD dwFlags, void *pvReserved, void *pvArg); @@ -1648,7 +1722,31 @@ BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement); BOOL WINAPI CertSerializeCRLStoreElement(PCCRL_CONTEXT pCrlContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement); BOOL WINAPI CertSerializeCTLStoreElement(PCCTL_CONTEXT pCtlContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement); - +BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pCertContext, DWORD dwAddDisposition, PCCERT_CONTEXT *ppStoreContext); +BOOL WINAPI CertAddEncodedCertificateToStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded, DWORD dwAddDisposition, PCCERT_CONTEXT *ppCertContext); +PCCERT_CONTEXT WINAPI CertCreateCertificateContext(DWORD dwCertEncodingType, const BYTE *pbCertEncoded, DWORD cbCertEncoded); +PCCERT_CONTEXT WINAPI CertEnumCertificatesInStore(HCERTSTORE hCertStore, PCCERT_CONTEXT pPrev); +PCCERT_CONTEXT WINAPI CertFindCertificateInStore(HCERTSTORE,DWORD,DWORD,DWORD,const void*,PCCERT_CONTEXT); +PCCTL_CONTEXT WINAPI CertEnumCTLsInStore(HCERTSTORE hCertStore, PCCTL_CONTEXT pPrev); +PCCTL_CONTEXT WINAPI CertCreateCTLContext(DWORD dwMsgAndCertEncodingType, const BYTE *pbCtlEncoded, DWORD cbCtlEncoded); +PCCRL_CONTEXT WINAPI CertCreateCRLContext( DWORD dwCertEncodingType, const BYTE* pbCrlEncoded, DWORD cbCrlEncoded); +PCCRL_CONTEXT WINAPI CertEnumCRLsInStore(HCERTSTORE hCertStore, PCCRL_CONTEXT pPrev); +BOOL WINAPI CryptHashCertificate(HCRYPTPROV hCryptProv, ALG_ID Algid, DWORD dwFlags, const BYTE *pbEncoded, DWORD cbEncoded, BYTE *pbComputedHash, DWORD *pcbComputedHash); +BOOL WINAPI CertFreeCTLContext( PCCTL_CONTEXT pCtlContext ); +BOOL WINAPI CertDeleteCTLFromStore(PCCTL_CONTEXT pCtlContext); +BOOL WINAPI CertSetCTLContextProperty(PCCTL_CONTEXT pCTLContext, DWORD dwPropId, DWORD dwFlags, const void *pvData); +BOOL WINAPI CertGetCTLContextProperty(PCCTL_CONTEXT pCTLContext, DWORD dwPropId, void *pvData, DWORD *pcbData); +BOOL WINAPI CertAddCTLContextToStore( HCERTSTORE hCertStore, PCCTL_CONTEXT pCtlContext, DWORD dwAddDisposition, PCCTL_CONTEXT *ppStoreContext ); +BOOL WINAPI CertFreeCRLContext( PCCRL_CONTEXT pCrlContext ); +BOOL WINAPI CertSetCRLContextProperty(PCCRL_CONTEXT pCRLContext, DWORD dwPropId, DWORD dwFlags, const void *pvData); +BOOL WINAPI CertDeleteCRLFromStore(PCCRL_CONTEXT pCrlContext); +BOOL WINAPI CertAddEncodedCTLToStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType, const BYTE *pbCtlEncoded, DWORD cbCtlEncoded, DWORD dwAddDisposition, PCCTL_CONTEXT *ppCtlContext); +BOOL WINAPI CertAddEncodedCRLToStore(HCERTSTORE hCertStore, DWORD dwCertEncodingType, const BYTE *pbCrlEncoded, DWORD cbCrlEncoded, DWORD dwAddDisposition, PCCRL_CONTEXT *ppCrlContext); +BOOL WINAPI CertDeleteCertificateFromStore(PCCERT_CONTEXT pCertContext); +BOOL WINAPI CertSetCertificateContextProperty(PCCERT_CONTEXT pCertContext, DWORD dwPropId, DWORD dwFlags, const void *pvData); +BOOL WINAPI CertAddCRLContextToStore( HCERTSTORE hCertStore, PCCRL_CONTEXT pCrlContext, DWORD dwAddDisposition, PCCRL_CONTEXT *ppStoreContext ); +BOOL WINAPI CertGetCRLContextProperty(PCCRL_CONTEXT pCRLContext, DWORD dwPropId, void *pvData, DWORD *pcbData); +BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext, DWORD dwPropId, void *pvData, DWORD *pcbData); BOOL WINAPI CertCloseStore(HCERTSTORE,DWORD); BOOL WINAPI CertGetCertificateChain(HCERTCHAINENGINE,PCCERT_CONTEXT,LPFILETIME,HCERT STORE,PCERT_CHAIN_PARA,DWORD,LPVOID,PCCERT_CHAIN_CONTEXT*); BOOL WINAPI CertVerifyCertificateChainPolicy(LPCSTR,PCCERT_CHAIN_CONTEXT,PCERT_CHAIN _POLICY_PARA,PCERT_CHAIN_POLICY_STATUS); @@ -1657,9 +1755,12 @@ DWORD WINAPI CertNameToStrW(DWORD,PCERT_NAME_BLOB,DWORD,LPWSTR,DWORD); HCERTSTORE WINAPI CertOpenSystemStoreA(HCRYPTPROV,LPCSTR); HCERTSTORE WINAPI CertOpenSystemStoreW(HCRYPTPROV,LPCWSTR); +DWORD WINAPI CertGetNameStringW(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, LPVOID pvType, LPWSTR pszName, DWORD dwName); +DWORD WINAPI CertGetNameStringA(PCCERT_CONTEXT pCertContext, DWORD dwType, DWORD dwFlags, LPVOID pvType, LPSTR pszName, DWORD dwName); HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwEncodingType, HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara); -PCCERT_CONTEXT WINAPI CertFindCertificateInStore(HCERTSTORE,DWORD,DWORD,DWORD,const void*,PCCERT_CONTEXT); BOOL WINAPI CertFreeCertificateContext(PCCERT_CONTEXT); +DWORD WINAPI CertNameToStrA(DWORD dwCertEncoding, PCERT_NAME_BLOB pCertName, DWORD dwType, LPSTR psz, DWORD dwSZ); +DWORD WINAPI CertNameToStrW(DWORD dwCertEncoding, PCERT_NAME_BLOB pCertName, DWORD dwType, LPWSTR psz, DWORD dwSZ); PCCERT_CONTEXT WINAPI CertGetIssuerCertificateFromStore(HCERTSTORE,PCCERT_CONTEXT,PCCERT_CONTE XT,DWORD*); PCCERT_CHAIN_CONTEXT WINAPI CertFindChainInStore(HCERTSTORE,DWORD,DWORD,DWORD,const void*,PCCERT_CHAIN_CONTEXT); BOOL WINAPI CryptAcquireContextA(HCRYPTPROV*,LPCSTR,LPCSTR,DWORD,DWORD); @@ -1669,6 +1770,7 @@ BOOL WINAPI CryptGenKey(HCRYPTPROV,ALG_ID,DWORD,HCRYPTKEY*); BOOL WINAPI CryptDeriveKey(HCRYPTPROV,ALG_ID,HCRYPTHASH,DWORD,HCRYPTKEY*); BOOL WINAPI CryptDestroyKey(HCRYPTKEY); +BOOL WINAPI CryptEncryptMessage( PCRYPT_ENCRYPT_MESSAGE_PARA pEncryptMessagePara, DWORD dwCert, PCCERT_CONTEXT pccertCert[], const BYTE* pbEncrypted, DWORD dwEncrypted, BYTE* pbBlob, DWORD* dwEncryptedBlob); #if (WINVER >= 0x0500) BOOL WINAPI CryptDuplicateHash(HCRYPTHASH,DWORD*,DWORD,HCRYPTHASH*); BOOL WINAPI CryptDuplicateKey(HCRYPTKEY,DWORD*,DWORD,HCRYPTKEY*); @@ -1712,6 +1814,9 @@ BOOL WINAPI CryptSetProviderW(LPCWSTR,DWORD); BOOL WINAPI CryptSetProviderExA(LPCSTR,DWORD,DWORD*,DWORD); BOOL WINAPI CryptSetProviderExW(LPCWSTR,DWORD,DWORD*,DWORD); +BOOL WINAPI CryptEncodeObject(DWORD dwCertEncodingType, LPCSTR lpszStructType, const void *pvStructInfo, BYTE *pbEncoded, DWORD *pcbEncoded); +BOOL WINAPI CryptEncodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara, void *pvEncoded, DWORD *pcbEncoded); + #ifdef UNICODE #define CertNameToStr CertNameToStrW #define CryptAcquireContext CryptAcquireContextW
19 years, 1 month
1
0
0
0
[cwittich] 19319: added LIST_FOR_EACH_ENTRY_SAFE macro
by cwittich@svn.reactos.com
added LIST_FOR_EACH_ENTRY_SAFE macro Modified: trunk/reactos/include/wine/list.h _____ Modified: trunk/reactos/include/wine/list.h --- trunk/reactos/include/wine/list.h 2005-11-17 23:19:29 UTC (rev 19318) +++ trunk/reactos/include/wine/list.h 2005-11-17 23:19:36 UTC (rev 19319) @@ -155,6 +155,13 @@ &(elem)->field != (list); \ (elem) = LIST_ENTRY((elem)->field.next, type, field)) +#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field) \ + for ((cursor) = LIST_ENTRY((list)->next, type, field), \ + (cursor2) = LIST_ENTRY((cursor)->field.next, type, field); \ + &(cursor)->field != (list); \ + (cursor) = (cursor2), \ + (cursor2) = LIST_ENTRY((cursor)->field.next, type, field)) + /* macros for statically initialized lists */ #define LIST_INIT(list) { &(list), &(list) }
19 years, 1 month
1
0
0
0
[gvg] 19318: Add CommandLineFromMsiDescriptor
by gvg@svn.reactos.com
Add CommandLineFromMsiDescriptor Modified: trunk/reactos/lib/advapi32/advapi32.def Modified: trunk/reactos/lib/advapi32/advapi32.xml Added: trunk/reactos/lib/advapi32/misc/msi.c _____ Modified: trunk/reactos/lib/advapi32/advapi32.def --- trunk/reactos/lib/advapi32/advapi32.def 2005-11-17 22:06:47 UTC (rev 19317) +++ trunk/reactos/lib/advapi32/advapi32.def 2005-11-17 23:19:29 UTC (rev 19318) @@ -70,7 +70,7 @@ CloseEventLog@4 CloseServiceHandle@4 ;CloseTrace@8 -;CommandLineFromMsiDescriptor@12 +CommandLineFromMsiDescriptor@12 ;ComputeAccessTokenFromCodeAuthzLevel@20 ControlService@12 ControlServiceEx@16 _____ Modified: trunk/reactos/lib/advapi32/advapi32.xml --- trunk/reactos/lib/advapi32/advapi32.xml 2005-11-17 22:06:47 UTC (rev 19317) +++ trunk/reactos/lib/advapi32/advapi32.xml 2005-11-17 23:19:29 UTC (rev 19318) @@ -24,6 +24,7 @@ <file>dllmain.c</file> <file>hwprofiles.c</file> <file>logon.c</file> + <file>msi.c</file> <file>shutdown.c</file> <file>sysfunc.c</file> </directory> _____ Added: trunk/reactos/lib/advapi32/misc/msi.c --- trunk/reactos/lib/advapi32/misc/msi.c 2005-11-17 22:06:47 UTC (rev 19317) +++ trunk/reactos/lib/advapi32/misc/msi.c 2005-11-17 23:19:29 UTC (rev 19318) @@ -0,0 +1,37 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: lib/advapi32/misc/msi.c + * PURPOSE: advapi32.dll MSI interface funcs + * NOTES: Copied from Wine + * Copyright 1995 Sven Verdoolaege + */ + +#include <advapi32.h> + +#define NDEBUG +#include <debug.h> + +typedef UINT (WINAPI *fnMsiProvideComponentFromDescriptor)(LPCWSTR,LPWSTR,DWORD*,DWORD*); + +DWORD WINAPI CommandLineFromMsiDescriptor( WCHAR *szDescriptor, + WCHAR *szCommandLine, DWORD *pcchCommandLine ) +{ + static const WCHAR szMsi[] = { 'm','s','i',0 }; + fnMsiProvideComponentFromDescriptor mpcfd; + HMODULE hmsi; + UINT r = ERROR_CALL_NOT_IMPLEMENTED; + + DPRINT("%S %p %p\n", szDescriptor, szCommandLine, pcchCommandLine); + + hmsi = LoadLibraryW( szMsi ); + if (!hmsi) + return r; + mpcfd = (void*) GetProcAddress( hmsi, "MsiProvideComponentFromDescriptorW" ); + if (mpcfd) + r = mpcfd( szDescriptor, szCommandLine, pcchCommandLine, NULL ); + FreeLibrary( hmsi ); + return r; +} + +/* EOF */ Property changes on: trunk/reactos/lib/advapi32/misc/msi.c ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native
19 years, 1 month
1
0
0
0
[gvg] 19317: Sync to Wine-0_9_1:
by gvg@svn.reactos.com
Sync to Wine-0_9_1: Huw Davies <huw(a)codeweavers.com> - Stubs for NdrStubForwardingFunction and NdrCStdStubBuffer2_Release along with a few related defines. - Marshal enums. Modified: trunk/reactos/lib/rpcrt4/cstub.c Modified: trunk/reactos/lib/rpcrt4/ndr_marshall.c Modified: trunk/reactos/lib/rpcrt4/ndr_midl.c Modified: trunk/reactos/lib/rpcrt4/rpcrt4.spec _____ Modified: trunk/reactos/lib/rpcrt4/cstub.c --- trunk/reactos/lib/rpcrt4/cstub.c 2005-11-17 21:59:57 UTC (rev 19316) +++ trunk/reactos/lib/rpcrt4/cstub.c 2005-11-17 22:06:47 UTC (rev 19317) @@ -109,6 +109,13 @@ return This->RefCount; } +ULONG WINAPI NdrCStdStubBuffer2_Release(LPRPCSTUBBUFFER iface, + LPPSFACTORYBUFFER pPSF) +{ + FIXME("Not implemented\n"); + return 0; +} + HRESULT WINAPI CStdStubBuffer_Connect(LPRPCSTUBBUFFER iface, LPUNKNOWN lpUnkServer) { _____ Modified: trunk/reactos/lib/rpcrt4/ndr_marshall.c --- trunk/reactos/lib/rpcrt4/ndr_marshall.c 2005-11-17 21:59:57 UTC (rev 19316) +++ trunk/reactos/lib/rpcrt4/ndr_marshall.c 2005-11-17 22:06:47 UTC (rev 19317) @@ -1431,6 +1431,7 @@ break; case RPC_FC_LONG: case RPC_FC_ULONG: + case RPC_FC_ENUM32: TRACE("long=%ld <= %p\n", *(DWORD*)pMemory, pMemory); memcpy(pStubMsg->Buffer, pMemory, 4); pStubMsg->Buffer += 4; @@ -1492,6 +1493,7 @@ break; case RPC_FC_LONG: case RPC_FC_ULONG: + case RPC_FC_ENUM32: memcpy(pMemory, pStubMsg->Buffer, 4); TRACE("long=%ld => %p\n", *(DWORD*)pMemory, pMemory); pStubMsg->Buffer += 4; @@ -1552,6 +1554,7 @@ break; case RPC_FC_LONG: case RPC_FC_ULONG: + case RPC_FC_ENUM32: pStubMsg->BufferLength += 4; pMemory += 4; break; @@ -1605,6 +1608,7 @@ break; case RPC_FC_LONG: case RPC_FC_ULONG: + case RPC_FC_ENUM32: pMemory += 4; break; case RPC_FC_POINTER: _____ Modified: trunk/reactos/lib/rpcrt4/ndr_midl.c --- trunk/reactos/lib/rpcrt4/ndr_midl.c 2005-11-17 21:59:57 UTC (rev 19316) +++ trunk/reactos/lib/rpcrt4/ndr_midl.c 2005-11-17 22:06:47 UTC (rev 19317) @@ -308,3 +308,13 @@ return RPC_S_OK; } + +/********************************************************************** ** + * NdrStubForwardingFunction [RPCRT4.@] + */ +void __RPC_STUB NdrStubForwardingFunction( IRpcStubBuffer *This, IRpcChannelBuffer *pChannel, + PRPC_MESSAGE pMsg, DWORD *pdwStubPhase ) +{ + FIXME("Not implemented\n"); + return; +} _____ Modified: trunk/reactos/lib/rpcrt4/rpcrt4.spec --- trunk/reactos/lib/rpcrt4/rpcrt4.spec 2005-11-17 21:59:57 UTC (rev 19316) +++ trunk/reactos/lib/rpcrt4/rpcrt4.spec 2005-11-17 22:06:47 UTC (rev 19317) @@ -154,7 +154,7 @@ @ stdcall NdrByteCountPointerFree(ptr ptr ptr) @ stdcall NdrByteCountPointerMarshall(ptr ptr ptr) @ stdcall NdrByteCountPointerUnmarshall(ptr ptr ptr long) -@ stub NdrCStdStubBuffer2_Release +@ stdcall NdrCStdStubBuffer2_Release(ptr ptr) @ stdcall NdrCStdStubBuffer_Release(ptr ptr) @ stdcall NdrClearOutParameters(ptr ptr ptr) @ varargs NdrClientCall2(ptr ptr) @@ -325,7 +325,7 @@ @ stdcall NdrSimpleTypeUnmarshall(ptr ptr long) @ stub NdrStubCall2 @ stub NdrStubCall -@ stub NdrStubForwardingFunction +@ stdcall NdrStubForwardingFunction(ptr ptr ptr ptr) @ stdcall NdrStubGetBuffer(ptr ptr ptr) @ stdcall NdrStubInitialize(ptr ptr ptr ptr) @ stub NdrStubInitializeMarshall
19 years, 1 month
1
0
0
0
[cwittich] 19316: fix a lot of compile problems with encode.c and cert.c (still not added to build)
by cwittich@svn.reactos.com
fix a lot of compile problems with encode.c and cert.c (still not added to build) Modified: trunk/reactos/include/reactos/debug.h Modified: trunk/reactos/lib/crypt32/cert.c Modified: trunk/reactos/lib/crypt32/precomp.h Modified: trunk/reactos/w32api/include/wincrypt.h _____ Modified: trunk/reactos/include/reactos/debug.h --- trunk/reactos/include/reactos/debug.h 2005-11-17 21:58:13 UTC (rev 19315) +++ trunk/reactos/include/reactos/debug.h 2005-11-17 21:59:57 UTC (rev 19316) @@ -59,9 +59,10 @@ #define CHECKPOINT do { DbgPrint("%s:%d\n",__FILE__,__LINE__); } while(0); #else - #define DPRINT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) + #ifdef __GNUC__ + #define DPRINT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0) + #endif #define CHECKPOINT - #endif #define UNIMPLEMENTED \ _____ Modified: trunk/reactos/lib/crypt32/cert.c --- trunk/reactos/lib/crypt32/cert.c 2005-11-17 21:58:13 UTC (rev 19315) +++ trunk/reactos/lib/crypt32/cert.c 2005-11-17 21:59:57 UTC (rev 19316) @@ -2652,7 +2652,7 @@ return NULL; } - __TRY + _SEH_TRY { const WINE_CONTEXT_INTERFACE *contextInterface = NULL; const WINE_CERT_PROP_HEADER *hdr = NULL; @@ -2814,7 +2814,7 @@ SetLastError(STATUS_ACCESS_VIOLATION); context = NULL; } - __ENDTRY + _SEH_END return context; } _____ Modified: trunk/reactos/lib/crypt32/precomp.h --- trunk/reactos/lib/crypt32/precomp.h 2005-11-17 21:58:13 UTC (rev 19315) +++ trunk/reactos/lib/crypt32/precomp.h 2005-11-17 21:59:57 UTC (rev 19316) @@ -1,20 +1,21 @@ - -#include "config.h" - -#include <assert.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> - -#include "windef.h" -#include "winbase.h" -#include "wincrypt.h" -#include "winreg.h" -#include "snmp.h" -#include "winnls.h" -#include "mssip.h" -#include "crypt32_private.h" -#include "wine/debug.h" - -#define NTOS_MODE_USER -#include <ndk/ntndk.h> +#include "config.h" + +#include <assert.h> +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> + +#include <libs/pseh/pseh.h> + +#include "windef.h" +#include "winbase.h" +#include "wincrypt.h" +#include "winreg.h" +#include "snmp.h" +#include "winnls.h" +#include "mssip.h" +#include "crypt32_private.h" +#include "wine/debug.h" + +#define NTOS_MODE_USER +#include <ndk/ntndk.h> _____ Modified: trunk/reactos/w32api/include/wincrypt.h --- trunk/reactos/w32api/include/wincrypt.h 2005-11-17 21:58:13 UTC (rev 19315) +++ trunk/reactos/w32api/include/wincrypt.h 2005-11-17 21:59:57 UTC (rev 19316) @@ -80,6 +80,17 @@ #define ALG_SID_TLS1PRF 10 #define ALG_SID_EXAMPLE 80 +/* some typedefs for function parameters */ +typedef unsigned int ALG_ID; +typedef unsigned long HCRYPTPROV; +typedef unsigned long HCRYPTKEY; +typedef unsigned long HCRYPTHASH; +typedef void *HCERTSTORE; +typedef void *HCRYPTMSG; +typedef void *HCERTSTOREPROV; +typedef void *HCRYPTOIDFUNCSET; +typedef void *HCRYPTOIDFUNCADDR; + #define CALG_MD2 (ALG_CLASS_HASH|ALG_TYPE_ANY|ALG_SID_MD2) #define CALG_MD4 (ALG_CLASS_HASH|ALG_TYPE_ANY|ALG_SID_MD4) #define CALG_MD5 (ALG_CLASS_HASH|ALG_TYPE_ANY|ALG_SID_MD5) @@ -100,6 +111,196 @@ #define CALG_DESX (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_DESX) #define CALG_TLS1PRF (ALG_CLASS_DHASH|ALG_TYPE_ANY|ALG_SID_TLS1PRF) +/* physical store dwFlags, also used by CertAddStoreToCollection as + * dwUpdateFlags + */ +#define CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG 0x1 +#define CERT_PHYSICAL_STORE_OPEN_DISABLE_FLAG 0x2 +#define CERT_PHYSICAL_STORE_REMOVE_OPEN_DISABLE_FLAG 0x4 +#define CERT_PHYSICAL_STORE_INSERT_COMPUTER_NAME_ENABLE_FLAG 0x8 + +/* dwFlag values for CertEnumPhysicalStore callback */ +#define CERT_PHYSICAL_STORE_PREDEFINED_ENUM_FLAG 0x1 + +/* predefined store names */ +#if defined(__GNUC__) +# define CERT_PHYSICAL_STORE_DEFAULT_NAME (const WCHAR[])\ + {'.','D','e','f','a','u','l','t','0'} +# define CERT_PHYSICAL_STORE_GROUP_POLICY_NAME (const WCHAR[])\ + {'.','G','r','o','u','p','P','o','l','i','c','y',0} +# define CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME (const WCHAR[])\ + {'.','L','o','c','a','l','M','a','c','h','i','n','e',0} +# define CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME (const WCHAR[])\ + {'.','U','s','e','r','C','e','r','t','i','f','i','c','a','t','e',0} +# define CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME (const WCHAR[])\ + {'.','L','o','c','a','l','M','a','c','h','i','n','e','G','r','o','u','p' ,\ + 'P','o','l','i','c','y',0} +# define CERT_PHYSICAL_STORE_ENTERPRISE_NAME (const WCHAR[])\ + {'.','E','n','t','e','r','p','r','i','s','e',0} +# define CERT_PHYSICAL_STORE_AUTH_ROOT_NAME (const WCHAR[])\ + {'.','A','u','t','h','R','o','o','t',0} +#elif defined(_MSC_VER) +# define CERT_PHYSICAL_STORE_DEFAULT_NAME \ + L".Default" +# define CERT_PHYSICAL_STORE_GROUP_POLICY_NAME \ + L".GroupPolicy" +# define CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME \ + L".LocalMachine" +# define CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME \ + L".UserCertificate" +# define CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME \ + L".LocalMachineGroupPolicy" +# define CERT_PHYSICAL_STORE_ENTERPRISE_NAME \ + L".Enterprise" +# define CERT_PHYSICAL_STORE_AUTH_ROOT_NAME \ + L".AuthRoot" +#else +static const WCHAR CERT_PHYSICAL_STORE_DEFAULT_NAME[] = + {'.','D','e','f','a','u','l','t','0'}; +static const WCHAR CERT_PHYSICAL_STORE_GROUP_POLICY_NAME[] = + {'.','G','r','o','u','p','P','o','l','i','c','y',0}; +static const WCHAR CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME[] = + {'.','L','o','c','a','l','M','a','c','h','i','n','e',0}; +static const WCHAR CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME[] = + {'.','U','s','e','r','C','e','r','t','i','f','i','c','a','t','e',0}; +static const WCHAR CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME[] = + {'.','L','o','c','a','l','M','a','c','h','i','n','e','G','r','o','u','p' , + 'P','o','l','i','c','y',0}; +static const WCHAR CERT_PHYSICAL_STORE_ENTERPRISE_NAME[] = + {'.','E','n','t','e','r','p','r','i','s','e',0}; +static const WCHAR CERT_PHYSICAL_STORE_AUTH_ROOT_NAME[] = + {'.','A','u','t','h','R','o','o','t',0}; +#endif + +/* system store locations */ +#define CERT_SYSTEM_STORE_LOCATION_MASK 0x00ff0000 +#define CERT_SYSTEM_STORE_LOCATION_SHIFT 16 + +/* system store location ids */ +/* hkcu */ +#define CERT_SYSTEM_STORE_CURRENT_USER_ID 1 +/* hklm */ +#define CERT_SYSTEM_STORE_LOCAL_MACHINE_ID 2 +/* hklm\Software\Microsoft\Cryptography\Services */ +#define CERT_SYSTEM_STORE_CURRENT_SERVICE_ID 4 +#define CERT_SYSTEM_STORE_SERVICES_ID 5 +/* HKEY_USERS */ +#define CERT_SYSTEM_STORE_USERS_ID 6 +/* hkcu\Software\Policies\Microsoft\SystemCertificates */ +#define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID 7 +/* hklm\Software\Policies\Microsoft\SystemCertificates */ +#define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID 8 +/* hklm\Software\Microsoft\EnterpriseCertificates */ +#define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID 9 + +/* system store location values */ +#define CERT_SYSTEM_STORE_CURRENT_USER \ + (CERT_SYSTEM_STORE_CURRENT_USER_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT) +#define CERT_SYSTEM_STORE_LOCAL_MACHINE \ + (CERT_SYSTEM_STORE_LOCAL_MACHINE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT) +#define CERT_SYSTEM_STORE_CURRENT_SERVICE \ + (CERT_SYSTEM_STORE_CURRENT_SERVICE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT) +#define CERT_SYSTEM_STORE_SERVICES \ + (CERT_SYSTEM_STORE_SERVICES_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT) +#define CERT_SYSTEM_STORE_USERS \ + (CERT_SYSTEM_STORE_USERS_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT) +#define CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY \ + (CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT) +#define CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY \ + (CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT) +#define CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE \ + (CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT) + +#if defined(__GNUC__) +#define CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH (const WCHAR[])\ + {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t ',\ + '\\','S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e' ,'s',\ + 0 } +#define CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH (const WCHAR[])\ + {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\ \',\ + 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e' ,'r',\ + 't','i','f','i','c','a','t','e','s',0 } +#elif defined(_MSC_VER) +#define CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH \ + L"Software\\Microsoft\\SystemCertificates" +#define CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH \ + L"Software\\Policies\\Microsoft\\SystemCertificates" +#else +static const WCHAR CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH[] = + {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t ','\\', + 'S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e','s', 0 }; +static const WCHAR CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH[] = + {'S','o','f','t','w','a','r','e','\\','P','o','l','i','c','i','e','s','\ \', + 'M','i','c','r','o','s','o','f','t','\\','S','y','s','t','e','m','C','e' ,'r', + 't','i','f','i','c','a','t','e','s',0 }; +#endif + +/* flags for CertOpenStore dwFlags */ +#define CERT_STORE_NO_CRYPT_RELEASE_FLAG 0x00000001 +#define CERT_STORE_SET_LOCALIZED_NAME_FLAG 0x00000002 +#define CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG 0x00000004 +#define CERT_STORE_DELETE_FLAG 0x00000010 +#define CERT_STORE_UNSAFE_PHYSICAL_FLAG 0x00000020 +#define CERT_STORE_SHARE_STORE_FLAG 0x00000040 +#define CERT_STORE_SHARE_CONTEXT_FLAG 0x00000080 +#define CERT_STORE_MANIFOLD_FLAG 0x00000100 +#define CERT_STORE_ENUM_ARCHIVED_FLAG 0x00000200 +#define CERT_STORE_UPDATE_KEYID_FLAG 0x00000400 +#define CERT_STORE_BACKUP_RESTORE_FLAG 0x00000800 +#define CERT_STORE_MAXIMUM_ALLOWED_FLAG 0x00001000 +#define CERT_STORE_CREATE_NEW_FLAG 0x00002000 +#define CERT_STORE_OPEN_EXISTING_FLAG 0x00004000 +#define CERT_STORE_READONLY_FLAG 0x00008000 + +/* dwAddDisposition */ +#define CERT_STORE_ADD_NEW 1 +#define CERT_STORE_ADD_USE_EXISTING 2 +#define CERT_STORE_ADD_REPLACE_EXISTING 3 +#define CERT_STORE_ADD_ALWAYS 4 +#define CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES 5 +#define CERT_STORE_ADD_NEWER 6 +#define CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES 7 + +/* cert store provider types */ +#define CERT_STORE_PROV_MSG ((LPCSTR)1) +#define CERT_STORE_PROV_MEMORY ((LPCSTR)2) +#define CERT_STORE_PROV_FILE ((LPCSTR)3) +#define CERT_STORE_PROV_REG ((LPCSTR)4) +#define CERT_STORE_PROV_PKCS7 ((LPCSTR)5) +#define CERT_STORE_PROV_SERIALIZED ((LPCSTR)6) +#define CERT_STORE_PROV_FILENAME_A ((LPCSTR)7) +#define CERT_STORE_PROV_FILENAME_W ((LPCSTR)8) +#define CERT_STORE_PROV_SYSTEM_A ((LPCSTR)9) +#define CERT_STORE_PROV_SYSTEM_W ((LPCSTR)10) +#define CERT_STORE_PROV_SYSTEM CERT_STORE_PROV_SYSTEM_W +#define CERT_STORE_PROV_COLLECTION ((LPCSTR)11) +#define CERT_STORE_PROV_SYSTEM_REGISTRY_A ((LPCSTR)12) +#define CERT_STORE_PROV_SYSTEM_REGISTRY_W ((LPCSTR)13) +#define CERT_STORE_PROV_SYSTEM_REGISTRY CERT_STORE_PROV_SYSTEM_REGISTRY_W +#define CERT_STORE_PROV_PHYSICAL_W ((LPCSTR)14) +#define CERT_STORE_PROV_PHYSICAL CERT_STORE_PROV_PHYSICAL_W +#define CERT_STORE_PROV_SMART_CARD_W ((LPCSTR)15) +#define CERT_STORE_PROV_SMART_CARD CERT_STORE_PROV_SMART_CARD_W +#define CERT_STORE_PROV_LDAP_W ((LPCSTR)16) +#define CERT_STORE_PROV_LDAP CERT_STORE_PROV_LDAP_W + +#define sz_CERT_STORE_PROV_MEMORY "Memory" +#define sz_CERT_STORE_PROV_FILENAME_W "File" +#define sz_CERT_STORE_PROV_FILENAME sz_CERT_STORE_PROV_FILENAME_W +#define sz_CERT_STORE_PROV_SYSTEM_W "System" +#define sz_CERT_STORE_PROV_SYSTEM sz_CERT_STORE_PROV_SYSTEM_W +#define sz_CERT_STORE_PROV_PKCS7 "PKCS7" +#define sz_CERT_STORE_PROV_SERIALIZED "Serialized" +#define sz_CERT_STORE_PROV_COLLECTION "Collection" +#define sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W "SystemRegistry" +#define sz_CERT_STORE_PROV_SYSTEM_REGISTRY sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W +#define sz_CERT_STORE_PROV_PHYSICAL_W "Physical" +#define sz_CERT_STORE_PROV_PHYSICAL sz_CERT_STORE_PROV_PHYSICAL_W +#define sz_CERT_STORE_PROV_SMART_CARD_W "SmartCard" +#define sz_CERT_STORE_PROV_SMART_CARD sz_CERT_STORE_PROV_SMART_CARD_W +#define sz_CERT_STORE_PROV_LDAP_W "Ldap" +#define sz_CERT_STORE_PROV_LDAP sz_CERT_STORE_PROV_LDAP_W + #define CRYPT_VERIFYCONTEXT 0xF0000000 #define CRYPT_NEWKEYSET 8 #define CRYPT_DELETEKEYSET 16 @@ -141,6 +342,91 @@ #define CRYPT_USER_DEFAULT 0x00000002 #define CRYPT_DELETE_DEFAULT 0x00000004 +/* cert system store flags */ +#define CERT_SYSTEM_STORE_MASK 0xffff0000 +#define CERT_SYSTEM_STORE_RELOCATE_FLAG 0x80000000 + +/* CertFindChainInStore dwFindType types */ +#define CERT_CHAIN_FIND_BY_ISSUER 1 + +/* CERT_INFO versions/flags */ +#define CERT_V1 0 +#define CERT_V2 1 +#define CERT_V3 2 +#define CERT_INFO_VERSION_FLAG 1 +#define CERT_INFO_SERIAL_NUMBER_FLAG 2 +#define CERT_INFO_SIGNATURE_ALGORITHM_FLAG 3 +#define CERT_INFO_ISSUER_FLAG 4 +#define CERT_INFO_NOT_BEFORE_FLAG 5 +#define CERT_INFO_NOT_AFTER_FLAG 6 +#define CERT_INFO_SUBJECT_FLAG 7 +#define CERT_INFO_SUBJECT_PUBLIC_KEY_INFO_FLAG 8 +#define CERT_INFO_ISSUER_UNIQUE_ID_FLAG 9 +#define CERT_INFO_SUBJECT_UNIQUE_ID_FLAG 10 +#define CERT_INFO_EXTENSION_FLAG 11 + +/* CERT_REQUEST_INFO versions */ +#define CERT_REQUEST_V1 0 + +/* CERT_KEYGEN_REQUEST_INFO versions */ +#define CERT_KEYGEN_REQUEST_V1 0 + +/* CRL versions */ +#define CRL_V1 0 +#define CRL_V2 1 + +/* CTL versions */ +#define CTL_V1 0 + +/* Certificate, CRL, CTL property IDs */ +#define CERT_KEY_PROV_HANDLE_PROP_ID 1 +#define CERT_KEY_PROV_INFO_PROP_ID 2 +#define CERT_SHA1_HASH_PROP_ID 3 +#define CERT_HASH_PROP_ID CERT_SHA1_HASH_PROP_ID +#define CERT_MD5_HASH_PROP_ID 4 +#define CERT_KEY_CONTEXT_PROP_ID 5 +#define CERT_KEY_SPEC_PROP_ID 6 +#define CERT_IE30_RESERVED_PROP_ID 7 +#define CERT_PUBKEY_HASH_RESERVED_PROP_ID 8 +#define CERT_ENHKEY_USAGE_PROP_ID 9 +#define CERT_CTL_USAGE_PROP_ID CERT_ENHKEY_USAGE_PROP_ID +#define CERT_NEXT_UPDATE_LOCATION_PROP_ID 10 +#define CERT_FRIENDLY_NAME_PROP_ID 11 +#define CERT_PVK_FILE_PROP_ID 12 +#define CERT_DESCRIPTION_PROP_ID 13 +#define CERT_ACCESS_STATE_PROP_ID 14 +#define CERT_SIGNATURE_HASH_PROP_ID 15 +#define CERT_SMART_CARD_DATA_PROP_ID 16 +#define CERT_EFS_PROP_ID 17 +#define CERT_FORTEZZA_DATA_PROP 18 +#define CERT_ARCHIVED_PROP_ID 19 +#define CERT_KEY_IDENTIFIER_PROP_ID 20 +#define CERT_AUTO_ENROLL_PROP_ID 21 +#define CERT_PUBKEY_ALG_PARA_PROP_ID 22 +#define CERT_CROSS_CERT_DIST_POINTS_PROP_ID 23 +#define CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID 24 +#define CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID 25 +#define CERT_ENROLLMENT_PROP_ID 26 +#define CERT_DATE_STAMP_PROP_ID 27 +#define CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID 28 +#define CERT_SUBJECT_NAME_MD5_HASH_PROP_ID 29 +#define CERT_EXTENDED_ERROR_INFO_PROP_ID 30 +/* 31 -- unused? + 32 -- cert prop id + 33 -- CRL prop id + 34 -- CTL prop id + 35 -- KeyId prop id + 36-63 -- reserved + */ +#define CERT_RENEWAL_PROP_ID 64 +#define CERT_ARCHIVED_KEY_HASH_PROP_ID 65 +#define CERT_AUTO_ENROLL_RETRY_PROP_ID 66 +#define CERT_AIA_URL_RETRIEVED_PROP_ID 67 +#define CERT_FIRST_RESERVED_PROP_ID 68 +#define CERT_LAST_RESERVED_PROP_ID 0x00007fff +#define CERT_FIRST_USER_PROP_ID 0x00008000 +#define CERT_LAST_USER_PROP_ID 0x0000ffff + /* Algorithm IDs */ #define GET_ALG_CLASS(x) (x & (7 << 13)) @@ -245,6 +531,44 @@ #define CALG_SSL2_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_SSL2_MASTER) #define CALG_TLS1_MASTER (ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL | ALG_SID_TLS1_MASTER) +/* CRL reason codes */ +#define CRL_REASON_UNSPECIFIED 0 +#define CRL_REASON_KEY_COMPROMISE 1 +#define CRL_REASON_CA_COMPROMISE 2 +#define CRL_REASON_AFFILIATION_CHANGED 3 +#define CRL_REASON_SUPERSEDED 4 +#define CRL_REASON_CESSATION_OF_OPERATION 5 +#define CRL_REASON_CERTIFICATE_HOLD 6 +#define CRL_REASON_REMOVE_FROM_CRL 8 + +/* CertControlStore control types */ +#define CERT_STORE_CTRL_RESYNC 1 +#define CERT_STORE_CTRL_NOTIFY_CHANGE 2 +#define CERT_STORE_CTRL_COMMIT 3 +#define CERT_STORE_CTRL_AUTO_RESYNC 4 +#define CERT_STORE_CTRL_CANCEL_NOTIFY 5 + +#define CERT_STORE_CTRL_COMMIT_FORCE_FLAG 0x1 +#define CERT_STORE_CTRL_COMMIT_CLEAR_FLAG 0x2 + +/* access state flags */ +#define CERT_ACCESS_STATE_WRITE_PERSIST_FLAG 0x1 +#define CERT_ACCESS_STATE_SYSTEM_STORE_FLAG 0x2 +#define CERT_ACCESS_STATE_LM_SYSTEM_STORE_FLAG 0x4 + +/* PFN_CERT_STORE_PROV_WRITE_CERT dwFlags values */ +#define CERT_STORE_PROV_WRITE_ADD_FLAG 0x1 + +/* CertAddSerializedElementToStore context types */ +#define CERT_STORE_CERTIFICATE_CONTEXT 1 +#define CERT_STORE_CRL_CONTEXT 2 +#define CERT_STORE_CTL_CONTEXT 3 +#define CERT_STORE_ALL_CONTEXT_FLAG ~0U +#define CERT_STORE_CERTIFICATE_CONTEXT_FLAG \ + (1 << CERT_STORE_CERTIFICATE_CONTEXT) +#define CERT_STORE_CRL_CONTEXT_FLAG (1 << CERT_STORE_CRL_CONTEXT) +#define CERT_STORE_CTL_CONTEXT_FLAG (1 << CERT_STORE_CTL_CONTEXT) + /* OIDs */ #define szOID_RSA "1.2.840.113549" #define szOID_PKCS "1.2.840.113549.1" @@ -1182,13 +1506,149 @@ LPCWSTR szPrompt; } CRYPTPROTECT_PROMPTSTRUCT, *PCRYPTPROTECT_PROMPTSTRUCT; +typedef struct _CERT_SIGNED_CONTENT_INFO { + CRYPT_DER_BLOB ToBeSigned; + CRYPT_ALGORITHM_IDENTIFIER SignatureAlgorithm; + CRYPT_BIT_BLOB Signature; +} CERT_SIGNED_CONTENT_INFO, *PCERT_SIGNED_CONTENT_INFO; +typedef struct _CERT_RDN_ATTR { + LPSTR pszObjId; + DWORD dwValueType; + CERT_RDN_VALUE_BLOB Value; +} CERT_RDN_ATTR, *PCERT_RDN_ATTR; + +typedef struct _CERT_RDN { + DWORD cRDNAttr; + PCERT_RDN_ATTR rgRDNAttr; +} CERT_RDN, *PCERT_RDN; + +typedef struct _CERT_NAME_INFO { + DWORD cRDN; + PCERT_RDN rgRDN; +} CERT_NAME_INFO, *PCERT_NAME_INFO; + +typedef struct _CRYPT_ENCODE_PARA { + DWORD cbSize; + PFN_CRYPT_ALLOC pfnAlloc; + PFN_CRYPT_FREE pfnFree; +} CRYPT_ENCODE_PARA, *PCRYPT_ENCODE_PARA; + +typedef struct _CERT_SYSTEM_STORE_INFO { + DWORD cbSize; +} CERT_SYSTEM_STORE_INFO, *PCERT_SYSTEM_STORE_INFO; + +typedef struct _CERT_PHYSICAL_STORE_INFO { + DWORD cbSize; + LPSTR pszOpenStoreProvider; + DWORD dwOpenEncodingType; + DWORD dwOpenFlags; + CRYPT_DATA_BLOB OpenParameters; + DWORD dwFlags; + DWORD dwPriority; +} CERT_PHYSICAL_STORE_INFO, *PCERT_PHYSICAL_STORE_INFO; + +typedef struct _CERT_STORE_PROV_INFO { + DWORD cbSize; + DWORD cStoreProvFunc; + void **rgpvStoreProvFunc; + HCERTSTOREPROV hStoreProv; + DWORD dwStoreProvFlags; + HCRYPTOIDFUNCADDR hStoreProvFuncAddr2; +} CERT_STORE_PROV_INFO, *PCERT_STORE_PROV_INFO; + +typedef BOOL (WINAPI *PFN_CERT_ENUM_SYSTEM_STORE_LOCATION)( + LPCWSTR pwszStoreLocation, DWORD dwFlags, void *pvReserved, void *pvArg); + +typedef BOOL (WINAPI *PFN_CERT_ENUM_SYSTEM_STORE)(const void *pvSystemStore, + DWORD dwFlags, PCERT_SYSTEM_STORE_INFO pStoreInfo, void *pvReserved, + void *pvArg); + +typedef BOOL (WINAPI *PFN_CERT_ENUM_PHYSICAL_STORE)(const void *pvSystemStore, + DWORD dwFlags, LPCWSTR pwszStoreName, PCERT_PHYSICAL_STORE_INFO pStoreInfo, + void *pvReserved, void *pvArg); + +/* Encode/decode object */ +typedef LPVOID (WINAPI *PFN_CRYPT_ALLOC)(size_t cbsize); +typedef VOID (WINAPI *PFN_CRYPT_FREE)(LPVOID pv); + +typedef BOOL (WINAPI *PFN_CERT_DLL_OPEN_STORE_PROV_FUNC)( + LPCSTR lpszStoreProvider, DWORD dwEncodingType, HCRYPTPROV hCryptProv, + DWORD dwFlags, const void *pvPara, HCERTSTORE hCertStore, + PCERT_STORE_PROV_INFO pStoreProvInfo); + +typedef void (WINAPI *PFN_CERT_STORE_PROV_CLOSE)(HCERTSTOREPROV hStoreProv, + DWORD dwFlags); + +typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CERT)(HCERTSTOREPROV hStoreProv, + PCCERT_CONTEXT pStoreCertContext, DWORD dwFlags, + PCCERT_CONTEXT *ppProvCertContext); + +typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CERT)(HCERTSTOREPROV hStoreProv, + PCCERT_CONTEXT pCertContext, DWORD dwFlags); + +typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CERT)( + HCERTSTOREPROV hStoreProv, PCCERT_CONTEXT pCertContext, DWORD dwFlags); + +typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CERT_PROPERTY)( + HCERTSTOREPROV hStoreProv, PCCERT_CONTEXT pCertContext, DWORD dwPropId, + DWORD dwFlags, const void *pvData); + +typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CRL)(HCERTSTOREPROV hStoreProv, + PCCRL_CONTEXT pStoreCrlContext, DWORD dwFlags, + PCCRL_CONTEXT *ppProvCrlContext); + +typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CRL)(HCERTSTOREPROV hStoreProv, + PCCRL_CONTEXT pCrlContext, DWORD dwFlags); + +typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CRL)(HCERTSTOREPROV hStoreProv, + PCCRL_CONTEXT pCrlContext, DWORD dwFlags); + +typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CRL_PROPERTY)( + HCERTSTOREPROV hStoreProv, PCCRL_CONTEXT pCrlContext, DWORD dwPropId, + DWORD dwFlags, const void *pvData); + +typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_READ_CTL)(HCERTSTOREPROV hStoreProv, + PCCTL_CONTEXT pStoreCtlContext, DWORD dwFlags, + PCCTL_CONTEXT *ppProvCtlContext); + +typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_WRITE_CTL)(HCERTSTOREPROV hStoreProv, + PCCTL_CONTEXT pCtlContext, DWORD dwFlags); + +typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_DELETE_CTL)( + HCERTSTOREPROV hStoreProv, PCCTL_CONTEXT pCtlContext, DWORD dwFlags); + +typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_SET_CTL_PROPERTY)( + HCERTSTOREPROV hStoreProv, PCCTL_CONTEXT pCtlContext, DWORD dwPropId, + DWORD dwFlags, const void *pvData); + +typedef BOOL (WINAPI *PFN_CERT_STORE_PROV_CONTROL)(HCERTSTOREPROV hStoreProv, + DWORD dwFlags, DWORD dwCtrlType, void const *pvCtrlPara); + +/* subject types for CryptVerifyCertificateSignatureEx */ +#define CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB 1 +#define CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT 2 +#define CRYPT_VERIFY_CERT_SIGN_SUBJECT_CRL 3 + +/* issuer types for CryptVerifyCertificateSignatureEx */ +#define CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY 1 +#define CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT 2 +#define CRYPT_VERIFY_CERT_SIGN_ISSUER_CHAIN 3 +#define CRYPT_VERIFY_CERT_SIGN_ISSUER_NULL 4 + /* crypt32.dll functions */ LPVOID WINAPI CryptMemAlloc(ULONG cbSize); LPVOID WINAPI CryptMemRealloc(LPVOID pv, ULONG cbSize); VOID WINAPI CryptMemFree(LPVOID pv); +PCRYPT_ATTRIBUTE WINAPI CertFindAttribute(LPCSTR pszObjId, DWORD cAttr, CRYPT_ATTRIBUTE rgAttr[]); +PCERT_EXTENSION WINAPI CertFindExtension(LPCSTR pszObjId, DWORD cExtensions, CERT_EXTENSION rgExtensions[]); +PCERT_RDN_ATTR WINAPI CertFindRDNAttr(LPCSTR pszObjId, PCERT_NAME_INFO pName); +BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement); +BOOL WINAPI CertSerializeCRLStoreElement(PCCRL_CONTEXT pCrlContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement); +BOOL WINAPI CertSerializeCTLStoreElement(PCCTL_CONTEXT pCtlContext, DWORD dwFlags, BYTE *pbElement, DWORD *pcbElement); + BOOL WINAPI CertCloseStore(HCERTSTORE,DWORD); BOOL WINAPI CertGetCertificateChain(HCERTCHAINENGINE,PCCERT_CONTEXT,LPFILETIME,HCERT STORE,PCERT_CHAIN_PARA,DWORD,LPVOID,PCCERT_CHAIN_CONTEXT*); BOOL WINAPI CertVerifyCertificateChainPolicy(LPCSTR,PCCERT_CHAIN_CONTEXT,PCERT_CHAIN _POLICY_PARA,PCERT_CHAIN_POLICY_STATUS); @@ -1197,7 +1657,7 @@ DWORD WINAPI CertNameToStrW(DWORD,PCERT_NAME_BLOB,DWORD,LPWSTR,DWORD); HCERTSTORE WINAPI CertOpenSystemStoreA(HCRYPTPROV,LPCSTR); HCERTSTORE WINAPI CertOpenSystemStoreW(HCRYPTPROV,LPCWSTR); -HCERTSTORE WINAPI CertOpenStore(LPCSTR,DWORD,HCRYPTPROV,DWORD,const void*); +HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwEncodingType, HCRYPTPROV hCryptProv, DWORD dwFlags, const void *pvPara); PCCERT_CONTEXT WINAPI CertFindCertificateInStore(HCERTSTORE,DWORD,DWORD,DWORD,const void*,PCCERT_CONTEXT); BOOL WINAPI CertFreeCertificateContext(PCCERT_CONTEXT); PCCERT_CONTEXT WINAPI CertGetIssuerCertificateFromStore(HCERTSTORE,PCCERT_CONTEXT,PCCERT_CONTE XT,DWORD*); @@ -1213,19 +1673,22 @@ BOOL WINAPI CryptDuplicateHash(HCRYPTHASH,DWORD*,DWORD,HCRYPTHASH*); BOOL WINAPI CryptDuplicateKey(HCRYPTKEY,DWORD*,DWORD,HCRYPTKEY*); #endif - +BOOL WINAPI CertAddStoreToCollection(HCERTSTORE hCollectionStore, HCERTSTORE hSiblingStore, DWORD dwUpdateFlags, DWORD dwPriority); BOOL WINAPI CryptExportKey (HCRYPTKEY hKey, HCRYPTKEY hExpKey, DWORD dwBlobType, DWORD dwFlags, BYTE *pbData, DWORD *pdwDataLen); - +LPCSTR WINAPI CertAlgIdToOID(DWORD dwAlgId); +DWORD WINAPI CertOIDToAlgId(LPCSTR pszObjId); BOOL WINAPI CryptExportPublicKeyInfo(HCRYPTPROV hCryptProv, DWORD dwKeySpec, DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, DWORD *pcbInfo); BOOL WINAPI CryptExportPublicKeyInfoEx(HCRYPTPROV hCryptProv, DWORD dwKeySpec, DWORD dwCertEncodingType, LPSTR pszPublicKeyObjId, DWORD dwFlags, void *pvAuxInfo, PCERT_PUBLIC_KEY_INFO pInfo, DWORD *pcbInfo); BOOL WINAPI CryptImportPublicKeyInfo(HCRYPTPROV hCryptProv, DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, HCRYPTKEY *phKey); BOOL WINAPI CryptImportPublicKeyInfoEx(HCRYPTPROV hCryptProv, DWORD dwCertEncodingType, PCERT_PUBLIC_KEY_INFO pInfo, ALG_ID aiKeyAlg, DWORD dwFlags, void *pvAuxInfo, HCRYPTKEY *phKey); - BOOL WINAPI CryptProtectData( DATA_BLOB* pDataIn, LPCWSTR szDataDescr, DATA_BLOB* pOptionalEntropy, PVOID pvReserved, CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, DATA_BLOB* pDataOut ); BOOL WINAPI CryptUnprotectData( DATA_BLOB* pDataIn, LPWSTR* ppszDataDescr, DATA_BLOB* pOptionalEntropy, PVOID pvReserved, CRYPTPROTECT_PROMPTSTRUCT* pPromptStruct, DWORD dwFlags, DATA_BLOB* pDataOut ); - +BOOL WINAPI CryptVerifyCertificateSignature(HCRYPTPROV hCryptProv, DWORD dwCertEncodingType, const BYTE *pbEncoded, DWORD cbEncoded, PCERT_PUBLIC_KEY_INFO pPublicKey); +BOOL WINAPI CryptVerifyCertificateSignatureEx(HCRYPTPROV hCryptProv, DWORD dwCertEncodingType, DWORD dwSubjectType, void *pvSubject, DWORD dwIssuerType, void *pvIssuer, DWORD dwFlags, void *pvReserved); BOOL WINAPI CryptSetKeyParam(HCRYPTKEY,DWORD,PBYTE,DWORD); BOOL WINAPI CryptGetKeyParam(HCRYPTKEY,DWORD,PBYTE,PDWORD,DWORD); +BOOL WINAPI CryptDecodeObject(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo, DWORD *pcbStructInfo); +BOOL WINAPI CryptDecodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo); BOOL WINAPI CryptSetHashParam(HCRYPTHASH,DWORD,PBYTE,DWORD); BOOL WINAPI CryptGetHashParam(HCRYPTHASH,DWORD,PBYTE,PDWORD,DWORD); BOOL WINAPI CryptSetProvParam(HCRYPTPROV,DWORD,PBYTE,DWORD);
19 years, 1 month
1
0
0
0
[gvg] 19315: Sync to Wine-0_9_1:
by gvg@svn.reactos.com
Sync to Wine-0_9_1: Phil Krylov <phil(a)newstar.rinet.ru> - Added support for EM_REQUESTRESIZE message, EN_REQUESTRESIZE notification, and ENM_REQUESTRESIZE event mask. - Cache background color brush instead of recreating it at each screen update. Mike McCormack <mike(a)codeweavers.com> - Convert all RTFPanic and RTFMsg calls to ERR calls. Modified: trunk/reactos/lib/riched20/caret.c Modified: trunk/reactos/lib/riched20/editor.c Modified: trunk/reactos/lib/riched20/editor.h Modified: trunk/reactos/lib/riched20/editstr.h Modified: trunk/reactos/lib/riched20/paint.c Modified: trunk/reactos/lib/riched20/reader.c Modified: trunk/reactos/lib/riched20/rtf.h Modified: trunk/reactos/lib/riched20/wrap.c _____ Modified: trunk/reactos/lib/riched20/caret.c --- trunk/reactos/lib/riched20/caret.c 2005-11-17 21:56:58 UTC (rev 19314) +++ trunk/reactos/lib/riched20/caret.c 2005-11-17 21:58:13 UTC (rev 19315) @@ -1097,6 +1097,7 @@ editor->bCaretAtEnd = FALSE; /* FIXME or maybe not */ ME_DeleteSelection(editor); ME_UpdateRepaint(editor); + ME_SendRequestResize(editor, FALSE); return TRUE; } if (ME_ArrowLeft(editor, p)) { @@ -1105,6 +1106,7 @@ ME_MoveCaret(editor); ME_DeleteTextAtCursor(editor, nCursor, 1); ME_UpdateRepaint(editor); + ME_SendRequestResize(editor, FALSE); } return TRUE; } @@ -1117,11 +1119,13 @@ ME_DeleteSelection(editor); ME_ClearTempStyle(editor); ME_UpdateRepaint(editor); + ME_SendRequestResize(editor, FALSE); return TRUE; } ME_DeleteTextAtCursor(editor, nCursor, 1); ME_ClearTempStyle(editor); ME_UpdateRepaint(editor); + ME_SendRequestResize(editor, FALSE); return TRUE; } case VK_HOME: { _____ Modified: trunk/reactos/lib/riched20/editor.c --- trunk/reactos/lib/riched20/editor.c 2005-11-17 21:56:58 UTC (rev 19314) +++ trunk/reactos/lib/riched20/editor.c 2005-11-17 21:58:13 UTC (rev 19315) @@ -83,7 +83,7 @@ - EM_PASTESPECIAL + EM_POSFROMCHAR + EM_REDO 2.0 - - EM_REQUESTRESIZE + + EM_REQUESTRESIZE + EM_REPLACESEL (proper style?) ANSI&Unicode - EM_SCROLL - EM_SCROLLCARET @@ -153,7 +153,7 @@ - EN_MSGFILTER - EN_OLEOPFAILED - EN_PROTECTED - - EN_REQUESTRESIZE + + EN_REQUESTRESIZE - EN_SAVECLIPBOARD + EN_SELCHANGE + EN_SETFOCUS @@ -633,6 +633,7 @@ } ME_MoveCaret(editor); ME_SendSelChange(editor); + ME_SendRequestResize(editor, FALSE); return 0; } @@ -820,6 +821,7 @@ ed->nUDArrowX = -1; ed->nSequence = 0; ed->rgbBackColor = -1; + ed->hbrBackground = GetSysColorBrush(COLOR_WINDOW); ed->bCaretAtEnd = FALSE; ed->nEventMask = 0; ed->nModifyStep = 0; @@ -925,7 +927,8 @@ if (editor->pFontCache[i].hFont) DeleteObject(editor->pFontCache[i].hFont); } - + DeleteObject(editor->hbrBackground); + FREE_OBJ(editor); } @@ -1134,7 +1137,6 @@ UNSUPPORTED_MSG(EM_HIDESELECTION) UNSUPPORTED_MSG(EM_LIMITTEXT) /* also known as EM_SETLIMITTEXT */ UNSUPPORTED_MSG(EM_PASTESPECIAL) - UNSUPPORTED_MSG(EM_REQUESTRESIZE) UNSUPPORTED_MSG(EM_SCROLL) UNSUPPORTED_MSG(EM_SCROLLCARET) UNSUPPORTED_MSG(EM_SELECTIONTYPE) @@ -1265,10 +1267,18 @@ case EM_SETBKGNDCOLOR: { LRESULT lColor = ME_GetBackColor(editor); + if (editor->rgbBackColor != -1) + DeleteObject(editor->hbrBackground); if (wParam) + { editor->rgbBackColor = -1; + editor->hbrBackground = GetSysColorBrush(COLOR_WINDOW); + } else + { editor->rgbBackColor = lParam; + editor->hbrBackground = CreateSolidBrush(editor->rgbBackColor); + } if (editor->bRedraw) { InvalidateRect(hWnd, NULL, TRUE); @@ -1792,12 +1802,9 @@ { HDC hDC = (HDC)wParam; RECT rc; - COLORREF rgbBG = ME_GetBackColor(editor); if (GetUpdateRect(hWnd,&rc,TRUE)) { - HBRUSH hbr = CreateSolidBrush(rgbBG); - FillRect(hDC, &rc, hbr); - DeleteObject(hbr); + FillRect(hDC, &rc, editor->hbrBackground); } } return 1; @@ -1974,6 +1981,9 @@ ME_RewrapRepaint(editor); return 0; } + case EM_REQUESTRESIZE: + ME_SendRequestResize(editor, TRUE); + return 0; case WM_SETREDRAW: editor->bRedraw = wParam; return 0; _____ Modified: trunk/reactos/lib/riched20/editor.h --- trunk/reactos/lib/riched20/editor.h 2005-11-17 21:56:58 UTC (rev 19314) +++ trunk/reactos/lib/riched20/editor.h 2005-11-17 21:58:13 UTC (rev 19315) @@ -173,6 +173,7 @@ void ME_InsertRowStart(ME_WrapContext *wc, ME_DisplayItem *pEnd); void ME_WrapTextParagraph(ME_Context *c, ME_DisplayItem *tp); BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor); +void ME_SendRequestResize(ME_TextEditor *editor, BOOL force); /* para.c */ ME_DisplayItem *ME_GetParagraph(ME_DisplayItem *run); _____ Modified: trunk/reactos/lib/riched20/editstr.h --- trunk/reactos/lib/riched20/editstr.h 2005-11-17 21:56:58 UTC (rev 19314) +++ trunk/reactos/lib/riched20/editstr.h 2005-11-17 21:58:13 UTC (rev 19315) @@ -270,6 +270,7 @@ int nSequence; int nOldSelFrom, nOldSelTo; COLORREF rgbBackColor; + HBRUSH hbrBackground; BOOL bCaretAtEnd; int nEventMask; int nModifyStep; _____ Modified: trunk/reactos/lib/riched20/paint.c --- trunk/reactos/lib/riched20/paint.c 2005-11-17 21:56:58 UTC (rev 19314) +++ trunk/reactos/lib/riched20/paint.c 2005-11-17 21:58:13 UTC (rev 19315) @@ -78,18 +78,17 @@ } if (ye>ys) { - HBRUSH hbr; - hbr = CreateSolidBrush(ME_GetBackColor(c.editor)); rc.left = xs; rc.top = ys; rc.right = xe; rc.bottom = ye; - FillRect(hDC, &rc, hbr); - DeleteObject(hbr); + FillRect(hDC, &rc, c.editor->hbrBackground); } if (ys == c.pt.y) /* don't overwrite the top bar */ ys++; } + if (editor->nTotalLength != editor->nLastTotalLength) + ME_SendRequestResize(editor, FALSE); editor->nLastTotalLength = editor->nTotalLength; ME_DestroyContext(&c); } _____ Modified: trunk/reactos/lib/riched20/reader.c --- trunk/reactos/lib/riched20/reader.c 2005-11-17 21:56:58 UTC (rev 19314) +++ trunk/reactos/lib/riched20/reader.c 2005-11-17 21:58:13 UTC (rev 19315) @@ -219,7 +219,7 @@ info->rtfTextBuf = RTFAlloc (rtfBufSiz); info->pushedTextBuf = RTFAlloc (rtfBufSiz); if (info->rtfTextBuf == NULL || info->pushedTextBuf == NULL) - RTFPanic (info,"Cannot allocate text buffers."); + ERR ("Cannot allocate text buffers."); info->rtfTextBuf[0] = info->pushedTextBuf[0] = '\0'; } @@ -283,7 +283,7 @@ info->inputName = RTFStrSave (name); if (info->inputName == NULL) - RTFPanic (info,"RTFSetInputName: out of memory"); + ERR ("RTFSetInputName: out of memory"); } @@ -299,7 +299,7 @@ info->outputName = RTFStrSave (name); if (info->outputName == NULL) - RTFPanic (info, "RTFSetOutputName: out of memory"); + ERR ("RTFSetOutputName: out of memory"); } @@ -388,7 +388,7 @@ if (info->rtfClass < 0 || info->rtfClass >= rtfMaxClass) /* watchdog */ { - RTFPanic (info,"Unknown class %d: %s (reader malfunction)", + ERR( "Unknown class %d: %s (reader malfunction)", info->rtfClass, info->rtfTextBuf); } if (RTFCheckCM (info, rtfControl, rtfDestination)) @@ -490,9 +490,9 @@ TRACE("\n"); if (info->pushedClass >= 0) /* there's already an ungotten token */ - RTFPanic (info,"cannot unget two tokens"); + ERR ("cannot unget two tokens"); if (info->rtfClass < 0) - RTFPanic (info,"no token to unget"); + ERR ("no token to unget"); info->pushedClass = info->rtfClass; info->pushedMajor = info->rtfMajor; info->pushedMinor = info->rtfMinor; @@ -600,7 +600,7 @@ /* FIXME: TranslateCharsetInfo does not work as good as it * should, so let's use it only when all else fails */ if (!TranslateCharsetInfo(&n, &csi, TCI_SRCCHARSET)) - RTFMsg(info, "%s: unknown charset %u\n", __FUNCTION__, charset); + ERR("%s: unknown charset %u\n", __FUNCTION__, charset); else return csi.ciACP; } @@ -893,19 +893,19 @@ else if (RTFCheckCM (info, rtfGroup, rtfBeginGroup)) old = 0; /* brace */ else /* can't tell! */ - RTFPanic (info, "%s: Cannot determine format", fn); + ERR ( "%s: Cannot determine format", fn); } if (old == 0) /* need to find "{" here */ { if (!RTFCheckCM (info, rtfGroup, rtfBeginGroup)) - RTFPanic (info, "%s: missing \"{\"", fn); + ERR ( "%s: missing \"{\"", fn); RTFGetToken (info); /* yes, skip to next token */ if (info->rtfClass == rtfEOF) break; } fp = New (RTFFont); if (fp == NULL) - RTFPanic (info, "%s: cannot allocate font entry", fn); + ERR ( "%s: cannot allocate font entry", fn); fp->rtfNextFont = info->fontList; info->fontList = fp; @@ -929,8 +929,8 @@ { default: /* ignore token but announce it */ - RTFMsg (info,"%s: unknown token \"%s\"\n", - fn, info->rtfTextBuf); + ERR ("%s: unknown token \"%s\"\n", + fn, info->rtfTextBuf); break; case rtfFontFamily: fp->rtfFFamily = info->rtfMinor; @@ -991,7 +991,7 @@ *bp = '\0'; fp->rtfFName = RTFStrSave (buf); if (fp->rtfFName == NULL) - RTFPanic (info, "%s: cannot allocate font name", fn); + ERR ( "%s: cannot allocate font name", fn); /* already have next token; don't read one */ /* at bottom of loop */ continue; @@ -999,7 +999,7 @@ else { /* ignore token but announce it */ - RTFMsg (info, "%s: unknown token \"%s\"\n", + ERR ( "%s: unknown token \"%s\"\n", fn,info->rtfTextBuf); } RTFGetToken (info); @@ -1012,7 +1012,7 @@ { RTFGetToken (info); if (!RTFCheckCM (info, rtfGroup, rtfEndGroup)) - RTFPanic (info, "%s: missing \"}\"", fn); + ERR ( "%s: missing \"}\"", fn); if (info->rtfClass == rtfEOF) break; } @@ -1026,7 +1026,7 @@ } } if (fp->rtfFNum == -1) - RTFPanic (info,"%s: missing font number", fn); + ERR( "%s: missing font number", fn); /* * Could check other pieces of structure here, too, I suppose. */ @@ -1068,7 +1068,7 @@ break; cp = New (RTFColor); if (cp == NULL) - RTFPanic (info,"%s: cannot allocate color entry", fn); + ERR ( "%s: cannot allocate color entry", fn); cp->rtfCNum = cnum++; cp->rtfCRed = cp->rtfCGreen = cp->rtfCBlue = -1; cp->rtfNextColor = info->colorList; @@ -1086,7 +1086,7 @@ if (info->rtfClass == rtfEOF) break; if (!RTFCheckCM (info, rtfText, ';')) - RTFPanic (info,"%s: malformed entry", fn); + ERR ("%s: malformed entry", fn); } RTFRouteToken (info); /* feed "}" back to router */ } @@ -1116,7 +1116,7 @@ break; sp = New (RTFStyle); if (sp == NULL) - RTFPanic (info,"%s: cannot allocate stylesheet entry", fn); + ERR ( "%s: cannot allocate stylesheet entry", fn); sp->rtfSName = NULL; sp->rtfSNum = -1; sp->rtfSType = rtfParStyle; @@ -1128,7 +1128,7 @@ sp->rtfExpanding = 0; info->styleList = sp; if (!RTFCheckCM (info, rtfGroup, rtfBeginGroup)) - RTFPanic (info,"%s: missing \"{\"", fn); + ERR ( "%s: missing \"{\"", fn); real_style = TRUE; for (;;) { @@ -1140,7 +1140,7 @@ { if (RTFCheckMM (info, rtfSpecialChar, rtfOptDest)) { RTFGetToken(info); - RTFPanic(info, "%s: skipping optional destination", fn); + ERR( "%s: skipping optional destination", fn); RTFSkipGroup(info); info->rtfClass = rtfGroup; info->rtfMajor = rtfEndGroup; @@ -1182,14 +1182,14 @@ } sep = New (RTFStyleElt); if (sep == NULL) - RTFPanic (info,"%s: cannot allocate style element", fn); + ERR ( "%s: cannot allocate style element", fn); sep->rtfSEClass = info->rtfClass; sep->rtfSEMajor = info->rtfMajor; sep->rtfSEMinor = info->rtfMinor; sep->rtfSEParam = info->rtfParam; sep->rtfSEText = RTFStrSave (info->rtfTextBuf); if (sep->rtfSEText == NULL) - RTFPanic (info,"%s: cannot allocate style element text", fn); + ERR ( "%s: cannot allocate style element text", fn); if (sepLast == NULL) sp->rtfSSEList = sep; /* first element */ else /* add to end */ @@ -1203,7 +1203,7 @@ * This passes over "{\*\keycode ... }, among * other things. A temporary (perhaps) hack. */ - RTFPanic(info, "%s: skipping begin", fn); + ERR( "%s: skipping begin", fn); RTFSkipGroup (info); continue; } @@ -1224,19 +1224,19 @@ *bp = '\0'; sp->rtfSName = RTFStrSave (buf); if (sp->rtfSName == NULL) - RTFPanic (info, "%s: cannot allocate style name", fn); + ERR ( "%s: cannot allocate style name", fn); } else /* unrecognized */ { /* ignore token but announce it */ - RTFMsg (info, "%s: unknown token \"%s\"\n", + ERR ( "%s: unknown token \"%s\"\n", fn, info->rtfTextBuf); } } if (real_style) { RTFGetToken (info); if (!RTFCheckCM (info, rtfGroup, rtfEndGroup)) - RTFPanic (info, "%s: missing \"}\"", fn); + ERR ( "%s: missing \"}\"", fn); /* * Check over the style structure. A name is a must. * If no style number was specified, check whether it's the @@ -1248,12 +1248,12 @@ * Some German RTF writers use "Standard" instead of "Normal". */ if (sp->rtfSName == NULL) - RTFPanic (info,"%s: missing style name", fn); + ERR ( "%s: missing style name", fn); if (sp->rtfSNum < 0) { if (strncmp (buf, "Normal", 6) != 0 && strncmp (buf, "Standard", 8) != 0) - RTFPanic (info,"%s: missing style number", fn); + ERR ( "%s: missing style number", fn); sp->rtfSNum = rtfNormalStyleNum; } if (sp->rtfSNextPar == -1) /* if \snext not given, */ @@ -1359,7 +1359,7 @@ if (s == NULL) return; if (s->rtfExpanding != 0) - RTFPanic (info,"Style expansion loop, style %d", n); + ERR ("Style expansion loop, style %d", n); s->rtfExpanding = 1; /* set expansion flag for loop detection */ /* * Expand "based-on" style (unless it's the same as the current @@ -2446,63 +2446,6 @@ /* ---------------------------------------------------------------------- */ /* - * Print message. - * - * Message should include linefeeds as necessary. - */ - - -void RTFMsg (RTF_Info *info, const char *fmt, ...) -{ - char buf[rtfBufSiz]; - - va_list args; - va_start (args,fmt); - vsprintf (buf, fmt, args); - va_end (args); - MESSAGE( "%s", buf); -} - - -/* ---------------------------------------------------------------------- */ - - -/* - * Process termination. Print error message and exit. Also prints - * current token, and current input line number and position within - * line if any input has been read from the current file. (No input - * has been read if prevChar is EOF). - */ - -static void DefaultPanicProc(RTF_Info *info, char *s) -{ - MESSAGE( "%s", s); - /*exit (1);*/ -} - - - -void RTFPanic(RTF_Info *info, const char *fmt, ...) -{ - char buf[rtfBufSiz]; - - va_list args; - va_start (args,fmt); - vsprintf (buf, fmt, args); - va_end (args); - lstrcatA (buf, "\n"); - if (info->prevChar != EOF && info->rtfTextBuf != NULL) - { - sprintf (buf + lstrlenA (buf), - "Last token read was \"%s\" near line %ld, position %d.\n", - info->rtfTextBuf, info->rtfLineNum, info->rtfLinePos); - } - DefaultPanicProc(info, buf); -} - -/* ---------------------------------------------------------------------- */ - -/* * originally from RTF tools' text-writer.c * * text-writer -- RTF-to-text translation writer code. @@ -2594,7 +2537,7 @@ TRACE("font %d codepage %d\n", info->rtfParam, info->codePage); } else - RTFMsg(info, "unknown font %d\n", info->rtfParam); + ERR( "unknown font %d\n", info->rtfParam); break; case rtfUnicodeLength: info->unicodeLength = info->rtfParam; _____ Modified: trunk/reactos/lib/riched20/rtf.h --- trunk/reactos/lib/riched20/rtf.h 2005-11-17 21:56:58 UTC (rev 19314) +++ trunk/reactos/lib/riched20/rtf.h 2005-11-17 21:58:13 UTC (rev 19315) @@ -1093,8 +1093,6 @@ RTFFuncPtr readHook; - RTFFuncPtr panicProc; - DWORD dwOutputCount; WCHAR OutputBuffer[0x1000]; @@ -1140,19 +1138,7 @@ RTFStyle *RTFGetStyle (RTF_Info *, int); int RTFCharToHex ( char); int RTFHexToChar ( int ); -void RTFSetMsgProc ( RTFFuncPtr ); -void RTFSetPanicProc ( RTF_Info *, RTFFuncPtr); -/* - * The following messing around is used to allow RTFMsg() and RTFPanic() - * to be variable-argument functions that are declared publicly but - * without generating prototype-mismatch errors on systems that have - * stdarg.h. - */ - -void RTFMsg (RTF_Info *, const char *fmt, ...); -void RTFPanic (RTF_Info *, const char *fmt, ...); - void RTFFlushOutputBuffer( RTF_Info *info ); void RTFSetEditStream(RTF_Info *info, ME_InStream *stream); _____ Modified: trunk/reactos/lib/riched20/wrap.c --- trunk/reactos/lib/riched20/wrap.c 2005-11-17 21:56:58 UTC (rev 19314) +++ trunk/reactos/lib/riched20/wrap.c 2005-11-17 21:58:13 UTC (rev 19315) @@ -448,9 +448,36 @@ } editor->sizeWindow.cx = c.rcView.right-c.rcView.left; editor->sizeWindow.cy = c.rcView.bottom-c.rcView.top; + editor->nTotalLength = c.pt.y; ME_DestroyContext(&c); ReleaseDC(hWnd, hDC); return bModified; } + + +void +ME_SendRequestResize(ME_TextEditor *editor, BOOL force) +{ + if (editor->nEventMask & ENM_REQUESTRESIZE) + { + RECT rc; + + GetClientRect(editor->hWnd, &rc); + + if (force || rc.bottom != editor->nTotalLength) + { + REQRESIZE info; + + info.nmhdr.hwndFrom = editor->hWnd; + info.nmhdr.idFrom = GetWindowLongW(editor->hWnd, GWLP_ID); + info.nmhdr.code = EN_REQUESTRESIZE; + info.rc = rc; + info.rc.bottom = editor->nTotalLength; + + SendMessageW(GetParent(editor->hWnd), WM_NOTIFY, + info.nmhdr.idFrom, (LPARAM)&info); + } + } +}
19 years, 1 month
1
0
0
0
[gvg] 19314: Francois Gouget <fgouget@free.fr>
by gvg@svn.reactos.com
Francois Gouget <fgouget(a)free.fr> Remove spaces before '\n' in traces. Modified: trunk/reactos/lib/olepro32/olepro32stubs.c _____ Modified: trunk/reactos/lib/olepro32/olepro32stubs.c --- trunk/reactos/lib/olepro32/olepro32stubs.c 2005-11-17 21:52:13 UTC (rev 19313) +++ trunk/reactos/lib/olepro32/olepro32stubs.c 2005-11-17 21:56:58 UTC (rev 19314) @@ -36,7 +36,7 @@ */ HRESULT WINAPI DllUnregisterServer() { - FIXME("not implemented (olepro32.dll) \n"); + FIXME("not implemented (olepro32.dll)\n"); return S_OK; } @@ -45,7 +45,7 @@ */ HRESULT WINAPI DllRegisterServer() { - FIXME("not implemented (olepro32.dll) \n"); + FIXME("not implemented (olepro32.dll)\n"); return S_OK; } @@ -54,7 +54,7 @@ */ HRESULT WINAPI DllCanUnloadNow(void) { - FIXME("not implemented (olepro32.dll) \n"); + FIXME("not implemented (olepro32.dll)\n"); return S_OK; } @@ -63,6 +63,6 @@ */ HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID riid, LPVOID* ppv ) { - FIXME("not implemented (olepro32.dll) \n"); + FIXME("not implemented (olepro32.dll)\n"); return S_OK; }
19 years, 1 month
1
0
0
0
[gvg] 19313: Sync to Wine-0_9_1:
by gvg@svn.reactos.com
Sync to Wine-0_9_1: Huw Davies <huw(a)codeweavers.com> - Treat paramflags == 0 like PARAMFLAG_FIN. - Don't call Release on a null ptr. - Deal with pExcepInfo == NULL. Robert Shearman <rob(a)codeweavers.com> - Add IFontEventsDisp and IProvideMultipleClassInfo. - Make sure to clean up properly on error. - Restrict the critical section to getting the channel buffer and adding a reference to it. - There is no need to call IUnknown_QueryInterface since getting the correct object is handled by the proxy manager. - Forward IDispatch functions to the MIDL-generated proxy. - Remove special cases caused by previous marshaling of IDispatch & IUnknown that is no longer done. - Add error messages if an IUnknown or IDispatch method is called when it no longer should be. - Cleanup formating of DispCallFunc. - Fix DispCallFunc for functions with return values. - Don't rely on _copy_arg as it is going away soon. - Make wParamFlags in the paramdesc dumping function human readable. - Enums should be VT_I4 instead of VT_INT. - Trace the return value from the ITypeInfo_fnInvoke. - Read DLL name from modules in MSFT typelibs. - A name offset of -1 for a parameter means that it has the same name as the function. - Print an error if a ReadName is attempted with an offset of -1, since this will read garbage. - Implement ITypeInfo_GetDllEntry. - Fix a crash during +variant logging caused by a typo causing an array to be one element less than expected. - The PSDispatch PS class factory can manage both typelib marshalled and IDispatch, which is NDR marshalled, so we need a wrapper to call the appropriate CreateProxy or CreateStub function. Alex Villacís Lasso <a_villacis(a)palosanto.com> - Implement complete VarDecDiv() for any valid DECIMAL. - Implement complete VarDecMul() for any valid DECIMAL. - Implement complete VarBstrFromDec() for any valid DECIMAL, with internationalization support borrowed from VARIANT_BstrFromReal(). The decimal fix for VARIANT_BstrFromReal was encapsulated in a separate function and reused. Michael Stefaniuc <mstefani(a)redhat.de> - Handle VT_DECIMAL in VarCmp(). - Handle VT_CY in VarDiv(). Uwe Bonnes <bon(a)elektron.ikp.physik.tu-darmstadt.de> - Extend VarCmp() and add test cases. Marcus Meissner <marcus(a)jet.franken.de> - Added support of loading of IPicture data from non-statable IStreams. Added testcases for this. - Added support for VT_I8/VT_UI8 marshalling. - Fixed FMT_DATE_GENERAL and FMT_DATE_TIME_SYS cases in VARIANT_FormatDate. Modified: trunk/reactos/include/wine/ocidl.h Modified: trunk/reactos/lib/oleaut32/oleaut.c Modified: trunk/reactos/lib/oleaut32/oleaut32.rc Added: trunk/reactos/lib/oleaut32/oleaut32_Ko.rc Modified: trunk/reactos/lib/oleaut32/olepicture.c Modified: trunk/reactos/lib/oleaut32/regsvr.c Modified: trunk/reactos/lib/oleaut32/tmarshal.c Modified: trunk/reactos/lib/oleaut32/typelib.c Modified: trunk/reactos/lib/oleaut32/typelib.h Modified: trunk/reactos/lib/oleaut32/usrmarshal.c Modified: trunk/reactos/lib/oleaut32/varformat.c Modified: trunk/reactos/lib/oleaut32/variant.c Modified: trunk/reactos/lib/oleaut32/vartype.c Modified: trunk/reactos/w32api/include/oaidl.h _____ Modified: trunk/reactos/include/wine/ocidl.h --- trunk/reactos/include/wine/ocidl.h 2005-11-17 21:35:56 UTC (rev 19312) +++ trunk/reactos/include/wine/ocidl.h 2005-11-17 21:52:13 UTC (rev 19313) @@ -5,6 +5,7 @@ DEFINE_GUID(IID_IFont, 0xbef6e002, 0xa874, 0x101a, 0x8b,0xba, 0x00,0xaa,0x00,0x30,0x0c,0xab); DEFINE_GUID(IID_IFontDisp, 0xbef6e003, 0xa874, 0x101a, 0x8b,0xba, 0x00,0xaa,0x00,0x30,0x0c,0xab); +DEFINE_GUID(IID_IFontEventsDisp, 0x4ef6100a, 0xaf88, 0x11d0, 0x98,0x46, 0x00,0xc0,0x4f,0xc2,0x99,0x93); DEFINE_GUID(IID_IPicture, 0x7bf80980, 0xbf32, 0x101a, 0x8b,0xbb, 0x00,0xaa,0x00,0x30,0x0c,0xab); DEFINE_GUID(IID_IPictureDisp, 0x7bf80981, 0xbf32, 0x101a, 0x8b,0xbb, 0x00,0xaa,0x00,0x30,0x0c,0xab); DEFINE_GUID(IID_IOleControl, 0xb196b288, 0xbab4, 0x101a, 0xb6,0x9c, 0x00,0xaa,0x00,0x34,0x1d,0x07); @@ -16,6 +17,7 @@ DEFINE_GUID(IID_IViewObjectEx, 0x3af24292, 0x0c96, 0x11ce, 0xa0,0xcf, 0x00,0xaa,0x00,0x60,0x0a,0xb8); DEFINE_GUID(IID_IProvideClassInfo, 0xb196b283, 0xbab4, 0x101a, 0xb6,0x9c, 0x00,0xaa,0x00,0x34,0x1d,0x07); DEFINE_GUID(IID_IProvideClassInfo2, 0xa6bc3ac0, 0xdbaa, 0x11ce, 0x9d,0xe3, 0x00,0xaa,0x00,0x4b,0xb8,0x51); +DEFINE_GUID(IID_IProvideMultipleClassInfo, 0xa7aba9c1, 0x8983, 0x11cf, 0x8f,0x20, 0x00,0x80,0x5f,0x2c,0xd0,0x64); DEFINE_GUID(IID_IConnectionPoint, 0xb196b286, 0xbab4, 0x101a, 0xb6,0x9c, 0x00,0xaa,0x00,0x34,0x1d,0x07); DEFINE_GUID(IID_IConnectionPointContainer, 0xb196b284, 0xbab4, 0x101a, 0xb6,0x9c, 0x00,0xaa,0x00,0x34,0x1d,0x07); DEFINE_GUID(IID_IEnumConnections, 0xb196b287, 0xbab4, 0x101a, 0xb6,0x9c, 0x00,0xaa,0x00,0x34,0x1d,0x07); _____ Modified: trunk/reactos/lib/oleaut32/oleaut.c --- trunk/reactos/lib/oleaut32/oleaut.c 2005-11-17 21:35:56 UTC (rev 19312) +++ trunk/reactos/lib/oleaut32/oleaut.c 2005-11-17 21:52:13 UTC (rev 19313) @@ -699,6 +699,76 @@ extern void _get_STDFONT_CF(LPVOID); extern void _get_STDPIC_CF(LPVOID); +static HRESULT WINAPI PSDispatchFacBuf_QueryInterface(IPSFactoryBuffer *iface, REFIID riid, void **ppv) +{ + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IPSFactoryBuffer)) + { + IUnknown_AddRef(iface); + *ppv = (void *)iface; + return S_OK; + } + return E_NOINTERFACE; +} + +static ULONG WINAPI PSDispatchFacBuf_AddRef(IPSFactoryBuffer *iface) +{ + return 2; +} + +static ULONG WINAPI PSDispatchFacBuf_Release(IPSFactoryBuffer *iface) +{ + return 1; +} + +static HRESULT WINAPI PSDispatchFacBuf_CreateProxy(IPSFactoryBuffer *iface, IUnknown *pUnkOuter, REFIID riid, IRpcProxyBuffer **ppProxy, void **ppv) +{ + IPSFactoryBuffer *pPSFB; + HRESULT hr; + + if (IsEqualIID(riid, &IID_IDispatch)) + hr = OLEAUTPS_DllGetClassObject(&CLSID_PSDispatch, &IID_IPSFactoryBuffer, (void **)&pPSFB); + else + hr = TMARSHAL_DllGetClassObject(&CLSID_PSOAInterface, &IID_IPSFactoryBuffer, (void **)&pPSFB); + + if (FAILED(hr)) return hr; + + hr = IPSFactoryBuffer_CreateProxy(pPSFB, pUnkOuter, riid, ppProxy, ppv); + + IPSFactoryBuffer_Release(pPSFB); + return hr; +} + +static HRESULT WINAPI PSDispatchFacBuf_CreateStub(IPSFactoryBuffer *iface, REFIID riid, IUnknown *pUnkOuter, IRpcStubBuffer **ppStub) +{ + IPSFactoryBuffer *pPSFB; + HRESULT hr; + + if (IsEqualIID(riid, &IID_IDispatch)) + hr = OLEAUTPS_DllGetClassObject(&CLSID_PSDispatch, &IID_IPSFactoryBuffer, (void **)&pPSFB); + else + hr = TMARSHAL_DllGetClassObject(&CLSID_PSOAInterface, &IID_IPSFactoryBuffer, (void **)&pPSFB); + + if (FAILED(hr)) return hr; + + hr = IPSFactoryBuffer_CreateStub(pPSFB, riid, pUnkOuter, ppStub); + + IPSFactoryBuffer_Release(pPSFB); + return hr; +} + +static const IPSFactoryBufferVtbl PSDispatchFacBuf_Vtbl = +{ + PSDispatchFacBuf_QueryInterface, + PSDispatchFacBuf_AddRef, + PSDispatchFacBuf_Release, + PSDispatchFacBuf_CreateProxy, + PSDispatchFacBuf_CreateStub +}; + +/* This is the whole PSFactoryBuffer object, just the vtableptr */ +static const IPSFactoryBufferVtbl *pPSDispatchFacBuf = &PSDispatchFacBuf_Vtbl; + /*********************************************************************** * DllGetClassObject (OLEAUT32.@) */ @@ -719,12 +789,16 @@ return S_OK; } } - if (IsEqualCLSID(rclsid, &CLSID_PSDispatch) || - IsEqualCLSID(rclsid, &CLSID_PSTypeInfo) || + if (IsEqualCLSID(rclsid, &CLSID_PSTypeInfo) || IsEqualCLSID(rclsid, &CLSID_PSTypeLib) || IsEqualCLSID(rclsid, &CLSID_PSEnumVariant)) { return OLEAUTPS_DllGetClassObject(&CLSID_PSDispatch, iid, ppv); } + if (IsEqualCLSID(rclsid, &CLSID_PSDispatch) && IsEqualIID(iid, &IID_IPSFactoryBuffer)) { + *ppv = &pPSDispatchFacBuf; + IPSFactoryBuffer_AddRef((IPSFactoryBuffer *)*ppv); + return S_OK; + } if (IsEqualGUID(rclsid,&CLSID_PSOAInterface)) { if (S_OK==TMARSHAL_DllGetClassObject(rclsid,iid,ppv)) return S_OK; _____ Modified: trunk/reactos/lib/oleaut32/oleaut32.rc --- trunk/reactos/lib/oleaut32/oleaut32.rc 2005-11-17 21:35:56 UTC (rev 19312) +++ trunk/reactos/lib/oleaut32/oleaut32.rc 2005-11-17 21:52:13 UTC (rev 19313) @@ -34,6 +34,7 @@ #include "oleaut32_Hu.rc" #include "oleaut32_It.rc" #include "oleaut32_Ja.rc" +#include "oleaut32_Ko.rc" #include "oleaut32_Nl.rc" #include "oleaut32_No.rc" #include "oleaut32_Pl.rc" _____ Copied: trunk/reactos/lib/oleaut32/oleaut32_Ko.rc (from rev 19311, vendor/wine/dlls/oleaut32/current/oleaut32_Ko.rc) Property changes on: trunk/reactos/lib/oleaut32/oleaut32_Ko.rc ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____ Modified: trunk/reactos/lib/oleaut32/olepicture.c --- trunk/reactos/lib/oleaut32/olepicture.c 2005-11-17 21:35:56 UTC (rev 19312) +++ trunk/reactos/lib/oleaut32/olepicture.c 2005-11-17 21:52:13 UTC (rev 19313) @@ -1056,6 +1056,7 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) { HRESULT hr = E_FAIL; BOOL headerisdata = FALSE; + BOOL statfailed = FALSE; ULONG xread, toread; BYTE *xbuf; DWORD header[2]; @@ -1065,19 +1066,29 @@ TRACE("(%p,%p)\n",This,pStm); + /*********************************************************************** ***************** + * Part 1: Load the data + */ /* Sometimes we have a header, sometimes we don't. Apply some guesses to find * out whether we do. * * UPDATE: the IStream can be mapped to a plain file instead of a stream in a - * compound file. This may explain most, if not all, of the cases of "no header", - * and the header validation should take this into account. At least in Visual Basic 6, - * resource streams, valid headers are + * compound file. This may explain most, if not all, of the cases of "no + * header", and the header validation should take this into account. + * At least in Visual Basic 6, resource streams, valid headers are * header[0] == "lt\0\0", * header[1] == length_of_stream. + * + * Also handle streams where we do not have a working "Stat" method by + * reading all data until the end of the stream. */ hr=IStream_Stat(pStm,&statstg,STATFLAG_NONAME); - if (hr) - FIXME("Stat failed with hres %lx\n",hr); + if (hr) { + TRACE("stat failed with hres %lx, proceeding to read all data.\n",hr); + statfailed = TRUE; + /* we will read at least 8 byte ... just right below */ + statstg.cbSize.QuadPart = 8; + } hr=IStream_Read(pStm,header,8,&xread); if (hr || xread!=8) { FIXME("Failure while reading picture header (hr is %lx, nread is %ld).\n",hr,xread); @@ -1089,42 +1100,77 @@ if (!memcmp(&(header[0]),"lt\0\0", 4) && (header[1] <= statstg.cbSize.QuadPart-8)) { toread = header[1]; } else { - if (!memcmp(&(header[0]), "GIF8", 4) || /* GIF header */ - !memcmp(&(header[0]), "BM", 2) || /* BMP header */ - !memcmp(&(header[0]), "\xff\xd8", 2) || /* JPEG header */ - (header[1] > statstg.cbSize.QuadPart) || /* invalid size */ - (header[1]==0) + if (!memcmp(&(header[0]), "GIF8", 4) || /* GIF header */ + !memcmp(&(header[0]), "BM", 2) || /* BMP header */ + !memcmp(&(header[0]), "\xff\xd8", 2) || /* JPEG header */ + (header[1] > statstg.cbSize.QuadPart)|| /* invalid size */ + (header[1]==0) ) {/* Incorrect header, assume none. */ headerisdata = TRUE; toread = statstg.cbSize.QuadPart-8; - xread = 8; + xread = 8; } else { - FIXME("Unknown stream header magic: %08lx\n", header[0]); + FIXME("Unknown stream header magic: %08lx\n", header[0]); toread = header[1]; } } - This->datalen = toread+(headerisdata?8:0); - xbuf = This->data = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, This->datalen); + if (statfailed) { /* we don't know the size ... read all we get */ + int sizeinc = 4096; + int origsize = sizeinc; + ULONG nread = 42; - if (headerisdata) - memcpy (xbuf, &header, 8); + TRACE("Reading all data from stream.\n"); + xbuf = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, origsize); + if (headerisdata) + memcpy (xbuf, &header, 8); + while (1) { + while (xread < origsize) { + hr = IStream_Read(pStm,xbuf+xread,origsize-xread,&nread); + xread+=nread; + if (hr || !nread) + break; + } + if (!nread || hr) /* done, or error */ + break; + if (xread == origsize) { + origsize += sizeinc; + sizeinc = 2*sizeinc; /* exponential increase */ + xbuf = HeapReAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, xbuf, origsize); + } + } + if (hr) + TRACE("hr in no-stat loader case is %08lx\n", hr); + TRACE("loaded %ld bytes.\n", xread); + This->datalen = xread; + This->data = xbuf; + } else { + This->datalen = toread+(headerisdata?8:0); + xbuf = This->data = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, This->datalen); - while (xread < This->datalen) { - ULONG nread; - hr = IStream_Read(pStm,xbuf+xread,This->datalen-xread,&nread); - xread+=nread; - if (hr || !nread) - break; + if (headerisdata) + memcpy (xbuf, &header, 8); + + while (xread < This->datalen) { + ULONG nread; + hr = IStream_Read(pStm,xbuf+xread,This->datalen-xread,&nread); + xread+=nread; + if (hr || !nread) + break; + } + if (xread != This->datalen) + FIXME("Could only read %ld of %d bytes out of stream?\n",xread,This->datalen); } - if (xread != This->datalen) - FIXME("Could only read %ld of %d bytes out of stream?\n",xread,This->datalen); - - if (This->datalen == 0) { /* Marks the "NONE" picture */ + if (This->datalen == 0) { /* Marks the "NONE" picture */ This->desc.picType = PICTYPE_NONE; return S_OK; } + + /*********************************************************************** ***************** + * Part 2: Process the loaded data + */ + magic = xbuf[0] + (xbuf[1]<<8); switch (magic) { case 0x4947: { /* GIF */ _____ Modified: trunk/reactos/lib/oleaut32/regsvr.c --- trunk/reactos/lib/oleaut32/regsvr.c 2005-11-17 21:35:56 UTC (rev 19312) +++ trunk/reactos/lib/oleaut32/regsvr.c 2005-11-17 21:52:13 UTC (rev 19313) @@ -544,15 +544,6 @@ /*********************************************************************** * interface list */ - -/* FIXME: these interfaces should be defined in ocidl.idl */ - -static IID const IID_IFontEventsDisp = { - 0x4EF6100A, 0xAF88, 0x11D0, {0x98,0x46,0x00,0xC0,0x4F,0xC2,0x99,0x93} }; - -static IID const IID_IProvideMultipleClassInfo = { - 0xA7ABA9C1, 0x8983, 0x11CF, {0x8F,0x20,0x00,0x80,0x5F,0x2C,0xD0,0x64} }; - static struct regsvr_interface const interface_list[] = { { &IID_IDispatch, "IDispatch", _____ Modified: trunk/reactos/lib/oleaut32/tmarshal.c --- trunk/reactos/lib/oleaut32/tmarshal.c 2005-11-17 21:35:56 UTC (rev 19312) +++ trunk/reactos/lib/oleaut32/tmarshal.c 2005-11-17 21:52:13 UTC (rev 19313) @@ -45,11 +45,7 @@ #include "typelib.h" #include "wine/debug.h" -static const WCHAR riidW[5] = {'r','i','i','d',0}; -static const WCHAR pdispparamsW[] = {'p','d','i','s','p','p','a','r','a','m','s',0}; -static const WCHAR ppvObjectW[] = {'p','p','v','O','b','j','e','c','t',0}; static const WCHAR IDispatchW[] = { 'I','D','i','s','p','a','t','c','h',0}; -static const WCHAR GetIDsOfNamesW[] = { 'G','e','t','I','D','s','O','f','N','a','m','e','s',0}; WINE_DEFAULT_DEBUG_CHANNEL(ole); WINE_DECLARE_DEBUG_CHANNEL(olerelay); @@ -60,9 +56,6 @@ LPBYTE base; int size; int curoff; - - BOOL thisisiid; - IID iid; /* HACK: for VT_VOID */ } marshal_state; /* used in the olerelay code to avoid having the L"" stuff added by debugstr_w */ @@ -360,6 +353,7 @@ IID iid; CRITICAL_SECTION crit; IUnknown *outerunknown; + IDispatch *dispatch; } TMProxyImpl; static HRESULT WINAPI @@ -396,6 +390,7 @@ if (!refCount) { + if (This->dispatch) IDispatch_Release(This->dispatch); DeleteCriticalSection(&This->crit); if (This->chanbuf) IRpcChannelBuffer_Release(This->chanbuf); VirtualFree(This->asmstubs, 0, MEM_RELEASE); @@ -450,6 +445,8 @@ int _argsize(DWORD vt) { switch (vt) { + case VT_UI8: + return 8/sizeof(DWORD); case VT_R8: return sizeof(double)/sizeof(DWORD); case VT_CY: @@ -478,6 +475,9 @@ arrsize *= adesc->rgbounds[i].cElements; return arrsize*_xsize(&adesc->tdescElem); } + case VT_UI8: + case VT_I8: + return 8; case VT_UI2: case VT_I2: return 2; @@ -506,6 +506,13 @@ switch (tdesc->vt) { case VT_EMPTY: /* nothing. empty variant for instance */ return S_OK; + case VT_I8: + case VT_UI8: + hres = S_OK; + if (debugout) TRACE_(olerelay)("%lx%lx",arg[0],arg[1]); + if (writeit) + hres = xbuf_add(buf,(LPBYTE)arg,8); + return hres; case VT_BOOL: case VT_ERROR: case VT_UINT: @@ -726,8 +733,6 @@ if (debugout && (i<(tattr->cVars-1))) TRACE_(olerelay)(","); } - if (buf->thisisiid && (tattr->cbSizeInstance==sizeof(GUID))) - memcpy(&(buf->iid),arg,sizeof(buf->iid)); if (debugout) TRACE_(olerelay)("}"); break; } @@ -773,296 +778,7 @@ } } -/* IDL desc: - * HRESULT GetIDsOfNames( - * [in] REFIID riid, args[1] - * [in, size_is(cNames)] LPOLESTR *rgszNames, args[2] - * [in] UINT cNames, args[3] - * [in] LCID lcid, args[4] - * [out, size_is(cNames)] DISPID *rgDispId); args[5] - * - * line format: - * IID iid; - * DWORD cNames; - * LPOLESTR rgszNames[cNames]; - * DWORD bytestrlen (incl 0) - * BYTE data[bytestrlen] (incl 0) - * LCID - */ static HRESULT -serialize_IDispatch_GetIDsOfNames( - BOOL inputparams, - BOOL debugout, - DWORD *args, - marshal_state *buf) -{ - HRESULT hres; - DWORD cNames = args[2]; - LPOLESTR *rgszNames = (LPOLESTR*)args[1]; - int i; - - if (inputparams) { - if (debugout) TRACE_(olerelay)("riid=%s,",debugstr_guid((REFIID)args[0])); - hres = xbuf_add(buf, (LPBYTE)args[0], sizeof(IID)); - if (hres) { - FIXME("serialize of IID failed.\n"); - return hres; - } - if (debugout) TRACE_(olerelay)("cNames=%ld,",cNames); - hres = xbuf_add(buf, (LPBYTE)&cNames, sizeof(DWORD)); - if (hres) { - FIXME("serialize of cNames failed.\n"); - return hres; - } - if (debugout) TRACE_(olerelay)("rgszNames=["); - for (i=0;i<cNames;i++) { - DWORD len = 2*(lstrlenW(rgszNames[i])+1); - - if (debugout) TRACE_(olerelay)("%s,",relaystr(rgszNames[i])); - hres = xbuf_add(buf, (LPBYTE)&len, sizeof(DWORD)); - if (hres) { - FIXME("serialize of len failed.\n"); - return hres; - } - hres = xbuf_add(buf, (LPBYTE)rgszNames[i], len); - if (hres) { - FIXME("serialize of rgszNames[i] failed.\n"); - return hres; - } - } - if (debugout) TRACE_(olerelay)("],lcid=%04lx)",args[3]); - hres = xbuf_add(buf, (LPBYTE)&args[3], sizeof(DWORD)); - if (hres) { - FIXME("serialize of lcid failed.\n"); - return hres; - } - } else { - DISPID *rgDispId = (DISPID*)args[4]; - - hres = xbuf_add(buf, (LPBYTE)rgDispId, sizeof(DISPID) * cNames); - if (hres) { - FIXME("serialize of rgDispId failed.\n"); - return hres; - } - if (debugout) { - TRACE_(olerelay)("riid=[in],rgszNames=[in],cNames=[in],rgDispId=["); - for (i=0;i<cNames;i++) - TRACE_(olerelay)("%08lx,",rgDispId[i]); - TRACE_(olerelay)("])"); - } - HeapFree(GetProcessHeap(),0,(IID*)args[0]); - rgszNames = (LPOLESTR*)args[1]; - for (i=0;i<cNames;i++) HeapFree(GetProcessHeap(),0,rgszNames[i]); - HeapFree(GetProcessHeap(),0,rgszNames); - HeapFree(GetProcessHeap(),0,rgDispId); - } - return S_OK; -} - -static HRESULT -deserialize_IDispatch_GetIDsOfNames( - BOOL inputparams, - BOOL debugout, - DWORD *args, - marshal_state *buf) -{ - HRESULT hres; - DWORD cNames; - LPOLESTR *rgszNames; - int i; - - if (inputparams) { - args[0] = (DWORD)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IID)); - if (!args[0]) return E_FAIL; - hres = xbuf_get(buf, (LPBYTE)args[0], sizeof(IID)); - if (hres) { - FIXME("deserialize of IID failed.\n"); - return hres; - } - if (debugout) TRACE_(olerelay)("riid=%s,",debugstr_guid((REFIID)args[0])); - - hres = xbuf_get(buf, (LPBYTE)&cNames, sizeof(DWORD)); - if (hres) { - FIXME("deserialize of cNames failed.\n"); - return hres; - } - args[2] = cNames; - if (debugout) TRACE_(olerelay)("cNames=%ld,",cNames); - if (debugout) TRACE_(olerelay)("rgszNames=["); - rgszNames = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(LPOLESTR) * cNames); - if (!rgszNames) return E_FAIL; - args[1] = (DWORD)rgszNames; - for (i=0;i<cNames;i++) { - DWORD len; - - hres = xbuf_get(buf, (LPBYTE)&len, sizeof(DWORD)); - if (hres) { - FIXME("serialize of len failed.\n"); - return hres; - } - rgszNames[i] = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); - if (!rgszNames[i]) { - FIXME("heapalloc of %ld bytes failed\n", len); - return E_FAIL; - } - hres = xbuf_get(buf, (LPBYTE)rgszNames[i], len); - if (hres) { - FIXME("serialize of rgszNames[i] failed.\n"); - return hres; - } - if (debugout) TRACE_(olerelay)("%s,",relaystr(rgszNames[i])); - } - hres = xbuf_get(buf, (LPBYTE)&args[3], sizeof(DWORD)); - if (hres) { - FIXME("deserialize of lcid failed.\n"); - return hres; - } - if (debugout) TRACE_(olerelay)("],lcid=%04lx,rgDispId=[out])",args[3]); - args[4] = (DWORD)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(DISPID) * cNames); - } else { - hres = xbuf_get(buf, (LPBYTE)args[4], sizeof(DISPID) * args[2]); - if (hres) { - FIXME("serialize of rgDispId failed.\n"); - return hres; - } - if (debugout) { - TRACE_(olerelay)("dispid=["); - for (i=0;i<args[2];i++) - TRACE_(olerelay)("%08lx,",((DISPID*)args[4])[i]); - TRACE_(olerelay)("])"); - } - } - return S_OK; -} - -static HRESULT -serialize_LPVOID_ptr( - ITypeInfo *tinfo, - BOOL writeit, - BOOL debugout, - BOOL dealloc, - TYPEDESC *tdesc, - DWORD *arg, - marshal_state *buf) -{ - HRESULT hres; - DWORD cookie; - - if ((tdesc->vt != VT_PTR) || - (tdesc->u.lptdesc->vt != VT_PTR) || - (tdesc->u.lptdesc->u.lptdesc->vt != VT_VOID) - ) { - FIXME("ppvObject not expressed as VT_PTR -> VT_PTR -> VT_VOID?\n"); - return E_FAIL; - } - cookie = (*(DWORD*)*arg) ? 0x42424242: 0x0; - if (writeit) { - hres = xbuf_add(buf, (LPVOID)&cookie, sizeof(cookie)); - if (hres) - return hres; - } - if (!*(DWORD*)*arg) { - if (debugout) TRACE_(olerelay)("<lpvoid NULL>"); - return S_OK; - } - if (debugout) - TRACE_(olerelay)("ppv(%p)",*(LPUNKNOWN*)*arg); - if (writeit) { - hres = _marshal_interface(buf,&(buf->iid),*(LPUNKNOWN*)*arg); - if (hres) - return hres; - } - if (dealloc) - HeapFree(GetProcessHeap(),0,(LPVOID)*arg); - return S_OK; -} - -static HRESULT -serialize_DISPPARAM_ptr( - ITypeInfo *tinfo, - BOOL writeit, - BOOL debugout, - BOOL dealloc, - TYPEDESC *tdesc, - DWORD *arg, - marshal_state *buf) -{ - DWORD cookie; - HRESULT hres; - DISPPARAMS *disp; - int i; - - if ((tdesc->vt != VT_PTR) || (tdesc->u.lptdesc->vt != VT_USERDEFINED)) { - FIXME("DISPPARAMS not expressed as VT_PTR -> VT_USERDEFINED?\n"); - return E_FAIL; - } - - cookie = *arg ? 0x42424242 : 0x0; - if (writeit) { - hres = xbuf_add(buf,(LPBYTE)&cookie,sizeof(cookie)); - if (hres) - return hres; - } - if (!*arg) { - if (debugout) TRACE_(olerelay)("<DISPPARAMS NULL>"); - return S_OK; - } - disp = (DISPPARAMS*)*arg; - if (writeit) { - hres = xbuf_add(buf,(LPBYTE)&disp->cArgs,sizeof(disp->cArgs)); - if (hres) - return hres; - } - if (debugout) TRACE_(olerelay)("D{"); - for (i=0;i<disp->cArgs;i++) { - TYPEDESC vtdesc; - - vtdesc.vt = VT_VARIANT; - serialize_param( - tinfo, - writeit, - debugout, - dealloc, - &vtdesc, - (DWORD*)(disp->rgvarg+i), - buf - ); - if (debugout && (i<disp->cArgs-1)) - TRACE_(olerelay)(","); - } - if (dealloc) - HeapFree(GetProcessHeap(),0,disp->rgvarg); - if (writeit) { - hres = xbuf_add(buf,(LPBYTE)&disp->cNamedArgs,sizeof(disp->cNamedArgs)); - if (hres) - return hres; - } - if (debugout) TRACE_(olerelay)("}{"); - for (i=0;i<disp->cNamedArgs;i++) { - TYPEDESC vtdesc; - - vtdesc.vt = VT_UINT; - serialize_param( - tinfo, - writeit, - debugout, - dealloc, - &vtdesc, - (DWORD*)(disp->rgdispidNamedArgs+i), - buf - ); - if (debugout && (i<disp->cNamedArgs-1)) - TRACE_(olerelay)(","); - } - if (debugout) TRACE_(olerelay)("}"); - if (dealloc) { - HeapFree(GetProcessHeap(),0,disp->rgdispidNamedArgs); - HeapFree(GetProcessHeap(),0,disp); - } - return S_OK; -} - -static HRESULT deserialize_param( ITypeInfo *tinfo, BOOL readit, @@ -1107,6 +823,14 @@ return S_OK; } } + case VT_I8: + case VT_UI8: + if (readit) { + hres = xbuf_get(buf,(LPBYTE)arg,8); + if (hres) ERR("Failed to read integer 8 byte\n"); + } + if (debugout) TRACE_(olerelay)("%lx%lx",arg[0],arg[1]); + return hres; case VT_ERROR: case VT_BOOL: case VT_I4: @@ -1331,8 +1055,6 @@ ); if (debugout && (i<tattr->cVars-1)) TRACE_(olerelay)(","); } - if (buf->thisisiid && (tattr->cbSizeInstance==sizeof(GUID))) - memcpy(&(buf->iid),(LPBYTE)*arg,sizeof(buf->iid)); if (debugout) TRACE_(olerelay)("}"); break; } @@ -1383,130 +1105,6 @@ } } -static HRESULT -deserialize_LPVOID_ptr( - ITypeInfo *tinfo, - BOOL readit, - BOOL debugout, - BOOL alloc, - TYPEDESC *tdesc, - DWORD *arg, - marshal_state *buf -) { - HRESULT hres; - DWORD cookie; - - if ((tdesc->vt != VT_PTR) || - (tdesc->u.lptdesc->vt != VT_PTR) || - (tdesc->u.lptdesc->u.lptdesc->vt != VT_VOID) - ) { - FIXME("ppvObject not expressed as VT_PTR -> VT_PTR -> VT_VOID?\n"); - return E_FAIL; - } - if (alloc) - *arg=(DWORD)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(LPVOID)); - if (readit) { - hres = xbuf_get(buf, (LPVOID)&cookie, sizeof(cookie)); - if (hres) - return hres; - if (cookie != 0x42424242) { - *(DWORD*)*arg = 0; - if (debugout) TRACE_(olerelay)("<lpvoid NULL>"); - return S_OK; - } - } - if (readit) { - hres = _unmarshal_interface(buf,&buf->iid,(LPUNKNOWN*)*arg); - if (hres) { - FIXME("_unmarshal_interface of %s , %p failed with %lx\n", debugstr_guid(&buf->iid), (LPUNKNOWN*)*arg, hres); - return hres; - } - } - if (debugout) TRACE_(olerelay)("ppv(%p)",(LPVOID)*arg); - return S_OK; -} - -static HRESULT -deserialize_DISPPARAM_ptr( - ITypeInfo *tinfo, - BOOL readit, - BOOL debugout, - BOOL alloc, - TYPEDESC *tdesc, - DWORD *arg, - marshal_state *buf) -{ - DWORD cookie; - DISPPARAMS *disps; - HRESULT hres; - int i; - - if ((tdesc->vt != VT_PTR) || (tdesc->u.lptdesc->vt != VT_USERDEFINED)) { - FIXME("DISPPARAMS not expressed as VT_PTR -> VT_USERDEFINED?\n"); - return E_FAIL; - } - if (readit) { - hres = xbuf_get(buf,(LPBYTE)&cookie,sizeof(cookie)); - if (hres) - return hres; - if (cookie == 0) { - *arg = 0; - if (debugout) TRACE_(olerelay)("<DISPPARAMS NULL>"); - return S_OK; - } - } - if (alloc) - *arg = (DWORD)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(DISPPARAMS)); - disps = (DISPPARAMS*)*arg; - if (!readit) - return S_OK; - hres = xbuf_get(buf, (LPBYTE)&disps->cArgs, sizeof(disps->cArgs)); - if (hres) - return hres; - if (alloc) - disps->rgvarg = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(VARIANT)*disps->cArgs ); - if (debugout) TRACE_(olerelay)("D{"); - for (i=0; i< disps->cArgs; i++) { - TYPEDESC vdesc; - - vdesc.vt = VT_VARIANT; - hres = deserialize_param( - tinfo, - readit, - debugout, - alloc, - &vdesc, - (DWORD*)(disps->rgvarg+i), - buf - ); - } - if (debugout) TRACE_(olerelay)("}{"); - hres = xbuf_get(buf, (LPBYTE)&disps->cNamedArgs, sizeof(disps->cNamedArgs)); - if (hres) - return hres; - if (disps->cNamedArgs) { - if (alloc) - disps->rgdispidNamedArgs = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(DISPID)*disps->cNamed Args); - for (i=0; i< disps->cNamedArgs; i++) { - TYPEDESC vdesc; - - vdesc.vt = VT_UINT; - hres = deserialize_param( - tinfo, - readit, - debugout, - alloc, - &vdesc, - (DWORD*)(disps->rgdispidNamedArgs+i), - buf - ); - if (debugout && i<(disps->cNamedArgs-1)) TRACE_(olerelay)(","); - } - } - if (debugout) TRACE_(olerelay)("}"); - return S_OK; -} - /* Searches function, also in inherited interfaces */ static HRESULT _get_funcdesc( @@ -1575,18 +1173,18 @@ BSTR fname,iname; BSTR names[10]; UINT nrofnames; - int is_idispatch_getidsofnames = 0; DWORD remoteresult = 0; ITypeInfo *tinfo; + IRpcChannelBuffer *chanbuf; EnterCriticalSection(&tpinfo->crit); hres = _get_funcdesc(tpinfo->tinfo,method,&tinfo,&fdesc,&iname,&fname); if (hres) { - ERR("Did not find typeinfo/funcdesc entry for method %d!\n",method); + ERR("Did not find typeinfo/funcdesc entry for method %d!\n",method); ITypeInfo_Release(tinfo); LeaveCriticalSection(&tpinfo->crit); - return E_FAIL; + return E_FAIL; } if (!tpinfo->chanbuf) @@ -1596,7 +1194,11 @@ LeaveCriticalSection(&tpinfo->crit); return RPC_E_DISCONNECTED; } + chanbuf = tpinfo->chanbuf; + IRpcChannelBuffer_AddRef(chanbuf); + LeaveCriticalSection(&tpinfo->crit); + if (relaydeb) { TRACE_(olerelay)("->"); if (iname) @@ -1607,34 +1209,12 @@ TRACE_(olerelay)("%d",method); TRACE_(olerelay)("("); } - if (iname && fname && !lstrcmpW(iname,IDispatchW) && !lstrcmpW(fname,GetIDsOfNamesW)) - is_idispatch_getidsofnames = 1; if (iname) SysFreeString(iname); if (fname) SysFreeString(fname); memset(&buf,0,sizeof(buf)); - buf.iid = IID_IUnknown; - /* Special IDispatch::GetIDsOfNames() serializer */ - if (is_idispatch_getidsofnames) { - hres = serialize_IDispatch_GetIDsOfNames(TRUE,relaydeb,args,&buf); - if (hres != S_OK) { - FIXME("serialize of IDispatch::GetIDsOfNames failed!\n"); - ITypeInfo_Release(tinfo); - LeaveCriticalSection(&tpinfo->crit); - return hres; - } - goto afterserialize; - } - - /* special QueryInterface serialize */ - if (method == 0) { - xbuf_add(&buf,(LPBYTE)args[0],sizeof(IID)); - if (relaydeb) TRACE_(olerelay)("riid=%s,[out])",debugstr_guid((REFIID)args[0])); - goto afterserialize; - } - /* normal typelib driven serializing */ /* Need them for hack below */ @@ -1647,62 +1227,27 @@ xargs = args; for (i=0;i<fdesc->cParams;i++) { ELEMDESC *elem = fdesc->lprgelemdescParam+i; - BOOL isserialized = FALSE; if (relaydeb) { if (i) TRACE_(olerelay)(","); if (i+1<nrofnames && names[i+1]) TRACE_(olerelay)("%s=",relaystr(names[i+1])); } /* No need to marshal other data than FIN and any VT_PTR. */ - if (!(elem->u.paramdesc.wParamFlags & PARAMFLAG_FIN) && (elem->tdesc.vt != VT_PTR)) { + if (!(elem->u.paramdesc.wParamFlags & PARAMFLAG_FIN || !elem->u.paramdesc.wParamFlags) && (elem->tdesc.vt != VT_PTR)) { xargs+=_argsize(elem->tdesc.vt); if (relaydeb) TRACE_(olerelay)("[out]"); continue; } - if (((i+1)<nrofnames) && !IsBadStringPtrW(names[i+1],1)) { - /* If the parameter is 'riid', we use it as interface IID - * for a later ppvObject serialization. - */ - buf.thisisiid = !lstrcmpW(names[i+1],riidW); + hres = serialize_param( + tinfo, + elem->u.paramdesc.wParamFlags & PARAMFLAG_FIN || !elem->u.paramdesc.wParamFlags, + relaydeb, + FALSE, + &elem->tdesc, + xargs, + &buf + ); - /* DISPPARAMS* needs special serializer */ - if (!lstrcmpW(names[i+1],pdispparamsW)) { - hres = serialize_DISPPARAM_ptr( - tinfo, - elem->u.paramdesc.wParamFlags & PARAMFLAG_FIN, - relaydeb, - FALSE, - &elem->tdesc, - xargs, - &buf - ); - isserialized = TRUE; - } - if (!lstrcmpW(names[i+1],ppvObjectW)) { - hres = serialize_LPVOID_ptr( - tinfo, - elem->u.paramdesc.wParamFlags & PARAMFLAG_FIN, - relaydeb, - FALSE, - &elem->tdesc, - xargs, - &buf - ); - if (hres == S_OK) - isserialized = TRUE; - } - } - if (!isserialized) - hres = serialize_param( - tinfo, - elem->u.paramdesc.wParamFlags & PARAMFLAG_FIN, - relaydeb, - FALSE, - &elem->tdesc, - xargs, - &buf - ); - if (hres) { ERR("Failed to serialize param, hres %lx\n",hres); break; @@ -1711,23 +1256,20 @@ } if (relaydeb) TRACE_(olerelay)(")"); -afterserialize: memset(&msg,0,sizeof(msg)); msg.cbBuffer = buf.curoff; msg.iMethod = method; - hres = IRpcChannelBuffer_GetBuffer(tpinfo->chanbuf,&msg,&(tpinfo->iid)); + hres = IRpcChannelBuffer_GetBuffer(chanbuf,&msg,&(tpinfo->iid)); if (hres) { ERR("RpcChannelBuffer GetBuffer failed, %lx\n",hres); - LeaveCriticalSection(&tpinfo->crit); - return hres; + goto exit; } memcpy(msg.Buffer,buf.base,buf.curoff); [truncated at 1000 lines; 1954 more skipped]
19 years, 1 month
1
0
0
0
← Newer
1
...
45
46
47
48
49
50
51
...
88
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Results per page:
10
25
50
100
200