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.

60 lines
1.0 KiB

  1. /*++
  2. Copyright (C) 1998 Microsoft Corporation
  3. Abstract:
  4. Test the ADSOpenDSObject call to see if it leaks memory
  5. Author:
  6. RameshV RameshV, 19-May-98 04:06
  7. Environment:
  8. User mode only
  9. --*/
  10. #include <hdrmacro.h>
  11. #include <store.h>
  12. #include <dhcpmsg.h>
  13. #include <wchar.h>
  14. #include <dsauth.h>
  15. void _cdecl main(void) {
  16. HRESULT Result, Error;
  17. HANDLE Handle;
  18. ULONG i,j;
  19. printf("how many iterations?: ");
  20. scanf("%ld", &i);
  21. printf("starting...");
  22. Sleep(60*1000);
  23. printf(" %ld iterations\n", i);
  24. for( j = 0; j < i ; j ++ ) {
  25. Result = ADSIOpenDSObject(
  26. L"LDAP://ntdev.microsoft.com/ROOTDSE",
  27. NULL,
  28. NULL,
  29. 0,
  30. &Handle
  31. );
  32. if( FAILED(Result) ) {
  33. printf("ADSIOpenDSObject failed %lx\n", Result);
  34. // return;
  35. continue;
  36. }
  37. ADSICloseDSObject(Handle);
  38. printf("Completed round %i\n", j + 1);
  39. }
  40. printf("Done......");
  41. Sleep(5*60*1000);
  42. }