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.

77 lines
2.2 KiB

  1. #include <nt.h>
  2. #include <ntrtl.h>
  3. #include <nturtl.h>
  4. #include <windows.h>
  5. #include <winsock2.h>
  6. #include <wsipx.h>
  7. #include <svcguid.h>
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <rpc.h>
  11. #include <rpcdce.h>
  12. #include "..\setup.h"
  13. #define BUFFSIZE 3000
  14. GUID ServiceClassId = { /* 5b50962a-e5a5-11cf-a555-00c04fd8d4ac */
  15. 0x5b50962a,
  16. 0xe5a5,
  17. 0x11cf,
  18. {0xa5, 0x55, 0x00, 0xc0, 0x4f, 0xd8, 0xd4, 0xac}
  19. };
  20. _cdecl
  21. main(int argc, char **argv)
  22. {
  23. DWORD dwBufSize = BUFFSIZE;
  24. WCHAR Buffer[BUFFSIZE];
  25. DWORD ret;
  26. DWORD iter;
  27. WSADATA wsaData;
  28. LPWSASERVICECLASSINFOW lpServiceClassInfo = (LPWSASERVICECLASSINFOW) Buffer;
  29. WSAStartup( MAKEWORD(1, 1), &wsaData );
  30. ret = WSAGetServiceClassInfo( &gProviderId,
  31. &ServiceClassId,
  32. &dwBufSize,
  33. lpServiceClassInfo );
  34. if ( ret )
  35. {
  36. printf("Error: WSAGetServiceClassInfo returned 0x%X\n", ret );
  37. printf(" GetLastError returned 0x%X\n", GetLastError() );
  38. WSACleanup();
  39. return -1;
  40. }
  41. printf( "\nlpServiceClassId : 0x%x\n",
  42. lpServiceClassInfo->lpServiceClassId );
  43. printf( "lpszServiceClassName : %S\n",
  44. lpServiceClassInfo->lpszServiceClassName );
  45. printf( "dwCount : %d\n",
  46. lpServiceClassInfo->dwCount );
  47. for ( iter = 0; iter < lpServiceClassInfo->dwCount; iter++ )
  48. {
  49. printf( "\n lpszName : %S\n",
  50. lpServiceClassInfo->lpClassInfos[iter].lpszName );
  51. printf( " dwNameSpace : %d\n",
  52. lpServiceClassInfo->lpClassInfos[iter].dwNameSpace );
  53. printf( " dwValueType : %d\n",
  54. lpServiceClassInfo->lpClassInfos[iter].dwValueType );
  55. printf( " dwValueSize : %d\n",
  56. lpServiceClassInfo->lpClassInfos[iter].dwValueSize );
  57. printf( " lpValue : 0x%X\n",
  58. lpServiceClassInfo->lpClassInfos[iter].lpValue );
  59. }
  60. WSACleanup();
  61. return(0);
  62. }