internals

How does windows console subsystem work?

▼魔方 西西 提交于 2019-12-04 22:05:42
So how does console subsystem work ? I understand high level stuff such as windows automatically creates console window for programs and then gives handle to console window to which you can write and read with WriteConsole and ReadConsole, but how does window itself work ? does windows use GDI to draw characters into console ? or some hidden internal functions ? what happens behind the curtains ? This question is too vague to really answer in a detailed fashion but I'll give it a shot. There are at least 3 different implementations of the console in 32-bit Windows: MS-DOS box in Windows 95/98

Stack and Stack Base Address

你说的曾经没有我的故事 提交于 2019-12-04 20:37:35
In the MEMORY_BASIC_INFORMATION structure one finds two PVOID variables, called BaseAddress and AllocationBase respectively. I'm reading a book on Threading and its going over how to get the stackspace left on the stack in quite some detail, however there's something I'm not sure I understand correctly. The BaseAddress in the structure mentioned above, does it point to the highest address in the current thread stack or the lowest address? Since the stack grows downwards, the lowest would be at the top and the highest at the bottom. What exactly is the difference between the AllocationBase and

my C# winform needs to detect when other applications enter/exit/run-in TRUE fullscreen, prefer by events

笑着哭i 提交于 2019-12-04 19:31:37
问题 my C# winform application needs put itself in standby mode during time other application runs in true fullscreen mode (not only maximized), like video games, video movies, powerpoint. I need a method to detect if currently there is other application in fullscreen. Is there a possibility to register to events which will fire when other application enters/exits fullscreen? for both needs, I'll appreciate to have code snippets. 回答1: According to this question "full screen mode" is not that

How does a syscall actually happen on linux?

若如初见. 提交于 2019-12-04 19:29:05
问题 Inspired by this question How can I force GDB to disassemble? and related to this one What is INT 21h? How does an actually system call happen under linux? what happens when the call is performed, until the actual kernel routine is invoked ? 回答1: Assuming we're talking about x86: The ID of the system call is deposited into the EAX register Any arguments required by the system call are deposited into the locations dictated by the system call. For example, some system calls expect their

Redirect ConfigurationManager to Another File

筅森魡賤 提交于 2019-12-04 14:13:16
问题 I am looking to redirect the standard .Net ConfigurationManager class to another file; entirely . The path is determined at runtime so I can't use configSource or such (this is not a duplicate question - I have looked at the others). I am essentially trying to duplicate what ASP.Net is doing behind the covers. Thus not only my classes should read from the new config file, but also any standard .Net stuff (the one I am specifically trying to get to work is the system.codeDom element). I have

Want to know Windows Clipboard Internals

♀尐吖头ヾ 提交于 2019-12-04 11:25:20
I am interested in learning windows system internals and how things work. I am inclined towards learning system programming on windows. With that context, I am curious to know few things on how windows clipboard internally functions: What precisely happens when we select some text, image etc and press Ctrl + C ? What precisely happens when we we press Ctrl + V in different application? Where exactly the copied data resides? Does the copied data go into kernel mode memory - that is shared across all processes? How the copied data becomes available to a different process? I want to know the

How does SQL Server store decimal type values internally?

空扰寡人 提交于 2019-12-04 10:08:34
In SQL Server you can use FLOAT or REAL to store floating point values the storage format of which is cleared defined by the IEEE 754 standard. For fixed point values we can use DECIMAL type (which has a synonym NUMERIC ). However I'm not pretty sure how SQL Server store DECIMAL values internally. For example, if I define a table and insert a row like this: IF OBJECT_ID('dbo.test_number_types') IS NOT NULL DROP TABLE dbo.test_number_types; CREATE TABLE dbo.test_number_types ( id INT IDENTITY(1, 1), c1 NUMERIC(5, 4) ) GO INSERT INTO dbo.test_number_types(c1)VALUES(5.7456); When I use DBCC PAGE

If Java's garbage collector moves objects, what is Object.hashCode and System.identityHashCode?

醉酒当歌 提交于 2019-12-04 08:08:15
问题 I've often heard that these methods ( Object.hashCode and System.identityHashCode ) return the address of the object, or something computed quickly from the address; but I'm also pretty sure the garbage collector moves and compacts objects. Since the hash code cannot change, this presents a problem. I know this is not something one needs to know for everyday work, but I'd like to understand the internals. So, does anyone know how this is implemented in Java? Or .NET, since they are probably

How are categories implemented in Objective C?

放肆的年华 提交于 2019-12-04 05:12:10
I know how to use categories as a programmer, but I'm curious how they are implemented. Does the compiler compile them into calls to class_replaceMethod from a static initializer? Thanks. New answer on topic. Each class has a list of methods, when doing a method lookup the method list is scanned from beginning to end. If no method is found the superclass' list is scanned, etc. until reaching the root class. Found methods are cached for faster lookup next time. When loading a category onto a class the categories method list is prepended to the existing list, and caches are flushed. Since the

What are the inner workings of the Selenium waitFor mechanism?

五迷三道 提交于 2019-12-04 03:31:58
I am trying to customize the behavior of Selenium's click command, (via user-extentions.js), by intercepting calls to doClick(locator). Basically I need to delay click actions whenever our application's "busy indicator" is being displayed. (Now the standard answer for this kind of thing is to insert a waitFor into the script for those situations. Indeed, we currently have zillions of them throughout our scripts. I'm trying to eliminate those.) Detecting the page element is the trivial part. The tricky part is getting the script to actually wait. My promising looking, but failed attempt looks