crpytnet: Use the constants from the wininet header
André Hentschel
nerv at dawncrow.de
Mon Aug 22 14:28:54 CDT 2011
---
dlls/cryptnet/cryptnet_main.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/cryptnet/cryptnet_main.c b/dlls/cryptnet/cryptnet_main.c
index ec9dddd..e20bc3b 100644
--- a/dlls/cryptnet/cryptnet_main.c
+++ b/dlls/cryptnet/cryptnet_main.c
@@ -583,15 +583,15 @@ static BOOL CRYPT_CrackUrl(LPCWSTR pszURL, URL_COMPONENTSW *components)
memset(components, 0, sizeof(*components));
components->dwStructSize = sizeof(*components);
- components->lpszHostName = CryptMemAlloc(MAX_PATH * sizeof(WCHAR));
- components->dwHostNameLength = MAX_PATH;
- components->lpszUrlPath = CryptMemAlloc(MAX_PATH * 2 * sizeof(WCHAR));
- components->dwUrlPathLength = 2 * MAX_PATH;
+ components->lpszHostName = CryptMemAlloc(INTERNET_MAX_HOST_NAME_LENGTH * sizeof(WCHAR));
+ components->dwHostNameLength = INTERNET_MAX_HOST_NAME_LENGTH;
+ components->lpszUrlPath = CryptMemAlloc(INTERNET_MAX_PATH_LENGTH * sizeof(WCHAR));
+ components->dwUrlPathLength = INTERNET_MAX_PATH_LENGTH;
ret = InternetCrackUrlW(pszURL, 0, ICU_DECODE, components);
if (ret)
{
- if ((components->dwUrlPathLength == 2 * MAX_PATH - 1) ||
- (components->dwHostNameLength == MAX_PATH - 1))
+ if ((components->dwUrlPathLength == INTERNET_MAX_PATH_LENGTH - 1) ||
+ (components->dwHostNameLength == INTERNET_MAX_HOST_NAME_LENGTH - 1))
FIXME("Buffers are too small\n");
switch (components->nScheme)
{
@@ -1025,14 +1025,14 @@ static BOOL WINAPI File_RetrieveEncodedObjectW(LPCWSTR pszURL,
*ppfnFreeObject = CRYPT_FreeBlob;
*ppvFreeContext = NULL;
- components.lpszUrlPath = CryptMemAlloc(MAX_PATH * 2 * sizeof(WCHAR));
- components.dwUrlPathLength = 2 * MAX_PATH;
+ components.lpszUrlPath = CryptMemAlloc(INTERNET_MAX_PATH_LENGTH * sizeof(WCHAR));
+ components.dwUrlPathLength = INTERNET_MAX_PATH_LENGTH;
ret = InternetCrackUrlW(pszURL, 0, ICU_DECODE, &components);
if (ret)
{
LPWSTR path;
- if (components.dwUrlPathLength == 2 * MAX_PATH - 1)
+ if (components.dwUrlPathLength == INTERNET_MAX_PATH_LENGTH - 1)
FIXME("Buffers are too small\n");
/* 3 == lstrlenW(L"c:") + 1 */
--
Best Regards, André Hentschel
More information about the wine-patches
mailing list