diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c index 1b672118639..db64a177484 100644 --- a/dlls/wininet/ftp.c +++ b/dlls/wininet/ftp.c @@ -1291,6 +1291,12 @@ static DWORD FTPFILE_QueryDataAvailable(object_header_t *hdr, DWORD *available, return ERROR_SUCCESS; } +static DWORD FTPFILE_LockRequestFile(object_header_t *hdr, req_file_t **ret) +{ + ftp_file_t *file = (ftp_file_t*)hdr; + FIXME("%p\n", file); + return ERROR_NOT_SUPPORTED; +} static const object_vtbl_t FTPFILEVtbl = { FTPFILE_Destroy, @@ -1301,7 +1307,8 @@ static const object_vtbl_t FTPFILEVtbl = { FTPFILE_ReadFileEx, FTPFILE_WriteFile, FTPFILE_QueryDataAvailable, - NULL + NULL, + FTPFILE_LockRequestFile }; /*********************************************************************** diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index d2bd2d47302..26156ce97dd 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -3252,6 +3252,13 @@ done: return ERROR_SUCCESS; } +static DWORD HTTPREQ_LockRequestFile(object_header_t *hdr, req_file_t **ret) +{ + http_request_t *req = (http_request_t*)hdr; + FIXME("(%p)\n", req); + return ERROR_NOT_SUPPORTED; +} + static const object_vtbl_t HTTPREQVtbl = { HTTPREQ_Destroy, HTTPREQ_CloseConnection, @@ -3261,7 +3268,8 @@ static const object_vtbl_t HTTPREQVtbl = { HTTPREQ_ReadFileEx, HTTPREQ_WriteFile, HTTPREQ_QueryDataAvailable, - NULL + NULL, + HTTPREQ_LockRequestFile }; /*********************************************************************** diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index ace1bfacef2..f1ea8be9064 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -3935,11 +3935,33 @@ void req_file_release(req_file_t *req_file) /*********************************************************************** * InternetLockRequestFile (WININET.@) */ -BOOL WINAPI InternetLockRequestFile( HINTERNET hInternet, HANDLE -*lphLockReqHandle) +BOOL WINAPI InternetLockRequestFile(HINTERNET hInternet, HANDLE *lphLockReqHandle) { - FIXME("STUB\n"); - return FALSE; + req_file_t *req_file = NULL; + object_header_t *hdr; + DWORD res; + + TRACE("(%p %p)\n", hInternet, lphLockReqHandle); + + hdr = get_handle_object(hInternet); + if (!hdr) { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + + if(hdr->vtbl->LockRequestFile) { + res = hdr->vtbl->LockRequestFile(hdr, &req_file); + }else { + WARN("wrong handle\n"); + res = ERROR_INTERNET_INCORRECT_HANDLE_TYPE; + } + + WININET_Release(hdr); + + *lphLockReqHandle = req_file; + if(res != ERROR_SUCCESS) + SetLastError(res); + return res == ERROR_SUCCESS; } BOOL WINAPI InternetUnlockRequestFile( HANDLE hLockHandle) diff --git a/dlls/wininet/internet.h b/dlls/wininet/internet.h index 8cde45ef188..2195897d4ba 100644 --- a/dlls/wininet/internet.h +++ b/dlls/wininet/internet.h @@ -266,6 +266,7 @@ typedef struct { DWORD (*WriteFile)(object_header_t*,const void*,DWORD,DWORD*); DWORD (*QueryDataAvailable)(object_header_t*,DWORD*,DWORD,DWORD_PTR); DWORD (*FindNextFileW)(object_header_t*,void*); + DWORD (*LockRequestFile)(object_header_t*,req_file_t**); } object_vtbl_t; #define INTERNET_HANDLE_IN_USE 1