about MarshalledBuffer

SCOPEINFO *psiLocal=NULL;
  MarshalledBuffer_t LocalBuffer;
  HRESULT hr = LocalBuffer.Marshal(psi, sizeof(SCOPEINFO), ARG_I_PTR, FALSE, FALSE);

  if (FAILED(hr))
  {
      return FALSE;                         
  }

  psiLocal = (SCOPEINFO *)LocalBuffer.ptr();

  if (!psiLocal || (psiLocal->dwSize != sizeof(SCOPEINFO)))
  {
      return FALSE;
  }

  BOOL fRet = FALSE;   
  UserTakenHereFlag;
  EnterUserMaybe();

  ScopeControl *psc = (ScopeControl *)GetWindowLong(hwnd, 0);
  if (!psc)
  {
      fRet = FALSE;
      goto Leave;
  }
  memcpy(psiLocal, &psc->m_si, sizeof(SCOPEINFO));
  fRet = TRUE;

你可能感兴趣的:(marshal)