Proxy DLL for ieframe.dll - windows-xp

I have created a template proxy dll for ieframe.dll using wrappit (http://www.codeproject.com/Articles/16541/Create-your-Proxy-DLLs-automatically)
Currently, I am trying to hook it to test if it works before modifying any function, however, when I tried it, Windows starts throwing out DEP errors and explorer.exe keeps crashing, as such, I tried disabling DEP for Windows Explorer, but explorer still keep crashing. Restarting the machine doesn't work either.
I am wondering if there is ieframe.dll is anything different about ieframe.dll in particular as compared to other dlls. Previously, I have created a proxy dll for advapi32.dll using the same method and there wasn't any issue with the hooking nor the DEP. Any ideas?
EDIT: I am using Windows XP SP3

Related

Executing IIS Express from command line credentials

I am using VS2015 to start my web application. I would like to be able to run IIS without it if possible to be able to use my app and work with atom or vscode when i want to.
I found the documentation here : http://www.iis.net/learn/extensions/using-iis-express/running-iis-express-from-the-command-line
and came out with (I did not specified the site name because it is the first in my config):
iisexpress -config:C:\Users\myuser\Documents\Project\TempProject\.vs\config\applicationhost.config
It work fine but when I start the server this way, credentials are required when it is not the case when started from VS2015. To my understanding both VS2015 and this command should run the same thing since they both use the same applicationhost.config.
What am I missing to use it with window authentication like vs2015 seem to do by default.
Thanks

Registration-free COM doesn't work when run from a service

I'm quite experienced with Registration-Free COM and manifests, but I'm stumped by a problem that I cannot overcome. I have an executable that is run as a windows service, and it spawns another executable (using CreateProcess). The spawned executable uses a COM library (that we make as well), and has a manifest file that defines the COM assembly.
It should be noted that the windows service can be run as a console mode from a command-prompt as well, for debugging purposes. When I run the service in console mode, the spawned executable "sees" the COM library, so the manifest is working correctly. When it is run as a service, I always get a "Class not registered" error in the spawned process.
I don't know why it's not working. Is it a registration-free limitation? If I register the COM library then all works fine (in console mode or service mode), but I'd obviously like to avoid that.
Thanks,
Normand
Might it be that the current directory of a windows service is the system32 folder? Try changing the environment once you are running and see if it'll then resolve the manifest file.
Odds are this is the problem but I don't want to spend the hour it would take to mock it all up and test it. :)

VSDBCMD Won't Start - Sql100DatabaseSchemaProvider can not be instantiated

I've followed the instructions over at http://msdn.microsoft.com/en-us/library/dd193258(v=vs.100).aspx
I've copied the deploy folder and the other dll's over to the remote machine and installed SQL Server 2008 Management Objects. However, when I attempt to run my command (real credentials stripped)
vsdbcmd /a:Import /cs:"Data Source=mydb;Integrated Security=false;Pooling=False;Initial Catalog=dbname;User ID=sa;Password=password;" /model:today.dbschema
I always get the error
The extension type Microsoft.Data.Schema.Sql.Sql100DatabaseSchemaProvider could not be instantiated.
I've searched around, but don't see anything that points to this. Any help please?
I found the issue - the server had .NET 4.0 Client Profile installed. Once I installed the full runtime, this issue went away.

Powershell System.__ComObject.document property no longer works under IE 9

I've been writing up a script that runs some server functions using a web-browser interface. I coded up the script on Windows 7 with Internet explorer 8 and it works fine.
As soon as I move it to the production server running Windows 2008 with Internet Explorer 9, it breaks. Finally traced it the point of failure, but I'm a bit stumped how to fix it.
Here's the code that will cause an issue:
$ie = new-object -com "InternetExplorer.Application"
$ie.navigate("http://www.google.com")
$ie.visible = $True
$doc = $ie.document
$Object1 = $doc.getElementByID("pocs")
This pops up an IE windows, and it should be able to search elements by ID. Trouble is, now I get the error
"Cannot find an overload for "getElementById" and the argument count:
"1"."
I can find very very little on this error. The actual issue is actually the variable $doc. If I do a "$doc | get-member" on IE 9 I get:
TypeName: System.__ComObject#{c59c6b12-f6c1-11cf-8835-00a0c911e8b2}
But under IE 8 I get:
TypeName: mshtml.HTMLDocumentClass
So, basically, IE 9 / Windows 2008 is failing to load the web document contents when I call $ie.document. I've tried setting IE9 to compatibility mode, but no luck there.
The $ie.document | get-member does actually show the method of : "getElementById Method Variant getElementById () " so it's in there, but there's no document for it to parse.
Any ideas would be greatly appreciated.
I am equally astonished this has not been fixed yet given the longevity of the issue on various technical forums. However I think I have found the solution, though it would be up to the Microsoft IE team to address at some point.
Like all the threads referenced that have looked into this I have suffered the same issue with the getElementById method, which with no other changes to a couple of test machines (one Windows 2008R2 Enterprise 64bit and one Windows 7 32bit), I can get the same script to work.
Workarounds that worked as temp solution that I didn't like:
Using the dev console in IE11, switch the Document Mode to 8 (9,10,11,Edge (default) don't work) - my automation script works instantly. No changes to IE trusted sites, zone security, protected mode, PowerShell session priveleges). So clearly just a component issue of the IE11 installation of some sort
Installing Office 2013, without ever running or licensing it, the same script works instantly without changing the Document Mode of IE11. Clearly Office does install/register something that fixes the problem (as Rhys Edwards says)
So I set about narrowing down what Office does to enable the COM object required for IE automation by:
Preparing a new Virtual Windows 2008R2 Server , no updates. Ran test script under IE8 - no issues.
Upgraded to IE11. Ran test script - failed as usual.
Took a VM snapshot
Used Regshot to do record the registry and file system
Ran the Office 2013 Pro_SP1 installation, no changes to default options
When Office install completes, did not run office once (at all ever)
Ran test script again - everything works, the IE automation with getElementById calls all back in operation
Took a 2nd VM snapshot
Ran 2nd scan with regshot and analysed the differences
Dumped the properties of my $ie object and also noticed there is far more there than before running Office install. References mshtml.dll and HTMLDocument classes throughout - looks as it should
I can see from the RegShot difference file that MSHTML.dll is ADDED and registered in the GAC (version 7.0.3300.0) by the office installation
What I did next may not be completely approved but:
I located the microsoft.mshtml.dll in the "c:\program files(x86)\Microsoft.net\primary interop assemblies" folder and saved it out of the VM to my local machine desktop
reverted to the pre-office 2013 snapshot
copied the microsoft.mshtml.dll into the VM and installed to the GAC (remember this is a 2008R2 server still on .net 2, I didn't update .net prior to or after IE11 install, only office). I installed to the GAC simply by dragging the file into the c:\windows\assembly view in explorer. In later versions of .Net you need to use gacutil /l
Tested the same script and BOOM, it all works fine. No need to change any IE settings or elevate script privileges or install Office
So to sum up. If you install IE11, to get PowerShell to automate the Document Model, I had to (re-)register the mshtml.dll in the GAC. Why the IE11 installation doesn't ensure this happens is beyond me but I think that the IE team need to look into this.
I also think for those where it 'just works' in IE10/11, you must have a product on the machine that has already registered the mshtml.dll in the GAC (perhaps Office, perhaps Visual Studio or some other MS app). Hence why you are not seeing the same problem that definitely exists.
Hope this helps someone - it was driving me crazy!
Andrew
As detailed in the comments on the question, there seems to be three solutions to this problem.
Upgrade to PowerShell 3.0: Version 2.0 is only compatible with up to IE8 when it comes to web-scraping and using IE as an object. However, version 3.0 will work with IE9. You can get it here.
Turn off protected mode in IE: Turning of protected mode for the Internet zone under the Security tab in settings seemed to do the trick for me. There are security implications to this that should be carefully considered.
Run the script in admin mode: Simply run the script in an elevated PowerShell prompt.
The last two solutions come from a different SO answer.
I had similar kind of issue and it got resolved by following below steps:
Check for the Microsoft.mshtml.dll on your machine. It should be available at location C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies. If you don't find it at this location, It might be the case that you don't have this dll and this is the reason you are getting this issue.
Find the dll, and try to load the assembly at run time. You can place the dll at any location on you machine and do it.
Below is the link to a method to load assembly at run time.
https://onedrive.live.com/?cid=21ad54fd70600673&id=21AD54FD70600673%211922

Can CruiseControl.NET Run on IIS 5.1 (WinXP Pro)?

Just wondering if anyone has successfully got ccnet 1.6.x running on an XP box (IIS 5.1). I have it installed and it builds projects (failing at the moment most likely due to file permissions), but for some reason the mapping in the web.config for showing the build XMLs via the dashboard does nothing. All I get are 404 errors. The same also goes for some projects loading of parameters, e.g. http://localhost/ccnet/server/local/project/someProject/ViewProjectParameters.aspx . Don't ask why the "server" is XP, but it is.
Well I figured out what the issue was. As it's IIS 5.1, I installed IIS Lockdown. I didn't realize that by default, URL paths with dots in them that aren't the file extension dot are disallowed by default. I set the [AllowDotsInPath] = 1 in the urlscan.ini and it works like a charm now.