Git Product home page Git Product logo

Comments (2)

Mistuke avatar Mistuke commented on July 16, 2024

Hi,

Thanks for opening an issue. So

  1. regQueryValue type seems correct to me, at least signature wise, it's return value on msdn (lpValue) is LPTSTR. However you're in that the behavior is wrong.

  2. Yes this is suspicious and I don't know why it was done. These two should be functionally the same if the subkey value is combined into the HKEY. But it doesn't seem to do that.

  3. No reason it can't be added, no one has ever needed it before, that's the only reason it's not there. I'd be happy to accept a pull request to add it. That would be the quickest, otherwise I'll try to find time to add it soon.

  4. I wouldn't mind such helper functions, since we already have some for error handling. I don't however want to restrict it to just these registry functions. so I would prefer something like getStorableValue :: forall a b. Storable b => String -> (a -> b) -> a -> IO b where the first String is the name of the function to put in the error message who's result couldn't be decoded. This would match the other helpers that exist and wouldn't be so specific.

I don't mind breaking changes, but I would mind a breaking change with the same signature, as this is a silent breaking change. Luckily there's some wiggle room here as the documentation for regQueryValue indicates it should be able to take a NULL and empty string. So I don't mind correcting the behavior of the function if the signature also changes to take a Maybe String so a compile error is issued to people using these functions who may not have read the changelog or are ignoring version bounds.

Since you are already working in this area, a pull request would be much appreciated!, otherwise I will fix these as soon as I can.

from win32.

tswelsh avatar tswelsh commented on July 16, 2024

Ah. I made more than one mistake in reading the docs, my apologies. The comment I criticised is correct, as RegQueryValue "Retrieves the data associated with the default or unnamed value of a specified registry key." That also explains my confusion over the return type as it looks like the default/unnamed value of a key is always of type REG_SZ.

I do intend to make a PR but might take me a while to get my head around various bits!

from win32.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.