Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.0 KiB

  1. /*++
  2. Copyright (C) 1999 Microsoft Coporation
  3. Module Name:
  4. readreg.c
  5. Abstract:
  6. This module reads the configuration from the registry into the
  7. MM data structures for NT4 and W2K.
  8. --*/
  9. #include <precomp.h>
  10. DWORD
  11. DhcpeximReadRegistryConfiguration(
  12. IN OUT PM_SERVER *Server
  13. )
  14. {
  15. REG_HANDLE Hdl;
  16. DWORD Error;
  17. LPTSTR Loc;
  18. //
  19. // The location in the registry where things are read from is
  20. // different between whether it is NT4 or W2K.
  21. //
  22. if( IsNT4() ) Loc = DHCPEXIM_REG_CFG_LOC4;
  23. else Loc = DHCPEXIM_REG_CFG_LOC5;
  24. //
  25. // Now open the regkey
  26. //
  27. Error = RegOpenKeyEx(
  28. HKEY_LOCAL_MACHINE, Loc, 0, KEY_ALL_ACCESS, &Hdl.Key );
  29. if( NO_ERROR != Error ) return Error;
  30. //
  31. // Set this as the current server
  32. //
  33. DhcpRegSetCurrentServer(&Hdl);
  34. //
  35. // Read the configuration
  36. //
  37. Error = DhcpRegReadThisServer(Server);
  38. RegCloseKey(Hdl.Key);
  39. DhcpRegSetCurrentServer(NULL);
  40. return Error;
  41. }