Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

problem with use windows api OppenProcessToken

Moderators: kris

Posted: 12/26/07 05:31:56 Modified: 12/26/07 05:35:10

import tango.sys.win32.Types;    
import tango.sys.win32.UserGdi;
void main()
{
	PHANDLE ph;
	OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,ph);
}
D:\d\project>dmd test.d
d:\d\Tango\bin\link.exe test,,,user32+kernel32/noi+tango-user-dmd.lib;
OPTLINK (R) for Win32  Release 8.00.1
Copyright (C) Digital Mars 1989-2004  All rights reserved.
test.obj(test)
 Error 42: Symbol Undefined _OpenProcessToken@12
--- errorlevel 1

why?????

Author Message

Posted: 12/26/07 09:48:29

You need to link against Advapi32 for OpenProcessToken.