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.

74 lines
2.0 KiB

  1. //+------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1993.
  5. //
  6. // File: bmrpc.cxx
  7. //
  8. // Contents: common Raw Rpc code
  9. //
  10. // Classes: None
  11. //
  12. // Functions:
  13. //
  14. // History: 02-Feb-94 Rickhi Created
  15. //
  16. //--------------------------------------------------------------------------
  17. #include <benchmrk.hxx>
  18. #include <rawrpc.h>
  19. extern "C" const GUID IID_IRawRpc =
  20. {0x00000145,0x0001,0x0008,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}};
  21. extern "C" void _gns__GUID (GUID* _target, PRPC_MESSAGE _prpcmsg);
  22. //+-------------------------------------------------------------------------
  23. //
  24. // Function: MIDL_user_allocate
  25. //
  26. // Synopsis: Allocate memory via OLE task allocator.
  27. //
  28. //--------------------------------------------------------------------------
  29. void *__stdcall MIDL_user_allocate(size_t size)
  30. {
  31. void *pMemory = (void *) new BYTE[size];
  32. if(pMemory == 0)
  33. RaiseException((unsigned long)E_OUTOFMEMORY, 0, 0, 0);
  34. return pMemory;
  35. }
  36. //+-------------------------------------------------------------------------
  37. //
  38. // Function: MIDL_user_free
  39. //
  40. // Synopsis: Free memory using OLE task allocator.
  41. //
  42. //--------------------------------------------------------------------------
  43. void __stdcall MIDL_user_free(void *pMemory)
  44. {
  45. delete pMemory;
  46. }
  47. /* routine that gets node for struct _GUID */
  48. void _gns__GUID (GUID * _target, PRPC_MESSAGE _prpcmsg)
  49. {
  50. unsigned long _alloc_total;
  51. ((void)( _alloc_total ));
  52. *(unsigned long *)&_prpcmsg->Buffer += 3;
  53. *(unsigned long *)&_prpcmsg->Buffer &= 0xfffffffc;
  54. /* receive data into &_target->Data1 */
  55. long_from_ndr((PRPC_MESSAGE)_prpcmsg, (unsigned long *)&_target->Data1);
  56. /* receive data into &_target->Data2 */
  57. short_from_ndr((PRPC_MESSAGE)_prpcmsg, (unsigned short *)&_target->Data2);
  58. /* receive data into &_target->Data3 */
  59. short_from_ndr((PRPC_MESSAGE)_prpcmsg, (unsigned short *)&_target->Data3);
  60. char_array_from_ndr ((PRPC_MESSAGE)_prpcmsg, 0, 0 + 8, (unsigned char *)_target->Data4);
  61. }