Newsgroup: it.comp.lang.visual-basic
Titolo: Win 95 ed NT:differenze tra il Registry

Abbiamo creato un'applicazione con VB5 (SP3) che scrive dei parametri nel
registry di Win95 usando le API. Quando si installa su una macchina con Win
NT perň, il prg non scrive un bel nulla.
La domanda č: quali sono le differenze tra il registry di Win95 e quello di
NT? Non dovrebbero essere identici? (e soprattutto: il set di istruzioni
Win32 non dovrebbe essere identico?).
Saluti.
P.S. gradite risposte anche a 
figlio...@fi.flashnet.it

...


 implementati!!!!!!!!!!!!!!
 
OKOKOKOK,
ma non ho specificato (e me ne scuso) di dire che fino alla creazione delle
chiavi ci arriva. Il prg si ferma all'inserimento dei valori all'interno
delle chiavi.
E poi, visto che parli di sicurezza, mi sembra di capire di aver omesso
qualcosa (a livello di dichiarazioni API o altro)... ma cosa?
Grazie per la risposta,
Tony

Prova a vedere questa parte e sappimi dire....
'**************************** Funzioni che fanno parte delle
AdvApi32...********************
'Operazioni su una chiave di registro...
Private Declare Function OSRegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA"
(ByVal hKey As Long, ByVal lpszSubKey As String, ByVal duOptions As Long,
ByVal samDesired As Long, lphkResult As Long) As Long
Private Declare Function OSRegCreateKeyEx Lib "advapi32" Alias
"RegCreateKeyExA" (ByVal hKey As Long, ByVal lpszSubKey As String, ByVal
duReserved As Long, ByVal lpszClass As String, ByVal duOptions As Long,
ByVal samDesired As Long, lpSecurityAttributes As SECURITY_ATTRIBUTES,
lphkResult As Long, lpDwDisposition As Long) As Long
Private Declare Function OSRegDeleteKey Lib "advapi32" Alias "RegDeleteKeyA"
(ByVal hKey As Long, ByVal lpSubKey As String) As Long
Private Declare Function OSRegCloseKey Lib "advapi32" Alias "RegCloseKey"
(ByVal HKeyIn As Long) As Long
'-.
'Operazioni sui valori di una chiave di registro...
Private Declare Function OSRegQueryValueEx Lib "advapi32" Alias
"RegQueryValueExA" (ByVal hKey As Long, ByVal lpszValueName As String, ByVal
lpdwReserved As Long, lpdwType As Long, ByVal lpbData As String, lpcbData As
Long) As Long
Private Declare Function OSRegSetValueEx Lib "advapi32" Alias
"RegSetValueExA" (ByVal hKey As Long, ByVal lpszValueName As String, ByVal
dwReserved As Long, ByVal fdwType As Long, ByVal lpData As String, ByVal
cbData As Long) As Long
Private Declare Function OSRegDeleteValue Lib "advapi32" Alias
"RegDeleteValueA" (ByVal hKey As Long, ByVal lpszValueName As String) As
Long
Private Declare Function OSRegSetStringEx Lib "advapi32" Alias
"RegSetValueExA" (ByVal hKey As Long, ByVal lpszValueName As String, ByVal
dwReserved As Long, ByVal fdwType As Long, ByVal lpData As String, ByVal
cbData As Long) As Long
'-.
'***************************************************************************
*****************
'************ Header definizione valore costanti comuni file risorse
*****************
'<Regclas.h>
Const resERROR_APITIT = 1
Const resERROR_APIDESC1 = 2
Const resERROR_APIDESC2 = 3
Const resERROR_APIDESC3 = 4
Const resERROR_APIDESC4 = 5
Const resERROR_APIDESC5 = 6
Const resERROR_APIDESC6 = 7
Const resERROR_APIDESC7 = 8
Const resERROR_APIDESC8 = 9
Const resERROR_APIDESC9 = 10
Const resERROR_APIDESC10 = 11
Const resERROR_CLSTIT = 12
Const resERROR_CLSDESC1 = 13
Const resERROR_CLSDESC2 = 14
Const resERROR_CLSDESC3 = 15
Const resERROR_CLSDESC4 = 16
Const resERROR_CLSDESC5 = 17
'
'**************************** Costanti Usate Dalle Api di questa DLL
************************
' -- handle
Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_USERS = &H80000003
Const HKEY_PERFORMANCE_DATA = &H80000004
Const HKEY_CURRENT_CONFIG = &H80000005
Const HKEY_DYN_DATA = &H80000006
' -- sicurezza (Win NT)
Const READ_CONTROL = &H20000
Const SYNCHRONIZE = &H100000
Const STANDARD_RIGHTS_ALL = &H1F0000
Const STANDARD_RIGHTS_READ = READ_CONTROL
Const STANDARD_RIGHTS_WRITE = READ_CONTROL
'chiavi
Const KEY_QUERY_VALUE = 1&
Const KEY_SET_VALUE = 2&
Const KEY_CREATE_SUB_KEY = &H4
Const KEY_ENUMERATE_SUB_KEYS = &H8
Const KEY_NOTIFY = &H10
Const KEY_CREATE_LINK = &H20
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))
Const KEY_READ = ((STANDARD_RIGHTS_READ Or KEY_QUERY_VALUE Or
KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY) And (Not SYNCHRONIZE))
Const KEY_EXECUTE = ((KEY_READ) And (Not SYNCHRONIZE))
Const KEY_WRITE = ((STANDARD_RIGHTS_WRITE Or KEY_SET_VALUE Or
KEY_CREATE_SUB_KEY) And (Not SYNCHRONIZE))
' -- Codici di errore
Const ERROR_SUCCESS = 0&
Const ERROR_FILE_NOT_FOUND = 2&
Const ERROR_ACCESS_DENIED = 5&
Const ERROR_OUTOFMEMORY = 14&
Const ERROR_INVALID_PARAMETER = 87&
Const ERROR_NO_MORE_ITEMS = 259&
Const ERROR_BADDB = 1009&
Const ERROR_BADKEY = 1010&
Const ERROR_CANTOPEN = 1011&
Const ERROR_CANTREAD = 1012&
Const ERROR_CANTWRITE = 1013&
' -- registro
Const REG_NONE = 0
Const REG_SZ = 1
Const REG_EXPAND_SZ = 2
Const REG_BINARY = 3
Const REG_DWORD = 4
Const REG_DWORD_LITTLE_ENDIAN = 4
Const REG_DWORD_BIG_ENDIAN = 5
Const REG_LINK = 6
Const REG_MULTI_SZ = 7
Const REG_RESOURCE_LIST = 8
Const REG_FULL_RESOURCE_DESCRIPTOR = 9
Const REG_RESOURCE_REQUIREMENTS_LIST = 10
' -- opzioni di registro(Win NT)
Const REG_OPTION_NON_VOLATILE = 0
Const REG_OPTION_VOLATILE = 1
'maschera di sicurezza per Windows NT
Private Type SECURITY_ATTRIBUTES
    nLength As Long
    lpSecurityDescriptor As Long
    bInheritHandle As Boolean
End Type
'tipi possibili di dato dei valori delle chiavi
Public Enum enmRegDataType
 erString
 erByte
 erDWord
End Enum
'tipi assegnati al vettore che contiene i valori letti dal registro
Public Enum enmRegValueOfIndex
  erStringFormat
  erByteFormat
  erDWordFormat
End Enum
'chiave corrente (nome e handle)
Private m_RegPathCorrente As String
Private lKeyHandle As Long
Ciao
Luca B.
Tony Taborre ha scritto nel messaggio <01bd9abc$73a58b40$06012380@fox>...


...
