Wininet UNICODE APIs
Alberto Massari
alby at exln.com
Thu Nov 7 04:25:30 CST 2002
ChangeLog:
- Added HttpOpenRequestW, HttpQueryInfoW, HttpSendRequestW
Alberto
Index: http.c
===================================================================
RCS file: /home/wine/wine/dlls/wininet/http.c,v
retrieving revision 1.29
diff -u -r1.29 http.c
--- http.c 27 Sep 2002 22:05:41 -0000 1.29
+++ http.c 7 Nov 2002 10:17:33 -0000
@@ -47,6 +47,7 @@
#include "internet.h"
#include "wine/debug.h"
+#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
@@ -248,6 +249,35 @@
}
}
+/***********************************************************************
+ * HttpOpenRequestW (WININET.@)
+ *
+ * Open a HTTP request handle
+ *
+ * RETURNS
+ * HINTERNET a HTTP request handle on success
+ * NULL on failure
+ *
+ */
+HINTERNET WINAPI HttpOpenRequestW(HINTERNET hHttpSession,
+ LPCWSTR lpszVerb, LPCWSTR lpszObjectName, LPCWSTR lpszVersion,
+ LPCWSTR lpszReferrer , LPCWSTR *lpszAcceptTypes,
+ DWORD dwFlags, DWORD dwContext)
+{
+ char szVerb[20],
+ szObjectName[INTERNET_MAX_PATH_LENGTH];
+ if(lpszVerb!=NULL)
+ WideCharToMultiByte(CP_ACP,0,lpszVerb,-1,szVerb,20,NULL,NULL);
+ else
+ szVerb[0]=0;
+ if(lpszObjectName!=NULL)
+
WideCharToMultiByte(CP_ACP,0,lpszObjectName,-1,szObjectName,INTERNET_MAX_PATH_LENGTH,NULL,NULL);
+ else
+ szObjectName[0]=0;
+ TRACE("object name=%s\n",szObjectName);
+ FIXME("lpszVersion, lpszReferrer and lpszAcceptTypes ignored\n");
+ return HttpOpenRequestA(hHttpSession, szVerb, szObjectName, NULL,
NULL, NULL, dwFlags, dwContext);
+}
/***********************************************************************
* HTTP_HttpOpenRequestA (internal)
@@ -563,6 +593,36 @@
return bSuccess;
}
+/***********************************************************************
+ * HttpQueryInfoW (WININET.@)
+ *
+ * Queries for information about an HTTP request
+ *
+ * RETURNS
+ * TRUE on success
+ * FALSE on failure
+ *
+ */
+BOOL WINAPI HttpQueryInfoW(HINTERNET hHttpRequest, DWORD dwInfoLevel,
+ LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex)
+{
+ BOOL result;
+ DWORD charLen=*lpdwBufferLength;
+ char* tempBuffer=HeapAlloc(GetProcessHeap(), 0, charLen);
+ result=HttpQueryInfoA(hHttpRequest, dwInfoLevel, tempBuffer, &charLen,
lpdwIndex);
+ if((dwInfoLevel & HTTP_QUERY_FLAG_NUMBER) ||
+ (dwInfoLevel & HTTP_QUERY_FLAG_SYSTEMTIME))
+ {
+ memcpy(lpBuffer,tempBuffer,charLen);
+ }
+ else
+ {
+ int nChars=MultiByteToWideChar(CP_ACP,0,
tempBuffer,charLen,lpBuffer,*lpdwBufferLength);
+ *lpdwBufferLength=nChars;
+ }
+ HeapFree(GetProcessHeap(), 0, tempBuffer);
+ return result;
+}
/***********************************************************************
* HttpSendRequestExA (WININET.@)
@@ -647,6 +707,34 @@
}
}
+/***********************************************************************
+ * HttpSendRequestW (WININET.@)
+ *
+ * Sends the specified request to the HTTP server
+ *
+ * RETURNS
+ * TRUE on success
+ * FALSE on failure
+ *
+ */
+BOOL WINAPI HttpSendRequestW(HINTERNET hHttpRequest, LPCWSTR lpszHeaders,
+ DWORD dwHeaderLength, LPVOID lpOptional ,DWORD dwOptionalLength)
+{
+ BOOL result;
+ char* szHeaders=NULL;
+ DWORD nLen=dwHeaderLength;
+ if(lpszHeaders!=NULL)
+ {
+ if(nLen==-1)
+ nLen=strlenW(lpszHeaders);
+ szHeaders=(char*)malloc(nLen+1);
+
WideCharToMultiByte(CP_ACP,0,lpszHeaders,nLen,szHeaders,nLen,NULL,NULL);
+ }
+ result=HttpSendRequestA(hHttpRequest, szHeaders, dwHeaderLength,
lpOptional, dwOptionalLength);
+ if(szHeaders!=NULL)
+ free(szHeaders);
+ return result;
+}
/***********************************************************************
* HTTP_HttpSendRequestA (internal)
Index: Makefile.in
===================================================================
RCS file: /home/wine/wine/dlls/wininet/Makefile.in,v
retrieving revision 1.18
diff -u -r1.18 Makefile.in
--- Makefile.in 9 Aug 2002 01:22:41 -0000 1.18
+++ Makefile.in 7 Nov 2002 10:17:33 -0000
@@ -5,6 +5,7 @@
VPATH = @srcdir@
MODULE = wininet.dll
IMPORTS = shlwapi user32 kernel32
+EXTRALIBS = $(LIBUNICODE)
LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
Index: wininet.spec
===================================================================
RCS file: /home/wine/wine/dlls/wininet/wininet.spec,v
retrieving revision 1.25
diff -u -r1.25 wininet.spec
--- wininet.spec 4 Nov 2002 23:53:43 -0000 1.25
+++ wininet.spec 7 Nov 2002 10:17:33 -0000
@@ -70,13 +70,13 @@
@ stdcall HttpEndRequestA(ptr ptr long long) HttpEndRequestA
@ stdcall HttpEndRequestW(ptr ptr long long) HttpEndRequestW
@ stdcall HttpOpenRequestA(ptr str str str str ptr long long)
HttpOpenRequestA
-@ stub HttpOpenRequestW
+@ stdcall HttpOpenRequestW(ptr wstr wstr wstr wstr ptr long long)
HttpOpenRequestW
@ stdcall HttpQueryInfoA(ptr long ptr ptr ptr) HttpQueryInfoA
-@ stub HttpQueryInfoW
+@ stdcall HttpQueryInfoW(ptr long ptr ptr ptr) HttpQueryInfoW
@ stdcall HttpSendRequestA(ptr str long ptr long) HttpSendRequestA
@ stdcall HttpSendRequestExA(long ptr ptr long long) HttpSendRequestExA
@ stub HttpSendRequestExW
-@ stub HttpSendRequestW
+@ stdcall HttpSendRequestW(ptr wstr long ptr long) HttpSendRequestW
@ stub IncrementUrlCacheHeaderData
@ stdcall InternetAttemptConnect(long) InternetAttemptConnect
@ stdcall InternetAutodial(long ptr) InternetAutoDial
More information about the wine-patches
mailing list