Source code of Windows XP (NT5)
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.

77 lines
1.8 KiB

  1. //============================================================================
  2. // Copyright (c) 1995, Microsoft Corporation
  3. //
  4. // File: Upgtest.c
  5. //
  6. // History:
  7. // V Raman July-1-1997 Created.
  8. //
  9. // Test program for digi updates
  10. //============================================================================
  11. #include <nt.h>
  12. #include <ntrtl.h>
  13. #include <nturtl.h>
  14. #include <windows.h>
  15. #include <stdio.h>
  16. #include <stdlib.h>
  17. #include <string.h>
  18. #include <malloc.h>
  19. #include <tchar.h>
  20. #include "upgrade.h"
  21. WCHAR c_tszCCS[] = TEXT( "System\\CurrentControlSet\\Services" );
  22. WCHAR c_tszPcimac[] = TEXT( "Pcimac15" );
  23. WCHAR c_tszPar[] = TEXT( "Parameters" );
  24. INT __cdecl main(INT iArgc, PSTR ppszArgv[])
  25. {
  26. DWORD dwErr = ERROR_SUCCESS, dwInd = 0;
  27. WCHAR tszKey[ MAX_PATH ], tszAdapterName[ MAX_PATH ];
  28. HKEY hKey;
  29. PWSTR * lplpText = NULL;
  30. DWORD dwNumLines;
  31. wsprintf( tszKey, TEXT( "%s\\%s\\%s" ), c_tszCCS, c_tszPcimac, c_tszPar );
  32. dwErr = RegOpenKeyEx(
  33. HKEY_LOCAL_MACHINE,
  34. (PCWSTR) tszKey,
  35. 0,
  36. KEY_READ,
  37. &hKey
  38. );
  39. if ( dwErr != ERROR_SUCCESS )
  40. {
  41. printf ( "Failed to open key %s : error %d\n", tszKey, dwErr );
  42. return dwErr;
  43. }
  44. dwErr = NetWriteDIGIISDNRegistry(
  45. hKey, TEXT( "Datafire" ), TEXT( "DataFireIsa4st" ),
  46. TEXT( "Datafire" ), &lplpText, &dwNumLines );
  47. if ( dwErr != ERROR_SUCCESS )
  48. {
  49. printf( "Failed NetWriteDIGIISDNRegistry : error %d\n", dwErr );
  50. }
  51. for ( dwInd = 0; dwInd < dwNumLines; dwInd++ )
  52. {
  53. _tprintf( TEXT( "%s" ), lplpText[ dwInd ] );
  54. }
  55. LocalFree( lplpText );
  56. return dwErr;
  57. }