|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| 07/21/2009 at 11:03AM PDT, ID: 24588352 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: |
Imports System.Runtime.InteropServices
Module Module1
Private Const CONTAINER_INHERIT_ACE As Integer = &H2
Private Const OBJECT_INHERIT_ACE As Integer = &H1
Private Const SET_ACCESS As Integer = &H2
Private Const SYNCHRONIZE As Integer = &H100000
Private Const READ_CONTROL As Integer = &H20000
Private Const WRITE_DAC As Integer = &H40000
Private Const WRITE_OWNER As Integer = &H80000
Private Const STANDARD_RIGHTS_READ As Integer = (READ_CONTROL)
Private Const STANDARD_RIGHTS_WRITE As Integer = (READ_CONTROL)
Private Const DELETE As Integer = &H10000
Private Const FILE_DELETE_CHILD As Integer = &H40
Private Const FILE_ALL_ACCESS As Integer = &HF0000 Or SYNCHRONIZE Or &H1FF
'typedef struct _TRUSTEE {
' PTRUSTEE pMultipleTrustee;
' MULTIPLE_TRUSTEE_OPERATION MultipleTrusteeOperation;
' TRUSTEE_FORM TrusteeForm;
' TRUSTEE_TYPE TrusteeType;
' LPTSTR ptstrName;
'} TRUSTEE, *PTRUSTEE;
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> _
Public Structure TRUSTEE
Dim pMultipleTrustee As IntPtr
Dim MultipleTrusteeOperation As Integer
Dim TrusteeForm As Integer
Dim TrusteeType As Integer
Dim ptstrName As String
End Structure
'typedef struct _EXPLICIT_ACCESS {
' DWORD grfAccessPermissions;
' ACCESS_MODE grfAccessMode;
' DWORD grfInheritance;
' TRUSTEE Trustee;
'} EXPLICIT_ACCESS, *PEXPLICIT_ACCESS;
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> _
Public Structure EXPLICIT_ACCESS
Dim grfAccessPermissions As Integer
Dim grfAccessMode As Integer
Dim grfInheritance As Integer
Dim Trustee As TRUSTEE
End Structure
'VOID BuildExplicitAccessWithName(
' PEXPLICIT_ACCESS pExplicitAccess,
' LPTSTR pTrusteeName,
' DWORD AccessPermissions,
' ACCESS_MODE AccessMode,
' DWORD Inheritance
');
Declare Auto Sub BuildExplicitAccessWithName Lib "AdvAPI32.DLL" ( _
ByRef pExplicitAccess As EXPLICIT_ACCESS, _
ByVal pTrusteeName As String, _
ByVal AccessPermissions As Integer, _
ByVal AccessMode As Integer, _
ByVal Inheritance As Integer _
)
Sub Main()
Dim ea As New EXPLICIT_ACCESS
Console.WriteLine("starting")
BuildExplicitAccessWithName(ea, "Users", FILE_ALL_ACCESS, SET_ACCESS, CONTAINER_INHERIT_ACE Or OBJECT_INHERIT_ACE)
Console.WriteLine("finished")
Console.WriteLine("ea.Trustee.ptstrName='" & ea.Trustee.ptstrName & "'")
Console.ReadLine()
End Sub
End Module
|
Advertisement