question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

API Set Resolution may loop back to module being loaded

See original GitHub issue

There is a case where a DLL’s API Set reference may resolve to the original DLL. An example is Kernel32.dll!InitializeProcThreadAttributeList, which forwards to api-ms-win-core-processthreads-l1-1-0.InitializeProcThreadAttributeList, which resolves back to Kernel32.dll!InitializeProcThreadAttributeList. This causes the API Set to not actually resolve and results in an error when attempting to call the function that was searched for.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
TheWovercommented, Dec 2, 2020

@ElephantSe4l Fixed in latest version.

0reactions
djhohnsteincommented, Jan 20, 2022

To reproduce:

  1. Download the dev branch zip file
  2. Change the project properties to a Console Application, .NET 4
  3. Add the following Program.cs to your project:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DInvoke
{
    class Program
    {
        public static void Main(string[] args)
        {
            IntPtr fn = DynamicInvoke.Generic.GetLibraryAddress("kernel32.dll", "InitializeProcThreadAttributeList");
        }
    }
}
  1. Run the application on x64 Server 2012 R2 instance. The application will bomb out on L627 of DynamicInvoke/Generic.cs as shown: image

As a workaround, I used GetModuleA and GetProcAddress to get the address of InitializeProcThreadAttributeList

Read more comments on GitHub >

github_iconTop Results From Across the Web

"module" in the package.json or use the .mjs extension - ...
Using the following command worked for me with node v14.16.1: node --loader ts-node/esm --experimental-specifier-resolution=node index.ts.
Read more >
Synchronization | LoopBack Documentation
Synchronization replicates data between client and server using the LoopBack replication API.
Read more >
umlaeute/v4l2loopback: v4l2-loopback device
v4l2loopback - a kernel module to create V4L2 loopback devices. This module allows you to create "virtual video devices". Normal (v4l2) applications will ......
Read more >
ECMAScript modules | Node.js v18 API
For example, attempting to load ./foo from data:text/javascript,import "./foo"; fails to resolve because there is no concept of relative resolution for ...
Read more >
CommonJS modules | Node.js v20.5.1 Documentation
In order to prevent an infinite loop, an unfinished copy of the a.js exports object is returned to the b.js module. b.js then...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found