How to properly insert windbg breakpoints on mshtml and MS IE 11? - function

I'm digging into MS Internet explorer 11 and mshtml.dll, lets be fast & clear : I'm investigating the "CTitleElement" class of "mshtml.dll" on windows 8.1, I want to set breakpoints on some functions in "CTitleElement" class to see what's going on inside this class (e.g : creating title element, getting title, setting title, getting title's length, etc ...)
I used windbg to attach the IE process, and here's what I did to set breakpoints :
0:013> bp MSHTML!CTitleElement::GetTitle
0:013> bp MSHTML!CTitleElement::SetTitle
0:013> bp MSHTML!CTitleElement::s_StringTable
0:013> bp MSHTML!CTitleElement::CreateElement
0:013> bp MSHTML!CTitleElement::TitleLength
and then running into IE with "g" command & opening the following simple html file :
<html>
<title>Hello There!</title>
</html>
but unfortunately, I did not get the desirable result, the debugger did not hit the breakpoints .
As I noticed, it's an unstable situation, because : "sometimes it got hit & sometimes not!"
I was think of ASLR and the type of breakpoint I just set ("bp"), disabled ASLR by installing EMET & disabling all memory protections, but I still unable to get the result in a reliable manner .
Any suggestion to solve this problem?
regards.

I don't think ASLR has got anything to do here. You are setting the break points using function names and not addresses. The addresses can change but the function names would still remain the same :)
to ensure that you do not miss out because of the child processes created by IE (as mentioned by Sesa)
Launch windbg.
From the file menu choose "Open Executable" OR Ctrl+E.
give the path of iexplorer.
make sure you have option "Debug Child Processes also" checked.
make sure you have the symbols correctly loaded.
To ensure your break-points persist across debugging sessions use "bu" instead of bp.
check that all break-points show up everytime using "bl"

I'm just speculating what is going on. Perhaps when you first load the page in IE it fully renders it. Next time, the page may not be fully rendered because the result of previous run used and an other code path is executed that doesn't hit your breakpoint.
Did you try force refresh Ctrl+F5?

Related

MS Access: Attachment type symbol shows black backround

I have a small database project where users can attach files to records. Mostly pdf and word docs. I am using the attachment type fields that access provides because I want to get more familiar with them. I have a continuous form that shows the attachment field using the Picture/Symbol view option. Most of the time, but strangely not always, the attachment symbol shows this black background behind its symbol. The black background does not cover the whole field but rather only the picture for the attachment type (Word, PDF etc.). The field itself is set to transparent, which is neccesary for my row highlighting to work. Does anyone know why this is happening? Is it a bug? Some way to fix it? It had worked when I had first set it up but upon restarting my computer and reopening the project they turned black and are now stuck that way. I removed them later for some reason and re-did the whole thing, upon which it seemingly worked but after restarting it went black again. There is no difference between using the view settings Picture/Symbol and Symbol.
Visual Aid:
Update 1:
The black backgrounds are seemingly random. I set the view option to Paperclip, restarted access, then set them to Picture/Symbol again and now I get this:
Closing and opening the file appears to turn the backgrounds black. Changing the view type back and forth inbetween can fix some, but not always.... I'm really not sure what's going on.
Update 2:
The issue is seemingly not affected by transparancy settings. Changing the Background color of the field has no impact either. The issue also persists when making a new form from scratch and adding the Attachment type field to it. It also carries over from one pc to another, so unless both have the same issue in their windows installation I don't think that is the root cause either. Compress & Repair did not help. I am only using one attached file per record.
Update 3:
I have had no luck consistently reproducing the issue. Most of the time, about 80% of it I am estimating, the issue persists. Some days, when launching access, the issue is resolved partially for either the word icon, or the pdf icon. On some days the issue is resolved for all icons as in the picture below. Almost always, after closing and opening access, the issue will immediately reappear for all icons. Closing and opening the form only and keeping the file open is fine, the issue stays resolved. Really not sure how to go about this.
My Access version:
Version 2205 Build 16.0.15225.20028
My Windows install:
Microsoft Windows 10 Pro
10.0.19044 Build 19044
So, updated to windows 11 and the issue is solved. No idea what was wrong exactly but it turns out it was related to the windows install. So, some kind of a bug in Win 10 is my guess, since it was happening on two different machines both running win 10.

Html input of type "file" freeze the browser sometimes

i'm struggling with the classic HTML input of type file. I was using it on my angular application and i had freeze sometimes, the whole browser became unresponsive, and the only thing that works is the scroll.
You can't click any buttons, select any text or even change tab on the browser for about 5 seconds. I tried a lot of different file type and sizes and it doesn't change any of this, it even freeze sometimes when i don't select any file in the explorer and i click the close button directly.
So I thought it was my implementation that was bad and i went to the Mozilla developper website where you have an example and I have exactly the same behaviour. I also tried to take only the HTML from the Mozilla website and put it alone on a .html file and again, same behaviour.
This does not occur 100% of the time, but I would argue that on my end it does it about 60/70 % of the times.
I tried it on chrome and Firefox (both up to date), on multiple computer (all running Windows though) and i have the same behaviour on all of them.
I don't have any error or anyting in the consoles.
I don't know what to do with this, i'm pretty sure it can't be the file's input on the whole web that are bugged, but i tried a lot of various things with always the same results. Should i report it somewhere? ( if so, where? ) Or what would you suggest to do to investigate this further?
I couldn't find anyone discussing this issue on the internet apart for this thread that had no solution, they also say in this thread that the bug is not reproducible in Edge, but i just tried and it does the same thing.
Thanks for reading me and for any help about this.
Chrome freezes for few seconds when after any use of file field.
It was because I had a shortcut in "Quick Access" menu in windows explorer. This shortcut has been linked with a folder shared by network. I've removed this shortcut and everything is good now.
Same here, I have a mapped network drive that is not responding, this make a 5 seconds delay. After unmapping the drive, no more delay. The delay is the same in firefox or chrome.
Same here, if you want to remove it, on Windows 10, click on the icon Quick access (blue star), then right click on the dead link appearing in the "Frequent folders" panel on the right panel and choose "Unpin/Remove from Quick access". There should be no error message.

Optimize - variant changes on specific elements not showing in preview mode

I'm trying to test changes to our website, which is a dynamic application. When making edits to certain elements, the visual editor gives a warning:
"The number of elements selected changed after the page was initially loaded. Make sure that your changes appear as expected using preview mode." I've read all the official Google documentation on this specific warning. See the layout here
I've enabled activation events, set it to optimize.activate and made sure it is being pushed to dataLayer.
When I preview in debug mode, it says the experience was applied, the activation event was triggered on 'optimize.activate' and the url matches. Yet only one of the changes have been applied. See here
When I open the console and call dataLayer, optimize.activate is right there.
I'm honestly baffled. I read here that filters on the Analytics view linked to your Optimize container can stop events 'showing up'. We use filters to IP block our staff from showing up in our Analytics data.
Any help on this would be amazing.
p.s. I'm not a developer so go easy on me :)
Ok this maybe for a couple of reasons... I've had a few instances where I can view changes in preview mode:
First of all, if you're viewing changes in incognito mode, you need to make sure the following option is switched off in your browser - Block third-party cookies. If this is switched on, then in preview mode, your browser will block the Optimize 360 cookie and your experiment will not run. (This means you will not see your changes).
Secondly, if you have Audience Targeting set, these features do not work or show in preview mode.
Thirdly, your test may not be firing on the correct event trigger. EG pageload. So make sure the correct event is attached to your AB Test. As you will be able to see the changes in edit mode, but again not in preview mode.
Your issue is likely to be point 1 or 3.

Web pages in CHtmlView with high dpi (150%) display incorrectly

Problem
I'm having the problem for days and haven't found anyone else mentioned it..
The issue is that when I set the system dpi scaling to 150% or above, some webpages I open in CHtmlView would be messed up, while using IE or Chrome not causing the same problem.
Context
It seems like in CHtmlView the fonts get bigger than it's needed. I figured out this situation happens if my program's "high DPI-aware" property is set. But I can't turn it off either because the webpage would be blurry.
The strange part is when I tested msdn or google paged in CHtmlView, they neither caused the problem nor scale 150%. They just displayed as the 100% one.
Not sure if I should do something to my program or the webpage. The webpage needed to be displayed in my program is also from my company, so if I know what to set in the webpage I could handle it.
Thank you :)
Edit:
Because the website I'm having problem with is a private site, so I use another page to explain the situation.
Webpage in HtmlView, seem like only fonts get bigger.
Webpage in IE
I'm here as I've got the same problem.
You can create a new VS2017 MFC project, derive a view from CHtmlView, you'll find this in the constructed code
void CMFCApplication4View::OnInitialUpdate()
{
CHtmlView::OnInitialUpdate();
Navigate2(_T("http://www.msdn.microsoft.com/visualc/"),nullptr, nullptr);
}
(Note I had to delete the two trailing nullptr arguments to get it to compile)
My application manifest lists the app as being High DPI Aware and I've got a 200% (192dpi) scaled monitor.
The web page that loads is tiny (unscaled).
zett42's answer (Aug 31 '17 at 14:39) is correct. Add the registry key indicated, using
Computer\HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
MFCApplication4.exe=11001 [your application name here].
Restart the app, hey presto everythin is correctly scaled.
Dunno why I can't upvote zett42.

Creating Chrome popup with a C++ program

Problem context:
I have a C++ program and a web presence. Currently the way things are working I have made a control panel with javascript and html. And it send commands via an unimportant communication medium to control things or get information from the C++ program.
Now, when the C++ program launches, I'm making it run a
ShellExecute(NULL, "open", addressBuffer," --new-window", NULL, SW_NORMAL);
This is a way of launching the default browser with the given address. The addressBuffer in this case points to an intermediate HTML file that quickly turns around and uses the
window.open()
in Javascript to open the final popup, then closes itself.
The result is the user now has the popup control panel that I want them to have but the user's main browser window also gets given focus, un-minimized, and placed on a different tab than the one they had selected. (Basically pops up out of nowhere and selects a another tab)
Problem:
I'm looking for a way to launch a Chrome popup, without disturbing a previously open browser window. Any ideas or solutions would be very helpful.
Lastly, it's worth noting that the " --new-window" from the code above doesn't actually open a new window like you would expect. In this case it's actually doing nothing... If it did work, none of this would really be an issue.
I know this is wordy so thanks in advance for you time!
-Michael
Alright, I came up with a solution.
Something about how ShellExecute processes it's commands was preventing the command line args to be passed in correctly.
My work-around includes grabbing the path to Chrome from the registry,
HKET_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe
Then simply doing a system() command with the chrome path "--new-window" and the web path.
Then I let the intermediate html page open it's popup and close itself.
Tada done.
Thanks.