[Bug 1805] New: InternetCrackUrl incorrectly sets dwUrlPathLength
Wine Bugs
wine-bugs at winehq.com
Wed Oct 29 15:00:15 CST 2003
http://bugs.winehq.com/show_bug.cgi?id=1805
Summary: InternetCrackUrl incorrectly sets dwUrlPathLength
Product: Wine
Version: unspecified
Platform: Other
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: wine-binary
AssignedTo: wine-bugs at winehq.com
ReportedBy: jan_lists at sporbeck-family.de
Hi,
During some application testing, we discovered that WinE does not correctly
mimic the WinINet function InternetCrackUrl. The real WinAPI sets the
dwUrlPathLength member of the URL_COMPONENTS structure to additionally hold
the extra info of the given URL if the extra info is not requested as a
separate component. Although this behaviour is not well documented by the
Win SDK, it is for instance implemented on WinXP, Win2000 and WinME and
therefore might be considered to be intended by Microsoft.
The following lines of code demonstrate the problem:
LPCTSTR lpszURL = _T("http://www.myserver.com/myscript.php?arg=1");
URL_COMPONENTS url;
// call 1: crack out url path and extra info
::ZeroMemory(&url, sizeof(url));
url.dwStructSize = sizeof(url);
url.dwHostNameLength = 1;
url.dwUrlPathLength = 1;
url.dwExtraInfoLength = 1;
::InternetCrackUrl(lpszURL, 0, 0, &url);
// dwUrlPathLength is 13, holding "/myscript.php"
// call 2: only crack out url path
::ZeroMemory(&url, sizeof(url));
url.dwStructSize = sizeof(url);
url.dwHostNameLength = 1;
url.dwUrlPathLength = 1;
::InternetCrackUrl(lpszURL, 0, 0, &url);
// now, dwUrlPathLength should be 19, holding "/myscript.php?arg=1",
// while WinE still sets it to 13
OK, it is of course no great deal to write code that correctly runs on real
Win systems and on WinE (2-3 lines did it). But programers who rely on this
behaviour will for example wonder why their applications don't transmit any
HTTP GET parameters when they call HttpOpenRequest with lpszObjectName set
to the URL path component returned by InternetCrackUrl...
--
Configure bugmail: http://bugs.winehq.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the wine-bugs
mailing list