Oxygen Basic

Information => Open Forum => Topic started by: kryton9 on June 04, 2012, 10:19:05 PM

Title: cool dll trick I found tonight
Post by: kryton9 on June 04, 2012, 10:19:05 PM
I was wondering how to bring all the commands from a dll into oxygen. The first thing is to get all the functions exported. Found a great tool built into windows.

Get command prompt window: cmd.exe
cd C:\Windows\System32
dumpbin /exports user32.dll >user32.txt  

I removed attachment as it is included in the next post attachment
Title: Re: cool dll trick I found tonight
Post by: kryton9 on June 06, 2012, 12:09:35 AM
I did the same to the following and got these text files:
Quote
06/06/2012  03:47 AM            41,755 advapi32.txt
06/06/2012  03:48 AM             8,751 comctl32.txt
06/06/2012  03:49 AM             1,795 comdlg32.txt
06/06/2012  03:49 AM            32,380 gdi32.txt
06/06/2012  03:49 AM             6,875 imm32.txt
06/06/2012  03:50 AM            68,125 kernel32.txt
06/06/2012  03:50 AM             1,518 lz32.txt
06/06/2012  03:51 AM             4,111 mpr.txt
06/06/2012  03:51 AM            25,621 netapi32.txt
06/06/2012  03:51 AM            32,020 shell32.txt
06/06/2012  03:46 AM            37,558 user32.txt
06/06/2012  03:52 AM             1,331 version.txt
06/06/2012  03:52 AM             8,818 winmm.txt
06/06/2012  03:53 AM            10,525 winspool.txt

You might ask why these. Well I went and installed my old Visual Studio 6, this is pre .net days version. I found a tool that they give for looking at the winapi as it can be used in Visual Basic 6. Using that tool, I got a text file. I have been parsing that file the last 2 nights. I will post the results of all that work soon. But, I went through and these were the dll's and drv files that I saw they used. So I did the dumpbin on them and got these. I will have 3 files when finished. One is all the winapi constants in file sorted alphabetically. Second all Types, in order of prior need as some types rely on others defined earlier. Third will be all the functions in the above files sorted alphabetically by function name. I have done test runs, and can't get my programs to compile, but I got all the problems oxygen had with the UDT's fixed. The third list of functions, will be just for reference as I think it will be best to use the bind command, but I will leave that up to Charles and Peter to work out.
Title: Re: cool dll trick I found tonight
Post by: kryton9 on June 06, 2012, 01:14:35 AM
Here is content for Charles, Peter and anyone else working on winapi stuff. Hope this can be useful. I am using this for my own tests and learning and wanted to share as it was lots of work to get it to this point.

Files:
win1Consts.inc
win2Types.inc
win3Funcs.inc

Using these I have not been able to compile anything yet, but working on it.
Update: Removed attachment newer version below.
Title: Re: cool dll trick I found tonight
Post by: Charles Pegge on June 06, 2012, 02:42:02 AM
Many thanks Kent,

Looks very promising, but will need some work to make it 64bit compatible. All the handles and pointer members must be of sys type instead of long or dword

There are entries where the lib name does not have the .dll extension

But all this could be cleaned up quite easily, and this data is good for quick-referencing Windows anyway.

Charles

Title: Re: cool dll trick I found tonight
Post by: kryton9 on June 06, 2012, 11:59:23 AM
Quote
There are entries where the lib name does not have the .dll extension

Believe me I was thrown for a loop when I saw that too, but when I did dumpbin whatever.drv it pulled data out. So those .drv files must be dll's of some sort.

I didn't mess too much with the longs and dwords as that is what VB6 is using. The only things I changed were when I saw in UDT's   name as string * 253
or SPECIAL as string * SOMECONSTANT

in those kind of cases, I did name(253) as zstring    or  SPECIAL(SOMECONSTANT) as zstring

I am going to make a bind file tonight to see if I can get anything to compile with that stuff. So I will use winConsts.inc, winTypes.inc and the new winBinds.inc when finished. Hope to have that tonight.
Title: I am done as far as I can go
Post by: kryton9 on June 06, 2012, 07:13:40 PM
I finished all I wanted to do so far with this phase of the winapi stuff. I made the bind file tonight. Enclosed is a zip with the latest files and test program. It won't compile, but it got passed the wintype errors. I had fixed them before, but somewhere along the line some of the changes reverted. Anyways. It is crashing when doing the binds now and I have no idea what the message means.

I am curious how big the exe file will be when it compiles with all those things included. I am taxing the oxygen compiler for you Charles. This is the longest compile time so far. So your powerful compiler is going oh know tsunami of windows api code, oh noooooo.

Load run cGLWindow.bas for the test program.
Title: Re: cool dll trick I found tonight
Post by: Charles Pegge on June 06, 2012, 09:10:09 PM
Hi Kent,

Here is a tool for checking and inserting '.dll' for winfuncs.inc

Processed file included: f.inc

Charles
Title: Re: cool dll trick I found tonight
Post by: Charles Pegge on June 07, 2012, 01:53:00 PM
Well, I spent the day on it, and got the API working with your GLWindow, Kent . WinFuncs required a substantial amount of revision to get the right types. A number of equates were also required in addition to WinConsts.

I think we could probably ditch AdvAPI. I don't know how useful it may be.

Anyway, I've provisionally included the API with Oxygen-in-progress, along with the new "!" declare syntax:

projects/WinApiVB6

Charles

PS: The upper limit for all entities is 100,000, more when scopes are used, So we have a long way to go :)


Title: Re: cool dll trick I found tonight
Post by: kryton9 on June 07, 2012, 02:18:07 PM
Thanks Charles, can't wait to test it out!
Title: Re: cool dll trick I found tonight
Post by: Charles Pegge on June 07, 2012, 02:28:31 PM
As you will see, most of the changes involved removing  "@" and "&" since the function protoypes control the referencing.
Title: Re: cool dll trick I found tonight
Post by: kryton9 on June 07, 2012, 02:30:38 PM
Wow it compiled super fast and the exe is still small!
Title: Re: cool dll trick I found tonight
Post by: kryton9 on June 07, 2012, 02:32:44 PM
As you will see, most of the changes involved removing  "@" and "&" since the function protoypes control the referencing.


From which file did you remove them Charles. I want to figure this stuff out and am making some progress, but most of it is like crossing a room in the dark, I just try.
Title: Updated files
Post by: kryton9 on June 07, 2012, 03:09:19 PM
Charles, I updated the files for projects/WinApiVB6

I added the constants in alpha asending order to winConsts.inc and removed them from cGLWindow.inc, added the missing funcs to winFuncs.inc and made a new inc to handle all the gl incs. Updated this all in the glWindow files to reflect the changes.

Again these would go into projects/WinApiVB6 to replace the same files there.
Title: Re: cool dll trick I found tonight
Post by: Charles Pegge on June 07, 2012, 03:38:55 PM
Thanks Kent.

It was from cGLWindow.inc. I took the version from /projects/GLWindow, copied it over, and modified it to match the VB API.

This code should work with any prototyped API of Windows. So you can used it as a template for further Windows development.

I also corrected PostQuitMessage 0 (1 param only)

Charles
Title: Re: cool dll trick I found tonight
Post by: kryton9 on June 07, 2012, 03:52:08 PM
I was looking through the files and noticed some @ missing in there. It makes the code easier to read and follow now too.

I started downloading the latest Windows SDK without .net, that is I unchecked anything .net in the options to download.
I am going to write an oxygen program based on your f.inc code, to go through all the .h files and pull out all the constants. Just to see how many more come out.
If it is a lot, then I will do the same for the types. I want to help you make Oxygen one with windows development along with the other guys help.

I see Windows as the dominant OS for sometime to come. Android, Chromium, Linux just are not going to replace Windows. There was a chance there, but it is gone now.
However, if you really plan on making oxygen run on other platforms, then I will start work on bringing freeglut into oxygen. It is a modern replacement for glut that is updated.
http://freeglut.sourceforge.net/ and at some point or another we should bring SDL, these are both very cross platform and widely used.

What do you think?
Title: winSDK preliminary stats
Post by: kryton9 on June 07, 2012, 04:10:48 PM
1,224 header files
267 lib files
Title: dumpbin of lib file with /ALL option
Post by: kryton9 on June 07, 2012, 04:26:38 PM
Charles, here is the output of from cmd window of Xinput.lib using dumpbin with the /ALL option. Can we pull anything useful out of this?
C:\Code\WinSDK\Lib>dumpbin /ALL Xinput.lib > _test.txt

Code: OxygenBasic
  1. Microsoft (R) COFF Binary File Dumper Version 6.00.8168
  2. Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
  3.  
  4.  
  5. Dump of file Xinput.lib
  6.  
  7. File Type: LIBRARY
  8.  
  9. Archive member name at 8: /              
  10. 4375874E time/date Sat Nov 12 01:10:22 2005
  11.          uid
  12.          gid
  13.        0 mode
  14.      188 size
  15. correct header end
  16.  
  17.     13 public symbols
  18.  
  19.       39A __IMPORT_DESCRIPTOR_XINPUT9_1_0
  20.       5D4 __NULL_IMPORT_DESCRIPTOR
  21.       710 XINPUT9_1_0_NULL_THUNK_DATA
  22.       86C _DllMain@12
  23.       86C __imp__DllMain@12
  24.       9D6 _XInputGetState@8
  25.       9D6 __imp__XInputGetState@8
  26.       A48 _XInputSetState@8
  27.       A48 __imp__XInputSetState@8
  28.       8D8 _XInputGetCapabilities@12
  29.       8D8 __imp__XInputGetCapabilities@12
  30.       952 _XInputGetDSoundAudioDeviceGuids@12
  31.       952 __imp__XInputGetDSoundAudioDeviceGuids@12
  32.  
  33. Archive member name at 1CC: /              
  34. 4375874E time/date Sat Nov 12 01:10:22 2005
  35.          uid
  36.          gid
  37.        0 mode
  38.      192 size
  39. correct header end
  40.  
  41.     8 offsets
  42.  
  43.         1      39A
  44.         2      5D4
  45.         3      710
  46.         4      86C
  47.         5      9D6
  48.         6      A48
  49.         7      8D8
  50.         8      952
  51.  
  52.     13 public symbols
  53.  
  54.         4 _DllMain@12
  55.         7 _XInputGetCapabilities@12
  56.         8 _XInputGetDSoundAudioDeviceGuids@12
  57.         5 _XInputGetState@8
  58.         6 _XInputSetState@8
  59.         1 __IMPORT_DESCRIPTOR_XINPUT9_1_0
  60.         2 __NULL_IMPORT_DESCRIPTOR
  61.         4 __imp__DllMain@12
  62.         7 __imp__XInputGetCapabilities@12
  63.         8 __imp__XInputGetDSoundAudioDeviceGuids@12
  64.         5 __imp__XInputGetState@8
  65.         6 __imp__XInputSetState@8
  66.         3 XINPUT9_1_0_NULL_THUNK_DATA
  67.  
  68. Archive member name at 39A: XINPUT9_1_0.dll/
  69. 4375874E time/date Sat Nov 12 01:10:22 2005
  70.          uid
  71.          gid
  72.        0 mode
  73.      1FE size
  74. correct header end
  75.  
  76. FILE HEADER VALUES
  77.              14C machine (i386)
  78.                3 number of sections
  79.         4375874E time date stamp Sat Nov 12 01:10:22 2005
  80.              114 file pointer to symbol table
  81.                8 number of symbols
  82.                0 size of optional header
  83.              100 characteristics
  84.                    32 bit word machine
  85.  
  86. SECTION HEADER #1
  87. .debug$S name
  88.        0 physical address
  89.        0 virtual address
  90.       46 size of raw data
  91.       8C file pointer to raw data
  92.        0 file pointer to relocation table
  93.        0 file pointer to line numbers
  94.        0 number of relocations
  95.        0 number of line numbers
  96. 42100040 flags
  97.          Initialized Data
  98.          Discardable
  99.          1 byte align
  100.          Read Only
  101.  
  102. RAW DATA #1
  103.   00000000: 02 00 00 00 16 00 09 00 00 00 00 00 0F 58 49 4E  .............XIN
  104.   00000010: 50 55 54 39 5F 31 5F 30 2E 64 6C 6C 28 00 13 10  PUT9_1_0.dll(...
  105.   00000020: 07 00 00 00 03 00 00 00 00 00 00 00 08 00 00 00  ................
  106.   00000030: 27 C6 12 4D 69 63 72 6F 73 6F 66 74 20 28 52 29  'Æ.Microsoft (R)
  107.  00000040: 20 4C 49 4E 4B 00                                 LINK.
  108.  
  109. SECTION HEADER #2
  110. .idata$2 name
  111.        0 physical address
  112.        0 virtual address
  113.       14 size of raw data
  114.       D2 file pointer to raw data
  115.       E6 file pointer to relocation table
  116.        0 file pointer to line numbers
  117.        3 number of relocations
  118.        0 number of line numbers
  119. C0300040 flags
  120.          Initialized Data
  121.          4 byte align
  122.          Read Write
  123.  
  124. RAW DATA #2
  125.   00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  126.   00000010: 00 00 00 00                                      ....
  127.  
  128. RELOCATIONS #2
  129.                                                 Symbol    Symbol
  130.  Offset    Type              Applied To         Index     Name
  131.  --------  ----------------  -----------------  --------  ------
  132.  0000000C  DIR32NB                    00000000         3  .idata$6
  133.  00000000  DIR32NB                    00000000         4  .idata$4
  134.  00000010  DIR32NB                    00000000         5  .idata$5
  135.  
  136. SECTION HEADER #3
  137. .idata$6 name
  138.        0 physical address
  139.        0 virtual address
  140.       10 size of raw data
  141.      104 file pointer to raw data
  142.       E6 file pointer to relocation table
  143.        0 file pointer to line numbers
  144.        0 number of relocations
  145.        0 number of line numbers
  146. C0200040 flags
  147.          Initialized Data
  148.          2 byte align
  149.          Read Write
  150.  
  151. RAW DATA #3
  152.   00000000: 58 49 4E 50 55 54 39 5F 31 5F 30 2E 64 6C 6C 00  XINPUT9_1_0.dll.
  153.  
  154. COFF SYMBOL TABLE
  155. 000 007BC627 ABS    notype       Static       | @comp.id
  156. 001 00000000 SECT2  notype       External     | __IMPORT_DESCRIPTOR_XINPUT9_1_0
  157. 002 C0000040 SECT2  notype       Section      | .idata$2
  158. 003 00000000 SECT3  notype       Static       | .idata$6
  159. 004 C0000040 UNDEF  notype       Section      | .idata$4
  160. 005 C0000040 UNDEF  notype       Section      | .idata$5
  161. 006 00000000 UNDEF  notype       External     | __NULL_IMPORT_DESCRIPTOR
  162. 007 00000000 UNDEF  notype       External     | XINPUT9_1_0_NULL_THUNK_DATA
  163.  
  164. String Table Size = 0x5A bytes
  165.  
  166. Archive member name at 5D4: XINPUT9_1_0.dll/
  167. 4375874E time/date Sat Nov 12 01:10:22 2005
  168.          uid
  169.          gid
  170.        0 mode
  171.       FF size
  172. correct header end
  173.  
  174. FILE HEADER VALUES
  175.              14C machine (i386)
  176.                2 number of sections
  177.         4375874E time date stamp Sat Nov 12 01:10:22 2005
  178.               BE file pointer to symbol table
  179.                2 number of symbols
  180.                0 size of optional header
  181.              100 characteristics
  182.                    32 bit word machine
  183.  
  184. SECTION HEADER #1
  185. .debug$S name
  186.        0 physical address
  187.        0 virtual address
  188.       46 size of raw data
  189.       64 file pointer to raw data
  190.        0 file pointer to relocation table
  191.        0 file pointer to line numbers
  192.        0 number of relocations
  193.        0 number of line numbers
  194. 42100040 flags
  195.          Initialized Data
  196.          Discardable
  197.          1 byte align
  198.          Read Only
  199.  
  200. RAW DATA #1
  201.   00000000: 02 00 00 00 16 00 09 00 00 00 00 00 0F 58 49 4E  .............XIN
  202.   00000010: 50 55 54 39 5F 31 5F 30 2E 64 6C 6C 28 00 13 10  PUT9_1_0.dll(...
  203.   00000020: 07 00 00 00 03 00 00 00 00 00 00 00 08 00 00 00  ................
  204.   00000030: 27 C6 12 4D 69 63 72 6F 73 6F 66 74 20 28 52 29  'Æ.Microsoft (R)
  205.  00000040: 20 4C 49 4E 4B 00                                 LINK.
  206.  
  207. SECTION HEADER #2
  208. .idata$3 name
  209.        0 physical address
  210.        0 virtual address
  211.       14 size of raw data
  212.       AA file pointer to raw data
  213.        0 file pointer to relocation table
  214.        0 file pointer to line numbers
  215.        0 number of relocations
  216.        0 number of line numbers
  217. C0300040 flags
  218.          Initialized Data
  219.          4 byte align
  220.          Read Write
  221.  
  222. RAW DATA #2
  223.   00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  224.   00000010: 00 00 00 00                                      ....
  225.  
  226. COFF SYMBOL TABLE
  227. 000 007BC627 ABS    notype       Static       | @comp.id
  228. 001 00000000 SECT2  notype       External     | __NULL_IMPORT_DESCRIPTOR
  229.  
  230. String Table Size = 0x1D bytes
  231.  
  232. Archive member name at 710: XINPUT9_1_0.dll/
  233. 4375874E time/date Sat Nov 12 01:10:22 2005
  234.          uid
  235.          gid
  236.        0 mode
  237.      11F size
  238. correct header end
  239.  
  240. FILE HEADER VALUES
  241.              14C machine (i386)
  242.                3 number of sections
  243.         4375874E time date stamp Sat Nov 12 01:10:22 2005
  244.               DA file pointer to symbol table
  245.                2 number of symbols
  246.                0 size of optional header
  247.              100 characteristics
  248.                    32 bit word machine
  249.  
  250. SECTION HEADER #1
  251. .debug$S name
  252.        0 physical address
  253.        0 virtual address
  254.       46 size of raw data
  255.       8C file pointer to raw data
  256.        0 file pointer to relocation table
  257.        0 file pointer to line numbers
  258.        0 number of relocations
  259.        0 number of line numbers
  260. 42100040 flags
  261.          Initialized Data
  262.          Discardable
  263.          1 byte align
  264.          Read Only
  265.  
  266. RAW DATA #1
  267.   00000000: 02 00 00 00 16 00 09 00 00 00 00 00 0F 58 49 4E  .............XIN
  268.   00000010: 50 55 54 39 5F 31 5F 30 2E 64 6C 6C 28 00 13 10  PUT9_1_0.dll(...
  269.   00000020: 07 00 00 00 03 00 00 00 00 00 00 00 08 00 00 00  ................
  270.   00000030: 27 C6 12 4D 69 63 72 6F 73 6F 66 74 20 28 52 29  'Æ.Microsoft (R)
  271.  00000040: 20 4C 49 4E 4B 00                                 LINK.
  272.  
  273. SECTION HEADER #2
  274. .idata$5 name
  275.        0 physical address
  276.        0 virtual address
  277.        4 size of raw data
  278.       D2 file pointer to raw data
  279.        0 file pointer to relocation table
  280.        0 file pointer to line numbers
  281.        0 number of relocations
  282.        0 number of line numbers
  283. C0300040 flags
  284.          Initialized Data
  285.          4 byte align
  286.          Read Write
  287.  
  288. RAW DATA #2
  289.   00000000: 00 00 00 00                                      ....
  290.  
  291. SECTION HEADER #3
  292. .idata$4 name
  293.        0 physical address
  294.        0 virtual address
  295.        4 size of raw data
  296.       D6 file pointer to raw data
  297.        0 file pointer to relocation table
  298.        0 file pointer to line numbers
  299.        0 number of relocations
  300.        0 number of line numbers
  301. C0300040 flags
  302.          Initialized Data
  303.          4 byte align
  304.          Read Write
  305.  
  306. RAW DATA #3
  307.   00000000: 00 00 00 00                                      ....
  308.  
  309. COFF SYMBOL TABLE
  310. 000 007BC627 ABS    notype       Static       | @comp.id
  311. 001 00000000 SECT2  notype       External     | XINPUT9_1_0_NULL_THUNK_DATA
  312.  
  313. String Table Size = 0x21 bytes
  314.  
  315. Archive member name at 86C: XINPUT9_1_0.dll/
  316. 4375874E time/date Sat Nov 12 01:10:22 2005
  317.          uid
  318.          gid
  319.        0 mode
  320.       30 size
  321. correct header end
  322.  
  323.   Version      : 0
  324.   Machine      : 14C (i386)
  325.   TimeDateStamp: 4375874E Sat Nov 12 01:10:22 2005
  326.   SizeOfData   : 0000001C
  327.   DLL name     : XINPUT9_1_0.dll
  328.   Symbol name  : _DllMain@12
  329.   Type         : code
  330.   Name type    : undecorate
  331.   Hint         : 0
  332.   Name         : DllMain
  333.  
  334. Archive member name at 8D8: XINPUT9_1_0.dll/
  335. 4375874E time/date Sat Nov 12 01:10:22 2005
  336.          uid
  337.          gid
  338.        0 mode
  339.       3E size
  340. correct header end
  341.  
  342.   Version      : 0
  343.   Machine      : 14C (i386)
  344.   TimeDateStamp: 4375874E Sat Nov 12 01:10:22 2005
  345.   SizeOfData   : 0000002A
  346.   DLL name     : XINPUT9_1_0.dll
  347.   Symbol name  : _XInputGetCapabilities@12
  348.   Type         : code
  349.   Name type    : undecorate
  350.   Hint         : 1
  351.   Name         : XInputGetCapabilities
  352.  
  353. Archive member name at 952: XINPUT9_1_0.dll/
  354. 4375874E time/date Sat Nov 12 01:10:22 2005
  355.          uid
  356.          gid
  357.        0 mode
  358.       48 size
  359. correct header end
  360.  
  361.   Version      : 0
  362.   Machine      : 14C (i386)
  363.   TimeDateStamp: 4375874E Sat Nov 12 01:10:22 2005
  364.   SizeOfData   : 00000034
  365.   DLL name     : XINPUT9_1_0.dll
  366.   Symbol name  : _XInputGetDSoundAudioDeviceGuids@12
  367.   Type         : code
  368.   Name type    : undecorate
  369.   Hint         : 2
  370.   Name         : XInputGetDSoundAudioDeviceGuids
  371.  
  372. Archive member name at 9D6: XINPUT9_1_0.dll/
  373. 4375874E time/date Sat Nov 12 01:10:22 2005
  374.          uid
  375.          gid
  376.        0 mode
  377.       36 size
  378. correct header end
  379.  
  380.   Version      : 0
  381.   Machine      : 14C (i386)
  382.   TimeDateStamp: 4375874E Sat Nov 12 01:10:22 2005
  383.   SizeOfData   : 00000022
  384.   DLL name     : XINPUT9_1_0.dll
  385.   Symbol name  : _XInputGetState@8
  386.   Type         : code
  387.   Name type    : undecorate
  388.   Hint         : 3
  389.   Name         : XInputGetState
  390.  
  391. Archive member name at A48: XINPUT9_1_0.dll/
  392. 4375874E time/date Sat Nov 12 01:10:22 2005
  393.          uid
  394.          gid
  395.        0 mode
  396.       36 size
  397. correct header end
  398.  
  399.   Version      : 0
  400.   Machine      : 14C (i386)
  401.   TimeDateStamp: 4375874E Sat Nov 12 01:10:22 2005
  402.   SizeOfData   : 00000022
  403.   DLL name     : XINPUT9_1_0.dll
  404.   Symbol name  : _XInputSetState@8
  405.   Type         : code
  406.   Name type    : undecorate
  407.   Hint         : 4
  408.   Name         : XInputSetState
  409.  
  410.      Exports
  411.  
  412.        ordinal    name
  413.  
  414.                   _DllMain@12
  415.                   _XInputGetCapabilities@12
  416.                   _XInputGetDSoundAudioDeviceGuids@12
  417.                   _XInputGetState@8
  418.                   _XInputSetState@8
  419.  
  420.   Summary
  421.  
  422.           D2 .debug$S
  423.           14 .idata$2
  424.           14 .idata$3
  425.            4 .idata$4
  426.            4 .idata$5
  427.           10 .idata$6
  428.  
Title: 0ver 190,000 constants
Post by: kryton9 on June 07, 2012, 04:58:23 PM
Here is a dump from all of the header files in the latest Windows SDK without .net of all the constants. The lines ending with "\"
have even more lines of code that are not showing. Well over 190,000 lines. How do you determine the ones that are important? I am at a loss.
But still fun to look at.  

I have given you a lot to look at the last several posts. I will stop here and wait to hear from you where you would like assistance and what to work on next.

Update: The attached is the raw dump put together. Further below you will find a cleaned up version.
Title: Re: cool dll trick I found tonight
Post by: Charles Pegge on June 07, 2012, 10:17:32 PM
This is what happens when a team of 5000 programmers spend 17 years creating an operating system :). Maybe 0.5% of it meets 99.9% of a project's requirements. As I see it, once you go beyond the basics, all the additional development resources come straight from the Web. It is the ultimate database.

It is very useful to have it all in a single file though. Looking up constants on the Web takes a lot of time.

With regard to FreeGlut and SDL etc, it should be possible to use the standard C headers with very minor extras, just like the OpenGl headers. Saves a lot of maintenance. The problem with many of these libraries is that they grow very large over the years. FreeImage, for instance is 2.5 megs, which is a bit OTT when JPEG and PNG is all you want from it.

Charles
Title: I just spent several hours cleaning up all the constants.
Post by: kryton9 on June 07, 2012, 11:22:25 PM
Here is best I can clean up constants Charles. It is sorted in alphabetical order, duplicates removed and any define starting with _ I commented out, they are at the beginning of the file. Almost 13,000.
The rest is lots of stuff. I am sure a lot we don't need.

One thing that surprised me in when I was cleaning up this file, the amount of header files without a header definition to ward off duplicate reads of it. Also how the naming of such defines were not standard.
You think on a project this big everything would be squeaky clean! From a world giant like Microsoft.

I just noticed after cleaning it is about half the raw file dump size :)
Title: Re: cool dll trick I found tonight
Post by: kryton9 on June 07, 2012, 11:24:48 PM
Quote
With regard to FreeGlut and SDL etc, it should be possible to use the standard C headers with very minor extras, just like the OpenGl headers. Saves a lot of maintenance.

I would say freeglut would be a good one to do. Since glut is used in so many examples and actually is pretty cool. Can you do your quick voodoo on it or should I slave on it, next?
Title: Re: cool dll trick I found tonight
Post by: kryton9 on June 08, 2012, 08:11:07 AM
After sleeping and waking up to do some more research, I realized the ConstsClean.inc file should just be used for a quick reference if ever needed. There are many things that could be removed from there that I am seeing now comparing it with the original header files. Besides we are not working on writing an operating system, so there are probably so many things that will never be used in daily programming. I guess going the VB6 route was complete enough.
Title: 8K to 108K
Post by: kryton9 on June 08, 2012, 10:04:26 AM
Having an all in one approach has it draw backs. Less work in the future, but bigger exe files each time.

What before was 8K is now 108K. So all this work this week was a waste in terms of being usable, but it was a good learning experience and we have good reference material for noobs like me trying to make use of windows dll functions.

Here is an updated winBinds.inc that works. It needs winConsts.inc and winTypes.inc. It has about 5 times as many functions as winFunc.inc. This can be used for quick and dirty testing when you don't want to mess with declaring the functions.

To make it clear. You use either winBinds.inc or winFuncs.inc as your main include file. Never both. Each will include winConsts.inc and winTypes.inc automatically.
Title: Re: cool dll trick I found tonight
Post by: Charles Pegge on June 08, 2012, 11:09:04 AM
One drawback with bind is that all the proc addresses in the list are linked in, whether they are used in the program or not. For a large list, this can add a lot unused code to a program.

Looking at FreeGlut, I doubt it adds much to what we already have. But I am going through the headers now. Oxygen gags on some of the syntax like:

typedef void (*GLUTproc)();
FGAPI GLUTproc FGAPIENTRY glutGetProcAddress( const char *procName );
Title: Re: cool dll trick I found tonight
Post by: kryton9 on June 08, 2012, 04:09:36 PM
What freeglut will add Charles is cross platform ability! 

About the size, it is just neat that oxygen can have so many ways to access dlls. How your parser handles all the different syntax boggles my mind!!!