当前位置: 首页>>代码示例>>C++>>正文


C++ CONTEXT函数代码示例

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


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


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