为什么我的ISAPI程序只能读注册表,不能写注册表
我在ISAPI的程序中读写注册表,读的时候没有问题,可是我的dll不允许写注册表。
能否改变程序运行的身份?
LPTSTR pszSubkey = _T("SOFTWARE\\PersonnelRemove");
HKEY hKey_p= HKEY_LOCAL_MACHINE ;
HKEY hSubKey ;
DWORD dwDisposition ;
LONG lRet = RegCreateKeyEx(
hKey_p, // handle of an open key
pszSubKey_p, // address of subkey name
0, // reserved
0, // address of class string
REG_OPTION_VOLATILE,// special options flag
KEY_READ, // desired security access
0, // address of key security structure
& hSubKey, // address of buffer for opened handle
& dwDisposition // address of disposition value buffer
) ;
lRet == 5