Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User acess to devices

Status
Not open for further replies.

rouge03

Programmer
May 5, 2003
16
PH
Hi!

I'm not sure if this is the right forum for this, but the program I wish to create uses mostly functions from the Windows API (I think). So I need sources from tech gurus who know or are more familiar with them =)

I wish to create a program that serves as an interface to enable/disable the use of USB/Firewire based devices. But only the Administrator(user) of the PC can set this. So if the USB/Firewire ports have been disabled for a particular local user(not-Admin), he/she will no longer be able to use them.

So my questions are:
1) Is it possible to deny access to particular media for an ordinary user programmatically? Btw, I'll be using VB6.
2) Which Windows DLL has the function that retrieves user/profile names in a WinXP environment? I tried to research this online.. but i seem to be always finding functions not listed in the API viewer of Visual Studio 6.
2) Can you point me to a good resource for the APIs I'll be needing (online preferred for faster lookup :D)? I'm just starting to experiment with it. =)

Thanks in advance!
 
To answer question 1, I'm not sure. For question 2 - it's been a while since I've done that but I did code for that before so I'll see if I can track down the old code and post it here. In the meantime I actually have a useful answer to the 3rd question (allow me to apologize here for the lack of help with the 1st 2 - I hate replies that don't really answer the question - even if they're mine).

MSDN API info:

AllAPI.net:

I've found both of those sites to be helpful before (though the best help I've found is a book - Dan Appleman's "Visual Basic Programmer's Guide to the Win32 API").
 
I can't find my old code, but I think it was the netapi32.dll that has the functionality that you're looking for. If you want to pull a list of users in the Admin group to compare against the current user (which sounds like what you might want here) check out this API information:

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top