mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
ADVAPI32.DLL / SERVICES.EXE:
Implement ControlService() RPCRT4.DLL: Disable a bogus buffer overflow check in NdrSimpleStructMarshall. svn path=/trunk/; revision=14658
This commit is contained in:
parent
631838f4a3
commit
30e7e912c2
4 changed files with 40 additions and 32 deletions
|
@ -39,10 +39,10 @@ cpp_quote("#endif");
|
||||||
[in] SC_HANDLE hSCObject);
|
[in] SC_HANDLE hSCObject);
|
||||||
|
|
||||||
/* Function 1 */
|
/* Function 1 */
|
||||||
// BOOL ScmrControlService([in] handle_t BindingHandle,
|
BOOL ScmrControlService([in] handle_t BindingHandle,
|
||||||
// [in] SC_HANDLE hService,
|
[in] SC_HANDLE hService,
|
||||||
// [in] DWORD dwControl,
|
[in] DWORD dwControl,
|
||||||
// [out] LPSERVICE_STATUS lpServiceStatus);
|
[out] LPSERVICE_STATUS lpServiceStatus);
|
||||||
|
|
||||||
/* Function 2 */
|
/* Function 2 */
|
||||||
DWORD ScmrDeleteService([in] handle_t BindingHandle,
|
DWORD ScmrDeleteService([in] handle_t BindingHandle,
|
||||||
|
|
|
@ -139,21 +139,22 @@ CloseServiceHandle(SC_HANDLE hSCObject)
|
||||||
{
|
{
|
||||||
DWORD dwError;
|
DWORD dwError;
|
||||||
|
|
||||||
DPRINT1("CloseServiceHandle() called\n");
|
DPRINT("CloseServiceHandle() called\n");
|
||||||
|
|
||||||
HandleBind();
|
HandleBind();
|
||||||
|
|
||||||
/* Call to services.exe using RPC */
|
/* Call to services.exe using RPC */
|
||||||
dwError = ScmrCloseServiceHandle(BindingHandle,
|
dwError = ScmrCloseServiceHandle(BindingHandle,
|
||||||
(unsigned int)hSCObject);
|
(unsigned int)hSCObject);
|
||||||
DPRINT1("dwError %lu\n", dwError);
|
|
||||||
|
|
||||||
if (dwError)
|
if (dwError)
|
||||||
{
|
{
|
||||||
|
DPRINT1("ScmrCloseServiceHandle() failed (Error %lu)\n", dwError);
|
||||||
SetLastError(dwError);
|
SetLastError(dwError);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DPRINT("CloseServiceHandle() done\n");
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,10 +169,9 @@ ControlService(SC_HANDLE hService,
|
||||||
DWORD dwControl,
|
DWORD dwControl,
|
||||||
LPSERVICE_STATUS lpServiceStatus)
|
LPSERVICE_STATUS lpServiceStatus)
|
||||||
{
|
{
|
||||||
#if 0
|
|
||||||
DWORD dwError;
|
DWORD dwError;
|
||||||
|
|
||||||
DPRINT1("ControlService(%x, %x, %p)\n",
|
DPRINT("ControlService(%x, %x, %p)\n",
|
||||||
hService, dwControl, lpServiceStatus);
|
hService, dwControl, lpServiceStatus);
|
||||||
|
|
||||||
HandleBind();
|
HandleBind();
|
||||||
|
@ -183,18 +183,14 @@ ControlService(SC_HANDLE hService,
|
||||||
lpServiceStatus);
|
lpServiceStatus);
|
||||||
if (dwError != ERROR_SUCCESS)
|
if (dwError != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
|
DPRINT1("ScmrControlService() failed (Error %lu)\n", dwError);
|
||||||
SetLastError(dwError);
|
SetLastError(dwError);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT1("ControlService() done\n");
|
DPRINT("ControlService() done\n");
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#endif
|
|
||||||
|
|
||||||
DPRINT1("ControlService is unimplemented\n");
|
|
||||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -262,7 +258,7 @@ DeleteService(SC_HANDLE hService)
|
||||||
{
|
{
|
||||||
DWORD dwError;
|
DWORD dwError;
|
||||||
|
|
||||||
DPRINT1("DeleteService(%x)\n", hService);
|
DPRINT("DeleteService(%x)\n", hService);
|
||||||
|
|
||||||
HandleBind();
|
HandleBind();
|
||||||
|
|
||||||
|
@ -271,6 +267,7 @@ DeleteService(SC_HANDLE hService)
|
||||||
(unsigned int)hService);
|
(unsigned int)hService);
|
||||||
if (dwError != ERROR_SUCCESS)
|
if (dwError != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
|
DPRINT1("ScmrDeleteService() failed (Error %lu)\n", dwError);
|
||||||
SetLastError(dwError);
|
SetLastError(dwError);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -536,7 +533,7 @@ LockServiceDatabase(SC_HANDLE hSCManager)
|
||||||
(unsigned int *)&hLock);
|
(unsigned int *)&hLock);
|
||||||
if (dwError != ERROR_SUCCESS)
|
if (dwError != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
DPRINT("ScmrLockServiceDatabase() failed (Error %lu)\n", dwError);
|
DPRINT1("ScmrLockServiceDatabase() failed (Error %lu)\n", dwError);
|
||||||
SetLastError(dwError);
|
SetLastError(dwError);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -613,9 +610,9 @@ OpenSCManagerA(LPCSTR lpMachineName,
|
||||||
(LPSTR)lpDatabaseName,
|
(LPSTR)lpDatabaseName,
|
||||||
dwDesiredAccess,
|
dwDesiredAccess,
|
||||||
(unsigned int*)&hScm);
|
(unsigned int*)&hScm);
|
||||||
if (dwError)
|
if (dwError != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
DPRINT("ScmrOpenSCManagerA() failed (Error %lu)\n", dwError);
|
DPRINT1("ScmrOpenSCManagerA() failed (Error %lu)\n", dwError);
|
||||||
SetLastError(dwError);
|
SetLastError(dwError);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -928,7 +925,7 @@ UnlockServiceDatabase(SC_LOCK ScLock)
|
||||||
(unsigned int)ScLock);
|
(unsigned int)ScLock);
|
||||||
if (dwError != ERROR_SUCCESS)
|
if (dwError != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
DPRINT("ScmrUnlockServiceDatabase() failed (Error %lu)\n", dwError);
|
DPRINT1("ScmrUnlockServiceDatabase() failed (Error %lu)\n", dwError);
|
||||||
SetLastError(dwError);
|
SetLastError(dwError);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1161,7 +1161,15 @@ unsigned char * WINAPI NdrSimpleStructMarshall(PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
if (pFormat[0] != RPC_FC_STRUCT)
|
if (pFormat[0] != RPC_FC_STRUCT)
|
||||||
EmbeddedPointerMarshall(pStubMsg, pMemory, pFormat+4);
|
EmbeddedPointerMarshall(pStubMsg, pMemory, pFormat+4);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This test does not work when NdrSimpleStructMarshall is called
|
||||||
|
* by an rpc-server to marshall data to return to the client because
|
||||||
|
* BufferStart and BufferEnd are bogus. MIDL does not update them
|
||||||
|
* when a new buffer is allocated in order to return data to the caller.
|
||||||
|
*/
|
||||||
|
#if 0
|
||||||
STD_OVERFLOW_CHECK(pStubMsg);
|
STD_OVERFLOW_CHECK(pStubMsg);
|
||||||
|
#endif
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1201,20 +1209,22 @@ unsigned char * WINAPI NdrSimpleStructUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* NdrSimpleStructUnmarshall [RPCRT4.@]
|
* NdrSimpleTypeUnmarshall [RPCRT4.@]
|
||||||
*/
|
*/
|
||||||
void WINAPI NdrSimpleTypeMarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory,
|
void WINAPI NdrSimpleTypeMarshall(PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
unsigned char FormatChar )
|
unsigned char *pMemory,
|
||||||
|
unsigned char FormatChar)
|
||||||
{
|
{
|
||||||
FIXME("stub\n");
|
FIXME("stub\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* NdrSimpleStructUnmarshall [RPCRT4.@]
|
* NdrSimpleTypeUnmarshall [RPCRT4.@]
|
||||||
*/
|
*/
|
||||||
void WINAPI NdrSimpleTypeUnmarshall( PMIDL_STUB_MESSAGE pStubMsg, unsigned char* pMemory,
|
void WINAPI NdrSimpleTypeUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
|
||||||
unsigned char FormatChar )
|
unsigned char *pMemory,
|
||||||
|
unsigned char FormatChar)
|
||||||
{
|
{
|
||||||
FIXME("stub\n");
|
FIXME("stub\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -272,7 +272,6 @@ ScmrCloseServiceHandle(handle_t BindingHandle,
|
||||||
|
|
||||||
|
|
||||||
/* Function 1 */
|
/* Function 1 */
|
||||||
#if 0
|
|
||||||
unsigned long
|
unsigned long
|
||||||
ScmrControlService(handle_t BindingHandle,
|
ScmrControlService(handle_t BindingHandle,
|
||||||
unsigned int hService,
|
unsigned int hService,
|
||||||
|
@ -281,7 +280,10 @@ ScmrControlService(handle_t BindingHandle,
|
||||||
{
|
{
|
||||||
DPRINT1("ScmrControlService() called\n");
|
DPRINT1("ScmrControlService() called\n");
|
||||||
|
|
||||||
#if 0
|
/* FIXME: return proper service information */
|
||||||
|
|
||||||
|
/* test data */
|
||||||
|
// #if 0
|
||||||
lpServiceStatus->dwServiceType = 0x12345678;
|
lpServiceStatus->dwServiceType = 0x12345678;
|
||||||
lpServiceStatus->dwCurrentState = 0x98765432;
|
lpServiceStatus->dwCurrentState = 0x98765432;
|
||||||
lpServiceStatus->dwControlsAccepted = 0xdeadbabe;
|
lpServiceStatus->dwControlsAccepted = 0xdeadbabe;
|
||||||
|
@ -289,11 +291,10 @@ ScmrControlService(handle_t BindingHandle,
|
||||||
lpServiceStatus->dwServiceSpecificExitCode = 0xdeadf00d;
|
lpServiceStatus->dwServiceSpecificExitCode = 0xdeadf00d;
|
||||||
lpServiceStatus->dwCheckPoint = 0xbaadbabe;
|
lpServiceStatus->dwCheckPoint = 0xbaadbabe;
|
||||||
lpServiceStatus->dwWaitHint = 0x2468ACE1;
|
lpServiceStatus->dwWaitHint = 0x2468ACE1;
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
return TRUE;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Function 2 */
|
/* Function 2 */
|
||||||
|
|
Loading…
Reference in a new issue