Click here to Skip to main content
15,949,686 members
Home / Discussions / C#
   

C#

 
GeneralRe: GotDotNet workspaces :) Pin
Paul Watson17-Sep-02 22:00
sitebuilderPaul Watson17-Sep-02 22:00 
GeneralRe: GotDotNet workspaces :) Pin
leppie18-Sep-02 1:57
leppie18-Sep-02 1:57 
GeneralConsuming Web Services... Pin
Matt Philmon16-Sep-02 11:16
Matt Philmon16-Sep-02 11:16 
GeneralRe: Consuming Web Services... Pin
leppie16-Sep-02 11:26
leppie16-Sep-02 11:26 
GeneralRe: Consuming Web Services... Pin
Paul Watson17-Sep-02 0:05
sitebuilderPaul Watson17-Sep-02 0:05 
GeneralRe: Consuming Web Services... Pin
Matt Philmon17-Sep-02 5:35
Matt Philmon17-Sep-02 5:35 
GeneralPrivileges [again] Pin
Nnamdi Onyeyiri16-Sep-02 10:24
Nnamdi Onyeyiri16-Sep-02 10:24 
GeneralRe: Privileges [again] Pin
leppie16-Sep-02 10:51
leppie16-Sep-02 10: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 11:32
Nnamdi Onyeyiri16-Sep-02 11:32 
GeneralRe: Privileges [again] Pin
leppie16-Sep-02 11:54
leppie16-Sep-02 11:54 
GeneralRe: Privileges [again] Pin
leppie16-Sep-02 12:12
leppie16-Sep-02 12:12 
Questionhow to implement SHFileOperation api call in c# Pin
waleed riaz16-Sep-02 1:34
waleed riaz16-Sep-02 1:34 
AnswerRe: how to implement SHFileOperation api call in c# Pin
James T. Johnson16-Sep-02 2:37
James T. Johnson16-Sep-02 2:37 
AnswerRe: how to implement SHFileOperation api call in c# Pin
Richard Deeming16-Sep-02 7:50
mveRichard Deeming16-Sep-02 7:50 
Questionunable to upload file,WebClient.UploadFile() doesn't work??? Pin
fftongzhi15-Sep-02 22:37
fftongzhi15-Sep-02 22:37 
GeneralIdentifying DesignTime Mode for Forms Pin
Firoz15-Sep-02 19:54
Firoz15-Sep-02 19:54 
GeneralRe: Identifying DesignTime Mode for Forms Pin
leppie15-Sep-02 21:49
leppie15-Sep-02 21:49 
GeneralRe: Identifying DesignTime Mode for Forms Pin
Firoz16-Sep-02 0:03
Firoz16-Sep-02 0:03 
GeneralRe: Identifying DesignTime Mode for Forms Pin
leppie16-Sep-02 5:44
leppie16-Sep-02 5:44 
GeneralRe: Identifying DesignTime Mode for Forms Pin
James T. Johnson16-Sep-02 9:30
James T. Johnson16-Sep-02 9:30 
GeneralRe: Identifying DesignTime Mode for Forms Pin
leppie16-Sep-02 9:46
leppie16-Sep-02 9:46 
GeneralRe: Identifying DesignTime Mode for Forms Pin
James T. Johnson16-Sep-02 15:23
James T. Johnson16-Sep-02 15:23 
GeneralRe: Identifying DesignTime Mode for Forms Pin
Paul Riley16-Sep-02 23:01
Paul Riley16-Sep-02 23:01 
GeneralRe: Identifying DesignTime Mode for Forms Pin
leppie16-Sep-02 23:07
leppie16-Sep-02 23:07 
GeneralRe: Identifying DesignTime Mode for Forms Pin
Paul Riley16-Sep-02 23:28
Paul Riley16-Sep-02 23: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.