Solved

Rights information for Domain user

Posted on 2000-03-26
17
229 Views
Last Modified: 2010-05-18

Is it possible to get all the rights that user have on a domain ?

Share
FileShare
Groups
etc..

Palli
0
Comment
Question by:palli011000
  • 10
  • 3
  • 3
  • +1
17 Comments
 

Author Comment

by:palli011000
ID: 2658506
I have Delphi 5, is it possible to fix this component ?
http://www.jgsoftware.com/files/accessrights.zip
0
 
LVL 17

Expert Comment

by:inthe
ID: 2658627
what error are you getting with component?
(and what code or line number gives error)

0
 

Author Comment

by:palli011000
ID: 2658851
I install first - cmpComputerAccessRights.pas -

Line: 68.

  if LookupPrivilegeDisplayName (PChar   (Computer), PChar (privilege), buffer, bufSize,    languageID) then

Error :

Types Of Actual And Formal Var Parameters
Must Be Identical

Palli.
0
 

Author Comment

by:palli011000
ID: 2658855
Barry do you know what this component do ?

Palli.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2659025
to compile  try change the integer vars to cardinal so it look like:

var
  languageID : Cardinal;
  buffer : array [0..256] of char;
  bufSize : Cardinal;
begin
  bufSize := sizeof (buffer);
  if LookupPrivilegeDisplayName (PChar (Computer), PChar (privilege), buffer, bufSize, languageID) then
    result := buffer
  else


if you get that error again on other procedures/functions do the same for their vars if they are type integer and they give error change to cardinal..

btw.
i think this component will do what your after
0
 

Author Comment

by:palli011000
ID: 2659087
it works, but i don't know anything about this component. Do you have any solutions?
( demo etc.. ).

Many thanks
Palli.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2659151
sorry dont have nt here with delphi installed on to install component to test any examples on.

(you cant install this component on win9* only compile it.)
0
 

Author Comment

by:palli011000
ID: 2659180
I have NT4,

this component is to hard for me,

Palli
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Expert Comment

by:yk030299
ID: 2659396
listen
0
 
LVL 20

Expert Comment

by:Madshi
ID: 2660194
I don't know this component. You can use GetFileSecurity/GetNamedObjectSecurity to get a security descriptor for files/shares. Then use GetSecurityDescriptorDacl to get the dacl of this security descriptor. Then you can use GetEffectiveRightsFromAcl to ask what rights your user has in this dacl. This is quite complicated stuff...   :-(

For user info you can use NetUserGetInfo or NetUserGetGroups.

Regards, Madshi.
0
 

Author Comment

by:palli011000
ID: 2662211
Madshi
do you have any examples of this functions?

Palli
0
 
LVL 20

Expert Comment

by:Madshi
ID: 2662988
Only for some, and those examples are deeply integrated in my private components collection (not published yet). So nothing I could offer you right now...   :-(

Sorry.

But you can look on this homepage for C++ knowledge:

http://www.wsb.poznan.pl/~pawel/vb/www.mvps.org/win32/network/nt95.html
0
 

Author Comment

by:palli011000
ID: 2663928
Madshi

If i want to use this function in my Delphi, what uses clause do i use to get it in the list

Uses Windows..........etc....

Palli
0
 

Author Comment

by:palli011000
ID: 2663936

HOW CAN I USE API FUNCTION THAT ARE IN DLL.
0
 

Author Comment

by:palli011000
ID: 2663955

HOW CAN I USE API FUNCTION THAT ARE IN DLL.
0
 
LVL 20

Accepted Solution

by:
Madshi earned 100 total points
ID: 2664043
Most of these functions are not declared anywhere. You have to declare them yourself, either statically or dynamically. This is an example for dynamic linking (extract from my components):

type
  // type for ISecurityObject.Type_, must be 4 byte long (needed by NT security APIs)
  {$minenumsize 4}
    TSecurityObjectType = (seUnknown, seFile, seService, sePrinter, seRegistry,
                                      seShare, seKernelObject, seWindowObject);
  {$minenumsize 1}

type
  // internal types for winNT security functions
  TSecurityInfo    = (siOwner, siGroup, siDAcl, siSAcl);
  TSecurityInfoSet = set of TSecurityInfo;
  PPAcl            = ^PAcl;
  PPSid            = ^PSid;

var
  // winNT security function variables
  GetNamedSecurityInfoW : function (objectName   : PWideChar;
                                    objectType   : TSecurityObjectType;
                                    securityInfo : cardinal;
                                    sidOwner     : PPSid;
                                    sidGroup     : PPSid;
                                    dacl         : PPAcl;
                                    sacl         : PPAcl;
                                    var sd       : PSecurityDescriptor) : cardinal; stdcall = nil;
  SetNamedSecurityInfoW : function (objectName   : PWideChar;
                                    objectType   : TSecurityObjectType;
                                    securityInfo : cardinal;
                                    sidOwner     : PSid;
                                    sidGroup     : PSid;
                                    dacl         : PAcl;
                                    sacl         : PAcl               ) : cardinal; stdcall = nil;
  GetSecurityInfoW      : function (handle       : cardinal;
                                    objectType   : TSecurityObjectType;
                                    securityInfo : cardinal;
                                    sidOwner     : PPSid;
                                    sidGroup     : PPSid;
                                    dacl         : PPAcl;
                                    sacl         : PPAcl;
                                    var sd       : PSecurityDescriptor) : cardinal; stdcall = nil;
  SetSecurityInfoW      : function (handle       : cardinal;
                                    objectType   : TSecurityObjectType;
                                    securityInfo : cardinal;
                                    sidOwner     : PSid;
                                    sidGroup     : PSid;
                                    dacl         : PAcl;
                                    sacl         : PAcl               ) : cardinal; stdcall = nil;

var dll : cardinal;
initialization
  dll := LoadLibrary(advapi32);
  // Windows unloads the library automatically when our program terminates...
  GetNamedSecurityInfoW := GetProcAddress(dll, 'GetNamedSecurityInfoW');
  SetNamedSecurityInfoW := GetProcAddress(dll, 'SetNamedSecurityInfoW');
  GetSecurityInfoW := GetProcAddress(dll,      'GetSecurityInfoW');
  SetSecurityInfoW := GetProcAddress(dll,      'SetSecurityInfoW');

Regards, Madshi.
0
 

Author Comment

by:palli011000
ID: 2664436
thanks
Palli
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now