Click here to Skip to main content
15,894,343 members
Home / Discussions / C#
   

C#

 
GeneralRe: Auto-updater? Pin
Ray Cassick18-Sep-02 5:16
Ray Cassick18-Sep-02 5:16 
GeneralRe: Auto-updater? Pin
User 988518-Sep-02 5:44
User 988518-Sep-02 5:44 
AnswerRe: Auto-updater? Pin
Andy Smith18-Sep-02 4:55
Andy Smith18-Sep-02 4:55 
Questionhelp? Pin
imran_rafique17-Sep-02 15:33
imran_rafique17-Sep-02 15:33 
Generalgetting a HANDLE Pin
Nnamdi Onyeyiri17-Sep-02 9:29
Nnamdi Onyeyiri17-Sep-02 9:29 
GeneralRe: getting a HANDLE Pin
leppie17-Sep-02 10:08
leppie17-Sep-02 10:08 
GeneralRe: getting a HANDLE Pin
Nnamdi Onyeyiri17-Sep-02 10:15
Nnamdi Onyeyiri17-Sep-02 10:15 
GeneralRe: getting a HANDLE Pin
leppie17-Sep-02 10:33
leppie17-Sep-02 10:33 
Nnamdi Onyeyiri wrote:
well this is what msdn says:

This method exists because it is not safe to make a direct platform invoke call to GetLastError to obtain this information. The common language runtime might have made internal calls to API's that overwrite the operating system maintained GetLastError.


Hmm nice Smile | :)

Nnamdi Onyeyiri wrote:
ok, now, if i was a computer, im sure all that code would make sense to me

That would be ideal for a flagged enum, lookout for them in the headers, its much better to use enums than to define endless constants. This what makes a strongly-typed language so nice Smile | :) I tried c++ once to test the intellisense, guess what it gave me a list of a few thousand different functions and constants. Alt - F4 did the job Laugh | :laugh:

So you would write it as (you can copy, its correct Smile | :) ):

[Flags]
public enum TokenAccessRights
{
	ASSIGN_PRIMARY    =(0x0001),
	DUPLICATE         =(0x0002),
	IMPERSONATE       =(0x0004),
	QUERY             =(0x0008),
	QUERY_SOURCE      =(0x0010),
	ADJUST_PRIVILEGES =(0x0020),
	ADJUST_GROUPS     =(0x0040),
	ADJUST_DEFAULT    =(0x0080),
	ADJUST_SESSIONID  =(0x0100),

	ALL_ACCESS_P =(STANDARD_RIGHTS_REQUIRED  |
		ASSIGN_PRIMARY      |
		DUPLICATE           |
		IMPERSONATE         |
		QUERY               |
		QUERY_SOURCE        |
		ADJUST_PRIVILEGES   |
		ADJUST_GROUPS       |
		ADJUST_DEFAULT ),

	ALL_ACCESS  =(ALL_ACCESS_P |
		ADJUST_SESSIONID ),

	READ       =(STANDARD_RIGHTS_READ      |
		QUERY),

	WRITE      =(STANDARD_RIGHTS_WRITE     |
		ADJUST_PRIVILEGES   |
		ADJUST_GROUPS       |
		ADJUST_DEFAULT),

	EXECUTE    =(STANDARD_RIGHTS_EXECUTE),
}

[Flags]
public enum AccessMask
{
	DELETE                           =(0x00010000),
	READ_CONTROL                     =(0x00020000),
	WRITE_DAC                        =(0x00040000),
	WRITE_OWNER                      =(0x00080000),
	SYNCHRONIZE                      =(0x00100000),

	STANDARD_RIGHTS_REQUIRED         =(0x000F0000),

	STANDARD_RIGHTS_READ             =(READ_CONTROL),
	STANDARD_RIGHTS_WRITE            =(READ_CONTROL),
	STANDARD_RIGHTS_EXECUTE          =(READ_CONTROL),

	STANDARD_RIGHTS_ALL              =(0x001F0000),

	SPECIFIC_RIGHTS_ALL              =(0x0000FFFF),
}

GeneralRe: getting a HANDLE Pin
Nnamdi Onyeyiri17-Sep-02 10:36
Nnamdi Onyeyiri17-Sep-02 10:36 
GeneralRe: getting a HANDLE Pin
leppie17-Sep-02 10:44
leppie17-Sep-02 10:44 
GeneralServices Pin
Mazdak17-Sep-02 8:47
Mazdak17-Sep-02 8:47 
GeneralMQSeries from .NET Pin
SimonS17-Sep-02 3:58
SimonS17-Sep-02 3:58 
GeneralRe: MQSeries from .NET Pin
leppie17-Sep-02 4:38
leppie17-Sep-02 4:38 
GeneralRe: MQSeries from .NET Pin
Gaul17-Sep-02 4:53
Gaul17-Sep-02 4:53 
GeneralRe: MQSeries from .NET Pin
SimonS17-Sep-02 5:27
SimonS17-Sep-02 5:27 
GeneralRe: MQSeries from .NET Pin
leppie17-Sep-02 7:24
leppie17-Sep-02 7:24 
GeneralRe: MQSeries from .NET Pin
Gaul25-Sep-02 12:05
Gaul25-Sep-02 12:05 
QuestionHow to remove null from arraylist? Pin
leppie17-Sep-02 0:53
leppie17-Sep-02 0:53 
AnswerRe: How to remove null from arraylist? Pin
jan larsen17-Sep-02 1:18
jan larsen17-Sep-02 1:18 
GeneralRe: How to remove null from arraylist? Pin
leppie17-Sep-02 1:31
leppie17-Sep-02 1:31 
GeneralRe: How to remove null from arraylist? Pin
jan larsen17-Sep-02 3:45
jan larsen17-Sep-02 3:45 
GeneralRe: How to remove null from arraylist? Pin
leppie17-Sep-02 4:26
leppie17-Sep-02 4:26 
GeneralRe: How to remove null from arraylist? Pin
leppie17-Sep-02 4:35
leppie17-Sep-02 4:35 
GeneralRe: How to remove null from arraylist? Pin
Ryan Cromwell17-Sep-02 3:12
Ryan Cromwell17-Sep-02 3:12 
GeneralGotDotNet workspaces :) Pin
leppie16-Sep-02 23:30
leppie16-Sep-02 23:30 

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.