Author: akhaldi
Date: Mon Sep 23 11:33:50 2013
New Revision: 60334
URL:
http://svn.reactos.org/svn/reactos?rev=60334&view=rev
Log:
[MSTASK]
* Sync with Wine 1.7.1.
CORE-7469
Modified:
trunk/reactos/dll/win32/mstask/CMakeLists.txt
trunk/reactos/dll/win32/mstask/factory.c
trunk/reactos/dll/win32/mstask/mstask_main.c
trunk/reactos/dll/win32/mstask/task_scheduler.c
trunk/reactos/dll/win32/mstask/task_trigger.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/mstask/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/CMakeList…
==============================================================================
--- trunk/reactos/dll/win32/mstask/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mstask/CMakeLists.txt [iso-8859-1] Mon Sep 23 11:33:50 2013
@@ -1,9 +1,3 @@
-
-remove_definitions(-DWINVER=0x502)
-add_definitions(-DWINVER=0x600)
-
-remove_definitions(-D_WIN32_WINNT=0x502)
-add_definitions(-D_WIN32_WINNT=0x600)
add_definitions(-D__WINESRC__)
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
@@ -16,12 +10,11 @@
task.c
task_scheduler.c
task_trigger.c
- rsrc.rc
${CMAKE_CURRENT_BINARY_DIR}/mstask_local_i.c
${CMAKE_CURRENT_BINARY_DIR}/mstask_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/mstask.def)
-add_library(mstask SHARED ${SOURCE})
+add_library(mstask SHARED ${SOURCE} rsrc.rc)
set_module_type(mstask win32dll)
target_link_libraries(mstask uuid wine)
add_importlibs(mstask ole32 msvcrt kernel32 ntdll)
Modified: trunk/reactos/dll/win32/mstask/factory.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/factory.c…
==============================================================================
--- trunk/reactos/dll/win32/mstask/factory.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mstask/factory.c [iso-8859-1] Mon Sep 23 11:33:50 2013
@@ -56,14 +56,14 @@
return E_NOINTERFACE;
}
-static ULONG WINAPI MSTASK_IClassFactory_AddRef(LPCLASSFACTORY iface)
+static ULONG WINAPI MSTASK_IClassFactory_AddRef(IClassFactory *face)
{
TRACE("\n");
InterlockedIncrement(&dll_ref);
return 2;
}
-static ULONG WINAPI MSTASK_IClassFactory_Release(LPCLASSFACTORY iface)
+static ULONG WINAPI MSTASK_IClassFactory_Release(IClassFactory *iface)
{
TRACE("\n");
InterlockedDecrement(&dll_ref);
@@ -71,8 +71,8 @@
}
static HRESULT WINAPI MSTASK_IClassFactory_CreateInstance(
- LPCLASSFACTORY iface,
- LPUNKNOWN pUnkOuter,
+ IClassFactory *iface,
+ IUnknown *pUnkOuter,
REFIID riid,
LPVOID *ppvObj)
{
@@ -89,21 +89,21 @@
if (FAILED(res))
return res;
- res = ITaskScheduler_QueryInterface(punk, riid, ppvObj);
- ITaskScheduler_Release(punk);
+ res = IUnknown_QueryInterface(punk, riid, ppvObj);
+ IUnknown_Release(punk);
return res;
}
static HRESULT WINAPI MSTASK_IClassFactory_LockServer(
- LPCLASSFACTORY iface,
+ IClassFactory *iface,
BOOL fLock)
{
TRACE("\n");
- if (fLock != FALSE)
- MSTASK_IClassFactory_AddRef(iface);
+ if (fLock)
+ IClassFactory_AddRef(iface);
else
- MSTASK_IClassFactory_Release(iface);
+ IClassFactory_Release(iface);
return S_OK;
}
Modified: trunk/reactos/dll/win32/mstask/mstask_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/mstask_ma…
==============================================================================
--- trunk/reactos/dll/win32/mstask/mstask_main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mstask/mstask_main.c [iso-8859-1] Mon Sep 23 11:33:50 2013
@@ -42,8 +42,6 @@
DisableThreadLibraryCalls(hinstDLL);
hInst = hinstDLL;
break;
- case DLL_PROCESS_DETACH:
- break;
}
return TRUE;
Modified: trunk/reactos/dll/win32/mstask/task_scheduler.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/task_sche…
==============================================================================
--- trunk/reactos/dll/win32/mstask/task_scheduler.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mstask/task_scheduler.c [iso-8859-1] Mon Sep 23 11:33:50 2013
@@ -89,16 +89,57 @@
ITaskScheduler* iface,
LPCWSTR pwszComputer)
{
- FIXME("%p, %s: stub\n", iface, debugstr_w(pwszComputer));
- return E_NOTIMPL;
+ TaskSchedulerImpl *This = impl_from_ITaskScheduler(iface);
+ WCHAR buffer[MAX_COMPUTERNAME_LENGTH + 3]; /* extra space for two '\' and a
zero */
+ DWORD len = MAX_COMPUTERNAME_LENGTH + 1; /* extra space for a zero */
+
+ TRACE("(%p)->(%s)\n", This, debugstr_w(pwszComputer));
+
+ /* NULL is an alias for the local computer */
+ if (!pwszComputer)
+ return S_OK;
+
+ buffer[0] = '\\';
+ buffer[1] = '\\';
+ if (GetComputerNameW(buffer + 2, &len))
+ {
+ if (!lstrcmpiW(buffer, pwszComputer) || /* full unc name */
+ !lstrcmpiW(buffer + 2, pwszComputer)) /* name without backslash */
+ return S_OK;
+ }
+
+ FIXME("remote computer %s not supported\n", debugstr_w(pwszComputer));
+ return HRESULT_FROM_WIN32(ERROR_BAD_NETPATH);
}
static HRESULT WINAPI MSTASK_ITaskScheduler_GetTargetComputer(
ITaskScheduler* iface,
LPWSTR *ppwszComputer)
{
- FIXME("%p, %p: stub\n", iface, ppwszComputer);
- return E_NOTIMPL;
+ TaskSchedulerImpl *This = impl_from_ITaskScheduler(iface);
+ LPWSTR buffer;
+ DWORD len = MAX_COMPUTERNAME_LENGTH + 1; /* extra space for the zero */
+
+ TRACE("(%p)->(%p)\n", This, ppwszComputer);
+
+ if (!ppwszComputer)
+ return E_INVALIDARG;
+
+ /* extra space for two '\' and a zero */
+ buffer = CoTaskMemAlloc((MAX_COMPUTERNAME_LENGTH + 3) * sizeof(WCHAR));
+ if (buffer)
+ {
+ buffer[0] = '\\';
+ buffer[1] = '\\';
+ if (GetComputerNameW(buffer + 2, &len))
+ {
+ *ppwszComputer = buffer;
+ return S_OK;
+ }
+ CoTaskMemFree(buffer);
+ }
+ *ppwszComputer = NULL;
+ return HRESULT_FROM_WIN32(GetLastError());
}
static HRESULT WINAPI MSTASK_ITaskScheduler_Enum(
Modified: trunk/reactos/dll/win32/mstask/task_trigger.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mstask/task_trig…
==============================================================================
--- trunk/reactos/dll/win32/mstask/task_trigger.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mstask/task_trigger.c [iso-8859-1] Mon Sep 23 11:33:50 2013
@@ -142,8 +142,6 @@
if (pTrigger->MinutesDuration <= pTrigger->MinutesInterval &&
pTrigger->MinutesInterval > 0)
return E_INVALIDARG;
- if (pTrigger->MinutesDuration > 0 && pTrigger->MinutesInterval ==
0)
- return E_INVALIDARG;
tmp_trigger_cond.MinutesDuration = pTrigger->MinutesDuration;
tmp_trigger_cond.MinutesInterval = pTrigger->MinutesInterval;
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Mon Sep 23 11:33:50 2013
@@ -125,7 +125,7 @@
reactos/dll/win32/msrle32 # Synced to Wine-1.7.1
reactos/dll/win32/mssign32 # Synced to Wine-1.7.1
reactos/dll/win32/mssip32 # Synced to Wine-1.7.1
-reactos/dll/win32/mstask # Synced to Wine-1.5.4
+reactos/dll/win32/mstask # Synced to Wine-1.7.1
reactos/dll/win32/msvcrt20 # Out of sync
reactos/dll/win32/msvcrt40 # Out of sync
reactos/dll/win32/msvfw32 # Autosync