Re: PostMessage return access denied
On Mon, 04 Jun 2007 06:52:50 -0700, Gurmit Teotia wrote:
Yes, it's running. I've verified the error using "FormatMessage" as
well. I'm using following code to run "osk.exe"
Have you tried using a NULL DACL SD? See below:
static SECURITY_ATTRIBUTES g_sa = {0};
static HANDLE g_hsa = 0;
BOOL CreateNullDaclSd ()
{
BOOL bRetVal = FALSE;
g_sa.nLength = sizeof(g_sa);
g_hsa = GlobalAlloc (GHND,SECURITY_DESCRIPTOR_MIN_LENGTH);
g_sa.lpSecurityDescriptor = GlobalLock(g_hsa);
g_sa.bInheritHandle = TRUE;
if (InitializeSecurityDescriptor (g_sa.lpSecurityDescriptor, 1))
{
if (SetSecurityDescriptorDacl (g_sa.lpSecurityDescriptor,
TRUE,
NULL,
FALSE))
{
bRetVal = TRUE;
}
else
{
OutputDebugString ("CNDS: cannot set sd DACL\n");
}
}
else
{
OutputDebugString("CNDS: cannot initialise sd\n");
}
return bRetVal;
}
void FreeNullDaclSd ()
{
GlobalUnlock (g_hsa);
GlobalFree (g_hsa);
}
--
Bob Moore
http://bobmoore.mvps.org/
(this is a non-commercial site and does not accept advertising)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do not reply via email unless specifically requested to do so.
Unsolicited email is NOT welcome and will go unanswered.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~