When we log on to windows as administrator or as a normal user, what decides the privilege level of the user? What happens in background? Where this information is stored in windows and How to read that information? Is there any API's related to this? I want to study this in detail. Kindly help me in this regard. Thanks in advance.
Each component has its own authorization. E.g. The user's permissions for SQL server and MS Access database are stored in database files, the file/folder permissions are stored on NTFS file system, etc. There is no universal way for authorization.
For Windows system objects, you can use use Windows authorization APIs to control permission on Securable Objects. If you want to authorize Windows users (requires Windows Authentication of course), you can add your own objects to securable Objects by implementing the authorization interface.