2 * Copyright (C) 2008 Google (Roy Shea)
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include "mstask_private.h"
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mstask
);
35 static HINSTANCE hInst
;
38 BOOL WINAPI
DllMain(HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID lpvReserved
)
40 TRACE("(%p, %d, %p)\n", hinstDLL
, fdwReason
, lpvReserved
);
44 case DLL_PROCESS_ATTACH
:
45 DisableThreadLibraryCalls(hinstDLL
);
53 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID iid
, LPVOID
*ppv
)
55 TRACE("(%s %s %p)\n", debugstr_guid(rclsid
), debugstr_guid(iid
), ppv
);
57 if (IsEqualGUID(rclsid
, &CLSID_CTaskScheduler
)) {
58 return IClassFactory_QueryInterface((LPCLASSFACTORY
)&MSTASK_ClassFactory
, iid
, ppv
);
61 FIXME("Not supported class: %s\n", debugstr_guid(rclsid
));
62 return CLASS_E_CLASSNOTAVAILABLE
;
65 HRESULT WINAPI
DllCanUnloadNow(void)
67 return dll_ref
!= 0 ? S_FALSE
: S_OK
;
70 HRESULT WINAPI
DllRegisterServer(void)
72 return __wine_register_resources( hInst
);
75 HRESULT WINAPI
DllUnregisterServer(void)
77 return __wine_unregister_resources( hInst
);
80 DWORD WINAPI
NetrJobAdd_wrapper(ATSVC_HANDLE server_name
, LPAT_INFO info
, LPDWORD jobid
)
82 return NetrJobAdd(server_name
, info
, jobid
);
85 DWORD WINAPI
NetrJobDel_wrapper(ATSVC_HANDLE server_name
, DWORD min_jobid
, DWORD max_jobid
)
87 return NetrJobDel(server_name
, min_jobid
, max_jobid
);
90 DWORD WINAPI
NetrJobEnum_wrapper(ATSVC_HANDLE server_name
, LPAT_ENUM_CONTAINER container
,
91 DWORD max_length
, LPDWORD total
, LPDWORD resume
)
93 return NetrJobEnum(server_name
, container
, max_length
, total
, resume
);
96 DWORD WINAPI
NetrJobGetInfo_wrapper(ATSVC_HANDLE server_name
, DWORD jobid
, LPAT_INFO
*info
)
98 return NetrJobGetInfo(server_name
, jobid
, info
);
101 DECLSPEC_HIDDEN
void __RPC_FAR
*__RPC_USER
MIDL_user_allocate(SIZE_T n
)
103 return HeapAlloc(GetProcessHeap(), 0, n
);
106 DECLSPEC_HIDDEN
void __RPC_USER
MIDL_user_free(void __RPC_FAR
*p
)
108 HeapFree(GetProcessHeap(), 0, p
);
111 DECLSPEC_HIDDEN handle_t __RPC_USER
ATSVC_HANDLE_bind(ATSVC_HANDLE str
)
113 static unsigned char ncalrpc
[] = "ncalrpc";
114 unsigned char *binding_str
;
115 handle_t rpc_handle
= 0;
117 if (RpcStringBindingComposeA(NULL
, ncalrpc
, NULL
, NULL
, NULL
, &binding_str
) == RPC_S_OK
)
119 RpcBindingFromStringBindingA(binding_str
, &rpc_handle
);
120 RpcStringFreeA(&binding_str
);
125 DECLSPEC_HIDDEN
void __RPC_USER
ATSVC_HANDLE_unbind(ATSVC_HANDLE ServerName
, handle_t rpc_handle
)
127 RpcBindingFree(&rpc_handle
);