c++ - Show UAC prompt before access is denied by IoCreateDeviceSecure function -


i adding access control driver (winpcap's ndis 6 filter driver) running on windows 7 , 8. want let administrators (users in administrators group) use driver. used new iocreatedevicesecure function instead of original iocreatedevice call.

my code belows:

unicode_string sddl = rtl_constant_string(l"d:p(a;;ga;;;sy)(a;;ga;;;ba)"); const guid guidclassnpf = { 0x26e0d1e0l, 0x8189, 0x12e0, { 0x99, 0x14, 0x08, 0x00, 0x22, 0x30, 0x19, 0x04 } }; status = iocreatedevicesecure(adriverobjectp, sizeof(device_extension), &devicename, file_device_transport, file_device_secure_open, false, &sddl, (lpcguid) &guidclassnpf, &devobjp); 

my sddl string "d:p(a;;ga;;;sy)(a;;ga;;;ba)" means "allows kernel, system, , administrator complete control on device. no other users may access device." in https://msdn.microsoft.com/en-us/library/windows/hardware/ff563667(v=vs.85).aspx.

it seems build-in administrator account can directly access device now. other members of administrators group denied because don't have escalated access token based on windows's user account control. know when user tries make critical changes system, uac prompt show user ask permissions.

my question is, there way windows shows such prompt when executing driver's iocreatedevicesecure call, if user agrees uac prompt, call can succeed. silent denial not friendly member in administrators group use rights. thanks!


more details:

my software combination of some dlls (wpcap.dll , packet.dll) , driver (npcap.sys). other people develop applications (like wireshark , nmap) use dlls , driver. invoking path is: exe -> wpcap.dll -> packet.dll -> npcap.sys. getting app elevated has issue. because other people develop apps. i'd do elevating thing in dll level.

i have learnt application (exe) can specify /manifestuac: highestavailable in manifest enforce administrator elevation. have tried add /manifestuac: highestavailable option dll (in vs 2008, modifying properties -> linker -> manifest file -> uac execution level highestavailable), nothing happened. doubt if meaningful add such option dll. is there way dll enforce administrator elevation process loads it? when exe (without /manifestuac: highestavailable) loading dll (with /manifestuac: highestavailable) tries start, required elevated uac prompt?


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -