Skip to content

Differences in work from windows.NewLazyDLL #2

@night-codes

Description

@night-codes

Hi) Are there any differences when using memory loading from a system function in terms of threads using and resource allocation? Faced the fact that in a number of experiments with cef (chromium embedded framework), launching three functions when linking in LDFLAGS and windows.NewLazyDll opens a new webview and loads url there. When using winloader.LoadFromMemory I get no errors, windows open, it opens a webview with a blank page (also works context-menu), but no URL opens. I've been investigating this issue for a week now, but I can't find any clear indication of the cause of this behavior.

	// #cgo LDFLAGS: -L. -llibcef
	/* C.cef_initialize(&settings.MainArgs, cefSettings, &settings.AppHandler, C.NULL) */

	// winloader.LoadFromMemory(b)
	/* cefInitialize.Call(
		uint64(uintptr(unsafe.Pointer(&settings.MainArgs))),
		uint64(uintptr(unsafe.Pointer(cefSettings))),
		uint64(uintptr(unsafe.Pointer(&settings.AppHandler))),
		uint64(uintptr(unsafe.Pointer(C.NULL))),
	) */

	// windows.NewLazyDLL("libcef.dll")
	cefInitialize.Call(
		uintptr(unsafe.Pointer(&settings.MainArgs)),
		uintptr(unsafe.Pointer(cefSettings)),
		uintptr(unsafe.Pointer(&settings.AppHandler)),
		uintptr(unsafe.Pointer(C.NULL)),
	)

I am not asking for help with cef, but maybe there are some subtleties that I do not know about and which could give me an idea of how to solve this problem. Unlike EDGE, the CEF library requires a lot of dlls in its directory and I am impressed by the idea of embedding them as resources in my application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions