Click here to Skip to main content
15,844,903 members
Home / Discussions / C#
   

C#

 
GeneralRe: GotDotNet workspaces :) Pin
Paul Watson17-Sep-02 23:00
sitebuilderPaul Watson17-Sep-02 23:00 
GeneralRe: GotDotNet workspaces :) Pin
leppie18-Sep-02 2:57
leppie18-Sep-02 2:57 
GeneralConsuming Web Services... Pin
Matt Philmon16-Sep-02 12:16
Matt Philmon16-Sep-02 12:16 
GeneralRe: Consuming Web Services... Pin
leppie16-Sep-02 12:26
leppie16-Sep-02 12:26 
GeneralRe: Consuming Web Services... Pin
Paul Watson17-Sep-02 1:05
sitebuilderPaul Watson17-Sep-02 1:05 
GeneralRe: Consuming Web Services... Pin
Matt Philmon17-Sep-02 6:35
Matt Philmon17-Sep-02 6:35 
GeneralPrivileges [again] Pin
Nnamdi Onyeyiri16-Sep-02 11:24
Nnamdi Onyeyiri16-Sep-02 11:24 
GeneralRe: Privileges [again] Pin
leppie16-Sep-02 11:51
leppie16-Sep-02 11:51 
Nnamdi Onyeyiri wrote:
[StructLayout(LayoutKind.Auto)]private class TOKEN_PRIVILEGES { public int PrivilegeCount; public LUID_AND_ATTRIBUTES[] Privileges = new LUID_AND_ATTRIBUTES[1];}

That MUST be Sequential as well.

BOOL AdjustTokenPrivileges(
HANDLE TokenHandle, // handle to token
BOOL DisableAllPrivileges, // disabling option
PTOKEN_PRIVILEGES NewState, // privilege information
DWORD BufferLength, // size of buffer
PTOKEN_PRIVILEGES PreviousState, // original state buffer
PDWORD ReturnLength // required buffer size
);

Param #5:

PreviousState
[out] Pointer to a buffer that the function fills with a TOKEN_PRIVILEGES structure that contains the previous state of any privileges that the function modifies. This parameter can be NULL.
If you specify a buffer that is too small to receive the complete list of modified privileges, the function fails and does not adjust any privileges. In this case, the function sets the variable pointed to by the ReturnLength parameter to the number of bytes required to hold the complete list of modified privileges.


That is the keyword. Normally these ype of functions need to be called twice. First to find the size of the buffer that is to be allocated (Marshalled in your case) and then to perform the actual function.

I came across these types too in the RASAPI, and I assume they are everywhere Smile | :)

See ms-help://MS.VSCC/MS.MSDNVS/rras/rasclnt_88j7.htm[^] for more info. Have a look at the C++ example and things will become clear. Smile | :)

UPDATE: oi that link dont work, funny links from Visual Studio help works...Mad | :mad: Just copy shortcut then.

Hope this helps Smile | :)
GeneralRe: Privileges [again] Pin
Nnamdi Onyeyiri16-Sep-02 12:32
Nnamdi Onyeyiri16-Sep-02 12:32 
GeneralRe: Privileges [again] Pin
leppie16-Sep-02 12:54
leppie16-Sep-02 12:54 
GeneralRe: Privileges [again] Pin
leppie16-Sep-02 13:12
leppie16-Sep-02 13:12 
Questionhow to implement SHFileOperation api call in c# Pin
waleed riaz16-Sep-02 2:34
waleed riaz16-Sep-02 2:34 
AnswerRe: how to implement SHFileOperation api call in c# Pin
James T. Johnson16-Sep-02 3:37
James T. Johnson16-Sep-02 3:37 
AnswerRe: how to implement SHFileOperation api call in c# Pin
Richard Deeming16-Sep-02 8:50
mveRichard Deeming16-Sep-02 8:50 
Questionunable to upload file,WebClient.UploadFile() doesn't work??? Pin
fftongzhi15-Sep-02 23:37
fftongzhi15-Sep-02 23:37 
GeneralIdentifying DesignTime Mode for Forms Pin
Firoz15-Sep-02 20:54
Firoz15-Sep-02 20:54 
GeneralRe: Identifying DesignTime Mode for Forms Pin
leppie15-Sep-02 22:49
leppie15-Sep-02 22:49 
GeneralRe: Identifying DesignTime Mode for Forms Pin
Firoz16-Sep-02 1:03
Firoz16-Sep-02 1:03 
GeneralRe: Identifying DesignTime Mode for Forms Pin
leppie16-Sep-02 6:44
leppie16-Sep-02 6:44 
GeneralRe: Identifying DesignTime Mode for Forms Pin
James T. Johnson16-Sep-02 10:30
James T. Johnson16-Sep-02 10:30 
GeneralRe: Identifying DesignTime Mode for Forms Pin
leppie16-Sep-02 10:46
leppie16-Sep-02 10:46 
GeneralRe: Identifying DesignTime Mode for Forms Pin
James T. Johnson16-Sep-02 16:23
James T. Johnson16-Sep-02 16:23 
GeneralRe: Identifying DesignTime Mode for Forms Pin
Paul Riley17-Sep-02 0:01
Paul Riley17-Sep-02 0:01 
GeneralRe: Identifying DesignTime Mode for Forms Pin
leppie17-Sep-02 0:07
leppie17-Sep-02 0:07 
GeneralRe: Identifying DesignTime Mode for Forms Pin
Paul Riley17-Sep-02 0:28
Paul Riley17-Sep-02 0:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.