Re: gtk windows question

2018-08-06 Thread Bill Kelly
Hi,

Wojciech Puchar wrote:
> How to (if it is possible) actually FORCE some font size when windows
> user sets "change the size of text, apps and other items".

We ran into this recently.

Setting the following environment variable provides some control over
the font scaling:

  GDK_WIN32_FONT_RESOLUTION

E.g. 96 being default DPI.


Regards,

Bill


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: argv

2016-04-17 Thread Bill Kelly
Andrew Robinson wrote:
> 
> The AddressOfEntryPoint is 0088 and is determined by me. The entry point
> is therefore always the same.

I may be misunderstanding the problem; but if you're implementing the startup
code yourself, don't you need to call GetCommandLine() in 
Kernel32.lib/Kernel32.dll?
Or obtain the command line from the NT Process Environment Block structure 
directly?

As I understand it, nothing is passed on the stack to the entry point of an EXE.
The fs segment register is initialized, however, and your Process' PEB structure
can be obtained via fetching from segment fs, offset 0x30.  (Or gs:0x60 for 
x64.)

This would allow direct access to the ProcessParameters structure, as it is a
field in the (semi-documented) PEB.

References:

http://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FNT%20Objects%2FProcess%2FPEB.html

http://tech.reboot.pro/printthread.php?tid=4417


Regards,

Bill


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: argv

2016-04-16 Thread Bill Kelly
Howdy,

Andrew Robinson wrote:
> This should be easy, but it is not. I am writing an assembly language program
> involving GTK+. I want to parse the command line for options but am unable to
> do so. The code to find argv and argc is simple:
> 
> main:
>push ebp
>mov ebp, esp
>lea eax, [ebp + 12]
>lea ecx, [ebp + 8]


Assuming your linker is producing a .exe file, what's the entry point
in the PE32 header?

Example:

$ dumpbin /headers stdcall_dll_user.exe
Microsoft (R) COFF/PE Dumper Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

Dump of file stdcall_dll_user.exe

PE signature found

File Type: EXECUTABLE IMAGE

FILE HEADER VALUES
 14C machine (x86)
   4 number of sections
55CC0078 time date stamp Wed Aug 12 19:27:04 2015
   0 file pointer to symbol table
   0 number of symbols
  E0 size of optional header
 102 characteristics
   Executable
   32 bit word machine

OPTIONAL HEADER VALUES
 10B magic # (PE32)
   10.00 linker version
 A00 size of code
 E00 size of initialized data
   0 size of uninitialized data
12F6 entry point (004012F6) _mainCRTStartup
[...]


$ dumpbin /disasm stdcall_dll_user.exe | grep -A 2 -E "_main|004010B3"
_main:
  00401000: 56 pushesi
  00401001: 8B 35 9C 20 40 00  mov esi,dword ptr [__impiob_func]
--
  004010B3: 6A 10  push10h
  004010B5: 68 08 22 40 00 push402208h
  004010BA: E8 01 05 00 00 call__SEH_prolog4
--
  004011D0: E8 2B FE FF FF call_main
  004011D5: 83 C4 0C   add esp,0Ch
  004011D8: A3 38 30 40 00 mov dword ptr ds:[00403038h],eax
--
_mainCRTStartup:
  004012F6: E8 6E 03 00 00 call___security_init_cookie
  004012FB: E9 B3 FD FF FF jmp 004010B3


Does the entry point change depending on whether you do or don't link with
GTK ?

Had you considered instructing the linker to use your own custom entry
point, so that you have full control over the startup?


Regards,

Bill

(yes, plenty of assembly in the 80's and 90's as a matter of necessity)


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list