• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ CONTEXT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中CONTEXT函数的典型用法代码示例。如果您正苦于以下问题:C++ CONTEXT函数的具体用法?C++ CONTEXT怎么用?C++ CONTEXT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了CONTEXT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: setjmp

PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
{
    if (isCurrent) {
	(void) setjmp(CONTEXT(t));
    }
    *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
    return (PRWord *) CONTEXT(t);
}
开发者ID:Axelio,项目名称:cert_ve_mozilla,代码行数:8,代码来源:nec.c


示例2: cgi_set_main

/**
	cgi_set_main : function:0? -> void
	<doc>Set or disable the main entry point function</doc>
**/
static value cgi_set_main( value f ) {
	if( val_is_null(f) ) {
		CONTEXT()->main = NULL;
		return val_true;
	}
	val_check_function(f,0);
	CONTEXT()->main = f;
	return val_true;
}
开发者ID:HaxeFoundation,项目名称:neko,代码行数:13,代码来源:cgi.c


示例3: setjmp

PRWord *_MD_HomeGCRegisters(PRThread *t, int isCurrent, int *np)
{
#ifndef _PR_PTHREADS
    if (isCurrent) {
	(void) setjmp(CONTEXT(t));
    }
    *np = sizeof(CONTEXT(t)) / sizeof(PRWord);
    return (PRWord *) CONTEXT(t);
#else
	*np = 0;
	return NULL;
#endif
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.external,代码行数:13,代码来源:hpux.c


示例4: CONTEXT

JNIEXPORT jint JNICALL Java_org_apache_commons_crypto_cipher_OpenSslNative_update
    (JNIEnv *env, jclass clazz, jlong ctx, jobject input, jint input_offset,
    jint input_len, jobject output, jint output_offset, jint max_output_len)
{
  EVP_CIPHER_CTX *context = CONTEXT(ctx);
  if (!check_update_max_output_len(context, input_len, max_output_len)) {
    THROW(env, "javax/crypto/ShortBufferException",  \
        "Output buffer is not sufficient.");
    return 0;
  }
  unsigned char *input_bytes = (*env)->GetDirectBufferAddress(env, input);
  unsigned char *output_bytes = (*env)->GetDirectBufferAddress(env, output);
  if (input_bytes == NULL || output_bytes == NULL) {
    THROW(env, "java/lang/InternalError", "Cannot get buffer address.");
    return 0;
  }
  input_bytes = input_bytes + input_offset;
  output_bytes = output_bytes + output_offset;

  int output_len = 0;
  if (!dlsym_EVP_CipherUpdate(context, output_bytes, &output_len,  \
      input_bytes, input_len)) {
    dlsym_EVP_CIPHER_CTX_cleanup(context);
    THROW(env, "java/lang/InternalError", "Error in EVP_CipherUpdate.");
    return 0;
  }
  return output_len;
}
开发者ID:InsightsDev,项目名称:commons-crypto,代码行数:28,代码来源:OpenSslNative.c


示例5: CONTEXT

JNIEXPORT jint JNICALL Java_com_intel_chimera_cipher_OpensslNative_doFinal
    (JNIEnv *env, jclass clazz, jlong ctx, jobject output, jint offset,
    jint max_output_len)
{
  EVP_CIPHER_CTX *context = CONTEXT(ctx);
  if (!check_doFinal_max_output_len(context, max_output_len)) {
    THROW(env, "javax/crypto/ShortBufferException",  \
        "Output buffer is not sufficient.");
    return 0;
  }
  unsigned char *output_bytes = (*env)->GetDirectBufferAddress(env, output);
  if (output_bytes == NULL) {
    THROW(env, "java/lang/InternalError", "Cannot get buffer address.");
    return 0;
  }
  output_bytes = output_bytes + offset;

  int output_len = 0;
  if (!dlsym_EVP_CipherFinal_ex(context, output_bytes, &output_len)) {
    dlsym_EVP_CIPHER_CTX_cleanup(context);
    THROW(env, "java/lang/InternalError", "Error in EVP_CipherFinal_ex.");
    return 0;
  }
  return output_len;
}
开发者ID:kexianda,项目名称:chimera,代码行数:25,代码来源:OpensslNative.c


示例6: CONTEXT

 // get full path of a shell folder
bool ShellDirectory::get_path(PTSTR path, size_t path_count) const
{
	CONTEXT("ShellDirectory::get_path()");

	if (!path || path_count==0)
		return false;

	path[0] = TEXT('\0');

	if (_folder.empty())
		return false;

	SFGAOF attribs = SFGAO_FILESYSTEM;

	// Split pidl into current and parent folder PIDLs
	ShellPath pidlParent, pidlFolder;
	_pidl.split(pidlParent, pidlFolder);

	if (FAILED(const_cast<ShellFolder&>(_folder)->GetAttributesOf(1, (LPCITEMIDLIST*)&pidlFolder, &attribs)))
		return false;

	if (!(attribs & SFGAO_FILESYSTEM))
		return false;

	if (FAILED(path_from_pidl(get_parent_folder(), &*_pidl, path, path_count)))
		return false;

	return true;
}
开发者ID:jmalak,项目名称:reactos,代码行数:30,代码来源:shellfs.cpp


示例7: CONTEXT

bool DesktopShellView::InitDragDrop()
{
	CONTEXT("DesktopShellView::InitDragDrop()");

	DesktopDropTarget * pDropTarget = new DesktopDropTarget(_hwnd);

	if (!pDropTarget)
		return false;

	pDropTarget->AddRef();

	if (FAILED(RegisterDragDrop(_hwnd, pDropTarget))) {
		pDropTarget->Release();
		return false;
	}

	FORMATETC ftetc;

	ftetc.dwAspect = DVASPECT_CONTENT;
	ftetc.lindex = -1;
	ftetc.tymed = TYMED_HGLOBAL;
	ftetc.cfFormat = CF_HDROP;

	pDropTarget->AddSuportedFormat(ftetc);
	pDropTarget->Release();

	return true;
}
开发者ID:RareHare,项目名称:reactos,代码行数:28,代码来源:desktop.cpp


示例8: restore_context

static void
restore_context(PARROT_INTERP, ARGIN(Parrot_Context * const initialctx))
{
    ASSERT_ARGS(restore_context)
    Parrot_Context *curctx = CONTEXT(interp);
    if (curctx != initialctx) {
        Parrot_warn((interp), PARROT_WARNINGS_NONE_FLAG,
                "popping context in Parrot_ext_try");
        do {
            Parrot_pop_context(interp);
            curctx = CONTEXT(interp);
            if (curctx == NULL)
                PANIC(interp, "cannot restore context");
        } while (curctx != initialctx);
    }
}
开发者ID:FROGGS,项目名称:parrot,代码行数:16,代码来源:extend.c


示例9: CONTEXT

JNIEXPORT jint JNICALL Java_com_intel_chimera_cipher_OpensslNative_updateByteArray
    (JNIEnv *env, jclass clazz, jlong ctx, jbyteArray input, jint input_offset,
    jint input_len, jbyteArray output, jint output_offset, jint max_output_len)
{
  EVP_CIPHER_CTX *context = CONTEXT(ctx);
  if (!check_update_max_output_len(context, input_len, max_output_len)) {
    THROW(env, "javax/crypto/ShortBufferException",  \
        "Output buffer is not sufficient.");
    return 0;
  }
  unsigned char *input_bytes = (unsigned char *) (*env)->GetByteArrayElements(env, input, 0);
  unsigned char *output_bytes = (unsigned char *) (*env)->GetByteArrayElements(env, output, 0);
  if (input_bytes == NULL || output_bytes == NULL) {
    THROW(env, "java/lang/InternalError", "Cannot get buffer address.");
    return 0;
  }

  int output_len = 0;
  int rc = dlsym_EVP_CipherUpdate(context, output_bytes + output_offset, &output_len,  \
      input_bytes + input_offset, input_len);

  (*env)->ReleaseByteArrayElements(env, input, (jbyte *) input_bytes, 0);
  (*env)->ReleaseByteArrayElements(env, output, (jbyte *) output_bytes, 0);

  if (rc == 0) {
    dlsym_EVP_CIPHER_CTX_cleanup(context);
    THROW(env, "java/lang/InternalError", "Error in EVP_CipherUpdate.");
    return 0;
  }
  return output_len;
}
开发者ID:JkSelf,项目名称:chimera,代码行数:31,代码来源:OpensslNative.c


示例10: explorer_main

int explorer_main(HINSTANCE hInstance, LPTSTR lpCmdLine, int cmdShow)
{
    CONTEXT("explorer_main");

     // initialize Common Controls library
    CommonControlInit usingCmnCtrl;

    try {
        InitInstance(hInstance);
    } catch(COMException& e) {
        HandleException(e, GetDesktopWindow());
        return -1;
    }

#ifndef ROSSHELL
    if (cmdShow != SW_HIDE) {
/*    // don't maximize if being called from the ROS desktop
        if (cmdShow == SW_SHOWNORMAL)
                ///@todo read window placement from registry
            cmdShow = SW_MAXIMIZE;
*/

        explorer_show_frame(cmdShow, lpCmdLine);
    }
#endif

    Window::MessageLoop();

    return 1;
}
开发者ID:darkvaderXD2014,项目名称:reactos,代码行数:30,代码来源:explorer.cpp


示例11: switch

LRESULT MDIShellBrowserChild::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
{
    switch(nmsg) {
    case PM_DISPATCH_COMMAND: {
        switch(LOWORD(wparam)) {
        case ID_WINDOW_NEW: {
            CONTEXT("MDIShellBrowserChild PM_DISPATCH_COMMAND ID_WINDOW_NEW");
            MDIShellBrowserChild::create(_create_info);
            break;
        }

        case ID_REFRESH:
            ///@todo refresh shell child
            _shellBrowser->invalidate_cache();
            break;

        case ID_VIEW_SDI:
            MainFrameBase::Create(ExplorerCmd(_url, false));
            break;

        default:
            return super::WndProc(nmsg, wparam, lparam);
        }
        return TRUE;
    }

    default:
        return super::WndProc(nmsg, wparam, lparam);
    }

    return 0;
}
开发者ID:svn2github,项目名称:ros-explorer,代码行数:32,代码来源:shellbrowser.cpp


示例12: CONTEXT

void ShellBrowser::Init()
{
    CONTEXT("ShellBrowser::Init()");

    const String& root_name = GetDesktopFolder().get_name(_create_info._root_shell_path, SHGDN_FORADDRESSBAR);

    _root._drive_type = DRIVE_UNKNOWN;
    lstrcpy(_root._volname, root_name);
    _root._fs_flags = 0;
    lstrcpy(_root._fs, TEXT("Desktop"));

    _root._entry = new ShellDirectory(GetDesktopFolder(), _create_info._root_shell_path, _hwnd);

    _root._entry->read_directory(SCAN_DONT_ACCESS|SCAN_NO_FILESYSTEM);	// avoid to handle desktop root folder as file system directory

    if (_left_hwnd) {
        InitializeTree();
        InitDragDrop();
    }

    jump_to(_create_info._shell_path);

    /* already filled by ShellDirectory constructor
    lstrcpy(_root._entry->_data.cFileName, TEXT("Desktop")); */
}
开发者ID:svn2github,项目名称:ros-explorer,代码行数:25,代码来源:shellbrowser.cpp


示例13: WFC_Device_DestroyElement

/*---------------------------------------------------------------------------
 *  Destroy element
 *
 *  \param device
 *  \param element
 *----------------------------------------------------------------------------*/
OWF_API_CALL WFCErrorCode
WFC_Device_DestroyElement(WFC_DEVICE* device,
                          WFCElement element)
{
    WFCint                  i;
    WFCErrorCode            result = WFC_ERROR_BAD_HANDLE;

    ENTER(WFC_Device_DestroyElement);

    FAIL_IF(NULL == device, WFC_ERROR_BAD_HANDLE);
    DPRINT(("destroying element %d", element));

    for (i = 0; i < device->elements.length; i++)
    {
        WFC_ELEMENT*        object;

        object = ELEMENT(OWF_Array_GetItemAt(&device->elements, i));
        DPRINT(("  element %d = %d", i, object->handle));
        if (object->handle == element)
        {
            WFC_Context_RemoveElement(CONTEXT(object->context), element);

            WFC_Context_DecreaseClientElementCount(object->context);
            OWF_Array_RemoveItemAt(&device->elements, i);
            WFC_Element_Destroy(object);
            result = WFC_ERROR_NONE;
            break;
        }
    }
    LEAVE(WFC_Device_DestroyElement);
    return result;
}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:38,代码来源:wfcdevice.c


示例14: WFC_Device_FindContext

/*---------------------------------------------------------------------------
 *  Find context context object by handle
 *
 *  \param device Device
 *  \param context Context handle
 *
 *  \return Corresponding context object or NULL
 *  if handle is invalid.
 *----------------------------------------------------------------------------*/
OWF_API_CALL WFC_CONTEXT*
WFC_Device_FindContext(WFC_DEVICE* device,
                       WFCContext context)
{
    WFCint                  i;
    WFC_CONTEXT*            result = NULL;

    ENTER(WFC_Device_FindContext);

    FAIL_IF(NULL == device, NULL);

    for (i = 0; i < device->contexts.length; i++)
    {
        WFC_CONTEXT*        ctmp;

        ctmp = CONTEXT(OWF_Array_GetItemAt(&device->contexts, i));
        if (ctmp->handle == context)
        {
            result = ctmp;
            break;
        }
    }
    LEAVE(WFC_Device_FindContext);

    return result;
}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:35,代码来源:wfcdevice.c


示例15: WFC_Device_FindScreenNumber

OWF_API_CALL WFCboolean
WFC_Device_FindScreenNumber(WFCint screenNumber)
{
    WFCint i, j, deviceArrayLength, contextArrayLength;
    WFC_DEVICE* pDevice = NULL;
    ENTER(WFC_Device_DestroyContext);

    DPRINT(("WFC_Device_CheckScreenNumber(screenNumber = %d)", screenNumber));

    deviceArrayLength = gPhyDevice.iDeviceInstanceArray.length;
    for (i = 0; i < deviceArrayLength; ++i)
    {
        pDevice = DEVICE(OWF_Array_GetItemAt(&(gPhyDevice.iDeviceInstanceArray), i));
        OWF_ASSERT(pDevice);
        if (pDevice)
        {
            contextArrayLength = pDevice->contexts.length;
            for (j = 0; j < contextArrayLength; j++)
            {
                WFC_CONTEXT*    pContext;
                pContext = CONTEXT(OWF_Array_GetItemAt(&pDevice->contexts, j));
                OWF_ASSERT(pContext);
                if (pContext && (pContext->screenNumber == screenNumber))
                {
                    return WFC_TRUE;
                }
            }
        }
    }
    return WFC_FALSE;
}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:31,代码来源:wfcdevice.c


示例16: WFC_Device_DestroyContextElements

/*---------------------------------------------------------------------------
 *  Called from context's destructor to clean up any elements that
 *  weren't added to any scene at all i.e. they only reside in the
 *  device's element list. These elements must not stay alive after
 *  the context has been deleted.
 *----------------------------------------------------------------------------*/
OWF_API_CALL void
WFC_Device_DestroyContextElements(WFC_DEVICE* device,
                                  WFC_CONTEXT* context)
{
    WFCint                  i;

    DPRINT(("WFC_Device_DestroyContextElements(device=%d, context=%d",
            device ? device->handle : 0,
            context ? context->handle : 0));

    if (!device || !context)
    {
        return;
    }

    for (i = device->elements.length; i > 0; i--)
    {
        WFC_ELEMENT*        element;

        element = ELEMENT(OWF_Array_GetItemAt(&device->elements, i-1));
        if (element->context == context)
        {
            DPRINT(("  Destroying element %d (%p)", element->handle, element));

            /* Improvement idea: This code is partially same as in
             * WFC_Device_RemoveElement. Maybe the common part should
             * be isolated into some DoRemoveElement function which then
             * would be called from here and RemoveElement.
             */
            WFC_Context_RemoveElement(CONTEXT(element->context), element->handle);
            OWF_Array_RemoveItemAt(&device->elements, i-1);
            WFC_Element_Destroy(element);
        }
    }
}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:41,代码来源:wfcdevice.c


示例17: CONTEXT

BOOL ShellEntry::launch_entry(HWND hwnd, UINT nCmdShow)
{
	CONTEXT("ShellEntry::launch_entry()");

	SHELLEXECUTEINFO shexinfo;

	shexinfo.cbSize = sizeof(SHELLEXECUTEINFO);
	shexinfo.fMask = SEE_MASK_INVOKEIDLIST;	// SEE_MASK_IDLIST is also possible.
	shexinfo.hwnd = hwnd;
	shexinfo.lpVerb = NULL;
	shexinfo.lpFile = NULL;
	shexinfo.lpParameters = NULL;
	shexinfo.lpDirectory = NULL;
	shexinfo.nShow = nCmdShow;

	ShellPath shell_path = create_absolute_pidl();
	shexinfo.lpIDList = &*shell_path;

	 // add PIDL to the recent file list
	SHAddToRecentDocs(SHARD_PIDL, shexinfo.lpIDList);

	BOOL ret = TRUE;

	if (!ShellExecuteEx(&shexinfo)) {
		display_error(hwnd, GetLastError());
		ret = FALSE;
	}

	return ret;
}
开发者ID:svn2github,项目名称:ros-explorer,代码行数:30,代码来源:shellfs.cpp


示例18: CONTEXT

LRESULT ShellBrowserChild::Init()
{
	CONTEXT("ShellBrowserChild::Init()");

	ClientRect rect(_hwnd);

	const String& root_name = GetDesktopFolder().get_name(_create_info._root_shell_path, SHGDN_FORADDRESSBAR);

	_root._drive_type = DRIVE_UNKNOWN;
	lstrcpy(_root._volname, root_name);
	_root._fs_flags = 0;
	lstrcpy(_root._fs, TEXT("Desktop"));

	_root._entry = new ShellDirectory(GetDesktopFolder(), _create_info._root_shell_path, _hwnd);

	 // -> set_curdir()
	_root._entry->read_directory();

	if (_left_hwnd) {
		InitializeTree();
		InitDragDrop();
	}

	jump_to(_create_info._shell_path);

	return 0;
}
开发者ID:svn2github,项目名称:ros-explorer,代码行数:27,代码来源:shellbrowser.cpp


示例19: IoMessage_locals_valueArgAt_

IoObject *IoCairoContext_setSource(IoCairoContext *self, IoObject *locals, IoMessage *m)
{
	IoCairoPattern *pattern = IoMessage_locals_valueArgAt_(m, locals, 0);
	cairo_set_source(CONTEXT(self), IoCairoPattern_rawPattern(pattern));
	CHECK_STATUS(self);
	return self;
}
开发者ID:eklitzke,项目名称:io,代码行数:7,代码来源:IoCairoContext.c


示例20: activated_

  Session_Servant_Impl_T<BASE_SKEL, EXEC, CONTEXT>::Session_Servant_Impl_T (
        EXEC * exe,
        Components::CCMHome_ptr home,
        const char * ins_name,
        Home_Servant_Impl_Base *home_servant,
        ::CIAO::Session_Container_ptr c)
    : CONTEXT::svnt_base_type (home, home_servant, c),
      activated_ (false),
      configuration_completed_ (false),
      executor_ (EXEC::_duplicate (exe)),
      context_ (0),
      ins_name_ (ins_name)
  {
    ACE_NEW (this->context_,
             CONTEXT (home, c, this, ins_name));

    ::Components::SessionComponent_var scom =
      ::Components::SessionComponent::_narrow (exe);

    if (! ::CORBA::is_nil (scom.in ()))
      {
        scom->set_session_context (this->context_);
      }
    else
      {
        CIAO_DEBUG (6,
                    (LM_DEBUG, CLINFO
                     "Session_Servant_Impl_T_T::Session_Servant_Impl_T_T - "
                     "Couldn't set session context for %C\n",
                     ins_name));
      }
  }
开发者ID:DOCGroup,项目名称:CIAO,代码行数:32,代码来源:Servant_Impl_T.cpp



注:本文中的CONTEXT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CONTROL函数代码示例发布时间:2022-05-30
下一篇:
C++ CONTAINS函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap