Click here to Skip to main content
15,897,704 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: MCAD OR MCSD Pin
Christian Graus29-Oct-07 0:13
protectorChristian Graus29-Oct-07 0:13 
AnswerRe: MCAD OR MCSD Pin
Colin Angus Mackay29-Oct-07 0:48
Colin Angus Mackay29-Oct-07 0:48 
Questionxml to database conversion Pin
KarthikMano28-Oct-07 22:19
KarthikMano28-Oct-07 22:19 
AnswerRe: xml to database conversion Pin
Dave Kreskowiak29-Oct-07 5:04
mveDave Kreskowiak29-Oct-07 5:04 
GeneralRe: xml to database conversion Pin
KarthikMano31-Oct-07 19:16
KarthikMano31-Oct-07 19:16 
QuestionHow to pass a structure contains an array in any size ? Pin
Ky Nam28-Oct-07 21:46
Ky Nam28-Oct-07 21:46 
AnswerRe: How to pass a structure contains an array in any size ? Pin
Dave Kreskowiak29-Oct-07 5:00
mveDave Kreskowiak29-Oct-07 5:00 
GeneralRe: How to pass a structure contains an array in any size ? Pin
Ky Nam29-Oct-07 5:23
Ky Nam29-Oct-07 5:23 
Thank you for your reply

I have used this structure for years , but I just want to know how to declare it like C++

Now I'm using this approach

Public Class SePrivilege
    Public Const SeCount As Integer = 35
    Public Const SeCreateTokenPrivilege As String = "SeCreateTokenPrivilege"
    Public Const SeAssignPrimaryTokenPrivilege As String = "SeAssignPrimaryTokenPrivilege"
    Public Const SeLockMemoryPrivilege As String = "SeLockMemoryPrivilege"
    Public Const SeIncreaseQuotaPrivilege As String = "SeIncreaseQuotaPrivilege"
    Public Const SeUnsolicitedInputPrivilege As String = "SeUnsolicitedInputPrivilege"
    Public Const SeMachineAccountPrivilege As String = "SeMachineAccountPrivilege"
    Public Const SeTcbPrivilege As String = "SeTcbPrivilege"
    Public Const SeSecurityPrivilege As String = "SeSecurityPrivilege"
    Public Const SeTakeOwnershipPrivilege As String = "SeTakeOwnershipPrivilege"
    Public Const SeLoadDriverPrivilege As String = "SeLoadDriverPrivilege"
    Public Const SeSystemProfilePrivilege As String = "SeSystemProfilePrivilege"
    Public Const SeSystemtimePrivilege As String = "SeSystemtimePrivilege"
    Public Const SeProfileSingleProcessPrivilege As String = "SeProfileSingleProcessPrivilege"
    Public Const SeIncreaseBasePriorityPrivilege As String = "SeIncreaseBasePriorityPrivilege"
    Public Const SeCreatePagefilePrivilege As String = "SeCreatePagefilePrivilege"
    Public Const SeCreatePermanentPrivilege As String = "SeCreatePermanentPrivilege"
    Public Const SeBackupPrivilege As String = "SeBackupPrivilege"
    Public Const SeRestorePrivilege As String = "SeRestorePrivilege"
    Public Const SeShutdownPrivilege As String = "SeShutdownPrivilege"
    Public Const SeDebugPrivilege As String = "SeDebugPrivilege"
    Public Const SeAuditPrivilege As String = "SeAuditPrivilege"
    Public Const SeSystemEnvironmentPrivilege As String = "SeSystemEnvironmentPrivilege"
    Public Const SeChangeNotifyPrivilege As String = "SeChangeNotifyPrivilege"
    Public Const SeRemoteShutdownPrivilege As String = "SeRemoteShutdownPrivilege"
    Public Const SeUndockPrivilege As String = "SeUndockPrivilege"
    Public Const SeSyncAgentPrivilege As String = "SeSyncAgentPrivilege"
    Public Const SeEnableDelegationPrivilege As String = "SeEnableDelegationPrivilege"
    Public Const SeManageVolumePrivilege As String = "SeManageVolumePrivilege"
    Public Const SeImpersonatePrivilege As String = "SeImpersonatePrivilege"
    Public Const SeCreateGlobalPrivilege As String = "SeCreateGlobalPrivilege"
    Public Const SeTrustedCredManAccessPrivilege As String = "SeTrustedCredManAccessPrivilege"
    Public Const SeRelabelPrivilege As String = "SeRelabelPrivilege"
    Public Const SeIncreaseWorkingSetPrivilege As String = "SeIncreaseWorkingSetPrivilege"
    Public Const SeTimeZonePrivilege As String = "SeTimeZonePrivilege"
    Public Const SeCreateSymbolicLinkPrivilege As String = "SeCreateSymbolicLinkPrivilege"
End Class

[Flags()] Public Enum SePrivilegeAction
    EnabledByDefault = 1
    Enabled = 2
    Removed = 4
    UsedForAccess = &H80000000
End Enum

[StructLayout(LayoutKind.Sequential)] Public Structure LUID

    Public LowPart As Integer
    Public HighPart As Integer

    Public Shared ReadOnly Zero = New LUID

    Public Shared Function FromPrivilegeName(ByVal PrivilegeName As String) As LUID
        Dim Luid As New [Structure].LUID()
        Advapi32.LookupPrivilegeValue(Nothing, PrivilegeName, Luid)
        Return Luid
    End Function

End Structure

[StructLayout(LayoutKind.Sequential)] Public Structure LUIDAndAttributes
    Public LUID As LUID
    Public Attributes As SePrivilegeAction
End Structure

[StructLayout(LayoutKind.Sequential)] Public Structure TokenPrivileges
    Public PrivilegeCount As Integer
    [MarshalAs(UnmanagedType.ByValArray, SizeConst:=SePrivilege.SeCount)] Public Privileges() As LUIDAndAttributes
End Structure


It seems I can not post "<" , ">" character
GeneralRe: How to pass a structure contains an array in any size ? Pin
Dave Kreskowiak29-Oct-07 7:51
mveDave Kreskowiak29-Oct-07 7:51 
GeneralRe: How to pass a structure contains an array in any size ? Pin
Ky Nam29-Oct-07 19:04
Ky Nam29-Oct-07 19:04 
GeneralRe: How to pass a structure contains an array in any size ? Pin
Dave Kreskowiak30-Oct-07 2:25
mveDave Kreskowiak30-Oct-07 2:25 
QuestionMoving buttons Pin
matjame28-Oct-07 20:51
matjame28-Oct-07 20:51 
AnswerRe: Moving buttons Pin
Tom Deketelaere28-Oct-07 21:41
professionalTom Deketelaere28-Oct-07 21:41 
GeneralRe: Moving buttons Pin
matjame28-Oct-07 21:43
matjame28-Oct-07 21:43 
GeneralRe: Moving buttons Pin
Christian Graus29-Oct-07 0:14
protectorChristian Graus29-Oct-07 0:14 
GeneralRe: Moving buttons Pin
Paul Conrad29-Oct-07 17:17
professionalPaul Conrad29-Oct-07 17:17 
QuestionNavigation of Internet connection Pin
ankur010128-Oct-07 19:39
ankur010128-Oct-07 19:39 
AnswerRe: Navigation of Internet connection Pin
Dave Kreskowiak29-Oct-07 4:37
mveDave Kreskowiak29-Oct-07 4:37 
Questionimage editor Pin
Aamir Mustafa28-Oct-07 18:16
Aamir Mustafa28-Oct-07 18:16 
AnswerRe: image editor Pin
Dave Kreskowiak29-Oct-07 4:33
mveDave Kreskowiak29-Oct-07 4:33 
QuestionHow to Create a Reverse Index by VB.NET? Pin
Asianhawk28-Oct-07 16:18
Asianhawk28-Oct-07 16:18 
AnswerRe: How to Create a Reverse Index by VB.NET? Pin
Dave Kreskowiak28-Oct-07 16:52
mveDave Kreskowiak28-Oct-07 16:52 
QuestionDatagrid Column Width Pin
ejaz_pk28-Oct-07 15:44
ejaz_pk28-Oct-07 15:44 
AnswerRe: Datagrid Column Width Pin
Dave Kreskowiak28-Oct-07 16:41
mveDave Kreskowiak28-Oct-07 16:41 
AnswerRe: Datagrid Column Width Pin
Salman Sheikh28-Oct-07 18:35
Salman Sheikh28-Oct-07 18:35 

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.