Autosyncing with Wine HEAD

svn path=/trunk/; revision=31775
This commit is contained in:
The Wine Synchronizer 2008-01-14 12:51:35 +00:00
parent 9801c4a81f
commit 3a6d558da6
2 changed files with 17 additions and 12 deletions

View file

@ -1,5 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<group>
<module name="cryptnet" type="win32dll" baseaddress="${BASEADDRESS_CRYPTNET}" installbase="system32" installname="cryptnet.dll" allowwarnings="true"> <module name="cryptnet" type="win32dll" baseaddress="${BASEADDRESS_CRYPTNET}" installbase="system32" installname="cryptnet.dll" allowwarnings="true">
<autoregister infsection="OleControlDlls" type="DllRegisterServer" /> <autoregister infsection="OleControlDlls" type="DllRegisterServer" />
<importlibrary definition="cryptnet.spec.def" /> <importlibrary definition="cryptnet.spec.def" />
@ -16,3 +17,4 @@
<file>cryptnet_main.c</file> <file>cryptnet_main.c</file>
<file>cryptnet.spec</file> <file>cryptnet.spec</file>
</module> </module>
</group>

View file

@ -476,18 +476,16 @@ static BOOL CRYPT_CrackUrl(LPCWSTR pszURL, URL_COMPONENTSW *components)
memset(components, 0, sizeof(*components)); memset(components, 0, sizeof(*components));
components->dwStructSize = sizeof(*components); components->dwStructSize = sizeof(*components);
components->dwHostNameLength = 1; components->lpszHostName = CryptMemAlloc(MAX_PATH * sizeof(WCHAR));
components->dwUrlPathLength = 1; components->dwHostNameLength = MAX_PATH;
components->lpszUrlPath = CryptMemAlloc(MAX_PATH * 2 * sizeof(WCHAR));
components->dwUrlPathLength = 2 * MAX_PATH;
ret = InternetCrackUrlW(pszURL, 0, ICU_DECODE, components); ret = InternetCrackUrlW(pszURL, 0, ICU_DECODE, components);
if (ret) if (ret)
{ {
LPWSTR hostname = strndupW(components->lpszHostName, if ((components->dwUrlPathLength == 2 * MAX_PATH - 1) ||
components->dwHostNameLength); (components->dwHostNameLength == MAX_PATH - 1))
LPWSTR path = strndupW(components->lpszUrlPath, FIXME("Buffers are too small\n");
components->dwUrlPathLength);
components->lpszHostName = hostname;
components->lpszUrlPath = path;
switch (components->nScheme) switch (components->nScheme)
{ {
case INTERNET_SCHEME_FTP: case INTERNET_SCHEME_FTP:
@ -873,12 +871,16 @@ static BOOL WINAPI File_RetrieveEncodedObjectW(LPCWSTR pszURL,
*ppfnFreeObject = CRYPT_FreeBlob; *ppfnFreeObject = CRYPT_FreeBlob;
*ppvFreeContext = NULL; *ppvFreeContext = NULL;
components.dwUrlPathLength = 1; components.lpszUrlPath = CryptMemAlloc(MAX_PATH * 2 * sizeof(WCHAR));
components.dwUrlPathLength = 2 * MAX_PATH;
ret = InternetCrackUrlW(pszURL, 0, ICU_DECODE, &components); ret = InternetCrackUrlW(pszURL, 0, ICU_DECODE, &components);
if (ret) if (ret)
{ {
LPWSTR path; LPWSTR path;
if (components.dwUrlPathLength == 2 * MAX_PATH - 1)
FIXME("Buffers are too small\n");
/* 3 == lstrlenW(L"c:") + 1 */ /* 3 == lstrlenW(L"c:") + 1 */
path = CryptMemAlloc((components.dwUrlPathLength + 3) * sizeof(WCHAR)); path = CryptMemAlloc((components.dwUrlPathLength + 3) * sizeof(WCHAR));
if (path) if (path)
@ -932,6 +934,7 @@ static BOOL WINAPI File_RetrieveEncodedObjectW(LPCWSTR pszURL,
CryptMemFree(path); CryptMemFree(path);
} }
} }
CryptMemFree(components.lpszUrlPath);
return ret; return ret;
} }
@ -952,7 +955,7 @@ static BOOL CRYPT_GetRetrieveFunction(LPCWSTR pszURL,
*pFunc = NULL; *pFunc = NULL;
*phFunc = 0; *phFunc = 0;
components.dwSchemeLength = 1; components.dwSchemeLength = 1;
ret = InternetCrackUrlW(pszURL, 0, ICU_DECODE, &components); ret = InternetCrackUrlW(pszURL, 0, 0, &components);
if (ret) if (ret)
{ {
/* Microsoft always uses CryptInitOIDFunctionSet/ /* Microsoft always uses CryptInitOIDFunctionSet/
@ -1136,7 +1139,7 @@ static BOOL WINAPI CRYPT_CreatePKCS7(LPCSTR pszObjectOid,
ret = CryptQueryObject(CERT_QUERY_OBJECT_BLOB, &pObject->rgBlob[0], ret = CryptQueryObject(CERT_QUERY_OBJECT_BLOB, &pObject->rgBlob[0],
CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED | CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED |
CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED, CERT_QUERY_FORMAT_FLAG_BINARY, CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED, CERT_QUERY_FORMAT_FLAG_BINARY,
0, NULL, NULL, NULL, (HCERTSTORE *)ppvContext, NULL, NULL); 0, NULL, NULL, NULL, ppvContext, NULL, NULL);
else else
{ {
FIXME("multiple messages unimplemented\n"); FIXME("multiple messages unimplemented\n");