473,706 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

LookupPrivilege Value function always return true irrespective of privilege status

Hi,

I am using LookupPrivilege Value to check whether SE_TCB_NAME privilege
exists for the user or not in windows 2000 .The value returned from
LookupPrivilege Value function is always true.i checked in
administartive tools for the right act as part of operating
system[SE_TCB_NAME privilege] is disabled .my code is below

//declarations
[StructLayout(La youtKind.Sequen tial)]

public struct LUID
{

public int LowPart;

public int HighPart;

}
[StructLayout(La youtKind.Sequen tial)]
public struct LUID_AND_ATTRIB UTES
{
public LUID Luid;
public int Attributes;

}

[DllImport("adva pi32.dll", CharSet=CharSet .Auto)]
public static extern System.Boolean LookupPrivilege Value(string
lpSystemName,st ring lpName,[MarshalAs(Unman agedType.Struct )] ref LUID
lpLuid);
internal const string SE_TCB_NAME = "SeTcbPrivilege ";
//calling LookupPrivilege Value function from main
LUID tLUID = new LUID();

bool ret=LookupPrivi legeValue(null , SE_TCB_NAME, ref tLUID);
The value for ret is always true.Is there any mistake in calling
LookupPrivilege Value function.
my program need is to check whether SE_TCB_NAME privilege exists for
the user or not.
Please help me out to solve the problem.

Regards,
Mani

Jan 4 '06 #1
1 3340
The value for ret is always true.Is there any mistake in calling
LookupPrivileg eValue function.
my program need is to check whether SE_TCB_NAME privilege exists for
the user or not.


Then you shouldn't use LookupPrivilege Value, it simply does a name to
LUID lookup. Try GetTokenInforma tion(TokenPrivi leges) instead.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jan 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4963
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my webserver runs that part of the script (see attached file, snippet.php), though, it doesn't go through. I don't get an error message or anything...it just returns a "1" (whereas it should return a "0") as far as I can tell. I have read the PHP...
2
9170
by: Kevin Lyons | last post by:
Hello, Can anyone assist me with what I am trying to do with the following code (six different scenarios to try to make the functionality work correctly)? I want to always (and ONLY) display in the status bar 'Symantec Corporation' whenever anyone mouses over (onMouseOver) my image or link OR when one clicks while holding the left mouse down (onClick) on the same image or link. Upon releasing the mouse (onMouseOut), the
3
4550
by: Liang Yitao | last post by:
I used DllImport() to load the function LookupPrivilegeValue() in advapi32.dll, and then called it in my button click event. But the function always returns false. I got the error code it left through GetLastError() function and the result is "997" which means, in the system error code in MSDN, "Overlapped I/O operation is in progress." I don't know what's wrong with it. The calling code is as below: --------------------------------...
5
3963
by: siaj | last post by:
Hello, I have a javascript function for a validation in the HTML page of the asp.Net page.. I call this function in a Savebutton click When the validation fails No postback should happen ( ie Save should not happen) the js function is as function IsValidAmount() {
0
8781
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8697
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9053
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7908
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5939
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4449
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2502
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.