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;

posted on 2010-04-20 18:21  酸辣大白菜  阅读(172)  评论(0编辑  收藏  举报

导航