QuickIOFileInfo.GetOwner() crashes

Jun 4, 2015 at 7:57 AM
Hello Benjamin

Many thanks for your work, I played little bit around and found an issue.

I try to get the Owner and the app crash without go into the "try catch". In Debug Mode, the vshost.exe crashes.

The OS is Windows 8.1. on a Surface 3.

Any ideas ?

Kind regards
Josch
Coordinator
Jun 4, 2015 at 12:42 PM
Hej Josch,

I doubt that QuickIO is responsible for this error, because no API elements are used, which would cause such a failure. If I'm right, then the surface used no Windows RT, so there should be no problems here actually.

Could you please write a small test project and test QuickIO there? Perhaps just a simple tercet.
If the error still occurs, then please give me a snippet of the source code.

PS: QuickIO has been moved to https://github.com/SchwabenCode/QuickIO
Jun 5, 2015 at 9:09 AM
Hi Benjamin

Many thanks for your really fast answer :-)

Below my test code:

Tested on a
:Surface 3 (no RT) with Windows 8.1 (bitlocker == on) : Crash
:HP Notebook with Windows 7 (bitlocker == on) : Crash

Let me know, if I can help to resolve, it is not so urgent, because I have a plan B as you see in the code below.

Have a nice weekend!
Josch


``` class Program
{
    static void Main(string[] args)
    {
        if (args.Length == 0)
        {
            Console.WriteLine("No direcotry path in arguments");
            Console.ReadKey();
        }
        else
        {
            Console.WriteLine("Directory :{0}", args[0]);

            var files = QuickIODirectory.EnumerateFiles(args[0], "*", System.IO.SearchOption.TopDirectoryOnly);

            foreach(var file in files)
            {
                Console.WriteLine(file.Name);


                if (args.Length > 1)
                {
                     // Crash
                    Console.WriteLine("Owner (QI) {0}",file.GetOwner().Value);
                }
                else
                {
                    // well executed
                    Console.WriteLine("Owner {0}", GetOwnerName(file.FullName));
                }

            }
            Console.ReadKey();
        }


    }

    static string GetOwnerName(string path)
    {
        FileSecurity fileSecurity = System.IO.File.GetAccessControl(path);
        IdentityReference identityReference = fileSecurity.GetOwner(typeof(SecurityIdentifier));
        NTAccount ntAccount = identityReference.Translate(typeof(NTAccount)) as NTAccount;
        return ntAccount.Value;
    }
}```


Coordinator
Jun 5, 2015 at 9:46 AM
Why there is no exception handling?
Use try-catch and give the exact error and stack please..
Jun 5, 2015 at 11:00 AM
The test application crashs in the native code, and the app doesn't run into the catch block.

Kind regards
Josch
Coordinator
Jun 5, 2015 at 11:36 AM
Unfortunately I cannot reprocude the scenario. No clue what that could be because all my tests work fine.
And I ask for understanding that I cannot invest tons of time into a problem, that I can simply not reproduce or understand.

I need more clues like error messages, stack traces...
Coordinator
Jun 6, 2015 at 10:36 AM
Please take a look at http://quickio.codeplex.com/workitem/5.
Probably caused by a Microsoft Windows Update. Still, I must find out what exactly the problem is.