[VB.net]원인을 몰라서 이렇게 질문해요!
개랑
Private Declare Function RegSetKeySecurity Lib advapi32.dll (ByVal hKey As Long, ByVal SecurityInformation As Long, pSecurityDescriptor As SECURITY_DESCRIPTOR) As Long
Private Declare Function RegCloseKey Lib advapi32.dll (ByVal hKey As Long) As Long
Private Declare Function RegOpenKey Lib advapi32.dll Alias RegOpenKeyA (ByVal hKey As Long, ByVal lpSubKey As String, ByRef phkResult As Long) As Long
Private Declare Function RegSetValueEx Lib advapi32 Alias RegSetValueExA (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As String, ByVal cbData As Long) As Long
Private Declare Function RegCreateKey Lib advapi32.dll Alias RegCreateKeyA (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegOpenKeyEx Lib advapi32.dll Alias RegOpenKeyExA (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
Public Declare Function RegQueryValueEx Lib advapi32.dll Alias RegQueryValueExA (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As String, lpcbData As Long) As Long
Private Declare Function InitializeSecurityDescriptor Lib advapi32.dll (ByRef pSecurityDescriptor As SECURITY_DESCRIPTOR, ByVal dwRevision As Long) As Long
Private Declare Function InitializeAcl Lib advapi32.dll (ByRef pAcl As ACL, ByVal nAclLength As Long, ByVal dwAclRevision As Long) As Long
Private Declare Function SetSecurityDescriptorDacl Lib advapi32.dll (ByRef pSecurityDescriptor As SECURITY_DESCRIPTOR, ByVal bDaclPresent As Long, ByRef pDacl As Object, ByVal bDaclDefaulted As Long) As Long
Private Structure SECURITY_DESCRIPTOR Dim Revision As Byte Dim Sbz1 As Byte Dim Control As Long Dim Owner As Long Dim Group As Long Dim Sacl As ACL Dim Dacl As ACL End Structure
Private Structure ACL Dim AclRevision As Byte Dim Sbz1 As Byte Dim AclSize As Integer Dim AceCount As Integer Dim Sbz2 As Integer End Structure
Private Const DACL_SECURITY_INFORMATION As Long = &H4& Private Const SECURITY_DESCRIPTOR_REVISION As Long = 1 Private Const ACL_REVISION As Long = 2 Private Const HKEY_LOCAL_MACHINE = &H80000002 Private Const REG_SZ = 1 Private Const STANDARD_RIGHTS_ALL = &H1F0000 Private Const KEY_QUERY_VALUE = &H1 Private Const KEY_ENUMERATE_SUB_KEYS = &H8 Private Const KEY_SET_VALUE = &H2 Private Const KEY_CREATE_SUB_KEY = &H4 Private Const KEY_NOTIFY = &H10 Private Const KEY_CREATE_LINK = &H20 Private Const SYNCHRONIZE = &H100000 Private Const KEY_ALL_ACCESS = ((STANDARD_RIGHTS_ALL Or KEY_QUERY_VALUE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY Or KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY Or KEY_CREATE_LINK) And (Not SYNCHRONIZE)) Private Const ERROR_SUCCESS = 0&
Dim SD As SECURITY_DESCRIPTOR Dim ACL_ As ACL Dim KeyResult As Long Dim ILen As Integer/steger Dim KeyHandle As Long Dim lRetVal As Long Dim dType As Long Dim Buffer As String Dim lBufferSize As Long Dim lSubKey As Long
Public Sub r_aclON(Path As String) On Error Resume Next
InitializeSecurityDescriptor(SD, SECURITY_DESCRIPTOR_REVISION) - 이 지점 InitializeAcl(ACL_, Len(ACL_), ACL_REVISION) SetSecurityDescriptorDacl(SD, True, ACL_, True) RegSetKeySecurity(GetregHandle(Path), DACL_SECURITY_INFORMATION, SD) End Sub
Public Sub r_aclOFF(Path As String) On Error Resume Next
InitializeSecurityDescriptor(SD, SECURITY_DESCRIPTOR_REVISION) - 이 지점 SetSecurityDescriptorDacl(SD, True, 0&, True) RegSetKeySecurity(GetregHandle(Path), DACL_SECURITY_INFORMATION, SD) End Sub
해당 지점에서 이런 오류가 발생해요.
...무슨 오류인지 못알아먹겠어요.VB6.0 은 잘되는게 VB.net 에서는 다르게 작용하나봐요.여기에 맞는 해결책 아시는분 답변 해주시면 감사하겠습니다..
번호 | 제 목 | 글쓴이 | 날짜 |
---|---|---|---|
2698551 | 게시판폭보다 큰 이미지올릴때 어떻게 하시는지요 (9) | 에드문드 | 2025-06-18 |
2698522 | [VB.net]원인을 몰라서 이렇게 질문해요! | 개랑 | 2025-06-17 |
2698448 | 인코딩 관련문제, 정말 어떻해야 할까요!! (3) | 해찬나래 | 2025-06-17 |
2698395 | [질문] 글꼴 포함 시켰을때 퍼블리시 속도 왤케느려요~~~~~~~~T.T (3) | 하연 | 2025-06-16 |
2698365 | 쉽지 않은 ul li 문제점 (2) | 크심 | 2025-06-16 |
2698310 | 제이쿼리 질문요~ (10) | 두힘 | 2025-06-15 |
2698284 | 원격지 서버 값 받아오기/ (3) | 민서 | 2025-06-15 |
2698252 | 제이쿼리 간단 질문 | 먹딸기 | 2025-06-15 |
2698231 | sprintf?? 질문 (1) | 별빛 | 2025-06-15 |
2698204 | 자동차 ECU 맵핑 아시는분? (4) | 풍란 | 2025-06-14 |
2698175 | 음 정말 c++과 api 네트워킹 고수분 께 질문합니다. | 앵겨쪼 | 2025-06-14 |
2698140 | 익스7과 익스8에서 마진이 다르게 먹혀요ㅠㅠ (4) | 안녕나야 | 2025-06-14 |
2698115 | 웹표준,접근성작업자 분들에게 궁금합니다. (4) | 튼동 | 2025-06-14 |
2698084 | 표준코딩(div) 비용 질문입니다. (1) | 좍좍 | 2025-06-13 |
2698054 | 트러스트폼에 피봇 기능있나요. | 아이폰 | 2025-06-13 |
2698003 | 웹표준어렵다고 테이블로 코딩해달라는 프로그래머 --; (10) | 지우 | 2025-06-13 |
2697945 | [질문] vc++ 에서 리스트 컨트롤에 부분만 UpdateData() 할 수 없을까요? (2) | 든해솔 | 2025-06-12 |
2697917 | {와 }의 필요성?.. (1) | 이루리라 | 2025-06-12 |
2697885 | valign 을 대치할수 있는 것은~~ (1) | 족장 | 2025-06-12 |
2697855 | 오라클이랑 궁합이 맞는 언어는 자바일까요? c++일까요? (4) | 배꽃 | 2025-06-11 |