Jump to content
ucwpotkan

[PAYING] C++ Function to AutoIt [SIMPLE]

Recommended Posts

ucwpotkan

Hello, could someone translate very very short code from cpp to AutoIt?

Call to function should be something like: Protect($hProcess)

DWORD ProtectProcess(void)
{
    HANDLE hProcess = GetCurrentProcess();
    PACL pEmptyDacl;
    DWORD dwErr;

    // using malloc guarantees proper alignment
    pEmptyDacl = (PACL)malloc(sizeof(ACL));

    if (!InitializeAcl(pEmptyDacl, sizeof(ACL), ACL_REVISION))
    {
        dwErr = GetLastError();
    }
    else
    {
        dwErr = SetSecurityInfo(hProcess, SE_KERNEL_OBJECT, 
                   DACL_SECURITY_INFORMATION, NULL, NULL, pEmptyDacl, NULL);
    }

    free(pEmptyDacl);
    return dwErr;
}

 

Share this post


Link to post
Share on other sites
ucwpotkan

First one who translates, i will pay 5$ for him. Send me code via PM, include your btc address.

Share this post


Link to post
Share on other sites
ucwpotkan

Hello, could someone translate very very short code from cpp to AutoIt?

Call to function should be something like: Protect($hProcess)
First one who translates, i will pay 5$ for him. Send me code via PM, include your btc address.

DWORD ProtectProcess(void)
{
    HANDLE hProcess = GetCurrentProcess();
    PACL pEmptyDacl;
    DWORD dwErr;

    // using malloc guarantees proper alignment
    pEmptyDacl = (PACL)malloc(sizeof(ACL));

    if (!InitializeAcl(pEmptyDacl, sizeof(ACL), ACL_REVISION))
    {
        dwErr = GetLastError();
    }
    else
    {
        dwErr = SetSecurityInfo(hProcess, SE_KERNEL_OBJECT, 
                   DACL_SECURITY_INFORMATION, NULL, NULL, pEmptyDacl, NULL);
    }

    free(pEmptyDacl);
    return dwErr;
}

 

Share this post


Link to post
Share on other sites
Jos

Where is the fire? 
No need to post multiple topics on the same subject, so just stick to this one.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
ucwpotkan

Sorry, i forgot to write something and couldnt find edit.

Share this post


Link to post
Share on other sites
SmOke_N

A google search of the function name and this website turned this up... Also, I'm fairly sure there's already a an include file running around here with a fair amount of process security functions in it.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×