Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.07.25;
Скачать: CL | DM;

Вниз

Ошибка при работе с RegQueryValueEx   Найти похожие ветки 

 
Alexis ©   (2004-06-12 15:37) [0]

procedure TRestrictionsForm.FormCreate(Sender: TObject);
var
OPENED : HKEY;
Buffer : Pointer;
ValType, BuffSize : DWORD;
begin
RegOpenKeyEx(HKEY_CURRENT_USER, "SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer", 0, KEY_EXECUTE, OPENED);
Buffer := nil;
if RegQueryValueEx(OPENED, "NoDrives", nil, @ValType, PByte(Buffer), @BuffSize) = ERROR_SUCCESS then
  if (ValType = REG_DWORD) or (ValType = REG_BINARY) then
   ShowMessage( IntToStr(Integer(Buffer)) );
end;

Постоянно выдается 0, даже при ненулевом значении.
Где ошибка?
Заранее спасибо.


 
Cobalt ©   (2004-06-13 13:52) [1]

А память под буфер выделять не собираетесь?


 
Cobalt ©   (2004-06-13 13:53) [2]

If the function fails, the return value is a nonzero error code defined in WINERROR.H. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
(GetSysError, если не ошибаюсь)



Страницы: 1 вся ветка

Текущий архив: 2004.07.25;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.037 c
14-1088656492
KilkennyCat
2004-07-01 08:34
2004.07.25
Ужас!


14-1088780346
olookin
2004-07-02 18:59
2004.07.25
Психология армейца.


3-1088659573
Anisa
2004-07-01 09:26
2004.07.25
Delphi6 DB2


14-1088593848
Piter
2004-06-30 15:10
2004.07.25
Дремучие тормозят


14-1088952154
SPeller
2004-07-04 18:42
2004.07.25
Глупость?