yashsingh1/xdaforums huggingface dataset:
[Windows Phone 7 Development and Hacking] Ttblondey:
tested on my custom rom Intrinsic .Error message:

Error trying to write the value 1337 to test address.System.runtime.interopservices.comexception (0x8007001f).A device attached to the system is not functioning.
[Windows Phone 7 Development and Hacking] GoodDayToDie:
@DreamCaster: The OS (Microsoft code) version is unimportant, what I need to know is the firmware version (OEM code). That said, thanks.

@Ttblondey: Another custom ROM with a crippled HtcUtility driver. I guess people didn't know what it could do so simply used the most recent version, which doesn't work anymore.
[Windows Phone 7 Development and Hacking] Ttblondey:
what do you suggest, maybe i can give feedback to the builder.
[Windows Phone 7 Development and Hacking] dreamcaster012:
Firmware revision number: 2305.13.20104.605

No problem, thanks for your work! :)
[Windows Phone 7 Development and Hacking] LiFePo4:
I have the same FW and get exactly the same error FYI
[Windows Phone 7 Development and Hacking] shinygerbil:
Thanks for all your hard work, this sounds incredibly promising :D

I also get the Error trying to Write the value 1337 to test address

System.Runtime.InteropServices.COMException (0x8007001F): A device attached to the system is not functioning.

My Firmware revision number is 2250.21.51004.401

(Stock unbranded HD7 [was originally on o2, flashed to a generic unmodified ROM in order to fast-track NoDo update] updated officially through Zune as far as it can go, which is to say, every update apart from the latest keyboard-bugfix update.)
[Windows Phone 7 Development and Hacking] GoodDayToDie:
Thanks for the info, everybody! Disappointing but still good to know.

@Ttblondey: Basically, this is the same problem as with ROMs that don't support TouchXplorer. For TX, the fix is to use an older version of the HtcFileUtility driver. For the HtcRoot project, the fix is an older version of the HtcUtility driver.
[Windows Phone 7 Development and Hacking] Ttblondey:
Can I do it myself if yes any link to the file.If not then i'll ask the builder to update it.

Update: I already install touchxplorer v 1.0.0.0 beta it can open folders.

Thanks
[Windows Phone 7 Development and Hacking] Jaxbot:
You're right.. that is some outright gorgeous code, GDTD!

Especially compared to *cough* dllimport *cough* :P

Joking aside, really neat what you've done here. Since we already have all the stock OEM ROMs, couldn't we just flash one to the device if the HtcUtility driver needs to be downgraded? I know there's the SPL5.x issue, but there are ways around that.
[Windows Phone 7 Development and Hacking] GoodDayToDie:
@JaxBot:

Wow, thanks! It still feels like six kinds of hack to me, but hey, it (sometimes) works...

Flashing an older ROM (or possibly just a firmware update - not sure if those can be used for downgrade) will work. You'll probably wipe the device in the process, though, unless it's an update CAB. So will restoring an old-enough backup for your phone.

The SPL probably won't be an issue, since stock ROMs and update have the Microsoft signatures that are needed. Now, if we wanted to make a custom CAB update that *just* reverted the HtcUtility driver... that would be awesome, but if it's even possible it will almost certainly require an unlocked bootloader.
[Windows Phone 7 Development and Hacking] GoodDayToDie:
First child project of HtcRoot:

HtcRoot WebServer! Still has a lot of progress to make, but it's pretty incredible already. Access the entire filesystem, download any file! Currently mostly read-only, but that will change (just takes time to write the features and work around weird edge cases with the various libraries being used).

Requirements for HtcRoot Webserver are identical to those for this test app. If the test app doesn't work for you (specifically, if it throws an exception) you won't be able to use the webserver either (though you can still use the low-privilege version of the webserver app).
[Windows Phone 7 Development and Hacking] voluptuary:
Ok, I ran the test on my HTC HD2 on B.t.t.F. v2.1 @ 8107 (no SP1) and these are the results I got:

SUCCESS!

Trying to open a file gives error 1260

Now, opening a file gives error 0

Finally, opening a file gives error 1206

However, your webserver app doesn't work on my HD2, confused. :(

I posted the error over in that tread.

EDIT: On a diff note, can you set permissions on files with this? Like say I want to make the OEM/MO marketplace files so they can't be over-written automatically by the system, can this be done?
[Windows Phone 7 Development and Hacking] GoodDayToDie:
@voluptuary: That is in fact the expected result for the test app. Congrats! Just for the record, I assume there was a bunch of stuff under "SUCCESS!"?

Give the webserver another shot. For reasons unknown, it like to fail on the first try to access the filesystem (with error 1260, which is the "you're trying to access me from within your sandbox" error; very odd). I posted a longer explanation on the relevant thread. Just refresh until it works. The error may change sometimes, or even sometimes load directories but not files (*very* weird, the code pulls the directory list first and doesn't revert permissions until after getting both!)

As for file permissions, I'm not actually sure to what degree CE supports ACLs on files. It has some concept of file permissions, but I don't know if you can do the equivalent of "Take ownership, remove all write permissions from everybody" for a full take-over like on NT, or if it's more of a "You shouldn't write to me, really, I promise! This bit in my attributes says so!" like DOS does, or somewhere in between. Whatever it is though, you certainly can - anything the system can do, you can do, and some flavor of read-only is supported (though it might be overwritable via the ZIP expander program, if the coder bothered to try).
[Windows Phone 7 Development and Hacking] voluptuary:
Yep, there was other stuff under SUCCESS! but I was too lazy to type it all out.
[Windows Phone 7 Development and Hacking] Martin7Pro:
Hi GoodDayToDie. Thi is very nice project. I want to test it, but I have mwang DFT v 3 (7740) on my HTC7Pro. Test app says:

"Error trying to Write the value 1337 to test address.

System.Runtime.InteropServices.COMException (0x8007001F): A device attached to the system is not functioning."

Means this the driver incompatibility? Can I install/change driver in ROM by any simple way (file uploading and "Init" key in registry changing etc.)? Or, DFT unlock is based on this file and is impossible to change it in DFT ROM? I see HtcUtility.dll file on my phone with zero length. Means it unreadable value or really zeroed length of file? Any more HTC*.dll files I see with zero length and HTCConnectinSetup.dll only I can to copy somewhere.

Second question: Is possible to force root access to any application from its independent part (for easy WM apps porting without recoding, only by "full access + missing API" cover)?

Third question: Exists theoretical possibility to code and run any "HtcUtility" wrapper in WP7 emulator for developed app testing? Or to use old WM 6 emulator for WP7 applications?

I want to use DFT ROM any time for various reasons, but I want also code and test apps your driver using. I am working for example on simple two-panels landscape filemanager, which may be in future able to autoselect fileaccess method by device possibilities detecting. This driver can increase its possibilities very much.
[Windows Phone 7 Development and Hacking] GoodDayToDie:
@Martin7Pro:

Looks like your DFT v3 ROM is using an incompatible HtcUtility driver, as you guessed.

You can't simply replace the driver while the phone is running; it's baked into the ROM. I've experiemented in the past with installing a driver to the normal (non-ROM) filesystem and using that, but it didn't work. The "zero length" thing is just because TouchXplorer and (non-HtcRoot) webserver apps don't know how to read ROM modules correctly.

I haven't yet proven that this method can be used for porting ntive apps, but I'm almost certain that it can. The problem with native apps, in general, is permissions-based. This hack works around that well enough. I've ound it to not work very well with multithreaded apps, though - either a fault of the way I coded the COM library, or of the way I swap the process token - so that's potentially an issue that needs working around.

You can't run anything using HtcUtility in the emulator. First of all, it doesn't *exist* in the emulator. The emulator is a basic WinCE kernel + WP7 userspace; it has no OEM firmware (like HTC drivers). Second, the HtcRoot library is native code (ARM) and wouldn't run on the emulator at all (which is actually an x86 veritual machine, not a true emulator). You could probably recompile the library for x86, but that wouldn't cause the HtcUtility driver to magically appear in the emulator image. The same problem applies to the WinCE/WinMo emulator as well.

Let me know how that two-pane file manager is doing; I'd like to see it. One reason that I've been writing an updated webserver app as my first real tool that uses the HtcRoot project is that the webserver can easily be used side-by-side in multiple windows or tabs of a browser, allowing access to multiple locations easily.
[Windows Phone 7 Development and Hacking] GoodDayToDie:
@voluptuary: Getting back to your earlier question about file permissions, that's actually something I should investigate. Just setting file properties isn't working like it should (I can clear ReadOnly, but I can't set it, for example). This may be related to some weirdness in the file permissions, which I'll investigate soon.

EDIT: Setting and clearing read-only both work just fine in the webserver now! It was a bug in my code. :-/

The actual file permissions (ACLs) are implemented using the policy system. I'm currently trying to modify those. Slow going but there's hope!
[Windows Phone 7 Development and Hacking] Androyx96:
HTC HD7 Unbranded Europe Official ROM Mango Interop-Unlocked

Hi! I'm running the "latest" version of Mango on my HTC HD7.

Official Europe ROM (Italy)

OS Version: 7.10.8107.79

Firmware 2250.21.51004.401

I didn't install the January update yet, because maybe it can breaks my Interop-Unlock. Now, I tried the XAP Test file and I get this error launching the application:

Title: "Error trying to Write the value 1337 to test address"

Body: "System.Runtime.InteropServices.COMException (0x8007001F): A device attached to the system is not functioning"

Hope this helps!
[Windows Phone 7 Development and Hacking] Martin7Pro:
Thanks for answers.

I have seen your posts here http://xdaforums.com/showthread.php?t=1434793&page=2#19 , then I mean WM apps porting will possible. Bigger problem will probably missed API then unlock.

I am afraid MS is reading XDA and will make any new restriction in cooperation with HTC in near future.

I mean two-panel ondevice fileexplorer. I am totally new in C# (I am desktop C programmer), then now I am trying first graphical proposition of this app only. I mean I must learn XNA instead Silverlight to make intended design (something similar to FileNote app from S80 Symbian (http://tech.groups.yahoo.com/group/FileNote/messages , it is not only filemanager, capabilities are for example here http://my-symbian.com/s80/software/applications.php?faq=3&fldAuto=865), but with touch control). It will objectively use fileaccess class, I prepared some provisioning solution first, but with full access it will much rapid and usable also on not full unlocked OS. But, with full unlock, may be OPL porting (it is ARM compiled, but with Psion or S80 API) will better solution, because FileNote is really well usable and is writed in OPL, which is interpreted basic language, working very quick on very slow old Arms.

I was mean to make something, which will add to emulator "system root access" similar to your solution on device, not driver porting.
[Windows Phone 7 Development and Hacking] GoodDayToDie:
Thanks @Androyx96. The problem is your firmware version, the 51XXX firmware is already known to not work.

I'm working on a way to make this usable on modern firmware. It will require first downgrading to a firmware where it works, installing something (using the root permissions), and then upgrading again.
[Windows Phone 7 Development and Hacking] Martin7Pro:
But, is necessary to change something on my full unlocked system? When I will add your files to my project, it may do nothing on fully unlocked phone and do something on interop-unlocked (and do interop unlock on dev-unlocked first;)). I will only need interop-unlocked app testers probably. And, when Opera will patched to work on interop-unlocked OS, I can change ROM.
[Windows Phone 7 Development and Hacking] Androyx96:
Yes, I remember you that the new January update, updates the firmware again. So if will be possible to update to this new firmware from the one I have now, it would be great!

(Sorry for my English but it's not my mother language)
[Windows Phone 7 Development and Hacking] GoodDayToDie:
Up to you whether you want to change ROMs or not. Currently, the HTcRoot project only works on outdated stock ROMs and a small handful of custom ROMs. I'm working on getting around that, but it's going to take time. I'm hoping that in the meantime more people can use this. That either means downgrading their phones' firmware (by a couple versions, in some cases) or installing a custom ROM (which may be much more up-to-date).

As a side note, one advantage of the HtcRoot project is that a true backup solution is finally possible. With essentially unrestricted access to the filesystem and registry, and even to things like the SMS and email APIs directly, backing up and restoring all your data should be much more feasible than before.
[Windows Phone 7 Development and Hacking] Martin7Pro:
Hi GoodDayToDie. When I use your compiled app, previously mentioned error is occured. But, when I compile source code myself, apllication crashes on start. I see under debugger only "ComException was unhandled" before breakpoint on first line. After any minutes Visual Studio blocks totally. Do you know, what it means? Thanks, M.

News: After rebuiding also htcroot.dll in VS 2008 and restarting phone it works "normally" with error "A device attached to the system is not functioning". Why cannot I take breakpoint to PhoneApplicationPage_Loaded code? M.
[Windows Phone 7 Development and Hacking] GoodDayToDie:
Hmm... my debugger is broken somehow (as in, Visual Studio refuses to ever launch an app on my phone, so I can't use it for debugging). This means I can't duplicate your work. It doesn't explain why you can't put a breakpoint in the event handler though... I really don't know about that one.

COMException is thrown automatically due to the way I use COM. Unlike a lot of the code I see on here, which uses [PreserveSig] on the COM APIs, the HtcRoot library automatically processes the HRESULT from the native code. If it's an error value, an exception object is automatically created and thrown. Some errors are well-known (FILE_NOT_FOUND, ACCESS_DENIED, etc.) and will throw corresponding managed exceptions. Others lack a managed exception (such as GetLastError=0x1F (31), ERROR_GEN_FAILURE) in which case Silverlight just generates a COMException with the message for that error code (in this case, "A device attached to the system is not functioning").

My code does use a global exception handler (in App.xaml.cs). A lot of people don't know about (or forget to include) that, so they might get exception crashes where they expect error messages.
[Windows Phone 7 Development and Hacking] Martin7Pro:
Thanks for explanation. I must study more, I am totally new in managed code. My debugger worked well last weak, now is something wrong, probably after intallation WM 6 SDK. I will try debug any simple "Silverlight only" app to see, if breakpoints work.

I have tried to change driver in device, still without success. After editing registry all seem do not use driver after soft reset, but after restart old driver was still used. It looks driver is called not only by registry values. I will search more. Can you upload your HTCUtility.dll file? If not, I will try get it from Ansar's ROM and compare with version, which I have in after Mango update Cab file. Do you know, if somebody is able to resign OEM upade cab now? I mean not, but I do not know all threads in XDA. Or, cannot exist any undocumented provisioning method for ondevice driver changing? On desktop Windows I can prepare actions, which are finished in OS booting time, then I mean something similar on phone. M.
[Windows Phone 7 Development and Hacking] GoodDayToDie:
I tweaked the debug-related registry values on my phone, so my debugger *might* work now. I'll check later. It didn't work even before I installed the WM6 SDK.

I've attempted to install replacement drivers before as well. No luck - neither the new nor the old driver was used until I changed the registry value back. I really wish I knew why; it would help a ton if I could just install an older driver.

HtcUtility.dll (like all the other HTC drivers, and like essentially every DLL or EXE "file" in \Windows) is a ROM module. I can't download that from a running device; it will need to either be pulled from an update CAB or extracted and assembled from a ROM image.

EDIT: If you happen to extract a non-working HTCUtility.dll driver, it might be interesting to decompile it and try and find a way to still use the IOCTL. It also might be a waste of time, but I won't know until I try. I don't seem to have a copy of it (though I have multiple versions of other HTC drivers).
[Windows Phone 7 Development and Hacking] Martin7Pro:
Do you mean values from http://xdaforums.com/showthread.php?t=1336137 , or something another? This I was used first last weak to force debugging, but debugger stops work after some trying with HTCRoot.

That is not problem for me to get any HTCUtility.dll from cabs or ROMs. Do you know your dll version? I studied driver changing on MSDN (Windows CE 5) first, but this is not working on my HTC7Pro with DFT v 3. I will search also CE 6 MSDN version, but, it seems to be more difficult by WP7.5 accesories, which are not public documented. But, I mean this driver version is related to another OEM files and will not changable itself due to system instability. I must do some important work on another project, I will continue here next weak. M.
[Windows Phone 7 Development and Hacking] GoodDayToDie:
Those are the values I tweaked, yes. I still can't launch an app from VS though, even for a simple pure-Silverlight task. Similarly, WPDM is unable to launch TouchXperience on my phone.

I don't know the DLL version. The module is 16168 bytes (quite small, actually). I'll try to get you a timestamp.

EDIT: There's a "HtcVersionUtility.dll" as well. I don't know what it does, and it's tiny (8184 bytes), but it does *something* and it might be related to the reason that installing an alternative (older, typically) driver is not working.
[Windows Phone 7 Development and Hacking] Martin7Pro:
OK. Only little topic: Is not possible to make any RUU package like Ansars's SL SPL (http://xdaforums.com/showthread.php?p=21682536 etc.), which will downgrade HTC driver only? I am not sure, how is about ROM addresing in this case. Bye next weak. M.
[Windows Phone 7 Development and Hacking] GoodDayToDie:
A custom update CAB should allow it, but you'd need a custom ROM (and of course HSPL) to do so. Not sure about applying a partial update like you describe...
[Windows Phone 7 Development and Hacking] Martin7Pro:
Ansar produces signed, "like official" versions. It is usable for any offical OS to downgrade. I mean one way is 1. to backup system by Zune+WPUpdate, 2. downgrade SPL by SL SPL, 3. downgrade OS to 7004 (I mean two-steps are safely), 4. update OS before OEM update, 5. return backup (if backup is dev or InterOP unlocked. If not, unlock between point 3 and 4, but backup is unusable here). But this way is very long and stops next updates, something short will much better.
[Windows Phone 7 Development and Hacking] GoodDayToDie:
Restoring the backup wipes the ROM completely and overwrites it. That's the point of the backups, to restore the ROM if an update goes bad. If you're going to mess with the SPL or the firmware, there's no point in restoring an update afterward - it will undo all your changes.

*If* ansar can actually produce something useful here, that would be great. I honestly don't trust him that much (partially on account of his reluctance to explain what any of his apps do, partially because a number of them just don't work even when they ought to, and partially because of the whole "Hit Thanks to get a copy of my app" BS) but I'll take help from anybody, and would love to be proven wrong.
[Windows Phone 7 Development and Hacking] dreamcaster012:
There was also that whole releasing a Verizon HTC Trophy update when NoDo was around that flashed the store model/demo unit OS version and made the phone unable to receive official updates or be recognized by Zune. Luckily I didn't flash it but a bunch of people over there did and couldn't get any help from him after they flashed it. Obviously its flasher beware, the releaser has no liability for what happens...but don't release something that basically makes the phone unusable.
[Windows Phone 7 Development and Hacking] Martin7Pro:
I did not want any co-operation with Ansar. I contacted him in past with no answer. I mentioned only his way to use full signed ROM image to downgrade small part of OS. I mean driver changing in SPL mode must be possible, when security allows it.
[Windows Phone 7 Development and Hacking] GoodDayToDie:
Ah... well, that would be cool. Downgrading a stock ROM without either needed to flash an old ROM (wiping everything) or restoring a backup... that would be quite useful!

ROMs really aren't my thing, so I don't know much about what's going on with all of that (including SL SPL). If it's possible to do what you say though, please let me know and I'll be glad to post a link with instructions here so people can make good use of it!
[Windows Phone 7 Development and Hacking] dragonide:
Could it be possible to downgrade second generation devices to the v1 radio (?) drivers to interop unlock ?

Pheraps it's not the radio one, but I mean the one with the exploit anyway ...
[Windows Phone 7 Development and Hacking] GoodDayToDie:
That would be a cool use, if possible. I'd be surprised but very happy to see it.

You need an older version of HtcProvisionDrv.dll, the ROM module driver responsible for allowing Silverlight apps to process provxml files.
[Windows Phone 7 Development and Hacking] dragonide:
I am not sure to be good enough to try this ...

And I am not sure I want to risk briking my Titan ...

If some dev could proof/test this it would be awesome ...
[Windows Phone 7 Development and Hacking] Martin7Pro:
Why I need HtcRoot project working:

http://xdaforums.com/showthread.php?p=22029185
[Windows Phone 7 Development and Hacking] GoodDayToDie:
@Martin7Pro: Nice! I'm working on some improvements to HtcRoot, but it'll be some time yet before I can get it to work on up-to-date devices.