Coder Social home page Coder Social logo

Comments (9)

martijnvanschie avatar martijnvanschie commented on August 26, 2024 1

Finally found my issue (or actually bug)

It was the GetCredentialAt method that had the bug. It did indeed always return a null and never set the actual ICredentialProviderCredential when found. So that was my access violation, there was no provider set.

It works now.

Thanks for taking the time to look into this.

from credprovider.net.

SteveSyfuhs avatar SteveSyfuhs commented on August 26, 2024

Presumably that's because GetBitmapValue is having issues. What does that code look like?

from credprovider.net.

martijnvanschie avatar martijnvanschie commented on August 26, 2024

I first thought of that too as the WinDbg trace shows this being called. But the function is pretty slim and i've tested it with different types of fields.

I think that credprovhost!_GetBitmapData+0x44: tries to access a pointer and fails there before even calling the COM object.

Here is the code.

        public virtual int GetBitmapValue(uint dwFieldID, out IntPtr phbmp)
        {
            Debug.Write("GetBitmapValue");
            Diagnostics.LogMethodEntry();
            phbmp = IntPtr.Zero;

            try
            {
                return HRESULT.S_OK;
            }
            catch (Exception ex)
            {
                _logger.Error(ex, $"{ex.Message}");
                return HRESULT.E_UNEXPECTED;
            }
            finally
            {
                Diagnostics.LogMethodExit();
            }
        }

from credprovider.net.

SteveSyfuhs avatar SteveSyfuhs commented on August 26, 2024

Do you have a better stack trace on this error? _GetBitmapData isn't doing anything particularly interesting. It first checks if this is an ICredentialProviderCredential3 and if so asks to call GetBitmapBufferValue. Yours most likely isn't a v3 so it skips this. It then calls GetBitmapValue, which makes a copy if the pointer isn't nullptr, and then finally returns any error or OK.

from credprovider.net.

martijnvanschie avatar martijnvanschie commented on August 26, 2024

Hi.

This stacktrace is all i have at the moment. The error accured in native code So there is no .Net runtime error and i can't use visual studio for debugging. I went with debugging using WinDbg. This is what i got. Tips are welcome of course

Also i cant find much on V3 credentials. Can you point me to some resources. I'm using v2 so maybee that is the issue.

This one is really getting on my nerves :)

from credprovider.net.

martijnvanschie avatar martijnvanschie commented on August 26, 2024

This is the stack btw. So perhaps a bit more than i thought. Hope it helps.

image

from credprovider.net.

SteveSyfuhs avatar SteveSyfuhs commented on August 26, 2024

Hmm. That all looks right. Nothing is jumping out. Can you share a simplified repo? I'm stepping through my code and its not obvious where this differs to cause the issue?

from credprovider.net.

martijnvanschie avatar martijnvanschie commented on August 26, 2024

Thought this all looked oke to me too. I'm thinking in the direction of build settings that differ but i checked the csproj and they are not that different.

I will need to clean up some code before i can share as this is a work project so cant just put it out there.
Let me get back to you. Thanx for the offer at least :)

from credprovider.net.

martijnvanschie avatar martijnvanschie commented on August 26, 2024

Hi again.

I finally shared a trimmed down version of my repo with you. If you could take a look that would be much appreciated.

from credprovider.net.

Related Issues (14)

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.