Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
May 2020
- 79 participants
- 626 discussions
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/qmgr/enum_jobs.c | 14 +-
dlls/qmgr/file.c | 4 +-
dlls/qmgr/job.c | 629 +++++++++++++++++++-----------------------
dlls/qmgr/qmgr.c | 10 +-
dlls/qmgr/qmgr.h | 2 +-
5 files changed, 300 insertions(+), 359 deletions(-)
diff --git a/dlls/qmgr/enum_jobs.c b/dlls/qmgr/enum_jobs.c
index 7fae597a4e..5a79825954 100644
--- a/dlls/qmgr/enum_jobs.c
+++ b/dlls/qmgr/enum_jobs.c
@@ -27,7 +27,7 @@ typedef struct
{
IEnumBackgroundCopyJobs IEnumBackgroundCopyJobs_iface;
LONG ref;
- IBackgroundCopyJob3 **jobs;
+ IBackgroundCopyJob4 **jobs;
ULONG numJobs;
ULONG indexJobs;
} EnumBackgroundCopyJobsImpl;
@@ -75,7 +75,7 @@ static ULONG WINAPI EnumBackgroundCopyJobs_Release(IEnumBackgroundCopyJobs *ifac
if (ref == 0) {
for(i = 0; i < This->numJobs; i++)
- IBackgroundCopyJob3_Release(This->jobs[i]);
+ IBackgroundCopyJob4_Release(This->jobs[i]);
HeapFree(GetProcessHeap(), 0, This->jobs);
HeapFree(GetProcessHeap(), 0, This);
}
@@ -89,7 +89,6 @@ static HRESULT WINAPI EnumBackgroundCopyJobs_Next(IEnumBackgroundCopyJobs *iface
EnumBackgroundCopyJobsImpl *This = impl_from_IEnumBackgroundCopyJobs(iface);
ULONG fetched;
ULONG i;
- IBackgroundCopyJob3 *job;
TRACE("(%p)->(%d %p %p)\n", This, celt, rgelt, pceltFetched);
@@ -111,9 +110,8 @@ static HRESULT WINAPI EnumBackgroundCopyJobs_Next(IEnumBackgroundCopyJobs *iface
/* Fill in the array of objects */
for (i = 0; i < fetched; ++i)
{
- job = This->jobs[This->indexJobs++];
- IBackgroundCopyJob3_AddRef(job);
- rgelt[i] = (IBackgroundCopyJob *)job;
+ rgelt[i] = (IBackgroundCopyJob *)This->jobs[This->indexJobs++];
+ IBackgroundCopyJob_AddRef(rgelt[i]);
}
return fetched == celt ? S_OK : S_FALSE;
@@ -213,8 +211,8 @@ HRESULT enum_copy_job_create(BackgroundCopyManagerImpl *qmgr, IEnumBackgroundCop
i = 0;
LIST_FOR_EACH_ENTRY(job, &qmgr->jobs, BackgroundCopyJobImpl, entryFromQmgr)
{
- IBackgroundCopyJob3_AddRef(&job->IBackgroundCopyJob3_iface);
- This->jobs[i++] = &job->IBackgroundCopyJob3_iface;
+ IBackgroundCopyJob4_AddRef(&job->IBackgroundCopyJob4_iface);
+ This->jobs[i++] = &job->IBackgroundCopyJob4_iface;
}
LeaveCriticalSection(&qmgr->cs);
diff --git a/dlls/qmgr/file.c b/dlls/qmgr/file.c
index 6621b23694..e0aeebf7ce 100644
--- a/dlls/qmgr/file.c
+++ b/dlls/qmgr/file.c
@@ -81,7 +81,7 @@ static ULONG WINAPI BackgroundCopyFile_Release(
if (ref == 0)
{
- IBackgroundCopyJob3_Release(&file->owner->IBackgroundCopyJob3_iface);
+ IBackgroundCopyJob4_Release(&file->owner->IBackgroundCopyJob4_iface);
HeapFree(GetProcessHeap(), 0, file->info.LocalName);
HeapFree(GetProcessHeap(), 0, file->info.RemoteName);
HeapFree(GetProcessHeap(), 0, file);
@@ -195,7 +195,7 @@ HRESULT BackgroundCopyFileConstructor(BackgroundCopyJobImpl *owner,
This->owner = owner;
This->read_size = 0;
This->tempFileName[0] = 0;
- IBackgroundCopyJob3_AddRef(&owner->IBackgroundCopyJob3_iface);
+ IBackgroundCopyJob4_AddRef(&owner->IBackgroundCopyJob4_iface);
*file = This;
return S_OK;
diff --git a/dlls/qmgr/job.c b/dlls/qmgr/job.c
index c33389574e..6f2c4d61ca 100644
--- a/dlls/qmgr/job.c
+++ b/dlls/qmgr/job.c
@@ -207,76 +207,77 @@ static inline BOOL is_job_done(const BackgroundCopyJobImpl *job)
return job->state == BG_JOB_STATE_CANCELLED || job->state == BG_JOB_STATE_ACKNOWLEDGED;
}
-static inline BackgroundCopyJobImpl *impl_from_IBackgroundCopyJob3(IBackgroundCopyJob3 *iface)
+static inline BackgroundCopyJobImpl *impl_from_IBackgroundCopyJob4(IBackgroundCopyJob4 *iface)
{
- return CONTAINING_RECORD(iface, BackgroundCopyJobImpl, IBackgroundCopyJob3_iface);
+ return CONTAINING_RECORD(iface, BackgroundCopyJobImpl, IBackgroundCopyJob4_iface);
}
-static HRESULT WINAPI BackgroundCopyJob_QueryInterface(
- IBackgroundCopyJob3 *iface, REFIID riid, void **obj)
+static HRESULT WINAPI BackgroundCopyJob_QueryInterface(IBackgroundCopyJob4 *iface, REFIID riid, void **obj)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
- TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
+ TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IBackgroundCopyJob) ||
IsEqualGUID(riid, &IID_IBackgroundCopyJob2) ||
- IsEqualGUID(riid, &IID_IBackgroundCopyJob3))
+ IsEqualGUID(riid, &IID_IBackgroundCopyJob3) ||
+ IsEqualGUID(riid, &IID_IBackgroundCopyJob4))
{
- *obj = &This->IBackgroundCopyJob3_iface;
+ *obj = &job->IBackgroundCopyJob4_iface;
}
else if (IsEqualGUID(riid, &IID_IBackgroundCopyJobHttpOptions))
{
- *obj = &This->IBackgroundCopyJobHttpOptions_iface;
+ *obj = &job->IBackgroundCopyJobHttpOptions_iface;
}
else
{
+ WARN("Unsupported interface %s.\n", debugstr_guid(riid));
*obj = NULL;
return E_NOINTERFACE;
}
- IBackgroundCopyJob3_AddRef(iface);
+ IBackgroundCopyJob4_AddRef(iface);
return S_OK;
}
-static ULONG WINAPI BackgroundCopyJob_AddRef(IBackgroundCopyJob3 *iface)
+static ULONG WINAPI BackgroundCopyJob_AddRef(IBackgroundCopyJob4 *iface)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- ULONG ref = InterlockedIncrement(&This->ref);
- TRACE("(%p)->(%d)\n", This, ref);
- return ref;
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
+ ULONG refcount = InterlockedIncrement(&job->ref);
+ TRACE("%p, refcount %d.\n", iface, refcount);
+ return refcount;
}
-static ULONG WINAPI BackgroundCopyJob_Release(IBackgroundCopyJob3 *iface)
+static ULONG WINAPI BackgroundCopyJob_Release(IBackgroundCopyJob4 *iface)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- ULONG i, j, ref = InterlockedDecrement(&This->ref);
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
+ ULONG i, j, ref = InterlockedDecrement(&job->ref);
- TRACE("(%p)->(%d)\n", This, ref);
+ TRACE("%p, refcount %d.\n", iface, ref);
- if (ref == 0)
+ if (!ref)
{
- This->cs.DebugInfo->Spare[0] = 0;
- DeleteCriticalSection(&This->cs);
- if (This->callback)
- IBackgroundCopyCallback2_Release(This->callback);
- HeapFree(GetProcessHeap(), 0, This->displayName);
- HeapFree(GetProcessHeap(), 0, This->description);
- HeapFree(GetProcessHeap(), 0, This->http_options.headers);
+ job->cs.DebugInfo->Spare[0] = 0;
+ DeleteCriticalSection(&job->cs);
+ if (job->callback)
+ IBackgroundCopyCallback2_Release(job->callback);
+ HeapFree(GetProcessHeap(), 0, job->displayName);
+ HeapFree(GetProcessHeap(), 0, job->description);
+ HeapFree(GetProcessHeap(), 0, job->http_options.headers);
for (i = 0; i < BG_AUTH_TARGET_PROXY; i++)
{
for (j = 0; j < BG_AUTH_SCHEME_PASSPORT; j++)
{
- BG_AUTH_CREDENTIALS *cred = &This->http_options.creds[i][j];
+ BG_AUTH_CREDENTIALS *cred = &job->http_options.creds[i][j];
HeapFree(GetProcessHeap(), 0, cred->Credentials.Basic.UserName);
HeapFree(GetProcessHeap(), 0, cred->Credentials.Basic.Password);
}
}
- CloseHandle(This->wait);
- CloseHandle(This->cancel);
- CloseHandle(This->done);
- HeapFree(GetProcessHeap(), 0, This);
+ CloseHandle(job->wait);
+ CloseHandle(job->cancel);
+ CloseHandle(job->done);
+ HeapFree(GetProcessHeap(), 0, job);
}
return ref;
@@ -284,18 +285,15 @@ static ULONG WINAPI BackgroundCopyJob_Release(IBackgroundCopyJob3 *iface)
/*** IBackgroundCopyJob methods ***/
-static HRESULT WINAPI BackgroundCopyJob_AddFileSet(
- IBackgroundCopyJob3 *iface,
- ULONG cFileCount,
- BG_FILE_INFO *pFileSet)
+static HRESULT WINAPI BackgroundCopyJob_AddFileSet(IBackgroundCopyJob4 *iface, ULONG cFileCount, BG_FILE_INFO *pFileSet)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
HRESULT hr = S_OK;
ULONG i;
- TRACE("(%p)->(%d %p)\n", This, cFileCount, pFileSet);
+ TRACE("%p, %u, %p.\n", iface, cFileCount, pFileSet);
- EnterCriticalSection(&This->cs);
+ EnterCriticalSection(&job->cs);
for (i = 0; i < cFileCount; ++i)
{
@@ -304,153 +302,142 @@ static HRESULT WINAPI BackgroundCopyJob_AddFileSet(
/* We should return E_INVALIDARG in these cases. */
FIXME("Check for valid filenames and supported protocols\n");
- hr = BackgroundCopyFileConstructor(This, pFileSet[i].RemoteName, pFileSet[i].LocalName, &file);
+ hr = BackgroundCopyFileConstructor(job, pFileSet[i].RemoteName, pFileSet[i].LocalName, &file);
if (hr != S_OK) break;
/* Add a reference to the file to file list */
- list_add_head(&This->files, &file->entryFromJob);
- This->jobProgress.BytesTotal = BG_SIZE_UNKNOWN;
- ++This->jobProgress.FilesTotal;
+ list_add_head(&job->files, &file->entryFromJob);
+ job->jobProgress.BytesTotal = BG_SIZE_UNKNOWN;
+ ++job->jobProgress.FilesTotal;
}
- LeaveCriticalSection(&This->cs);
+ LeaveCriticalSection(&job->cs);
return hr;
}
-static HRESULT WINAPI BackgroundCopyJob_AddFile(
- IBackgroundCopyJob3 *iface,
- LPCWSTR RemoteUrl,
- LPCWSTR LocalName)
+static HRESULT WINAPI BackgroundCopyJob_AddFile(IBackgroundCopyJob4 *iface, LPCWSTR RemoteUrl, LPCWSTR LocalName)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
BG_FILE_INFO file;
- TRACE("(%p)->(%s %s)\n", This, debugstr_w(RemoteUrl), debugstr_w(LocalName));
+ TRACE("%p, %s, %s.\n", iface, debugstr_w(RemoteUrl), debugstr_w(LocalName));
file.RemoteName = (LPWSTR)RemoteUrl;
file.LocalName = (LPWSTR)LocalName;
- return IBackgroundCopyJob3_AddFileSet(iface, 1, &file);
+ return IBackgroundCopyJob4_AddFileSet(iface, 1, &file);
}
-static HRESULT WINAPI BackgroundCopyJob_EnumFiles(
- IBackgroundCopyJob3 *iface,
- IEnumBackgroundCopyFiles **enum_files)
+static HRESULT WINAPI BackgroundCopyJob_EnumFiles(IBackgroundCopyJob4 *iface, IEnumBackgroundCopyFiles **enum_files)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- TRACE("(%p)->(%p)\n", This, enum_files);
- return EnumBackgroundCopyFilesConstructor(This, enum_files);
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
+ TRACE("%p, %p.\n", iface, enum_files);
+ return EnumBackgroundCopyFilesConstructor(job, enum_files);
}
-static HRESULT WINAPI BackgroundCopyJob_Suspend(
- IBackgroundCopyJob3 *iface)
+static HRESULT WINAPI BackgroundCopyJob_Suspend(IBackgroundCopyJob4 *iface)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p): stub\n", This);
+ FIXME("(%p): stub\n", iface);
return E_NOTIMPL;
}
-static HRESULT WINAPI BackgroundCopyJob_Resume(
- IBackgroundCopyJob3 *iface)
+static HRESULT WINAPI BackgroundCopyJob_Resume(IBackgroundCopyJob4 *iface)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- HRESULT rv = S_OK;
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
+ HRESULT hr = S_OK;
- TRACE("(%p)\n", This);
+ TRACE("%p.\n", iface);
EnterCriticalSection(&globalMgr.cs);
- if (is_job_done(This))
+ if (is_job_done(job))
{
- rv = BG_E_INVALID_STATE;
+ hr = BG_E_INVALID_STATE;
}
- else if (This->jobProgress.FilesTransferred == This->jobProgress.FilesTotal)
+ else if (job->jobProgress.FilesTransferred == job->jobProgress.FilesTotal)
{
- rv = BG_E_EMPTY;
+ hr = BG_E_EMPTY;
}
- else if (This->state != BG_JOB_STATE_CONNECTING
- && This->state != BG_JOB_STATE_TRANSFERRING)
+ else if (job->state != BG_JOB_STATE_CONNECTING
+ && job->state != BG_JOB_STATE_TRANSFERRING)
{
- This->state = BG_JOB_STATE_QUEUED;
- This->error.context = 0;
- This->error.code = S_OK;
- if (This->error.file)
+ job->state = BG_JOB_STATE_QUEUED;
+ job->error.context = 0;
+ job->error.code = S_OK;
+ if (job->error.file)
{
- IBackgroundCopyFile2_Release(This->error.file);
- This->error.file = NULL;
+ IBackgroundCopyFile2_Release(job->error.file);
+ job->error.file = NULL;
}
SetEvent(globalMgr.jobEvent);
}
LeaveCriticalSection(&globalMgr.cs);
- return rv;
+ return hr;
}
-static HRESULT WINAPI BackgroundCopyJob_Cancel(
- IBackgroundCopyJob3 *iface)
+static HRESULT WINAPI BackgroundCopyJob_Cancel(IBackgroundCopyJob4 *iface)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- HRESULT rv = S_OK;
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
+ HRESULT hr = S_OK;
- TRACE("(%p)\n", This);
+ TRACE("%p.\n", iface);
- EnterCriticalSection(&This->cs);
+ EnterCriticalSection(&job->cs);
- if (is_job_done(This))
+ if (is_job_done(job))
{
- rv = BG_E_INVALID_STATE;
+ hr = BG_E_INVALID_STATE;
}
else
{
BackgroundCopyFileImpl *file;
- if (This->state == BG_JOB_STATE_CONNECTING || This->state == BG_JOB_STATE_TRANSFERRING)
+ if (job->state == BG_JOB_STATE_CONNECTING || job->state == BG_JOB_STATE_TRANSFERRING)
{
- This->state = BG_JOB_STATE_CANCELLED;
- SetEvent(This->cancel);
+ job->state = BG_JOB_STATE_CANCELLED;
+ SetEvent(job->cancel);
- LeaveCriticalSection(&This->cs);
- WaitForSingleObject(This->done, INFINITE);
- EnterCriticalSection(&This->cs);
+ LeaveCriticalSection(&job->cs);
+ WaitForSingleObject(job->done, INFINITE);
+ EnterCriticalSection(&job->cs);
}
- LIST_FOR_EACH_ENTRY(file, &This->files, BackgroundCopyFileImpl, entryFromJob)
+ LIST_FOR_EACH_ENTRY(file, &job->files, BackgroundCopyFileImpl, entryFromJob)
{
if (file->tempFileName[0] && !DeleteFileW(file->tempFileName))
{
WARN("Couldn't delete %s (%u)\n", debugstr_w(file->tempFileName), GetLastError());
- rv = BG_S_UNABLE_TO_DELETE_FILES;
+ hr = BG_S_UNABLE_TO_DELETE_FILES;
}
if (file->info.LocalName && !DeleteFileW(file->info.LocalName))
{
WARN("Couldn't delete %s (%u)\n", debugstr_w(file->info.LocalName), GetLastError());
- rv = BG_S_UNABLE_TO_DELETE_FILES;
+ hr = BG_S_UNABLE_TO_DELETE_FILES;
}
}
- This->state = BG_JOB_STATE_CANCELLED;
+ job->state = BG_JOB_STATE_CANCELLED;
}
- LeaveCriticalSection(&This->cs);
- return rv;
+ LeaveCriticalSection(&job->cs);
+ return hr;
}
-static HRESULT WINAPI BackgroundCopyJob_Complete(
- IBackgroundCopyJob3 *iface)
+static HRESULT WINAPI BackgroundCopyJob_Complete(IBackgroundCopyJob4 *iface)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- HRESULT rv = S_OK;
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
+ HRESULT hr = S_OK;
- TRACE("(%p)\n", This);
+ TRACE("%p.\n", iface);
- EnterCriticalSection(&This->cs);
+ EnterCriticalSection(&job->cs);
- if (is_job_done(This))
+ if (is_job_done(job))
{
- rv = BG_E_INVALID_STATE;
+ hr = BG_E_INVALID_STATE;
}
else
{
BackgroundCopyFileImpl *file;
- LIST_FOR_EACH_ENTRY(file, &This->files, BackgroundCopyFileImpl, entryFromJob)
+ LIST_FOR_EACH_ENTRY(file, &job->files, BackgroundCopyFileImpl, entryFromJob)
{
if (file->fileProgress.Completed)
{
@@ -462,406 +449,326 @@ static HRESULT WINAPI BackgroundCopyJob_Complete(
ERR("Couldn't rename file %s -> %s\n",
debugstr_w(file->tempFileName),
debugstr_w(file->info.LocalName));
- rv = BG_S_PARTIAL_COMPLETE;
+ hr = BG_S_PARTIAL_COMPLETE;
}
}
else
- rv = BG_S_PARTIAL_COMPLETE;
+ hr = BG_S_PARTIAL_COMPLETE;
}
}
- This->state = BG_JOB_STATE_ACKNOWLEDGED;
- LeaveCriticalSection(&This->cs);
+ job->state = BG_JOB_STATE_ACKNOWLEDGED;
+ LeaveCriticalSection(&job->cs);
- return rv;
+ return hr;
}
-static HRESULT WINAPI BackgroundCopyJob_GetId(
- IBackgroundCopyJob3 *iface,
- GUID *pVal)
+static HRESULT WINAPI BackgroundCopyJob_GetId(IBackgroundCopyJob4 *iface, GUID *id)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- TRACE("(%p)->(%p)\n", This, pVal);
- *pVal = This->jobId;
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
+
+ TRACE("%p, %p.\n", iface, id);
+
+ *id = job->jobId;
+
return S_OK;
}
-static HRESULT WINAPI BackgroundCopyJob_GetType(
- IBackgroundCopyJob3 *iface,
- BG_JOB_TYPE *pVal)
+static HRESULT WINAPI BackgroundCopyJob_GetType(IBackgroundCopyJob4 *iface, BG_JOB_TYPE *job_type)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
- TRACE("(%p)->(%p)\n", This, pVal);
+ TRACE("%p, %p.\n", iface, job_type);
- if (!pVal)
+ if (!job_type)
return E_INVALIDARG;
- *pVal = This->type;
+ *job_type = job->type;
return S_OK;
}
-static HRESULT WINAPI BackgroundCopyJob_GetProgress(
- IBackgroundCopyJob3 *iface,
- BG_JOB_PROGRESS *pVal)
+static HRESULT WINAPI BackgroundCopyJob_GetProgress(IBackgroundCopyJob4 *iface, BG_JOB_PROGRESS *progress)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
- TRACE("(%p)->(%p)\n", This, pVal);
+ TRACE("%p, %p.\n", iface, progress);
- if (!pVal)
+ if (!progress)
return E_INVALIDARG;
- EnterCriticalSection(&This->cs);
- *pVal = This->jobProgress;
- LeaveCriticalSection(&This->cs);
+ EnterCriticalSection(&job->cs);
+ *progress = job->jobProgress;
+ LeaveCriticalSection(&job->cs);
return S_OK;
}
-static HRESULT WINAPI BackgroundCopyJob_GetTimes(
- IBackgroundCopyJob3 *iface,
- BG_JOB_TIMES *pVal)
+static HRESULT WINAPI BackgroundCopyJob_GetTimes(IBackgroundCopyJob4 *iface, BG_JOB_TIMES *pVal)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%p): stub\n", This, pVal);
+ FIXME("%p, %p: stub\n", iface, pVal);
return E_NOTIMPL;
}
-static HRESULT WINAPI BackgroundCopyJob_GetState(
- IBackgroundCopyJob3 *iface,
- BG_JOB_STATE *pVal)
+static HRESULT WINAPI BackgroundCopyJob_GetState(IBackgroundCopyJob4 *iface, BG_JOB_STATE *state)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
- TRACE("(%p)->(%p)\n", This, pVal);
+ TRACE("%p, %p.\n", iface, state);
- if (!pVal)
+ if (!state)
return E_INVALIDARG;
/* Don't think we need a critical section for this */
- *pVal = This->state;
+ *state = job->state;
return S_OK;
}
-static HRESULT WINAPI BackgroundCopyJob_GetError(
- IBackgroundCopyJob3 *iface,
- IBackgroundCopyError **ppError)
+static HRESULT WINAPI BackgroundCopyJob_GetError(IBackgroundCopyJob4 *iface, IBackgroundCopyError **ppError)
{
- BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob3(iface);
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
- TRACE("(%p)->(%p)\n", job, ppError);
+ TRACE("%p, %p.\n", iface, ppError);
if (!job->error.context) return BG_E_ERROR_INFORMATION_UNAVAILABLE;
return create_copy_error(job->error.context, job->error.code, job->error.file, ppError);
}
-static HRESULT WINAPI BackgroundCopyJob_GetOwner(
- IBackgroundCopyJob3 *iface,
- LPWSTR *pVal)
+static HRESULT WINAPI BackgroundCopyJob_GetOwner(IBackgroundCopyJob4 *iface, LPWSTR *owner)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%p): stub\n", This, pVal);
+ FIXME("%p, %p: stub\n", iface, owner);
return E_NOTIMPL;
}
-static HRESULT WINAPI BackgroundCopyJob_SetDisplayName(
- IBackgroundCopyJob3 *iface,
- LPCWSTR Val)
+static HRESULT WINAPI BackgroundCopyJob_SetDisplayName(IBackgroundCopyJob4 *iface, LPCWSTR name)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%s): stub\n", This, debugstr_w(Val));
+ FIXME("%p, %s: stub\n", iface, debugstr_w(name));
return E_NOTIMPL;
}
-static HRESULT WINAPI BackgroundCopyJob_GetDisplayName(
- IBackgroundCopyJob3 *iface,
- LPWSTR *pVal)
+static HRESULT WINAPI BackgroundCopyJob_GetDisplayName(IBackgroundCopyJob4 *iface, LPWSTR *name)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
- TRACE("(%p)->(%p)\n", This, pVal);
+ TRACE("%p, %p.\n", iface, name);
- return return_strval(This->displayName, pVal);
+ return return_strval(job->displayName, name);
}
-static HRESULT WINAPI BackgroundCopyJob_SetDescription(
- IBackgroundCopyJob3 *iface,
- LPCWSTR Val)
+static HRESULT WINAPI BackgroundCopyJob_SetDescription(IBackgroundCopyJob4 *iface, LPCWSTR desc)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
static const int max_description_len = 1024;
HRESULT hr = S_OK;
int len;
- TRACE("(%p)->(%s)\n", This, debugstr_w(Val));
+ TRACE("%p, %s.\n", iface, debugstr_w(desc));
- if (!Val) return E_INVALIDARG;
+ if (!desc)
+ return E_INVALIDARG;
- len = lstrlenW(Val);
+ len = lstrlenW(desc);
if (len > max_description_len) return BG_E_STRING_TOO_LONG;
- EnterCriticalSection(&This->cs);
+ EnterCriticalSection(&job->cs);
- if (is_job_done(This))
+ if (is_job_done(job))
{
hr = BG_E_INVALID_STATE;
}
else
{
- HeapFree(GetProcessHeap(), 0, This->description);
- if ((This->description = HeapAlloc(GetProcessHeap(), 0, (len+1)*sizeof(WCHAR))))
- lstrcpyW(This->description, Val);
+ HeapFree(GetProcessHeap(), 0, job->description);
+ if ((job->description = HeapAlloc(GetProcessHeap(), 0, (len+1)*sizeof(WCHAR))))
+ lstrcpyW(job->description, desc);
else
hr = E_OUTOFMEMORY;
}
- LeaveCriticalSection(&This->cs);
+ LeaveCriticalSection(&job->cs);
return hr;
}
-static HRESULT WINAPI BackgroundCopyJob_GetDescription(
- IBackgroundCopyJob3 *iface,
- LPWSTR *pVal)
+static HRESULT WINAPI BackgroundCopyJob_GetDescription(IBackgroundCopyJob4 *iface, LPWSTR *desc)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
- TRACE("(%p)->(%p)\n", This, pVal);
+ TRACE("%p, %p.\n", iface, desc);
- return return_strval(This->description, pVal);
+ return return_strval(job->description, desc);
}
-static HRESULT WINAPI BackgroundCopyJob_SetPriority(
- IBackgroundCopyJob3 *iface,
- BG_JOB_PRIORITY Val)
+static HRESULT WINAPI BackgroundCopyJob_SetPriority(IBackgroundCopyJob4 *iface, BG_JOB_PRIORITY priority)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%d): stub\n", This, Val);
+ FIXME("%p, %d: stub\n", iface, priority);
return S_OK;
}
-static HRESULT WINAPI BackgroundCopyJob_GetPriority(
- IBackgroundCopyJob3 *iface,
- BG_JOB_PRIORITY *pVal)
+static HRESULT WINAPI BackgroundCopyJob_GetPriority(IBackgroundCopyJob4 *iface, BG_JOB_PRIORITY *priority)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%p): stub\n", This, pVal);
+ FIXME("%p, %p: stub\n", iface, priority);
return E_NOTIMPL;
}
-static HRESULT WINAPI BackgroundCopyJob_SetNotifyFlags(
- IBackgroundCopyJob3 *iface,
- ULONG Val)
+static HRESULT WINAPI BackgroundCopyJob_SetNotifyFlags(IBackgroundCopyJob4 *iface, ULONG flags)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
static const ULONG valid_flags = BG_NOTIFY_JOB_TRANSFERRED |
BG_NOTIFY_JOB_ERROR |
BG_NOTIFY_DISABLE |
BG_NOTIFY_JOB_MODIFICATION |
BG_NOTIFY_FILE_TRANSFERRED;
- TRACE("(%p)->(0x%x)\n", This, Val);
+ TRACE("%p, %#x.\n", iface, flags);
- if (is_job_done(This)) return BG_E_INVALID_STATE;
- if (Val & ~valid_flags) return E_NOTIMPL;
- This->notify_flags = Val;
+ if (is_job_done(job)) return BG_E_INVALID_STATE;
+ if (flags & ~valid_flags) return E_NOTIMPL;
+ job->notify_flags = flags;
return S_OK;
}
-static HRESULT WINAPI BackgroundCopyJob_GetNotifyFlags(
- IBackgroundCopyJob3 *iface,
- ULONG *pVal)
+static HRESULT WINAPI BackgroundCopyJob_GetNotifyFlags(IBackgroundCopyJob4 *iface, ULONG *flags)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
- TRACE("(%p)->(%p)\n", This, pVal);
+ TRACE("%p, %p.\n", iface, flags);
- if (!pVal) return E_INVALIDARG;
+ if (!flags) return E_INVALIDARG;
- *pVal = This->notify_flags;
+ *flags = job->notify_flags;
return S_OK;
}
-static HRESULT WINAPI BackgroundCopyJob_SetNotifyInterface(
- IBackgroundCopyJob3 *iface,
- IUnknown *Val)
+static HRESULT WINAPI BackgroundCopyJob_SetNotifyInterface(IBackgroundCopyJob4 *iface, IUnknown *callback)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
HRESULT hr = S_OK;
- TRACE("(%p)->(%p)\n", This, Val);
+ TRACE("%p, %p.\n", iface, callback);
- if (is_job_done(This)) return BG_E_INVALID_STATE;
+ if (is_job_done(job)) return BG_E_INVALID_STATE;
- if (This->callback)
+ if (job->callback)
{
- IBackgroundCopyCallback2_Release(This->callback);
- This->callback = NULL;
- This->callback2 = FALSE;
+ IBackgroundCopyCallback2_Release(job->callback);
+ job->callback = NULL;
+ job->callback2 = FALSE;
}
- if (Val)
+ if (callback)
{
- hr = IUnknown_QueryInterface(Val, &IID_IBackgroundCopyCallback2, (void**)&This->callback);
+ hr = IUnknown_QueryInterface(callback, &IID_IBackgroundCopyCallback2, (void **)&job->callback);
if (FAILED(hr))
- hr = IUnknown_QueryInterface(Val, &IID_IBackgroundCopyCallback, (void**)&This->callback);
+ hr = IUnknown_QueryInterface(callback, &IID_IBackgroundCopyCallback, (void**)&job->callback);
else
- This->callback2 = TRUE;
+ job->callback2 = TRUE;
}
return hr;
}
-static HRESULT WINAPI BackgroundCopyJob_GetNotifyInterface(
- IBackgroundCopyJob3 *iface,
- IUnknown **pVal)
+static HRESULT WINAPI BackgroundCopyJob_GetNotifyInterface(IBackgroundCopyJob4 *iface, IUnknown **callback)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
- TRACE("(%p)->(%p)\n", This, pVal);
+ TRACE("%p, %p.\n", iface, callback);
- if (!pVal) return E_INVALIDARG;
+ if (!callback) return E_INVALIDARG;
- *pVal = (IUnknown*)This->callback;
- if (*pVal)
- IUnknown_AddRef(*pVal);
+ *callback = (IUnknown *)job->callback;
+ if (*callback)
+ IUnknown_AddRef(*callback);
return S_OK;
}
-static HRESULT WINAPI BackgroundCopyJob_SetMinimumRetryDelay(
- IBackgroundCopyJob3 *iface,
- ULONG Seconds)
+static HRESULT WINAPI BackgroundCopyJob_SetMinimumRetryDelay(IBackgroundCopyJob4 *iface, ULONG delay)
{
- FIXME("%u\n", Seconds);
+ FIXME("%p, %u.\n", iface, delay);
return S_OK;
}
-static HRESULT WINAPI BackgroundCopyJob_GetMinimumRetryDelay(
- IBackgroundCopyJob3 *iface,
- ULONG *Seconds)
+static HRESULT WINAPI BackgroundCopyJob_GetMinimumRetryDelay(IBackgroundCopyJob4 *iface, ULONG *delay)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%p): stub\n", This, Seconds);
- *Seconds = 30;
+ FIXME("%p, %p: stub\n", iface, delay);
+ *delay = 30;
return S_OK;
}
-static HRESULT WINAPI BackgroundCopyJob_SetNoProgressTimeout(
- IBackgroundCopyJob3 *iface,
- ULONG Seconds)
+static HRESULT WINAPI BackgroundCopyJob_SetNoProgressTimeout(IBackgroundCopyJob4 *iface, ULONG timeout)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%d): stub\n", This, Seconds);
+ FIXME("%p, %u.: stub\n", iface, timeout);
return S_OK;
}
-static HRESULT WINAPI BackgroundCopyJob_GetNoProgressTimeout(
- IBackgroundCopyJob3 *iface,
- ULONG *Seconds)
+static HRESULT WINAPI BackgroundCopyJob_GetNoProgressTimeout(IBackgroundCopyJob4 *iface, ULONG *timeout)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%p): stub\n", This, Seconds);
- *Seconds = 900;
+ FIXME("%p, %p: stub\n", iface, timeout);
+ *timeout = 900;
return S_OK;
}
-static HRESULT WINAPI BackgroundCopyJob_GetErrorCount(
- IBackgroundCopyJob3 *iface,
- ULONG *Errors)
+static HRESULT WINAPI BackgroundCopyJob_GetErrorCount(IBackgroundCopyJob4 *iface, ULONG *count)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%p): stub\n", This, Errors);
+ FIXME("%p, %p: stub\n", iface, count);
return E_NOTIMPL;
}
-static HRESULT WINAPI BackgroundCopyJob_SetProxySettings(
- IBackgroundCopyJob3 *iface,
- BG_JOB_PROXY_USAGE ProxyUsage,
- const WCHAR *ProxyList,
- const WCHAR *ProxyBypassList)
+static HRESULT WINAPI BackgroundCopyJob_SetProxySettings(IBackgroundCopyJob4 *iface, BG_JOB_PROXY_USAGE proxy_usage,
+ const WCHAR *proxy_list, const WCHAR *proxy_bypass_list)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%d %s %s): stub\n", This, ProxyUsage, debugstr_w(ProxyList), debugstr_w(ProxyBypassList));
+ FIXME("%p, %d, %s, %s: stub\n", iface, proxy_usage, debugstr_w(proxy_list), debugstr_w(proxy_bypass_list));
return E_NOTIMPL;
}
-static HRESULT WINAPI BackgroundCopyJob_GetProxySettings(
- IBackgroundCopyJob3 *iface,
- BG_JOB_PROXY_USAGE *pProxyUsage,
- LPWSTR *pProxyList,
- LPWSTR *pProxyBypassList)
+static HRESULT WINAPI BackgroundCopyJob_GetProxySettings(IBackgroundCopyJob4 *iface, BG_JOB_PROXY_USAGE *proxy_usage,
+ LPWSTR *proxy_list, LPWSTR *proxy_bypass_list)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%p %p %p): stub\n", This, pProxyUsage, pProxyList, pProxyBypassList);
+ FIXME("%p, %p, %p, %p: stub\n", iface, proxy_usage, proxy_list, proxy_bypass_list);
return E_NOTIMPL;
}
-static HRESULT WINAPI BackgroundCopyJob_TakeOwnership(
- IBackgroundCopyJob3 *iface)
+static HRESULT WINAPI BackgroundCopyJob_TakeOwnership(IBackgroundCopyJob4 *iface)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p): stub\n", This);
+ FIXME("%p: stub\n", iface);
return E_NOTIMPL;
}
-static HRESULT WINAPI BackgroundCopyJob_SetNotifyCmdLine(
- IBackgroundCopyJob3 *iface,
- LPCWSTR prog,
- LPCWSTR params)
+static HRESULT WINAPI BackgroundCopyJob_SetNotifyCmdLine(IBackgroundCopyJob4 *iface, LPCWSTR prog, LPCWSTR params)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%s %s): stub\n", This, debugstr_w(prog), debugstr_w(params));
+ FIXME("%p, %s, %s: stub\n", iface, debugstr_w(prog), debugstr_w(params));
return E_NOTIMPL;
}
-static HRESULT WINAPI BackgroundCopyJob_GetNotifyCmdLine(
- IBackgroundCopyJob3 *iface,
- LPWSTR *prog,
- LPWSTR *params)
+static HRESULT WINAPI BackgroundCopyJob_GetNotifyCmdLine(IBackgroundCopyJob4 *iface, LPWSTR *prog, LPWSTR *params)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%p %p): stub\n", This, prog, params);
+ FIXME("%p, %p, %p: stub\n", iface, prog, params);
return E_NOTIMPL;
}
-static HRESULT WINAPI BackgroundCopyJob_GetReplyProgress(
- IBackgroundCopyJob3 *iface,
- BG_JOB_REPLY_PROGRESS *progress)
+static HRESULT WINAPI BackgroundCopyJob_GetReplyProgress(IBackgroundCopyJob4 *iface, BG_JOB_REPLY_PROGRESS *progress)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%p): stub\n", This, progress);
+ FIXME("%p, %p: stub\n", iface, progress);
return E_NOTIMPL;
}
-static HRESULT WINAPI BackgroundCopyJob_GetReplyData(
- IBackgroundCopyJob3 *iface,
- byte **pBuffer,
- UINT64 *pLength)
+static HRESULT WINAPI BackgroundCopyJob_GetReplyData(IBackgroundCopyJob4 *iface, byte **buffer, UINT64 *length)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%p %p): stub\n", This, pBuffer, pLength);
+ FIXME("%p, %p, %p: stub\n", iface, buffer, length);
return E_NOTIMPL;
}
-static HRESULT WINAPI BackgroundCopyJob_SetReplyFileName(
- IBackgroundCopyJob3 *iface,
- LPCWSTR filename)
+static HRESULT WINAPI BackgroundCopyJob_SetReplyFileName(IBackgroundCopyJob4 *iface, LPCWSTR filename)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%s): stub\n", This, debugstr_w(filename));
+ FIXME("%p, %s: stub\n", iface, debugstr_w(filename));
return E_NOTIMPL;
}
-static HRESULT WINAPI BackgroundCopyJob_GetReplyFileName(
- IBackgroundCopyJob3 *iface,
- LPWSTR *pFilename)
+static HRESULT WINAPI BackgroundCopyJob_GetReplyFileName(IBackgroundCopyJob4 *iface, LPWSTR *filename)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%p): stub\n", This, pFilename);
+ FIXME("%p, %p: stub\n", iface, filename);
return E_NOTIMPL;
}
@@ -877,15 +784,13 @@ static int index_from_scheme(BG_AUTH_SCHEME scheme)
return scheme - 1;
}
-static HRESULT WINAPI BackgroundCopyJob_SetCredentials(
- IBackgroundCopyJob3 *iface,
- BG_AUTH_CREDENTIALS *cred)
+static HRESULT WINAPI BackgroundCopyJob_SetCredentials(IBackgroundCopyJob4 *iface, BG_AUTH_CREDENTIALS *cred)
{
- BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob3(iface);
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
BG_AUTH_CREDENTIALS *new_cred;
int idx_target, idx_scheme;
- TRACE("(%p)->(%p)\n", job, cred);
+ TRACE("%p, %p.\n", iface, cred);
if ((idx_target = index_from_target(cred->Target)) < 0) return BG_E_INVALID_AUTH_TARGET;
if ((idx_scheme = index_from_scheme(cred->Scheme)) < 0) return BG_E_INVALID_AUTH_SCHEME;
@@ -912,15 +817,15 @@ static HRESULT WINAPI BackgroundCopyJob_SetCredentials(
}
static HRESULT WINAPI BackgroundCopyJob_RemoveCredentials(
- IBackgroundCopyJob3 *iface,
+ IBackgroundCopyJob4 *iface,
BG_AUTH_TARGET target,
BG_AUTH_SCHEME scheme)
{
- BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob3(iface);
+ BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJob4(iface);
BG_AUTH_CREDENTIALS *new_cred;
int idx_target, idx_scheme;
- TRACE("(%p)->(%u %u)\n", job, target, scheme);
+ TRACE("%p, %u, %u.\n", iface, target, scheme);
if ((idx_target = index_from_target(target)) < 0) return BG_E_INVALID_AUTH_TARGET;
if ((idx_scheme = index_from_scheme(scheme)) < 0) return BG_E_INVALID_AUTH_SCHEME;
@@ -939,46 +844,74 @@ static HRESULT WINAPI BackgroundCopyJob_RemoveCredentials(
}
static HRESULT WINAPI BackgroundCopyJob_ReplaceRemotePrefix(
- IBackgroundCopyJob3 *iface,
+ IBackgroundCopyJob4 *iface,
LPCWSTR OldPrefix,
LPCWSTR NewPrefix)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%s %s): stub\n", This, debugstr_w(OldPrefix), debugstr_w(NewPrefix));
+ FIXME("%p, %s, %s: stub\n", iface, debugstr_w(OldPrefix), debugstr_w(NewPrefix));
return S_OK;
}
static HRESULT WINAPI BackgroundCopyJob_AddFileWithRanges(
- IBackgroundCopyJob3 *iface,
+ IBackgroundCopyJob4 *iface,
LPCWSTR RemoteUrl,
LPCWSTR LocalName,
DWORD RangeCount,
BG_FILE_RANGE Ranges[])
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%s %s %u %p): stub\n", This, debugstr_w(RemoteUrl), debugstr_w(LocalName), RangeCount, Ranges);
+ FIXME("%p, %s, %s, %u, %p: stub\n", iface, debugstr_w(RemoteUrl), debugstr_w(LocalName), RangeCount, Ranges);
+ return S_OK;
+}
+
+static HRESULT WINAPI BackgroundCopyJob_SetFileACLFlags(IBackgroundCopyJob4 *iface, DWORD flags)
+{
+ FIXME("%p, %#x: stub\n", iface, flags);
return S_OK;
}
-static HRESULT WINAPI BackgroundCopyJob_SetFileACLFlags(
- IBackgroundCopyJob3 *iface,
- DWORD Flags)
+static HRESULT WINAPI BackgroundCopyJob_GetFileACLFlags(IBackgroundCopyJob4 *iface, DWORD *flags)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%x): stub\n", This, Flags);
+ FIXME("%p, %p: stub\n", iface, flags);
return S_OK;
}
-static HRESULT WINAPI BackgroundCopyJob_GetFileACLFlags(
- IBackgroundCopyJob3 *iface,
- DWORD *Flags)
+static HRESULT WINAPI BackgroundCopyJob_SetPeerCachingFlags(IBackgroundCopyJob4 *iface, DWORD flags)
{
- BackgroundCopyJobImpl *This = impl_from_IBackgroundCopyJob3(iface);
- FIXME("(%p)->(%p): stub\n", This, Flags);
+ FIXME("%p, %#x.\n", iface, flags);
return S_OK;
}
-static const IBackgroundCopyJob3Vtbl BackgroundCopyJob3Vtbl =
+static HRESULT WINAPI BackgroundCopyJob_GetPeerCachingFlags(IBackgroundCopyJob4 *iface, DWORD *flags)
+{
+ FIXME("%p, %p.\n", iface, flags);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BackgroundCopyJob_GetOwnerIntegrityLevel(IBackgroundCopyJob4 *iface, ULONG *level)
+{
+ FIXME("%p, %p.\n", iface, level);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BackgroundCopyJob_GetOwnerElevationState(IBackgroundCopyJob4 *iface, BOOL *elevated)
+{
+ FIXME("%p, %p.\n", iface, elevated);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BackgroundCopyJob_SetMaximumDownloadTime(IBackgroundCopyJob4 *iface, ULONG timeout)
+{
+ FIXME("%p, %u.\n", iface, timeout);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI BackgroundCopyJob_GetMaximumDownloadTime(IBackgroundCopyJob4 *iface, ULONG *timeout)
+{
+ FIXME("%p, %p.\n", iface, timeout);
+ return E_NOTIMPL;
+}
+
+static const IBackgroundCopyJob4Vtbl BackgroundCopyJobVtbl =
{
BackgroundCopyJob_QueryInterface,
BackgroundCopyJob_AddRef,
@@ -1026,7 +959,13 @@ static const IBackgroundCopyJob3Vtbl BackgroundCopyJob3Vtbl =
BackgroundCopyJob_ReplaceRemotePrefix,
BackgroundCopyJob_AddFileWithRanges,
BackgroundCopyJob_SetFileACLFlags,
- BackgroundCopyJob_GetFileACLFlags
+ BackgroundCopyJob_GetFileACLFlags,
+ BackgroundCopyJob_SetPeerCachingFlags,
+ BackgroundCopyJob_GetPeerCachingFlags,
+ BackgroundCopyJob_GetOwnerIntegrityLevel,
+ BackgroundCopyJob_GetOwnerElevationState,
+ BackgroundCopyJob_SetMaximumDownloadTime,
+ BackgroundCopyJob_GetMaximumDownloadTime,
};
static inline BackgroundCopyJobImpl *impl_from_IBackgroundCopyJobHttpOptions(
@@ -1041,21 +980,21 @@ static HRESULT WINAPI http_options_QueryInterface(
void **ppvObject)
{
BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJobHttpOptions(iface);
- return IBackgroundCopyJob3_QueryInterface(&job->IBackgroundCopyJob3_iface, riid, ppvObject);
+ return IBackgroundCopyJob4_QueryInterface(&job->IBackgroundCopyJob4_iface, riid, ppvObject);
}
static ULONG WINAPI http_options_AddRef(
IBackgroundCopyJobHttpOptions *iface)
{
BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJobHttpOptions(iface);
- return IBackgroundCopyJob3_AddRef(&job->IBackgroundCopyJob3_iface);
+ return IBackgroundCopyJob4_AddRef(&job->IBackgroundCopyJob4_iface);
}
static ULONG WINAPI http_options_Release(
IBackgroundCopyJobHttpOptions *iface)
{
BackgroundCopyJobImpl *job = impl_from_IBackgroundCopyJobHttpOptions(iface);
- return IBackgroundCopyJob3_Release(&job->IBackgroundCopyJob3_iface);
+ return IBackgroundCopyJob4_Release(&job->IBackgroundCopyJob4_iface);
}
static HRESULT WINAPI http_options_SetClientCertificateByID(
@@ -1205,7 +1144,7 @@ HRESULT BackgroundCopyJobConstructor(LPCWSTR displayName, BG_JOB_TYPE type, GUID
if (!This)
return E_OUTOFMEMORY;
- This->IBackgroundCopyJob3_iface.lpVtbl = &BackgroundCopyJob3Vtbl;
+ This->IBackgroundCopyJob4_iface.lpVtbl = &BackgroundCopyJobVtbl;
This->IBackgroundCopyJobHttpOptions_iface.lpVtbl = &http_options_vtbl;
InitializeCriticalSection(&This->cs);
This->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BackgroundCopyJobImpl.cs");
@@ -1281,7 +1220,11 @@ void processJob(BackgroundCopyJobImpl *job)
{
transitionJobState(job, BG_JOB_STATE_QUEUED, BG_JOB_STATE_TRANSFERRED);
if (job->callback && (job->notify_flags & BG_NOTIFY_JOB_TRANSFERRED))
- IBackgroundCopyCallback2_JobTransferred(job->callback, (IBackgroundCopyJob*)&job->IBackgroundCopyJob3_iface);
+ {
+ TRACE("Calling JobTransferred -->\n");
+ IBackgroundCopyCallback2_JobTransferred(job->callback, (IBackgroundCopyJob*)&job->IBackgroundCopyJob4_iface);
+ TRACE("Called JobTransferred <--\n");
+ }
return;
}
diff --git a/dlls/qmgr/qmgr.c b/dlls/qmgr/qmgr.c
index 110b87bf7f..5b16e86caf 100644
--- a/dlls/qmgr/qmgr.c
+++ b/dlls/qmgr/qmgr.c
@@ -66,7 +66,7 @@ static HRESULT WINAPI BackgroundCopyManager_CreateJob(IBackgroundCopyManager *if
return hres;
/* Add a reference to the job to job list */
- *ppJob = (IBackgroundCopyJob *)&job->IBackgroundCopyJob3_iface;
+ *ppJob = (IBackgroundCopyJob *)&job->IBackgroundCopyJob4_iface;
IBackgroundCopyJob_AddRef(*ppJob);
EnterCriticalSection(&globalMgr.cs);
list_add_head(&globalMgr.jobs, &job->entryFromQmgr);
@@ -93,8 +93,8 @@ static HRESULT WINAPI BackgroundCopyManager_GetJob(IBackgroundCopyManager *iface
{
if (IsEqualGUID(&cur->jobId, jobID))
{
- *job = (IBackgroundCopyJob *)&cur->IBackgroundCopyJob3_iface;
- IBackgroundCopyJob3_AddRef(&cur->IBackgroundCopyJob3_iface);
+ *job = (IBackgroundCopyJob *)&cur->IBackgroundCopyJob4_iface;
+ IBackgroundCopyJob_AddRef(*job);
hr = S_OK;
break;
}
@@ -164,7 +164,7 @@ DWORD WINAPI fileTransfer(void *param)
LIST_FOR_EACH_ENTRY_SAFE(job, jobCur, &qmgr->jobs, BackgroundCopyJobImpl, entryFromQmgr)
{
list_remove(&job->entryFromQmgr);
- IBackgroundCopyJob3_Release(&job->IBackgroundCopyJob3_iface);
+ IBackgroundCopyJob4_Release(&job->IBackgroundCopyJob4_iface);
}
return 0;
}
@@ -179,7 +179,7 @@ DWORD WINAPI fileTransfer(void *param)
if (job->state == BG_JOB_STATE_ACKNOWLEDGED || job->state == BG_JOB_STATE_CANCELLED)
{
list_remove(&job->entryFromQmgr);
- IBackgroundCopyJob3_Release(&job->IBackgroundCopyJob3_iface);
+ IBackgroundCopyJob4_Release(&job->IBackgroundCopyJob4_iface);
}
else if (job->state == BG_JOB_STATE_QUEUED)
{
diff --git a/dlls/qmgr/qmgr.h b/dlls/qmgr/qmgr.h
index 87f8307a42..de808049ea 100644
--- a/dlls/qmgr/qmgr.h
+++ b/dlls/qmgr/qmgr.h
@@ -35,7 +35,7 @@
/* Background copy job vtbl and related data */
typedef struct
{
- IBackgroundCopyJob3 IBackgroundCopyJob3_iface;
+ IBackgroundCopyJob4 IBackgroundCopyJob4_iface;
IBackgroundCopyJobHttpOptions IBackgroundCopyJobHttpOptions_iface;
LONG ref;
LPWSTR displayName;
--
2.26.2
1
1
08 May '20
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com>
1
0
[PATCH 3/4] msasn1: Add partial implementation of ASN1_CreateDecoder
by Vijay Kiran Kamuju 08 May '20
by Vijay Kiran Kamuju 08 May '20
08 May '20
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com>
1
0
Since wine-5.5 cmd shows on cursor up just the half
of the last entered command.
A bisect points here:
commit ffe6548d6c55f81918e1aa63228b724cbe72e567
Date: Sat Mar 21 11:57:39 2020 +0100
server: Store length of console history lines instead of null-terminating them.
Signed-off-by: Bernhard Übelacker <bernhardu(a)mailbox.org>
---
server/console.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/server/console.c b/server/console.c
index 5feb1c2ba7a..302be6a1c1a 100644
--- a/server/console.c
+++ b/server/console.c
@@ -1680,7 +1680,7 @@ DECL_HANDLER(append_console_input_history)
struct console_input *console;
if (!(console = console_input_get( req->handle, FILE_WRITE_PROPERTIES ))) return;
- console_input_append_hist( console, get_req_data(), get_req_data_size() / sizeof(WCHAR) );
+ console_input_append_hist( console, get_req_data(), get_req_data_size() );
release_object( console );
}
--
2.20.1
1
1
08 May '20
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com>
1
0
[PATCH 1/4] msasn1: Add partial implementation of ASN1_CreateEncoder
by Vijay Kiran Kamuju 08 May '20
by Vijay Kiran Kamuju 08 May '20
08 May '20
Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com>
1
0
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/dmime/dmime_private.h | 7 ++
dlls/dmime/wavetrack.c | 196 ++++++++++++++++++++++++++++++++++++-
2 files changed, 201 insertions(+), 2 deletions(-)
diff --git a/dlls/dmime/dmime_private.h b/dlls/dmime/dmime_private.h
index 9759039a03e9..f7431e882f42 100644
--- a/dlls/dmime/dmime_private.h
+++ b/dlls/dmime/dmime_private.h
@@ -86,6 +86,13 @@ typedef struct _DMUS_PRIVATE_TEMPO_ITEM {
DMUS_IO_TEMPO_ITEM item;
} DMUS_PRIVATE_TEMPO_ITEM, *LPDMUS_PRIVATE_TEMPO_ITEM;
+struct wave_item {
+ struct list entry; /* for listing elements */
+ DMUS_IO_WAVE_TRACK_HEADER header;
+
+ IDirectMusicObject *object;
+};
+
typedef struct _DMUS_PRIVATE_SEGMENT_ITEM {
struct list entry; /* for listing elements */
DMUS_IO_SEGMENT_ITEM_HEADER header;
diff --git a/dlls/dmime/wavetrack.c b/dlls/dmime/wavetrack.c
index 1c6b08b52355..23406e0794d0 100644
--- a/dlls/dmime/wavetrack.c
+++ b/dlls/dmime/wavetrack.c
@@ -20,6 +20,8 @@
#include "dmime_private.h"
#include "dmobject.h"
+#include "wine/heap.h"
+
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
/*****************************************************************************
@@ -32,6 +34,8 @@ typedef struct IDirectMusicWaveTrack {
IDirectMusicTrack8 IDirectMusicTrack8_iface;
struct dmobject dmobj; /* IPersistStream only */
LONG ref;
+
+ struct list items;
} IDirectMusicWaveTrack;
/* IDirectMusicWaveTrack IDirectMusicTrack8 part: */
@@ -40,6 +44,11 @@ static inline IDirectMusicWaveTrack *impl_from_IDirectMusicTrack8(IDirectMusicTr
return CONTAINING_RECORD(iface, IDirectMusicWaveTrack, IDirectMusicTrack8_iface);
}
+static inline IDirectMusicWaveTrack *impl_from_IPersistStream(IPersistStream *iface)
+{
+ return CONTAINING_RECORD(iface, IDirectMusicWaveTrack, dmobj.IPersistStream_iface);
+}
+
static HRESULT WINAPI wave_track_QueryInterface(IDirectMusicTrack8 *iface, REFIID riid,
void **ret_iface)
{
@@ -81,6 +90,19 @@ static ULONG WINAPI wave_track_Release(IDirectMusicTrack8 *iface)
TRACE("(%p) ref=%d\n", This, ref);
if (!ref) {
+ struct list *cursor, *cursor2;
+ struct wave_item *item;
+
+ LIST_FOR_EACH_SAFE(cursor, cursor2, &This->items) {
+ item = LIST_ENTRY(cursor, struct wave_item, entry);
+ list_remove(cursor);
+
+ if (item->object)
+ IDirectMusicObject_Release(item->object);
+
+ heap_free(item);
+ }
+
HeapFree(GetProcessHeap(), 0, This);
DMIME_UnlockModule();
}
@@ -280,10 +302,179 @@ static const IDirectMusicTrack8Vtbl dmtrack8_vtbl = {
wave_track_Join
};
+static HRESULT parse_wave_item(IDirectMusicWaveTrack *This, IStream *stream,
+ struct chunk_entry *wave, struct wave_item *item)
+{
+ HRESULT hr;
+ struct chunk_entry chunk = {.parent = wave};
+
+ if (FAILED(hr = stream_next_chunk(stream, &chunk)))
+ return hr;
+
+ if(chunk.id == FOURCC_LIST && chunk.type == DMUS_FOURCC_WAVE_LIST)
+ {
+ struct chunk_entry child = {.parent = &chunk};
+ DMUS_IO_WAVE_ITEM_HEADER header;
+
+ if (FAILED(hr = stream_next_chunk(stream, &child)))
+ return hr;
+
+ if(child.id != DMUS_FOURCC_WAVEITEM_CHUNK)
+ return DMUS_E_UNSUPPORTED_STREAM;
+
+ if (FAILED(hr = stream_chunk_get_data(stream, &child, &header, child.size))) {
+ WARN("Failed to read data of %s\n", debugstr_chunk(&child));
+ return hr;
+ }
+
+ TRACE("Found DMUS_IO_WAVE_ITEM_HEADER\n");
+ TRACE(" - lVolume %d\n", header.lVolume);
+ TRACE(" - dwVariations %d\n", header.dwVariations);
+ TRACE(" - rtTime %d\n", header.rtTime);
+ TRACE(" - rtStartOffset %d\n", header.rtStartOffset);
+ TRACE(" - rtReserved %d\n", header.rtReserved);
+ TRACE(" - rtDuration %d\n", header.rtDuration);
+ TRACE(" - dwLoopStart %d\n", header.dwLoopStart);
+ TRACE(" - dwLoopEnd %d\n", header.dwLoopEnd);
+ TRACE(" - dwFlags 0x%08x\n", header.dwFlags);
+ TRACE(" - wVolumeRange %d\n", header.wVolumeRange);
+ TRACE(" - wPitchRange %d\n", header.wPitchRange);
+
+ if (FAILED(hr = stream_next_chunk(stream, &child)))
+ return hr;
+
+ if(child.id == FOURCC_LIST && child.type == DMUS_FOURCC_REF_LIST)
+ {
+ struct chunk_entry dmrf = {.parent = &child};
+ IDirectMusicGetLoader *getloader;
+ IDirectMusicLoader *loader;
+ DMUS_IO_REFERENCE reference;
+
+ if (FAILED(hr = stream_next_chunk(stream, &dmrf)))
+ return hr;
+
+ if(dmrf.id != DMUS_FOURCC_REF_CHUNK)
+ return DMUS_E_UNSUPPORTED_STREAM;
+
+ if (FAILED(hr = stream_chunk_get_data(stream, &dmrf, &reference, dmrf.size))) {
+ WARN("Failed to read data of %s\n", debugstr_chunk(&dmrf));
+ return hr;
+ }
+
+ TRACE("REFERENCE guidClassID %s, dwValidData 0x%08x\n", debugstr_dmguid(&reference.guidClassID),
+ reference.dwValidData);
+
+ This->dmobj.desc.guidClass = reference.guidClassID;
+ This->dmobj.desc.dwValidData = DMUS_OBJ_CLASS;
+
+ hr = dmobj_parsedescriptor(stream, &child, &This->dmobj.desc, reference.dwValidData);
+ if (FAILED(hr))
+ return hr;
+
+ dump_DMUS_OBJECTDESC(&This->dmobj.desc);
+
+ hr = IStream_QueryInterface (stream, &IID_IDirectMusicGetLoader, (void**)&getloader);
+ if (FAILED(hr))
+ return hr;
+
+ hr = IDirectMusicGetLoader_GetLoader (getloader, &loader);
+ if (FAILED(hr))
+ return hr;
+ IDirectMusicGetLoader_Release (getloader);
+
+ hr = IDirectMusicLoader_GetObject (loader, &This->dmobj.desc, &IID_IDirectMusicObject,
+ (void**)&item->object);
+ IDirectMusicLoader_Release (loader);
+ }
+ }
+ else
+ hr = DMUS_E_UNSUPPORTED_STREAM;
+
+ return SUCCEEDED(hr) ? S_OK : hr;
+}
+
+static HRESULT parse_wavetrack_list(IDirectMusicWaveTrack *This, IStream *stream,
+ struct chunk_entry *wave)
+{
+ HRESULT hr;
+ struct chunk_entry chunk = {.parent = wave};
+ struct wave_item *item = NULL;
+
+ TRACE("Parsing segment form in %p: %s\n", stream, debugstr_chunk(wave));
+
+ if (FAILED(hr = stream_next_chunk(stream, &chunk)))
+ return hr;
+
+ if (chunk.id != DMUS_FOURCC_WAVETRACK_CHUNK)
+ return DMUS_E_UNSUPPORTED_STREAM;
+
+ item = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(struct wave_item));
+ if (!item)
+ return E_OUTOFMEMORY;
+
+ list_add_tail (&This->items, &item->entry);
+
+ if (FAILED(hr = stream_next_chunk(stream, &chunk)))
+ return hr;
+
+ if (chunk.id == FOURCC_LIST && chunk.type == DMUS_FOURCC_WAVEPART_LIST)
+ {
+ struct chunk_entry child = {.parent = wave};
+ DMUS_IO_WAVE_PART_HEADER header;
+
+ if (FAILED(hr = stream_next_chunk(stream, &child)))
+ return hr;
+
+ if (child.id != DMUS_FOURCC_WAVEPART_CHUNK)
+ return DMUS_E_UNSUPPORTED_STREAM;
+
+ if (FAILED(hr = stream_chunk_get_data(stream, &child, &header, child.size))) {
+ WARN("Failed to read data of %s\n", debugstr_chunk(&child));
+ return hr;
+ }
+
+ TRACE("Found DMUS_IO_WAVE_PART_HEADER\n");
+ TRACE(" - lVolume %d\n", header.lVolume);
+ TRACE(" - dwVariations %d\n", header.dwVariations);
+ TRACE(" - dwPChannel %d\n", header.dwPChannel);
+ TRACE(" - dwLockToPart %d\n", header.dwLockToPart);
+ TRACE(" - dwFlags 0x%08x\n", header.dwFlags);
+ TRACE(" - dwIndex %d\n", header.dwIndex);
+
+ if (FAILED(hr = stream_next_chunk(stream, &child)))
+ return hr;
+
+ if(child.id != FOURCC_LIST || child.type != DMUS_FOURCC_WAVEITEM_LIST)
+ return DMUS_E_UNSUPPORTED_STREAM;
+
+ hr = parse_wave_item(This, stream, &child, item);
+ }
+ else
+ hr = DMUS_E_UNSUPPORTED_STREAM;
+
+ return SUCCEEDED(hr) ? S_OK : hr;
+}
+
static HRESULT WINAPI wave_IPersistStream_Load(IPersistStream *iface, IStream *stream)
{
- FIXME(": Loading not implemented yet\n");
- return S_OK;
+ IDirectMusicWaveTrack *This = impl_from_IPersistStream(iface);
+ HRESULT hr;
+ struct chunk_entry chunk = {0};
+
+ TRACE("%p, %p\n", This, stream);
+
+ if (!stream)
+ return E_POINTER;
+
+ if ((hr = stream_get_chunk(stream, &chunk) != S_OK))
+ return hr;
+
+ if (chunk.id == FOURCC_LIST && chunk.type == DMUS_FOURCC_WAVETRACK_LIST)
+ hr = parse_wavetrack_list(This, stream, &chunk);
+ else
+ hr = DMUS_E_UNSUPPORTED_STREAM;
+
+ return hr;
}
static const IPersistStreamVtbl persiststream_vtbl = {
@@ -313,6 +504,7 @@ HRESULT WINAPI create_dmwavetrack(REFIID lpcGUID, void **ppobj)
dmobject_init(&track->dmobj, &CLSID_DirectMusicWaveTrack,
(IUnknown *)&track->IDirectMusicTrack8_iface);
track->dmobj.IPersistStream_iface.lpVtbl = &persiststream_vtbl;
+ list_init(&track->items);
DMIME_LockModule();
hr = IDirectMusicTrack8_QueryInterface(&track->IDirectMusicTrack8_iface, lpcGUID, ppobj);
--
2.26.2
2
2
08 May '20
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/quartz/quartz_private.h | 2 --
dlls/quartz/videorenderer.c | 24 ------------------------
dlls/quartz/vmr9.c | 24 ------------------------
dlls/quartz/window.c | 7 +++++--
4 files changed, 5 insertions(+), 52 deletions(-)
diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h
index 7e49367a932..d3f3a8915ae 100644
--- a/dlls/quartz/quartz_private.h
+++ b/dlls/quartz/quartz_private.h
@@ -112,8 +112,6 @@ struct video_window_ops
BOOL (*resize)(struct video_window *window, LONG height, LONG width);
HRESULT (*get_current_image)(struct video_window *window, LONG *size, LONG *image);
- HRESULT (WINAPI *pfnSetDefaultSourceRect)(struct video_window *window);
- HRESULT (WINAPI *pfnSetDefaultTargetRect)(struct video_window *window);
};
void video_window_cleanup(struct video_window *window) DECLSPEC_HIDDEN;
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c
index ea5142e3213..8504a51d747 100644
--- a/dlls/quartz/videorenderer.c
+++ b/dlls/quartz/videorenderer.c
@@ -314,35 +314,11 @@ static HRESULT video_renderer_get_current_image(struct video_window *iface, LONG
return S_OK;
}
-static HRESULT WINAPI VideoRenderer_SetDefaultSourceRect(struct video_window *iface)
-{
- struct video_renderer *This = impl_from_video_window(iface);
-
- SetRect(&This->window.src, 0, 0, This->VideoWidth, This->VideoHeight);
-
- return S_OK;
-}
-
-static HRESULT WINAPI VideoRenderer_SetDefaultTargetRect(struct video_window *iface)
-{
- struct video_renderer *This = impl_from_video_window(iface);
- RECT rect;
-
- if (!GetClientRect(This->window.hwnd, &rect))
- return E_FAIL;
-
- SetRect(&This->window.dst, 0, 0, rect.right, rect.bottom);
-
- return S_OK;
-}
-
static const struct video_window_ops window_ops =
{
.get_default_rect = video_renderer_get_default_rect,
.resize = video_renderer_resize,
.get_current_image = video_renderer_get_current_image,
- .pfnSetDefaultSourceRect = VideoRenderer_SetDefaultSourceRect,
- .pfnSetDefaultTargetRect = VideoRenderer_SetDefaultTargetRect,
};
static HRESULT WINAPI VideoWindow_get_FullScreenMode(IVideoWindow *iface,
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c
index 4fb8ddc32f4..64ef4a53e3e 100644
--- a/dlls/quartz/vmr9.c
+++ b/dlls/quartz/vmr9.c
@@ -734,35 +734,11 @@ out:
return hr;
}
-static HRESULT WINAPI VMR9_SetDefaultSourceRect(struct video_window *iface)
-{
- struct quartz_vmr *filter = impl_from_video_window(iface);
-
- SetRect(&filter->window.src, 0, 0, filter->VideoWidth, filter->VideoHeight);
-
- return S_OK;
-}
-
-static HRESULT WINAPI VMR9_SetDefaultTargetRect(struct video_window *iface)
-{
- RECT rect;
- struct quartz_vmr *filter = impl_from_video_window(iface);
-
- if (!GetClientRect(filter->window.hwnd, &rect))
- return E_FAIL;
-
- SetRect(&filter->window.dst, 0, 0, rect.right, rect.bottom);
-
- return S_OK;
-}
-
static const struct video_window_ops window_ops =
{
.get_default_rect = vmr_get_default_rect,
.resize = vmr_resize,
.get_current_image = vmr_get_current_image,
- .pfnSetDefaultSourceRect = VMR9_SetDefaultSourceRect,
- .pfnSetDefaultTargetRect = VMR9_SetDefaultTargetRect,
};
static const IVideoWindowVtbl IVideoWindow_VTable =
diff --git a/dlls/quartz/window.c b/dlls/quartz/window.c
index ebd3ffe3024..d383370e5d8 100644
--- a/dlls/quartz/window.c
+++ b/dlls/quartz/window.c
@@ -1055,10 +1055,12 @@ static HRESULT WINAPI basic_video_GetSourcePosition(IBasicVideo *iface,
static HRESULT WINAPI basic_video_SetDefaultSourcePosition(IBasicVideo *iface)
{
struct video_window *window = impl_from_IBasicVideo(iface);
+ const BITMAPINFOHEADER *bitmap_header = get_bitmap_header(window);
TRACE("window %p.\n", window);
- return window->ops->pfnSetDefaultSourceRect(window);
+ SetRect(&window->src, 0, 0, bitmap_header->biWidth, bitmap_header->biHeight);
+ return S_OK;
}
static HRESULT WINAPI basic_video_SetDestinationPosition(IBasicVideo *iface,
@@ -1098,7 +1100,8 @@ static HRESULT WINAPI basic_video_SetDefaultDestinationPosition(IBasicVideo *ifa
TRACE("window %p.\n", window);
- return window->ops->pfnSetDefaultTargetRect(window);
+ GetClientRect(window->hwnd, &window->dst);
+ return S_OK;
}
static HRESULT WINAPI basic_video_GetVideoSize(IBasicVideo *iface, LONG *width, LONG *height)
--
2.26.2
2
5
08 May '20
From: Vincent Povirk <vincent(a)codeweavers.com>
Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com>
---
dlls/gdiplus/graphics.c | 66 ++++++++++++++++++++++++++++++++---------
1 file changed, 52 insertions(+), 14 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 04c5501deb6..72075e02fbb 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -2242,7 +2242,7 @@ void get_log_fontW(const GpFont *font, GpGraphics *graphics, LOGFONTW *lf)
static void get_font_hfont(GpGraphics *graphics, GDIPCONST GpFont *font,
GDIPCONST GpStringFormat *format, HFONT *hfont,
- GDIPCONST GpMatrix *matrix)
+ LOGFONTW *lfw_return, GDIPCONST GpMatrix *matrix)
{
HDC hdc = CreateCompatibleDC(0);
GpPointF pt[3];
@@ -2300,6 +2300,9 @@ static void get_font_hfont(GpGraphics *graphics, GDIPCONST GpFont *font,
*hfont = CreateFontIndirectW(&lfw);
+ if (lfw_return)
+ *lfw_return = lfw;
+
DeleteDC(hdc);
DeleteObject(unscaled_font);
}
@@ -5371,7 +5374,7 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics,
if (scaled_rect.Width >= 1 << 23) scaled_rect.Width = 1 << 23;
if (scaled_rect.Height >= 1 << 23) scaled_rect.Height = 1 << 23;
- get_font_hfont(graphics, font, stringFormat, &gdifont, NULL);
+ get_font_hfont(graphics, font, stringFormat, &gdifont, NULL, NULL);
oldfont = SelectObject(hdc, gdifont);
for (i=0; i<stringFormat->range_count; i++)
@@ -5505,7 +5508,7 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics,
if (scaled_rect.Width >= 1 << 23) scaled_rect.Width = 1 << 23;
if (scaled_rect.Height >= 1 << 23) scaled_rect.Height = 1 << 23;
- get_font_hfont(graphics, font, format, &gdifont, NULL);
+ get_font_hfont(graphics, font, format, &gdifont, NULL, NULL);
oldfont = SelectObject(hdc, gdifont);
bounds->X = rect->X;
@@ -5692,7 +5695,7 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
SelectClipRgn(hdc, rgn);
}
- get_font_hfont(graphics, font, format, &gdifont, NULL);
+ get_font_hfont(graphics, font, format, &gdifont, NULL, NULL);
SelectObject(hdc, gdifont);
args.graphics = graphics;
@@ -6990,7 +6993,7 @@ GpStatus WINGDIPAPI GdipMeasureDriverString(GpGraphics *graphics, GDIPCONST UINT
if (flags & unsupported_flags)
FIXME("Ignoring flags %x\n", flags & unsupported_flags);
- get_font_hfont(graphics, font, NULL, &hfont, matrix);
+ get_font_hfont(graphics, font, NULL, &hfont, NULL, matrix);
hdc = CreateCompatibleDC(0);
SelectObject(hdc, hfont);
@@ -7075,20 +7078,30 @@ static GpStatus GDI32_GdipDrawDriverString(GpGraphics *graphics, GDIPCONST UINT1
GDIPCONST GpBrush *brush, GDIPCONST PointF *positions,
INT flags, GDIPCONST GpMatrix *matrix)
{
- static const INT unsupported_flags = ~(DriverStringOptionsRealizedAdvance|DriverStringOptionsCmapLookup);
INT save_state;
- GpPointF pt;
+ GpPointF pt, *real_positions=NULL;
+ INT *eto_positions=NULL;
HFONT hfont;
+ LOGFONTW lfw;
UINT eto_flags=0;
GpStatus status;
HRGN hrgn;
- if (flags & unsupported_flags)
- FIXME("Ignoring flags %x\n", flags & unsupported_flags);
-
if (!(flags & DriverStringOptionsCmapLookup))
eto_flags |= ETO_GLYPH_INDEX;
+ if (!(flags & DriverStringOptionsRealizedAdvance) && length > 1)
+ {
+ real_positions = heap_alloc(sizeof(*real_positions) * length);
+ eto_positions = heap_alloc(sizeof(*eto_positions) * 2 * (length - 1));
+ if (!real_positions || !eto_positions)
+ {
+ heap_free(real_positions);
+ heap_free(eto_positions);
+ return OutOfMemory;
+ }
+ }
+
save_state = SaveDC(graphics->hdc);
SetBkMode(graphics->hdc, TRANSPARENT);
SetTextColor(graphics->hdc, get_gdi_brush_color(brush));
@@ -7104,14 +7117,37 @@ static GpStatus GDI32_GdipDrawDriverString(GpGraphics *graphics, GDIPCONST UINT1
pt = positions[0];
gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, &pt, 1);
- get_font_hfont(graphics, font, format, &hfont, matrix);
+ get_font_hfont(graphics, font, format, &hfont, &lfw, matrix);
+
+ if (!(flags & DriverStringOptionsRealizedAdvance) && length > 1)
+ {
+ GpMatrix rotation;
+ INT i;
+
+ eto_flags |= ETO_PDY;
+
+ memcpy(real_positions, positions, sizeof(PointF) * length);
+
+ gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, real_positions, length);
+
+ GdipSetMatrixElements(&rotation, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
+ GdipRotateMatrix(&rotation, lfw.lfEscapement / 10.0, MatrixOrderAppend);
+ GdipTransformMatrixPoints(&rotation, real_positions, length);
+
+ for (i = 0; i < (length - 1); i++)
+ {
+ eto_positions[i*2] = gdip_round(real_positions[i+1].X) - gdip_round(real_positions[i].X);
+ eto_positions[i*2+1] = gdip_round(real_positions[i].Y) - gdip_round(real_positions[i+1].Y);
+ }
+ }
+
SelectObject(graphics->hdc, hfont);
SetTextAlign(graphics->hdc, TA_BASELINE|TA_LEFT);
gdi_transform_acquire(graphics);
- ExtTextOutW(graphics->hdc, gdip_round(pt.X), gdip_round(pt.Y), eto_flags, NULL, text, length, NULL);
+ ExtTextOutW(graphics->hdc, gdip_round(pt.X), gdip_round(pt.Y), eto_flags, NULL, text, length, eto_positions);
gdi_transform_release(graphics);
@@ -7119,6 +7155,9 @@ static GpStatus GDI32_GdipDrawDriverString(GpGraphics *graphics, GDIPCONST UINT1
DeleteObject(hfont);
+ heap_free(real_positions);
+ heap_free(eto_positions);
+
return Ok;
}
@@ -7182,7 +7221,7 @@ static GpStatus SOFTWARE_GdipDrawDriverString(GpGraphics *graphics, GDIPCONST UI
heap_free(real_positions);
}
- get_font_hfont(graphics, font, format, &hfont, matrix);
+ get_font_hfont(graphics, font, format, &hfont, NULL, matrix);
hdc = CreateCompatibleDC(0);
SelectObject(hdc, hfont);
@@ -7346,7 +7385,6 @@ static GpStatus draw_driver_string(GpGraphics *graphics, GDIPCONST UINT16 *text,
length = lstrlenW(text);
if (graphics->hdc && !graphics->alpha_hdc &&
- ((flags & DriverStringOptionsRealizedAdvance) || length <= 1) &&
brush->bt == BrushTypeSolidColor &&
(((GpSolidFill*)brush)->color & 0xff000000) == 0xff000000)
stat = GDI32_GdipDrawDriverString(graphics, text, length, font, format,
--
2.17.1
1
0
[PATCH] http.sys: Use a separate file and preprocessor directives to avoid duplication.
by Zebediah Figura 07 May '20
by Zebediah Figura 07 May '20
07 May '20
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/http.sys/http.c | 531 ++--------------------------------------
dlls/http.sys/request.h | 310 +++++++++++++++++++++++
2 files changed, 336 insertions(+), 505 deletions(-)
create mode 100644 dlls/http.sys/request.h
diff --git a/dlls/http.sys/http.c b/dlls/http.sys/http.c
index 46590f972f..31c7fc0971 100644
--- a/dlls/http.sys/http.c
+++ b/dlls/http.sys/http.c
@@ -33,164 +33,6 @@ static DEVICE_OBJECT *device_obj;
WINE_DEFAULT_DEBUG_CHANNEL(http);
-/* We have to return the HTTP_REQUEST structure to userspace exactly as it will
- * be consumed; httpapi has no opportunity to massage it. Since it contains
- * pointers, this is somewhat nontrivial. */
-
-struct http_unknown_header_32
-{
- USHORT NameLength;
- USHORT RawValueLength;
- ULONG pName; /* char string */
- ULONG pRawValue; /* char string */
-};
-
-struct http_data_chunk_32
-{
- HTTP_DATA_CHUNK_TYPE DataChunkType;
- union
- {
- struct
- {
- ULONG pBuffer; /* char string */
- ULONG BufferLength;
- } FromMemory;
- /* for the struct size */
- struct
- {
- ULARGE_INTEGER StartingOffset;
- ULARGE_INTEGER Length;
- HANDLE FileHandle;
- } FromFileHandle;
- };
-};
-
-struct http_request_32
-{
- ULONG Flags;
- HTTP_CONNECTION_ID ConnectionId;
- HTTP_REQUEST_ID RequestId;
- HTTP_URL_CONTEXT UrlContext;
- HTTP_VERSION Version;
- HTTP_VERB Verb;
- USHORT UnknownVerbLength;
- USHORT RawUrlLength;
- ULONG pUnknownVerb; /* char string */
- ULONG pRawUrl; /* char string */
- struct
- {
- USHORT FullUrlLength;
- USHORT HostLength;
- USHORT AbsPathLength;
- USHORT QueryStringLength;
- ULONG pFullUrl; /* WCHAR string */
- ULONG pHost; /* pointer to above */
- ULONG pAbsPath; /* pointer to above */
- ULONG pQueryString; /* pointer to above */
- } CookedUrl;
- struct
- {
- ULONG pRemoteAddress; /* SOCKADDR */
- ULONG pLocalAddress; /* SOCKADDR */
- } Address;
- struct
- {
- USHORT UnknownHeaderCount;
- ULONG pUnknownHeaders; /* struct http_unknown_header_32 */
- USHORT TrailerCount;
- ULONG pTrailers; /* NULL */
- struct
- {
- USHORT RawValueLength;
- ULONG pRawValue; /* char string */
- } KnownHeaders[HttpHeaderRequestMaximum];
- } Headers;
- ULONGLONG BytesReceived;
- USHORT EntityChunkCount;
- ULONG pEntityChunks; /* struct http_data_chunk_32 */
- HTTP_RAW_CONNECTION_ID RawConnectionId;
- ULONG pSslInfo; /* NULL (FIXME) */
- USHORT RequestInfoCount;
- ULONG pRequestInfo; /* NULL (FIXME) */
-};
-
-struct http_unknown_header_64
-{
- USHORT NameLength;
- USHORT RawValueLength;
- ULONGLONG pName; /* char string */
- ULONGLONG pRawValue; /* char string */
-};
-
-struct http_data_chunk_64
-{
- HTTP_DATA_CHUNK_TYPE DataChunkType;
- union
- {
- struct
- {
- ULONGLONG pBuffer; /* char string */
- ULONG BufferLength;
- } FromMemory;
- /* for the struct size */
- struct
- {
- ULARGE_INTEGER StartingOffset;
- ULARGE_INTEGER Length;
- HANDLE FileHandle;
- } FromFileHandle;
- };
-};
-
-struct http_request_64
-{
- ULONG Flags;
- HTTP_CONNECTION_ID ConnectionId;
- HTTP_REQUEST_ID RequestId;
- HTTP_URL_CONTEXT UrlContext;
- HTTP_VERSION Version;
- HTTP_VERB Verb;
- USHORT UnknownVerbLength;
- USHORT RawUrlLength;
- ULONGLONG pUnknownVerb; /* char string */
- ULONGLONG pRawUrl; /* char string */
- struct
- {
- USHORT FullUrlLength;
- USHORT HostLength;
- USHORT AbsPathLength;
- USHORT QueryStringLength;
- ULONGLONG pFullUrl; /* WCHAR string */
- ULONGLONG pHost; /* pointer to above */
- ULONGLONG pAbsPath; /* pointer to above */
- ULONGLONG pQueryString; /* pointer to above */
- } CookedUrl;
- struct
- {
- ULONGLONG pRemoteAddress; /* SOCKADDR */
- ULONGLONG pLocalAddress; /* SOCKADDR */
- } Address;
- struct
- {
- USHORT UnknownHeaderCount;
- ULONGLONG pUnknownHeaders; /* struct http_unknown_header_32 */
- USHORT TrailerCount;
- ULONGLONG pTrailers; /* NULL */
- struct
- {
- USHORT RawValueLength;
- ULONGLONG pRawValue; /* char string */
- } KnownHeaders[HttpHeaderRequestMaximum];
- } Headers;
- ULONGLONG BytesReceived;
- USHORT EntityChunkCount;
- ULONGLONG pEntityChunks; /* struct http_data_chunk_32 */
- HTTP_RAW_CONNECTION_ID RawConnectionId;
- ULONGLONG pSslInfo; /* NULL (FIXME) */
- USHORT RequestInfoCount;
- ULONGLONG pRequestInfo; /* NULL (FIXME) */
-};
-
#define DECLARE_CRITICAL_SECTION(cs) \
static CRITICAL_SECTION cs; \
static CRITICAL_SECTION_DEBUG cs##_debug = \
@@ -405,365 +247,44 @@ static void parse_header(const char *name, int *name_len, const char **value, in
*value_len = p - *value + 1;
}
+#define http_unknown_header http_unknown_header_64
+#define http_data_chunk http_data_chunk_64
+#define http_request http_request_64
+#define complete_irp complete_irp_64
+#define POINTER ULONGLONG
+#include "request.h"
+#undef http_unknown_header
+#undef http_data_chunk
+#undef http_request
+#undef complete_irp
+#undef POINTER
+
+#define http_unknown_header http_unknown_header_32
+#define http_data_chunk http_data_chunk_32
+#define http_request http_request_32
+#define complete_irp complete_irp_32
+#define POINTER ULONG
+#include "request.h"
+#undef http_unknown_header
+#undef http_data_chunk
+#undef http_request
+#undef complete_irp
+#undef POINTER
+
static NTSTATUS complete_irp(struct connection *conn, IRP *irp)
{
- static const WCHAR httpW[] = {'h','t','t','p',':','/','/'};
const struct http_receive_request_params params
= *(struct http_receive_request_params *)irp->AssociatedIrp.SystemBuffer;
- DWORD irp_size = (params.bits == 32) ? sizeof(struct http_request_32) : sizeof(struct http_request_64);
- ULONG cooked_len, host_len, abs_path_len, query_len, chunk_len = 0, offset, processed;
- IO_STACK_LOCATION *stack = IoGetCurrentIrpStackLocation(irp);
- const DWORD output_len = stack->Parameters.DeviceIoControl.OutputBufferLength;
- const char *p, *name, *value, *host, *abs_path, *query;
- USHORT unk_headers_count = 0, unk_header_idx;
- int name_len, value_len, len;
- struct sockaddr_in addr;
TRACE("Completing IRP %p.\n", irp);
if (!conn->req_id)
conn->req_id = ++req_id_counter;
- /* First calculate the total buffer size needed for this IRP. */
-
- if (conn->unk_verb_len)
- irp_size += conn->unk_verb_len + 1;
- irp_size += conn->url_len + 1;
-
- /* cooked URL */
- if (conn->url[0] == '/')
- {
- p = host = conn->host;
- while (isgraph(*p)) ++p;
- host_len = p - conn->host;
- abs_path = conn->url;
- abs_path_len = conn->url_len;
- }
- else
- {
- host = conn->url + 7;
- abs_path = strchr(host, '/');
- host_len = abs_path - host;
- abs_path_len = (conn->url + conn->url_len) - abs_path;
- }
- if ((query = memchr(abs_path, '?', abs_path_len)))
- {
- query_len = (abs_path + abs_path_len) - query;
- abs_path_len = query - abs_path;
- }
- else
- query_len = 0;
- cooked_len = (7 /* scheme */ + host_len + abs_path_len + query_len) * sizeof(WCHAR);
- irp_size += cooked_len + sizeof(WCHAR);
-
- /* addresses */
- irp_size += 2 * sizeof(addr);
-
- /* headers */
- p = strstr(conn->buffer, "\r\n") + 2;
- while (memcmp(p, "\r\n", 2))
- {
- name = p;
- parse_header(name, &name_len, &value, &value_len);
- if (parse_header_name(name, name_len) == HttpHeaderRequestMaximum)
- {
- irp_size += name_len + 1;
- ++unk_headers_count;
- }
- irp_size += value_len + 1;
- p = strstr(p, "\r\n") + 2;
- }
- p += 2;
-
if (params.bits == 32)
- irp_size += unk_headers_count * sizeof(struct http_unknown_header_32);
+ return complete_irp_32(conn, irp);
else
- irp_size += unk_headers_count * sizeof(struct http_unknown_header_64);
-
- TRACE("Need %u bytes, have %u.\n", irp_size, output_len);
- irp->IoStatus.Information = irp_size;
-
- memset(irp->AssociatedIrp.SystemBuffer, 0, output_len);
-
- if (output_len < irp_size)
- {
- if (params.bits == 32)
- {
- struct http_request_32 *req = irp->AssociatedIrp.SystemBuffer;
- req->ConnectionId = (ULONG_PTR)conn;
- req->RequestId = conn->req_id;
- }
- else
- {
- struct http_request_64 *req = irp->AssociatedIrp.SystemBuffer;
- req->ConnectionId = (ULONG_PTR)conn;
- req->RequestId = conn->req_id;
- }
- return STATUS_BUFFER_OVERFLOW;
- }
-
- if (params.bits == 32)
- {
- struct http_request_32 *req = irp->AssociatedIrp.SystemBuffer;
- struct http_unknown_header_32 *unk_headers = NULL;
- char *buffer = irp->AssociatedIrp.SystemBuffer;
- struct http_data_chunk_32 *chunk = NULL;
-
- offset = sizeof(*req);
-
- req->ConnectionId = (ULONG_PTR)conn;
- req->RequestId = conn->req_id;
- req->UrlContext = conn->queue->context;
- req->Version = conn->version;
- req->Verb = conn->verb;
- req->UnknownVerbLength = conn->unk_verb_len;
- req->RawUrlLength = conn->url_len;
-
- if (conn->unk_verb_len)
- {
- req->pUnknownVerb = params.addr + offset;
- memcpy(buffer + offset, conn->buffer, conn->unk_verb_len);
- offset += conn->unk_verb_len;
- buffer[offset++] = 0;
- }
-
- req->pRawUrl = params.addr + offset;
- memcpy(buffer + offset, conn->url, conn->url_len);
- offset += conn->url_len;
- buffer[offset++] = 0;
-
- req->CookedUrl.FullUrlLength = cooked_len;
- req->CookedUrl.HostLength = host_len * sizeof(WCHAR);
- req->CookedUrl.AbsPathLength = abs_path_len * sizeof(WCHAR);
- req->CookedUrl.QueryStringLength = query_len * sizeof(WCHAR);
- req->CookedUrl.pFullUrl = params.addr + offset;
- req->CookedUrl.pHost = req->CookedUrl.pFullUrl + 7 * sizeof(WCHAR);
- req->CookedUrl.pAbsPath = req->CookedUrl.pHost + host_len * sizeof(WCHAR);
- if (query)
- req->CookedUrl.pQueryString = req->CookedUrl.pAbsPath + abs_path_len * sizeof(WCHAR);
-
- memcpy(buffer + offset, httpW, sizeof(httpW));
- offset += 7 * sizeof(WCHAR);
- MultiByteToWideChar(CP_ACP, 0, host, host_len, (WCHAR *)(buffer + offset), host_len * sizeof(WCHAR));
- offset += host_len * sizeof(WCHAR);
- MultiByteToWideChar(CP_ACP, 0, abs_path, abs_path_len + query_len,
- (WCHAR *)(buffer + offset), (abs_path_len + query_len) * sizeof(WCHAR));
- offset += (abs_path_len + query_len) * sizeof(WCHAR);
- buffer[offset++] = 0;
- buffer[offset++] = 0;
-
- req->Address.pRemoteAddress = params.addr + offset;
- len = sizeof(addr);
- getpeername(conn->socket, (struct sockaddr *)&addr, &len);
- memcpy(buffer + offset, &addr, sizeof(addr));
- offset += sizeof(addr);
-
- req->Address.pLocalAddress = params.addr + offset;
- len = sizeof(addr);
- getsockname(conn->socket, (struct sockaddr *)&addr, &len);
- memcpy(buffer + offset, &addr, sizeof(addr));
- offset += sizeof(addr);
-
- req->Headers.UnknownHeaderCount = unk_headers_count;
- if (unk_headers_count)
- {
- req->Headers.pUnknownHeaders = params.addr + offset;
- unk_headers = (struct http_unknown_header_32 *)(buffer + offset);
- offset += unk_headers_count * sizeof(*unk_headers);
- }
-
- unk_header_idx = 0;
- p = strstr(conn->buffer, "\r\n") + 2;
- while (memcmp(p, "\r\n", 2))
- {
- HTTP_HEADER_ID id;
-
- name = p;
- parse_header(name, &name_len, &value, &value_len);
- if ((id = parse_header_name(name, name_len)) == HttpHeaderRequestMaximum)
- {
- unk_headers[unk_header_idx].NameLength = name_len;
- unk_headers[unk_header_idx].RawValueLength = value_len;
- unk_headers[unk_header_idx].pName = params.addr + offset;
- memcpy(buffer + offset, name, name_len);
- offset += name_len;
- buffer[offset++] = 0;
- unk_headers[unk_header_idx].pRawValue = params.addr + offset;
- memcpy(buffer + offset, value, value_len);
- offset += value_len;
- buffer[offset++] = 0;
- ++unk_header_idx;
- }
- else
- {
- req->Headers.KnownHeaders[id].RawValueLength = value_len;
- req->Headers.KnownHeaders[id].pRawValue = params.addr + offset;
- memcpy(buffer + offset, value, value_len);
- offset += value_len;
- buffer[offset++] = 0;
- }
- p = strstr(p, "\r\n") + 2;
- }
- p += 2;
-
- if (irp_size + sizeof(*chunk) < output_len && (params.flags & HTTP_RECEIVE_REQUEST_FLAG_COPY_BODY))
- chunk_len = min(conn->content_len, output_len - (irp_size + sizeof(*chunk)));
- if (chunk_len)
- {
- req->EntityChunkCount = 1;
- req->pEntityChunks = params.addr + offset;
- chunk = (struct http_data_chunk_32 *)(buffer + offset);
- offset += sizeof(*chunk);
- chunk->DataChunkType = HttpDataChunkFromMemory;
- chunk->FromMemory.BufferLength = chunk_len;
- chunk->FromMemory.pBuffer = params.addr + offset;
- memcpy(buffer + offset, p, chunk_len);
- offset += chunk_len;
-
- irp->IoStatus.Information = irp_size + sizeof(*chunk) + chunk_len;
- }
-
- if (chunk_len < conn->content_len)
- req->Flags |= HTTP_REQUEST_FLAG_MORE_ENTITY_BODY_EXISTS;
-
- req->BytesReceived = conn->req_len;
- }
- else
- {
- struct http_request_64 *req = irp->AssociatedIrp.SystemBuffer;
- struct http_unknown_header_64 *unk_headers = NULL;
- char *buffer = irp->AssociatedIrp.SystemBuffer;
- struct http_data_chunk_64 *chunk = NULL;
-
- offset = sizeof(*req);
-
- req->ConnectionId = (ULONG_PTR)conn;
- req->RequestId = conn->req_id;
- req->UrlContext = conn->queue->context;
- req->Version = conn->version;
- req->Verb = conn->verb;
- req->UnknownVerbLength = conn->unk_verb_len;
- req->RawUrlLength = conn->url_len;
-
- if (conn->unk_verb_len)
- {
- req->pUnknownVerb = params.addr + offset;
- memcpy(buffer + offset, conn->buffer, conn->unk_verb_len);
- offset += conn->unk_verb_len;
- buffer[offset++] = 0;
- }
-
- req->pRawUrl = params.addr + offset;
- memcpy(buffer + offset, conn->url, conn->url_len);
- offset += conn->url_len;
- buffer[offset++] = 0;
-
- req->CookedUrl.FullUrlLength = cooked_len;
- req->CookedUrl.HostLength = host_len * sizeof(WCHAR);
- req->CookedUrl.AbsPathLength = abs_path_len * sizeof(WCHAR);
- req->CookedUrl.QueryStringLength = query_len * sizeof(WCHAR);
- req->CookedUrl.pFullUrl = params.addr + offset;
- req->CookedUrl.pHost = req->CookedUrl.pFullUrl + 7 * sizeof(WCHAR);
- req->CookedUrl.pAbsPath = req->CookedUrl.pHost + host_len * sizeof(WCHAR);
- if (query)
- req->CookedUrl.pQueryString = req->CookedUrl.pAbsPath + abs_path_len * sizeof(WCHAR);
-
- memcpy(buffer + offset, httpW, sizeof(httpW));
- offset += 7 * sizeof(WCHAR);
- MultiByteToWideChar(CP_ACP, 0, host, host_len, (WCHAR *)(buffer + offset), host_len * sizeof(WCHAR));
- offset += host_len * sizeof(WCHAR);
- MultiByteToWideChar(CP_ACP, 0, abs_path, abs_path_len + query_len,
- (WCHAR *)(buffer + offset), (abs_path_len + query_len) * sizeof(WCHAR));
- offset += (abs_path_len + query_len) * sizeof(WCHAR);
- buffer[offset++] = 0;
- buffer[offset++] = 0;
-
- req->Address.pRemoteAddress = params.addr + offset;
- len = sizeof(addr);
- getpeername(conn->socket, (struct sockaddr *)&addr, &len);
- memcpy(buffer + offset, &addr, sizeof(addr));
- offset += sizeof(addr);
-
- req->Address.pLocalAddress = params.addr + offset;
- len = sizeof(addr);
- getsockname(conn->socket, (struct sockaddr *)&addr, &len);
- memcpy(buffer + offset, &addr, sizeof(addr));
- offset += sizeof(addr);
-
- req->Headers.UnknownHeaderCount = unk_headers_count;
- if (unk_headers_count)
- {
- req->Headers.pUnknownHeaders = params.addr + offset;
- unk_headers = (struct http_unknown_header_64 *)(buffer + offset);
- offset += unk_headers_count * sizeof(*unk_headers);
- }
-
- unk_header_idx = 0;
- p = strstr(conn->buffer, "\r\n") + 2;
- while (memcmp(p, "\r\n", 2))
- {
- HTTP_HEADER_ID id;
-
- name = p;
- parse_header(name, &name_len, &value, &value_len);
- if ((id = parse_header_name(name, name_len)) == HttpHeaderRequestMaximum)
- {
- unk_headers[unk_header_idx].NameLength = name_len;
- unk_headers[unk_header_idx].RawValueLength = value_len;
- unk_headers[unk_header_idx].pName = params.addr + offset;
- memcpy(buffer + offset, name, name_len);
- offset += name_len;
- buffer[offset++] = 0;
- unk_headers[unk_header_idx].pRawValue = params.addr + offset;
- memcpy(buffer + offset, value, value_len);
- offset += value_len;
- buffer[offset++] = 0;
- ++unk_header_idx;
- }
- else
- {
- req->Headers.KnownHeaders[id].RawValueLength = value_len;
- req->Headers.KnownHeaders[id].pRawValue = params.addr + offset;
- memcpy(buffer + offset, value, value_len);
- offset += value_len;
- buffer[offset++] = 0;
- }
- p = strstr(p, "\r\n") + 2;
- }
- p += 2;
-
- if (irp_size + sizeof(*chunk) < output_len && (params.flags & HTTP_RECEIVE_REQUEST_FLAG_COPY_BODY))
- chunk_len = min(conn->content_len, output_len - (irp_size + sizeof(*chunk)));
- if (chunk_len)
- {
- req->EntityChunkCount = 1;
- req->pEntityChunks = params.addr + offset;
- chunk = (struct http_data_chunk_64 *)(buffer + offset);
- offset += sizeof(*chunk);
- chunk->DataChunkType = HttpDataChunkFromMemory;
- chunk->FromMemory.BufferLength = chunk_len;
- chunk->FromMemory.pBuffer = params.addr + offset;
- memcpy(buffer + offset, p, chunk_len);
- offset += chunk_len;
-
- irp->IoStatus.Information = irp_size + sizeof(*chunk) + chunk_len;
- }
-
- if (chunk_len < conn->content_len)
- req->Flags |= HTTP_REQUEST_FLAG_MORE_ENTITY_BODY_EXISTS;
-
- req->BytesReceived = conn->req_len;
- }
-
- assert(offset == irp->IoStatus.Information);
-
- conn->available = FALSE;
- processed = conn->req_len - (conn->content_len - chunk_len);
- memmove(conn->buffer, conn->buffer + processed, conn->len - processed);
- conn->content_len -= chunk_len;
- conn->len -= processed;
-
- return STATUS_SUCCESS;
+ return complete_irp_64(conn, irp);
}
/* Complete an IOCTL_HTTP_RECEIVE_REQUEST IRP if there is one to complete. */
diff --git a/dlls/http.sys/request.h b/dlls/http.sys/request.h
new file mode 100644
index 0000000000..a1b77b67dc
--- /dev/null
+++ b/dlls/http.sys/request.h
@@ -0,0 +1,310 @@
+/*
+ * Copyright 2019 Zebediah Figura
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/* We have to return the HTTP_REQUEST structure to userspace exactly as it will
+ * be consumed; httpapi has no opportunity to massage it. Since it contains
+ * pointers, this is somewhat nontrivial. */
+
+struct http_unknown_header
+{
+ USHORT NameLength;
+ USHORT RawValueLength;
+ POINTER pName; /* char string */
+ POINTER pRawValue; /* char string */
+};
+
+struct http_data_chunk
+{
+ HTTP_DATA_CHUNK_TYPE DataChunkType;
+ union
+ {
+ struct
+ {
+ POINTER pBuffer; /* char string */
+ ULONG BufferLength;
+ } FromMemory;
+ /* for the struct size */
+ struct
+ {
+ ULARGE_INTEGER StartingOffset;
+ ULARGE_INTEGER Length;
+ POINTER FileHandle;
+ } FromFileHandle;
+ };
+};
+
+struct http_request
+{
+ ULONG Flags;
+ HTTP_CONNECTION_ID ConnectionId;
+ HTTP_REQUEST_ID RequestId;
+ HTTP_URL_CONTEXT UrlContext;
+ HTTP_VERSION Version;
+ HTTP_VERB Verb;
+ USHORT UnknownVerbLength;
+ USHORT RawUrlLength;
+ POINTER pUnknownVerb; /* char string */
+ POINTER pRawUrl; /* char string */
+ struct
+ {
+ USHORT FullUrlLength;
+ USHORT HostLength;
+ USHORT AbsPathLength;
+ USHORT QueryStringLength;
+ POINTER pFullUrl; /* WCHAR string */
+ POINTER pHost; /* pointer to above */
+ POINTER pAbsPath; /* pointer to above */
+ POINTER pQueryString; /* pointer to above */
+ } CookedUrl;
+ struct
+ {
+ POINTER pRemoteAddress; /* SOCKADDR */
+ POINTER pLocalAddress; /* SOCKADDR */
+ } Address;
+ struct
+ {
+ USHORT UnknownHeaderCount;
+ POINTER pUnknownHeaders; /* struct http_unknown_header */
+ USHORT TrailerCount;
+ POINTER pTrailers; /* NULL */
+ struct
+ {
+ USHORT RawValueLength;
+ POINTER pRawValue; /* char string */
+ } KnownHeaders[HttpHeaderRequestMaximum];
+ } Headers;
+ ULONGLONG BytesReceived;
+ USHORT EntityChunkCount;
+ POINTER pEntityChunks; /* struct http_data_chunk */
+ HTTP_RAW_CONNECTION_ID RawConnectionId;
+ POINTER pSslInfo; /* NULL (FIXME) */
+ USHORT RequestInfoCount;
+ POINTER pRequestInfo; /* NULL (FIXME) */
+};
+
+static NTSTATUS complete_irp(struct connection *conn, IRP *irp)
+{
+ const struct http_receive_request_params params
+ = *(struct http_receive_request_params *)irp->AssociatedIrp.SystemBuffer;
+ ULONG cooked_len, host_len, abs_path_len, query_len, chunk_len = 0, offset, processed;
+ IO_STACK_LOCATION *stack = IoGetCurrentIrpStackLocation(irp);
+ const DWORD output_len = stack->Parameters.DeviceIoControl.OutputBufferLength;
+ struct http_request *req = irp->AssociatedIrp.SystemBuffer;
+ const char *p, *name, *value, *host, *abs_path, *query;
+ struct http_unknown_header *unk_headers = NULL;
+ char *buffer = irp->AssociatedIrp.SystemBuffer;
+ DWORD irp_size = sizeof(struct http_request);
+ USHORT unk_headers_count = 0, unk_header_idx;
+ struct http_data_chunk *chunk = NULL;
+ int name_len, value_len, len;
+ struct sockaddr_in addr;
+
+ /* First calculate the total buffer size needed for this IRP. */
+
+ if (conn->unk_verb_len)
+ irp_size += conn->unk_verb_len + 1;
+ irp_size += conn->url_len + 1;
+
+ /* cooked URL */
+ if (conn->url[0] == '/')
+ {
+ p = host = conn->host;
+ while (isgraph(*p)) ++p;
+ host_len = p - conn->host;
+ abs_path = conn->url;
+ abs_path_len = conn->url_len;
+ }
+ else
+ {
+ host = conn->url + 7;
+ abs_path = strchr(host, '/');
+ host_len = abs_path - host;
+ abs_path_len = (conn->url + conn->url_len) - abs_path;
+ }
+ if ((query = memchr(abs_path, '?', abs_path_len)))
+ {
+ query_len = (abs_path + abs_path_len) - query;
+ abs_path_len = query - abs_path;
+ }
+ else
+ query_len = 0;
+ cooked_len = (7 /* scheme */ + host_len + abs_path_len + query_len) * sizeof(WCHAR);
+ irp_size += cooked_len + sizeof(WCHAR);
+
+ /* addresses */
+ irp_size += 2 * sizeof(addr);
+
+ /* headers */
+ p = strstr(conn->buffer, "\r\n") + 2;
+ while (memcmp(p, "\r\n", 2))
+ {
+ name = p;
+ parse_header(name, &name_len, &value, &value_len);
+ if (parse_header_name(name, name_len) == HttpHeaderRequestMaximum)
+ {
+ irp_size += name_len + 1;
+ ++unk_headers_count;
+ }
+ irp_size += value_len + 1;
+ p = strstr(p, "\r\n") + 2;
+ }
+ p += 2;
+
+ irp_size += unk_headers_count * sizeof(struct http_unknown_header);
+
+ TRACE("Need %u bytes, have %u.\n", irp_size, output_len);
+ irp->IoStatus.Information = irp_size;
+
+ memset(irp->AssociatedIrp.SystemBuffer, 0, output_len);
+
+ if (output_len < irp_size)
+ {
+ req->ConnectionId = (ULONG_PTR)conn;
+ req->RequestId = conn->req_id;
+ return STATUS_BUFFER_OVERFLOW;
+ }
+
+ offset = sizeof(*req);
+
+ req->ConnectionId = (ULONG_PTR)conn;
+ req->RequestId = conn->req_id;
+ req->UrlContext = conn->queue->context;
+ req->Version = conn->version;
+ req->Verb = conn->verb;
+ req->UnknownVerbLength = conn->unk_verb_len;
+ req->RawUrlLength = conn->url_len;
+
+ if (conn->unk_verb_len)
+ {
+ req->pUnknownVerb = params.addr + offset;
+ memcpy(buffer + offset, conn->buffer, conn->unk_verb_len);
+ offset += conn->unk_verb_len;
+ buffer[offset++] = 0;
+ }
+
+ req->pRawUrl = params.addr + offset;
+ memcpy(buffer + offset, conn->url, conn->url_len);
+ offset += conn->url_len;
+ buffer[offset++] = 0;
+
+ req->CookedUrl.FullUrlLength = cooked_len;
+ req->CookedUrl.HostLength = host_len * sizeof(WCHAR);
+ req->CookedUrl.AbsPathLength = abs_path_len * sizeof(WCHAR);
+ req->CookedUrl.QueryStringLength = query_len * sizeof(WCHAR);
+ req->CookedUrl.pFullUrl = params.addr + offset;
+ req->CookedUrl.pHost = req->CookedUrl.pFullUrl + 7 * sizeof(WCHAR);
+ req->CookedUrl.pAbsPath = req->CookedUrl.pHost + host_len * sizeof(WCHAR);
+ if (query)
+ req->CookedUrl.pQueryString = req->CookedUrl.pAbsPath + abs_path_len * sizeof(WCHAR);
+
+ memcpy(buffer + offset, L"http://", sizeof(L"http://"));
+ offset += 7 * sizeof(WCHAR);
+ MultiByteToWideChar(CP_ACP, 0, host, host_len, (WCHAR *)(buffer + offset), host_len * sizeof(WCHAR));
+ offset += host_len * sizeof(WCHAR);
+ MultiByteToWideChar(CP_ACP, 0, abs_path, abs_path_len + query_len,
+ (WCHAR *)(buffer + offset), (abs_path_len + query_len) * sizeof(WCHAR));
+ offset += (abs_path_len + query_len) * sizeof(WCHAR);
+ buffer[offset++] = 0;
+ buffer[offset++] = 0;
+
+ req->Address.pRemoteAddress = params.addr + offset;
+ len = sizeof(addr);
+ getpeername(conn->socket, (struct sockaddr *)&addr, &len);
+ memcpy(buffer + offset, &addr, sizeof(addr));
+ offset += sizeof(addr);
+
+ req->Address.pLocalAddress = params.addr + offset;
+ len = sizeof(addr);
+ getsockname(conn->socket, (struct sockaddr *)&addr, &len);
+ memcpy(buffer + offset, &addr, sizeof(addr));
+ offset += sizeof(addr);
+
+ req->Headers.UnknownHeaderCount = unk_headers_count;
+ if (unk_headers_count)
+ {
+ req->Headers.pUnknownHeaders = params.addr + offset;
+ unk_headers = (struct http_unknown_header *)(buffer + offset);
+ offset += unk_headers_count * sizeof(*unk_headers);
+ }
+
+ unk_header_idx = 0;
+ p = strstr(conn->buffer, "\r\n") + 2;
+ while (memcmp(p, "\r\n", 2))
+ {
+ HTTP_HEADER_ID id;
+
+ name = p;
+ parse_header(name, &name_len, &value, &value_len);
+ if ((id = parse_header_name(name, name_len)) == HttpHeaderRequestMaximum)
+ {
+ unk_headers[unk_header_idx].NameLength = name_len;
+ unk_headers[unk_header_idx].RawValueLength = value_len;
+ unk_headers[unk_header_idx].pName = params.addr + offset;
+ memcpy(buffer + offset, name, name_len);
+ offset += name_len;
+ buffer[offset++] = 0;
+ unk_headers[unk_header_idx].pRawValue = params.addr + offset;
+ memcpy(buffer + offset, value, value_len);
+ offset += value_len;
+ buffer[offset++] = 0;
+ ++unk_header_idx;
+ }
+ else
+ {
+ req->Headers.KnownHeaders[id].RawValueLength = value_len;
+ req->Headers.KnownHeaders[id].pRawValue = params.addr + offset;
+ memcpy(buffer + offset, value, value_len);
+ offset += value_len;
+ buffer[offset++] = 0;
+ }
+ p = strstr(p, "\r\n") + 2;
+ }
+ p += 2;
+
+ if (irp_size + sizeof(*chunk) < output_len && (params.flags & HTTP_RECEIVE_REQUEST_FLAG_COPY_BODY))
+ chunk_len = min(conn->content_len, output_len - (irp_size + sizeof(*chunk)));
+ if (chunk_len)
+ {
+ req->EntityChunkCount = 1;
+ req->pEntityChunks = params.addr + offset;
+ chunk = (struct http_data_chunk *)(buffer + offset);
+ offset += sizeof(*chunk);
+ chunk->DataChunkType = HttpDataChunkFromMemory;
+ chunk->FromMemory.BufferLength = chunk_len;
+ chunk->FromMemory.pBuffer = params.addr + offset;
+ memcpy(buffer + offset, p, chunk_len);
+ offset += chunk_len;
+
+ irp->IoStatus.Information = irp_size + sizeof(*chunk) + chunk_len;
+ }
+
+ if (chunk_len < conn->content_len)
+ req->Flags |= HTTP_REQUEST_FLAG_MORE_ENTITY_BODY_EXISTS;
+
+ req->BytesReceived = conn->req_len;
+
+ assert(offset == irp->IoStatus.Information);
+
+ conn->available = FALSE;
+ processed = conn->req_len - (conn->content_len - chunk_len);
+ memmove(conn->buffer, conn->buffer + processed, conn->len - processed);
+ conn->content_len -= chunk_len;
+ conn->len -= processed;
+
+ return STATUS_SUCCESS;
+}
--
2.26.2
1
0