CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2010
    Posts
    907

    How to link undocumented windows apis?

    For example,
    there is an api in windows called SHCreateDesktop,
    It is located in shell32.dll, but Microsoft keeps this symbol private,
    so using shell32.lib won't link in the api to the executable.
    If I really want to use it, how do I call this api in my vc++ program?
    Thanks
    Jack

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    Re: How to link undocumented windows apis?

    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How to link undocumented windows apis?

    Quote Originally Posted by lucky6969b View Post
    For example,
    there is an api in windows called SHCreateDesktop,
    It is located in shell32.dll, but Microsoft keeps this symbol private,
    so using shell32.lib won't link in the api to the executable.
    If I really want to use it, how do I call this api in my vc++ program?
    Thanks
    Jack
    Kind of wondering why some folks tend to gravitate toward undocumented winapi's. Can you explain why you think it's a good idea?

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: How to link undocumented windows apis?

    Quote Originally Posted by Arjay View Post
    Kind of wondering why some folks tend to gravitate toward undocumented winapi's. Can you explain why you think it's a good idea?
    Kind of self-affirmation?
    Victor Nijegorodov

  5. #5
    Join Date
    Dec 2010
    Posts
    907

    Re: How to link undocumented windows apis?

    Hello,
    I am also wondering why some apis live in the area around 0x7xxxxxxxxx
    but it is just in the user space area. but in 32bit windows environment, the kernel space actually starts at 0x80000000
    When those user modules are loaded, they stay in a fixed address, only thunks can call them
    I am looking into ways to load windows xp explorer in windows 7. But The thunks are one problem,
    I can hook them, but what about the internal data structures? like pointers, that might call an absolute address in the same module or another module. So what is the minimum address that would be regarded as the
    "kernel", or "user executvie" area?

    Not just to prove myself, but as you know, windows xp user executives just can adapt in windows 7 environment,
    they are different animals, I have to spawn a separate explorer.exe on another desktop out, I have to get rid of
    all the out-of-range internal calls and thunk calls.


    Thanks
    Jack
    Last edited by lucky6969b; July 17th, 2016 at 02:23 AM.

  6. #6
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    Re: How to link undocumented windows apis?

    There have been major changes to the underlying OS architecture between XP and Windows 7 via Vista. Why are you expending so much effort trying to get XP explorer to work with Windows 7?
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  7. #7
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: How to link undocumented windows apis?

    Quote Originally Posted by lucky6969b View Post
    For example,
    there is an api in windows called SHCreateDesktop,
    It is located in shell32.dll, but Microsoft keeps this symbol private,
    so using shell32.lib won't link in the api to the executable.
    If I really want to use it, how do I call this api in my vc++ program?
    Thanks
    Jack
    Did you ever hear about dynamic linking? How much you know about dlls? How much you know about import libraries and creating those? We need to know this to understand where to start explaining.
    Best regards,
    Igor

  8. #8
    Join Date
    Jan 2021
    Posts
    8

    Re: How to link undocumented windows apis?

    Try this to link undocumented Windows API
    Reflection. Here you get an object and ask it to reveal information about itself, like methods, properties etc.
    With the right options (depending on language) you can reveal information that isn't "public".
    Decompilation. This regenerates (a version) of the source used to create the binary. Again this might reveal non public parts of the API.

    Let me know if this works for you or not!
    Tim Paine

  9. #9
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How to link undocumented windows apis?

    Why the quest for using undocumented APIs? Is writing fragile, unsupported code a 'thing'? Given 2020 wasn't all that great, let's kick off 2021 in the right direction - let's try to color inside the lines in 2021 and only use documented APIs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured