Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. Bizarre behavior of RegQueryValueEx(), please advise.

Bizarre behavior of RegQueryValueEx(), please advise.

Scheduled Pinned Locked Moved Windows API
questioncsswindows-admindata-structureshelp
26 Posts 2 Posters 101 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S SMD111

    I have included the essential code example with my original post. You are welcome to comment on it or let me know if I should give more details.

    L Offline
    L Offline
    Lost User
    wrote on last edited by
    #21

    Try your code again, but isolate it in a console-app. Have it fill the array, save it, and read it as the C# example I posted. Have it output the first byte. That way it should be easy to determine whether something is wrong with the code you posted, or whether it is going wrong in another place. If it is something in the QueryValueEx call, then it should be reproducable with a few lines of code.

    Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

    1 Reply Last reply
    0
    • L Lost User

      That's why my example doesn't use the managed api. The dll will hardly care whether the calling code is in C, Delphi or managed. Or am I wrong on that concept? :rolleyes:

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #22

      Eddy Vluggen wrote:

      Or am I wrong

      No, I think you are probably correct.

      1 Reply Last reply
      0
      • S SMD111

        Quote:

        You really need to do some serious debugging to find out why this is happening.

        Why do you assume I have not done “some serious debugging”? Please teach me how to debug a single RTL function call that does not generate an error.

        Quote:

        Rather than just assuming that it's a Microsoft error…

        Do you work for Microsoft? You see, I came to this forum in order to share with people some very strange findings, in order to get somebody interested in finding what is really going on, and not to get a write-off along the lines “It works on my computer!” If you don’t have interest in this problem, you don’t have to post to this thread, I thank you very much for looking into this.

        Quote:

        you should look deeper into your code

        You have my code, above.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #23

        SMD111 wrote:

        Why do you assume I have not done “some serious debugging”?

        I assume nothing; I respond only to the information you have provided.

        SMD111 wrote:

        Do you work for Microsoft?

        No, but experience has taught me that in situations such as this it is most likely a user error.

        SMD111 wrote:

        If you don’t have interest in this problem

        I do have interest, which is why I wrote a program to try and identify why this situation occurs.

        SMD111 wrote:

        You have my code, above.

        Which, as I said elsewhere, tells us very little.

        1 Reply Last reply
        0
        • S SMD111

          Thank you for the code example. I cannot compile it because I use plain C, such as in Microsoft Windows Help (Win32 Online Help, version 1.00.178) or on MSDN pages, or such as this one: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724911%28v=vs.85%29.aspx[^]

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #24

          SMD111 wrote:

          I cannot compile it because I use plain C,

          Download a compiler? Translating it to C would not help very much in proving that the api-call works as intended. Or in another wording, I'm simply trying to prove that SELECT is not broken. If I can prove that, then the error must be somewhere else in the code.

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

          S 1 Reply Last reply
          0
          • L Lost User

            SMD111 wrote:

            I cannot compile it because I use plain C,

            Download a compiler? Translating it to C would not help very much in proving that the api-call works as intended. Or in another wording, I'm simply trying to prove that SELECT is not broken. If I can prove that, then the error must be somewhere else in the code.

            Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

            S Offline
            S Offline
            SMD111
            wrote on last edited by
            #25

            Eddy Vluggen wrote:

            Download a compiler? Translating it to C would not help very much in proving that the api-call works as intended.

            I do not understand what you are saying. C is a low-level language that shows how things exactly work (well, assembler would be better still, but I don't have time to write an asm example of RegQuerryValueEx() use). After all, according to MSDN article[^],

            Quote:

            The Win32 API (also known as the Windows API) is a C-based framework for creating Windows applications.

            Or, in this one[^]:

            Quote:

            This API is designed for use by C/C++ programmers.

            This is a Windows API forum, right? It looks like we are speaking different languages ;) Perhaps the problem I observe is not related to the use of API but to some Windows system internals, such as user policies management... Maybe I should re-post my question in a different forum. Whatever it is, I'll let you know if I find an answer.

            L 1 Reply Last reply
            0
            • S SMD111

              Eddy Vluggen wrote:

              Download a compiler? Translating it to C would not help very much in proving that the api-call works as intended.

              I do not understand what you are saying. C is a low-level language that shows how things exactly work (well, assembler would be better still, but I don't have time to write an asm example of RegQuerryValueEx() use). After all, according to MSDN article[^],

              Quote:

              The Win32 API (also known as the Windows API) is a C-based framework for creating Windows applications.

              Or, in this one[^]:

              Quote:

              This API is designed for use by C/C++ programmers.

              This is a Windows API forum, right? It looks like we are speaking different languages ;) Perhaps the problem I observe is not related to the use of API but to some Windows system internals, such as user policies management... Maybe I should re-post my question in a different forum. Whatever it is, I'll let you know if I find an answer.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #26

              SMD111 wrote:

              C is a low-level language that shows how things exactly work

              For the things you write, yes. It does not show the internals of the WinAPI, and you can call those functions from higher level languages. If there are policies playing along (or other settings or stuff like a corrupted register), then the problem should re-occur in whatever language you use to call the API.

              SMD111 wrote:

              This is a Windows API forum, right? It looks like we are speaking different languages ;)

              I assumed English, my bad.

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups