There are plenty of online resources available, e.g.
https://www.google.co.nz/search?q=c%2B%2B+headers+to+delphi&ie=utf-8&oe=utf-8&client=firefox-b-ab&gfe_rd=cr&ei=Kqb2V7CDHdLu8wfJmbLwAQ

Rudy Velthuis has some good resources, including this page 
http://rvelthuis.de/programs/convertpack.html which lays out the  steps 
required.

HTH

David

David Moorhouse (BCom) | Principal Software Engineer - HealthOne
Pegasus Health (Charitable) Ltd
P: 03 353 0871 |   W:  www.pegasus.org.nz<http://www.pegasus.org.nz/>
E: [email protected]<mailto:[email protected]>
PO Box 741, Christchurch 8140
160 Bealey Ave, Christchurch 8014

[cid:[email protected]]



From: [email protected] 
[mailto:[email protected]] On Behalf Of Ross Levis
Sent: Thursday, 6 October 2016 11:13 p.m.
To: 'NZ Borland Developers Group - Delphi List'
Subject: Re: [DUG] NtSetInformationProcess

I have found code in C++ but I'm not good with dynamically loading DLLs to 
access a function pointer.  Can someone please help me translate this for 
Delphi.


    [DllImport("ntdll.dll", SetLastError = true)]
    public static extern int NtSetInformationProcess(IntPtr processHandle,
       PROCESS_INFORMATION_CLASS processInformationClass, ref IntPtr 
processInformation, uint processInformationLength);


    enum IOPriority : uint
    {
        VeryLow = 0,
        Low = 1,
        Normal = 2,
    }

    static int SetIOPriority(IntPtr hProcess, IOPriority newPrio)
    {
        IntPtr ioPrio = (IntPtr) newPrio;
        int lret= NtSetInformationProcess(hProcess, 
PROCESS_INFORMATION_CLASS.ProcessIoPriority, ref ioPrio, 4);
        return lret;
    }
ProcessIOPriority is a constant with the value 21.

Many thanks,
Ross.

From: Ross Levis [mailto:[email protected]]
Sent: Thursday, 6 October 2016 4:48 p.m.
To: 'NZ Borland Developers Group - Delphi List'
Subject: NtSetInformationProcess

Can anyone provide the definition for accessing this Windows function.  It 
doesn't exist in Windows.pas in Delphi 7.  I guess it's in kernel32.dll.

There seems to be some issue with my app inheriting a "Low" I/O priority after 
a recent Windows 10 update and causing lots of issues with my customers.  I 
want to try to set it to Normal.

Note this is not a Process or Thread Priority.

Cheers,
Ross.
[http://snow.pegasus.org.nz/wp-content/uploads/2016/10/moving_footer.jpg]

********************************************************************************
This email or attachment(s) may contain confidential or legally privileged 
information intended for the sole use of the addressee(s). Any use, 
redistribution, 
disclosure, or reproduction of this message, except as intended, is prohibited. 
If you received this email in error, please notify the sender and erase all 
copies of the message, including any attachments.

Any views or opinions expressed in this email (unless otherwise stated) may not 
represent those of Pegasus Health Ltd.

********************************************************************************
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: [email protected]
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [email protected] with 
Subject: unsubscribe

Reply via email to