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.

96 lines
2.4 KiB

  1. #pragma once
  2. #define SXAPW_CREATEOBJECT_NOWRAP 0x0001
  3. #define SXAPW_CREATEOBJECT_WRAP 0x0002
  4. /* The rest are not implemented, because they complicate caching; we cache per .dll. * /
  5. define SXAPW_CREATEOBJECT_WRAP_USE_SELF 0x0002 /* based on resource id 3 in the dll * /
  6. define SXAPW_CREATEOBJECT_WRAP_USE_CURRENT 0x0004 /* not implemented, would GetCurrentActCtx * /
  7. define SXAPW_CREATEOBJECT_WRAP_USE_SPECIFIED 0x0008 /* not implemented, would take another parameter * /
  8. define SXAPW_CREATEOBJECT_WRAP_USE_PROCESS_DEFAULT 0x0010 /* use process default * /
  9. define SXAPW_CREATEOBJECT_WRAP_USE_EMPTY 0x0020 /* not implemented * /
  10. */
  11. #define SXAPW_PROCESS_DEFAULT_ACTCTX_HANDLE (NULL)
  12. HRESULT
  13. SxApwCreateObject(
  14. REFCLSID rclsid,
  15. REFIID riid,
  16. DWORD dwFlags,
  17. void** pp
  18. );
  19. HRESULT
  20. SxApwCreateObject(
  21. LPCWSTR something,
  22. REFIID riid,
  23. DWORD dwFlags,
  24. void** pp
  25. );
  26. template <typename T>
  27. inline HRESULT
  28. SxApwCreateObject(
  29. LPCWSTR something,
  30. DWORD dwFlags,
  31. ATL::CComPtr<T>& p
  32. )
  33. {
  34. return SxApwCreateObject(something, __uuidof(T), dwFlags, reinterpret_cast<void**>(&p));
  35. }
  36. template <typename T>
  37. inline HRESULT
  38. SxApwCreateObject(
  39. LPCWSTR something,
  40. DWORD dwFlags,
  41. ATL::CComQIPtr<T>& p
  42. )
  43. {
  44. return SxApwCreateObject(something, __uuidof(T), dwFlags, reinterpret_cast<void**>(&p));
  45. }
  46. template <typename T>
  47. inline HRESULT
  48. SxApwCreateObject(
  49. LPCWSTR something,
  50. DWORD dwFlags,
  51. T** pp
  52. )
  53. {
  54. return SxApwCreateObject(something, __uuidof(T), dwFlags, reinterpret_cast<void**>(pp));
  55. }
  56. template <typename T>
  57. inline HRESULT
  58. SxApwCreateObject(
  59. REFCLSID rclsid,
  60. DWORD dwFlags,
  61. ATL::CComPtr<T>& p
  62. )
  63. {
  64. return SxApwCreateObject(rclsid, __uuidof(T), dwFlags, reinterpret_cast<void**>(&p));
  65. }
  66. template <typename T>
  67. inline HRESULT
  68. SxApwCreateObject(
  69. REFCLSID rclsid,
  70. DWORD dwFlags,
  71. ATL::CComQIPtr<T>& p
  72. )
  73. {
  74. return SxApwCreateObject(rclsid, __uuidof(T), dwFlags, reinterpret_cast<void**>(&p));
  75. }
  76. template <typename T>
  77. inline HRESULT
  78. SxApwCreateObject(
  79. REFCLSID rclsid,
  80. DWORD dwFlags,
  81. T** pp
  82. )
  83. {
  84. return SxApwCreateObject(rclsid, __uuidof(T), dwFlags, reinterpret_cast<void**>(pp));
  85. }