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.

73 lines
1.6 KiB

  1. #include <winsock2.h>
  2. #include <ws2spi.h>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include "..\setup.h"
  6. INT
  7. UnInstallTestProviders(void)
  8. {
  9. INT ReturnCode;
  10. ReturnCode = WSCUnInstallNameSpace( &gProviderId );
  11. return(ReturnCode);
  12. }
  13. int __cdecl main( int argc, char**argv )
  14. {
  15. DWORD NameSpaceId;
  16. INT ReturnCode;
  17. DWORD LastError;
  18. WORD wVersionRequested;
  19. WSADATA wsaData;
  20. INT err;
  21. wVersionRequested = MAKEWORD( 1, 1 );
  22. err = WSAStartup( wVersionRequested, &wsaData );
  23. if ( err != 0 )
  24. {
  25. //
  26. // Tell the user that we couldn't find a useable WinSock DLL.
  27. //
  28. fprintf( stderr,
  29. "Useable Winsock DLL couldn't be found\n" );
  30. return -1;
  31. }
  32. //
  33. // Confirm that the WinSock DLL supports 1.1.
  34. // Note that if the DLL supports versions greater
  35. // than 1.1 in addition to 1.1, it will still return
  36. // 1.1 in wVersion since that is the version we
  37. // requested.
  38. //
  39. if ( LOBYTE( wsaData.wVersion ) != 1 ||
  40. HIBYTE( wsaData.wVersion ) != 1 )
  41. {
  42. //
  43. // Tell the user that we couldn't find a useable WinSock DLL.
  44. //
  45. fprintf( stderr,
  46. "Useable Winsock DLL couldn't be found\n" );
  47. WSACleanup();
  48. return -1;
  49. }
  50. ReturnCode = UnInstallTestProviders();
  51. if(ReturnCode != ERROR_SUCCESS)
  52. {
  53. fprintf( stderr,
  54. "NT5 Uninstall failed \n" );
  55. return -1;
  56. }
  57. return 0;
  58. }