00_Symbols.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import os, sys, mmap
  2. from regression import Regression
  3. loader = os.environ['PAL_LOADER']
  4. regression = Regression(loader, "Symbols")
  5. all_symbols = [
  6. 'DkVirtualMemoryAlloc',
  7. 'DkVirtualMemoryFree',
  8. 'DkVirtualMemoryProtect',
  9. 'DkProcessCreate',
  10. 'DkProcessExit',
  11. 'DkProcessSandboxCreate',
  12. 'DkStreamOpen',
  13. 'DkStreamWaitForClient',
  14. 'DkStreamRead',
  15. 'DkStreamWrite',
  16. 'DkStreamDelete',
  17. 'DkStreamMap',
  18. 'DkStreamUnmap',
  19. 'DkStreamSetLength',
  20. 'DkStreamFlush',
  21. 'DkSendHandle',
  22. 'DkReceiveHandle',
  23. 'DkStreamAttributesQuery',
  24. 'DkStreamAttributesQueryByHandle',
  25. 'DkStreamAttributesSetByHandle',
  26. 'DkStreamGetName',
  27. 'DkStreamChangeName',
  28. 'DkThreadCreate',
  29. 'DkThreadDelayExecution',
  30. 'DkThreadYieldExecution',
  31. 'DkThreadExit',
  32. 'DkThreadResume',
  33. 'DkSetExceptionHandler',
  34. 'DkExceptionReturn',
  35. 'DkMutexCreate',
  36. 'DkMutexRelease',
  37. 'DkNotificationEventCreate',
  38. 'DkSynchronizationEventCreate',
  39. 'DkEventSet',
  40. 'DkEventClear',
  41. 'DkObjectsWaitAny',
  42. 'DkObjectClose',
  43. 'DkSystemTimeQuery',
  44. 'DkRandomBitsRead',
  45. 'DkInstructionCacheFlush',
  46. 'DkSegmentRegister',
  47. 'DkMemoryAvailableQuota',
  48. 'DkCreatePhysicalMemoryChannel',
  49. 'DkPhysicalMemoryCommit',
  50. 'DkPhysicalMemoryMap']
  51. def check_symbols(res):
  52. for sym in all_symbols:
  53. found = False
  54. for line in res[0].log:
  55. if line and line.startswith(sym + ' = '):
  56. if line == sym + ' = 0x0':
  57. return False
  58. found = True
  59. break
  60. if not found:
  61. return False
  62. return True
  63. regression.add_check(name="Symbol Resolution", check=check_symbols);
  64. rv = regression.run_checks()
  65. if rv: sys.exit(rv)