Compare commits

..

3326 Commits

Author SHA1 Message Date
Magnus Olsen
3fc60348d1 commit the working ks.h header, we need fixing portcls.h before we can commit it to trunk
svn path=/branches/reactx/; revision=33003
2008-04-17 17:37:43 +00:00
Magnus Olsen
44f5135cee fix a typo
svn path=/branches/reactx/; revision=32280
2008-02-10 21:01:18 +00:00
Magnus Olsen
fcdf5988ad This header work now to build ksfilter, it is some linking issue now for ksfilter
svn path=/branches/reactx/; revision=32278
2008-02-10 20:22:16 +00:00
Magnus Olsen
60ab52bffd fix some more build issue for ks.h in trunk for ksfilter driver
svn path=/branches/reactx/; revision=32270
2008-02-10 18:37:31 +00:00
Magnus Olsen
f9f5208de9 fixet more building issue with trunk
svn path=/branches/reactx/; revision=32267
2008-02-10 16:21:07 +00:00
Magnus Olsen
d2b05bf4b9 fixed some wrong postions of some struct
svn path=/branches/reactx/; revision=32266
2008-02-10 15:23:49 +00:00
Magnus Olsen
0b6354fdc1 Finsh ks.h header time to test it in trunk before it merges down
svn path=/branches/reactx/; revision=32258
2008-02-10 12:58:54 +00:00
Magnus Olsen
4806139fe6 add more struct, define, type and so.
around 90% completed of this header now

svn path=/branches/reactx/; revision=32246
2008-02-10 01:21:12 +00:00
Magnus Olsen
572dd8c11e fixet wrong KSDATAFORMAT thx silverblade
add new com, define, types, struct

svn path=/branches/reactx/; revision=32245
2008-02-09 23:39:50 +00:00
Magnus Olsen
7f564f7789 add more struct, define, type and so.
around 70% completed of this header now

svn path=/branches/reactx/; revision=32244
2008-02-09 22:07:41 +00:00
Magnus Olsen
4deeb5ec6b add more struct, define, type and so.
around 48% completed of this header now

svn path=/branches/reactx/; revision=32243
2008-02-09 20:25:33 +00:00
Magnus Olsen
00d398cbcf adding few more struct
svn path=/branches/reactx/; revision=32242
2008-02-09 18:02:55 +00:00
Magnus Olsen
858e5d6456 fixet small typo in ks.h
svn path=/branches/reactx/; revision=32241
2008-02-09 17:10:25 +00:00
Magnus Olsen
d05c0eadf6 Update the documentation
adding lite more code 

svn path=/branches/reactx/; revision=30301
2007-11-09 17:33:02 +00:00
Magnus Olsen
7e69094a29 Implement KsCreateAllocator, KsCreateClock, KsCreatePin, KsCreateTopologyNode
stub : KsiCreateObjectType
all functions are call to KsiCreateObjectType, so they are not really implement.
Old code from 2004, it have not been cleanup for KsiCreateObjectType, the new ks.h header I wrote is now ready for this code. 
This module can not be merge to trunk until the new ks.h is ready. 





svn path=/branches/reactx/; revision=30295
2007-11-09 15:08:44 +00:00
Magnus Olsen
6855595796 update the new ks-h with one more struct
svn path=/branches/reactx/; revision=30293
2007-11-09 14:21:55 +00:00
Magnus Olsen
59a7e0c23c Fix the reactx build for ksuser.dll
svn path=/branches/reactx/; revision=30278
2007-11-08 20:09:58 +00:00
Magnus Olsen
b9039cc7c8 Start on ksuser.
svn path=/branches/reactx/; revision=30277
2007-11-08 20:08:42 +00:00
Magnus Olsen
ea280e00a7 fix wdmguid.a (it is now compatible with ddk version 3790.1830)
svn path=/branches/reactx/; revision=30275
2007-11-08 16:19:08 +00:00
Magnus Olsen
ce29a81e41 start fixing wdmguid.a 50% is done
svn path=/branches/reactx/; revision=30258
2007-11-08 01:49:53 +00:00
Magnus Olsen
171df52e37 add last guids for ksguid.a
This lib are now completed against ddk version 3790.1830

svn path=/branches/reactx/; revision=30256
2007-11-08 00:59:17 +00:00
Magnus Olsen
a430817798 add 20 more guids for ksguid.a
svn path=/branches/reactx/; revision=30253
2007-11-08 00:18:34 +00:00
Magnus Olsen
26c0180e8a smaller cleanup/sort in the guids define list bit
svn path=/branches/reactx/; revision=30252
2007-11-07 23:46:50 +00:00
Magnus Olsen
f3044a10fe add some more guids id to ksguid
smaller cleanup/sort in the guids define list bit

svn path=/branches/reactx/; revision=30250
2007-11-07 22:47:20 +00:00
Magnus Olsen
419b1f3665 add 40 more guids for ksguid.a
svn path=/branches/reactx/; revision=30246
2007-11-07 21:45:50 +00:00
Magnus Olsen
d4856b4202 add around 100 more guids for ksguid.a
svn path=/branches/reactx/; revision=30245
2007-11-07 20:57:31 +00:00
Magnus Olsen
c486e5e7c8 add 5 more guids for ksguid.a
svn path=/branches/reactx/; revision=30233
2007-11-06 23:27:39 +00:00
Magnus Olsen
1fdbfefe85 add 18 more guids for ksguid.a
svn path=/branches/reactx/; revision=30231
2007-11-06 23:15:50 +00:00
Magnus Olsen
ddd1c8f888 add 14 more guids for ksguid.a
svn path=/branches/reactx/; revision=30230
2007-11-06 21:42:29 +00:00
Magnus Olsen
82e669aa42 add 37 more guids for ksguid.a
svn path=/branches/reactx/; revision=30227
2007-11-06 21:12:30 +00:00
Magnus Olsen
343b7bf8c5 add 14 more guids for ksguid.a
svn path=/branches/reactx/; revision=30200
2007-11-05 20:37:16 +00:00
Magnus Olsen
e02097896e add 30 more guids for ksguid.a
svn path=/branches/reactx/; revision=30195
2007-11-05 19:52:44 +00:00
Magnus Olsen
1d682c45f9 add 10 more guids for ksguid.a
svn path=/branches/reactx/; revision=30179
2007-11-05 15:20:17 +00:00
Magnus Olsen
370529231f add 27 more guids for ksguid.a
svn path=/branches/reactx/; revision=30174
2007-11-05 13:19:44 +00:00
Magnus Olsen
52922faf05 add 6 more guids for ksguid.a
svn path=/branches/reactx/; revision=30148
2007-11-05 06:58:52 +00:00
Magnus Olsen
163cda6df4 add 20 more guids for ksguid.a
svn path=/branches/reactx/; revision=30147
2007-11-05 06:49:27 +00:00
Magnus Olsen
d1327bf255 21 more guid to ksguid.a
svn path=/branches/reactx/; revision=30143
2007-11-05 00:55:46 +00:00
Magnus Olsen
e3bd20e41c Add follow guids to ksguid.a/ksguid.lib KSCATEGORY_RENDER, KSCATEGORY_CAPTURE, KSCATEGORY_BRIDGE
svn path=/branches/reactx/; revision=30141
2007-11-05 00:03:15 +00:00
Magnus Olsen
43e400e70e Fix varus issue.
make audiosrv using the new ks.h and link with ksguid
Fix dxapi build
Fix ddkmapi.h so it works like windkk version 3790.1830
offline #define DEFINE_KSPROPERTY_TOPOLOGYSET in ks.h it seam some type problem there


svn path=/branches/reactx/; revision=30140
2007-11-04 23:54:40 +00:00
Magnus Olsen
67a3fbe3e7 start building up ksguid.a/ksguid.lib it is need it for ks.h
svn path=/branches/reactx/; revision=30139
2007-11-04 23:24:42 +00:00
Magnus Olsen
eb615b5cf1 add allot more struct, enum, define, to many to write in the log
svn path=/branches/reactx/; revision=30131
2007-11-04 21:43:33 +00:00
Magnus Olsen
66b9434834 Commit a ks.h header file from 2005 written by me, it is base on dxsdk 2004 dec, but it is not completed, I do not found the almost completed version of this header I wrote.
so I add the version I found so it does not get lost. Our current ks.h are not completed and is full with hacks in psdk. it will be deleted later, when ks.h are finish it will
merge down to trunks to let silveblade continue on some work.
 

svn path=/branches/reactx/; revision=30128
2007-11-04 19:47:36 +00:00
Magnus Olsen
00d0b6a666 start remove stuff got home made stuff or base on wine dx
add global file version of dx dll. 

svn path=/branches/reactx/; revision=30125
2007-11-04 17:50:09 +00:00
Magnus Olsen
60fb768885 global header for directx version info for the rc file.
svn path=/branches/reactx/; revision=30124
2007-11-04 17:43:50 +00:00
Magnus Olsen
7da42d614f start remove stuff got home made stuff or base on wine dx
svn path=/branches/reactx/; revision=30123
2007-11-04 17:33:57 +00:00
Magnus Olsen
d3d6cf78e8 Fill in more info in the lockup tables.
svn path=/branches/reactx/; revision=30121
2007-11-04 16:49:20 +00:00
Magnus Olsen
b394251018 Implement DxGetVersionNumber
comment up some functions that are implement. 

svn path=/branches/reactx/; revision=30120
2007-11-04 16:23:11 +00:00
Magnus Olsen
44e6f014a9 Add dxapi.sys, most api are stub.
Implemnt GsDriverEntry, DxApiGetVersion, DxApi.
All DxApi that are callbacks are stub.
 

svn path=/branches/reactx/; revision=30117
2007-11-04 14:57:57 +00:00
Magnus Olsen
8dce1974ed Fix the build of ReactX and smaller typos
svn path=/branches/reactx/; revision=29859
2007-10-24 23:18:05 +00:00
Magnus Olsen
d1c1e99025 Implement DxEngGetHdevData after some old notes I found , hope every things works.
Partly implement DxEngGetDCState

svn path=/branches/reactx/; revision=29858
2007-10-24 22:52:13 +00:00
Magnus Olsen
349d4d4458 Header fix only
---------------------
update DxEngGetHdevData define values in dxeng.h 
add new member to PDEV the _EDD_DIRECTDRAW_GLOBAL * pEDDgpl;
add missing struct D3DNTHAL_CALLBACKS2 and D3DNTHAL_CALLBACKS3 to ddk/d3dnthal.h
add missing struct _EDD_DIRECTDRAW_LOCAL to directxint.h from "Windows Graphics Programming Win32 GDI and DirectDraw by Feng Yuan"
fixed smaller typos in  directxint.h

 

svn path=/branches/reactx/; revision=29857
2007-10-24 22:49:06 +00:00
Magnus Olsen
995737523f Update the dxeng.h header with some more info
format the struct _EDD_DIRECTDRAW_GLOBAL as Feng Yuan - Windows Graphics Programming Win32 Gdi And Directdraw
Update the _EDD_DIRECTDRAW_GLOBAL struct with some private notes. (it is not all notes I have of it yet)


svn path=/branches/reactx/; revision=29855
2007-10-24 19:35:31 +00:00
Magnus Olsen
19462f737c add complete startup process code for dxg.sys
svn path=/branches/reactx/; revision=29848
2007-10-24 11:05:44 +00:00
Magnus Olsen
3cc2abdc0a Add documentations for EngDxIoctl, NtGdiDxgGenericThunk
optimize for EngDxIoctl, NtGdiDxgGenericThunk
implement DxDxgGenericThunk, DxDdIoctl for they are outdated, they are left for compatible issue. 
 

svn path=/branches/reactx/; revision=29847
2007-10-24 08:13:39 +00:00
Magnus Olsen
6246902fcd adding driver export list for dxg.sys, thuse api that being export as driver
adding private include file for dxg.sys

svn path=/branches/reactx/; revision=29832
2007-10-23 19:06:11 +00:00
Magnus Olsen
1dce1e3a3c move in DC/PDC to ntgdihdl and all neasry struct that are need it.
svn path=/branches/reactx/; revision=29804
2007-10-22 23:38:11 +00:00
Magnus Olsen
b3792fec24 puting back dc.h and driver.h to win32k/include as jimtablor requested.
we need move PDC only to ntgdihdl.h.

svn path=/branches/reactx/; revision=29803
2007-10-22 23:21:23 +00:00
Magnus Olsen
03cd85d4e1 actvate more code and slash away more notes to the trachcan, and smaller cleanup
svn path=/branches/reactx/; revision=29798
2007-10-22 21:15:10 +00:00
Magnus Olsen
969eb0a20a dxgthk 100% finish, it should work now in windows, complete replacement for ms dxgthk.sys now.
not tested yet in windows. 

svn path=/branches/reactx/; revision=29797
2007-10-22 20:55:18 +00:00
Magnus Olsen
bf3e6f5443 rename dxg.def to dxgthk.def
svn path=/branches/reactx/; revision=29796
2007-10-22 20:16:48 +00:00
Magnus Olsen
115c413a45 adding dxgthk.sys stub we need it for dxg.sys
svn path=/branches/reactx/; revision=29795
2007-10-22 20:15:49 +00:00
Magnus Olsen
5697e7c2d2 fix the build for win32k.sys
svn path=/branches/reactx/; revision=29791
2007-10-22 19:49:06 +00:00
Magnus Olsen
31f85ca295 start activate code in dxg.sys
fixed compiling issue with win32kdc.h
FIXME : win32k.sys and dxg.sys compiling are broken at moment

svn path=/branches/reactx/; revision=29790
2007-10-22 19:42:53 +00:00
Magnus Olsen
461b232a67 rename dc.h to win32kdc.h
rename driver.h to win32kdriver.h

svn path=/branches/reactx/; revision=29788
2007-10-22 19:37:43 +00:00
Magnus Olsen
5fbe1981ea Moved remotely
win32k/include/driver to include/reactos/win32k

svn path=/branches/reactx/; revision=29787
2007-10-22 19:35:10 +00:00
Magnus Olsen
63d64ecb75 Moved remotely
dc.h from win32k/include to include/reactos/win32k

svn path=/branches/reactx/; revision=29786
2007-10-22 19:28:41 +00:00
Magnus Olsen
034be89e6c make dxg.sys to compile
svn path=/branches/reactx/; revision=29784
2007-10-22 18:11:24 +00:00
Magnus Olsen
9d36446482 Adding code from 2004, DxDdStartupDxGraphics, DxDdCleanupDxGraphics(), DdHmgDestroy()
svn path=/branches/reactx/; revision=29780
2007-10-22 16:26:59 +00:00
Magnus Olsen
7a6391ae7d start adding dxg.sys
svn path=/branches/reactx/; revision=29761
2007-10-21 23:38:13 +00:00
Magnus Olsen
7f5e624fc6 fix compilng forget implement stub for DxEngIncDispUniq
svn path=/branches/reactx/; revision=29751
2007-10-21 18:52:42 +00:00
Magnus Olsen
0bb73dc1f8 forget remove a smaller hack i the drv functions list that being pass to dxg.sys
svn path=/branches/reactx/; revision=29750
2007-10-21 18:47:16 +00:00
Magnus Olsen
43560602c9 add stub for all dxeng so the dxg.sys does not crash, but we see where the problem are.
now we can start play with dxg.sys in ReactX

svn path=/branches/reactx/; revision=29746
2007-10-21 18:28:31 +00:00
Magnus Olsen
86bc741994 implement DxEngLockDC and DxEngUnlockDC
Documented DxEngLockDC and DxEngUnlockDC

svn path=/branches/reactx/; revision=29743
2007-10-21 17:08:12 +00:00
Magnus Olsen
bd8a20efb1 add correct prototypes for DxEngLockDC and DxEngUnlockDC
add comment how DxEngLockDC and DxEngUnlockDC works

svn path=/branches/reactx/; revision=29742
2007-10-21 17:06:27 +00:00
Magnus Olsen
a85334323c add driver functions list that are need it for dxg.c startup process.
dxeng.c are not finish and the drv list are not either finish allot is comment out for now

svn path=/branches/reactx/; revision=29737
2007-10-21 15:11:19 +00:00
Magnus Olsen
598e4e5569 make ReactX compile again, it can not load dxg.sys yet.
svn path=/branches/reactx/; revision=29736
2007-10-21 13:49:29 +00:00
Magnus Olsen
d3527f3196 fixed allot compiling issue
svn path=/branches/reactx/; revision=29734
2007-10-21 13:31:39 +00:00
Magnus Olsen
4efa4a4b9c Add documentations : how NtGdiDdCreateD3DBuffer works, did nott add full docs, but egunt for people start using it if they read msdn as well
Optimize : NtGdiDdCreateD3DBuffer

svn path=/branches/reactx/; revision=29725
2007-10-21 01:25:26 +00:00
Magnus Olsen
b18e1f0406 Add documentations : how NtGdiD3dContextDestroyAll works, MSDN docs is wrong
Optimize : NtGdiD3dContextDestroyAll

svn path=/branches/reactx/; revision=29724
2007-10-21 00:47:24 +00:00
Magnus Olsen
c21492b9b3 update some docs with info that is correct, this info can not be found in msdn, msdn is wrong in this part.
that why people can not check see if they can create a surface. 


svn path=/branches/reactx/; revision=29721
2007-10-20 18:58:13 +00:00
Magnus Olsen
4a53c0fc46 This header are need it for our owm dxg.h, This stuct can not be found in msdn.
This struct are documented partly or full in Feng Yuan - Windows Graphics Programming Win32 Gdi And Directdraw.
I am great full to Alex to help figut and fill in the missing parts. Thank you. 

svn path=/branches/reactx/; revision=29717
2007-10-20 18:03:36 +00:00
Magnus Olsen
85033b2610 Optimze : the NtGdiDdCanCreateD3DBuffer and NtGdiDdCanCreateD3DBuffer , with the new optimze method.
Add : doxgen tags for how NtGdiDdCanCreateD3DBuffer and NtGdiDdCanCreateD3DBuffer works 
Add : a sort code for the DxEngDrv so we getting the driver functions in sorted list in DxDdStartupDxGraphics, this will be part of optimize the dx code in directx
it will allow us call function with gpDxFuncs[DXG_INDEX_DxD3dContextCreate].pfn instead first to search after it. 
Fix few bugs, as well. 
rember u can not still build ReactX I have not commit thuse part yet.





svn path=/branches/reactx/; revision=29715
2007-10-20 17:34:14 +00:00
Magnus Olsen
ef6f1d494e all redirect are done, for syscall and export api to dxg.sys
left todo fix compiling issue and fix all stub for dxeng.c


svn path=/branches/reactx/; revision=29627
2007-10-16 09:11:22 +00:00
Magnus Olsen
be2a0beb1e commit layout for allot functions that need be redirected to dxg.sys
the code are not finish

svn path=/branches/reactx/; revision=29625
2007-10-16 08:35:57 +00:00
Magnus Olsen
ad4b6c7616 fixing few compiling issue.
svn path=/branches/reactx/; revision=29624
2007-10-16 07:42:36 +00:00
Magnus Olsen
2c49e7a9db fixing few compiling issue.
svn path=/branches/reactx/; revision=29615
2007-10-15 20:55:06 +00:00
Magnus Olsen
a0a831361b fixing few compiling issue.
svn path=/branches/reactx/; revision=29612
2007-10-15 20:28:06 +00:00
Magnus Olsen
28110234c3 fixing few compiling issue.
svn path=/branches/reactx/; revision=29611
2007-10-15 19:48:41 +00:00
Magnus Olsen
8359a5f898 smaller cleanup in thuse two new header
svn path=/branches/reactx/; revision=29610
2007-10-15 19:45:48 +00:00
Magnus Olsen
0c91d34b41 wrong protype in MSDN, the protypes is VOID APIENTRY NtGdiDdUnattachSurface(HANDLE hSurface, HANDLE hSurfaceAttached); and the text in msdn talk it can return either DDHAL_DRIVER_HANDLED or DDHAL_DRIVER_NOTHANDLED, see http://msdn2.microsoft.com/en-us/library/ms648703.aspx, so I change the protype to DWORD APIENTRY NtGdiDdUnattachSurface(HANDLE hSurface, HANDLE hSurfaceAttached);
svn path=/branches/reactx/; revision=29609
2007-10-15 19:43:58 +00:00
Magnus Olsen
5538059b89 fixing few compiling issue with this new header.
add few more redirect in ddraw.c to dxg.sys

svn path=/branches/reactx/; revision=29607
2007-10-15 19:04:50 +00:00
Magnus Olsen
8e71c124ed fixing few compiling issue with this new header.
svn path=/branches/reactx/; revision=29606
2007-10-15 18:40:01 +00:00
Magnus Olsen
7396205d50 fixing few compiling issue with this new header.
svn path=/branches/reactx/; revision=29605
2007-10-15 18:27:56 +00:00
Magnus Olsen
ed47fc3520 adding one more api to dxeng.c
svn path=/branches/reactx/; revision=29601
2007-10-15 13:10:59 +00:00
Magnus Olsen
1a146fe5ca comment some protypes and how they work.
svn path=/branches/reactx/; revision=29600
2007-10-15 12:40:29 +00:00
Magnus Olsen
6a362ee13f start implement the dxeng driver api that are need it for dxg.sys
I manger kill of some local tree with this commit. 
ReactX can not be build 

svn path=/branches/reactx/; revision=29599
2007-10-15 12:38:50 +00:00
Magnus Olsen
43e85fc362 add two empty folder for now, it si for dxg.sys and dxapi.sys
svn path=/branches/reactx/; revision=29598
2007-10-15 11:03:28 +00:00
Magnus Olsen
a476025b55 Start Build the next header we need, see https://www.openrce.org/forums/posts/535
only avail docs for it on the net. 

svn path=/branches/reactx/; revision=29597
2007-10-15 10:57:08 +00:00
Magnus Olsen
8c0f839acf add one more redirect to dxg.sys
svn path=/branches/reactx/; revision=29596
2007-10-15 09:49:58 +00:00
Magnus Olsen
706c0e7de6 rename 3 INDEX to diffent name to more logic names.
add comment which part being syscall, export list and internal use from win32k.sys



svn path=/branches/reactx/; revision=29595
2007-10-15 08:45:42 +00:00
Magnus Olsen
5c9253834f adding more redirect to dxg.sys
svn path=/branches/reactx/; revision=29594
2007-10-15 08:42:47 +00:00
Magnus Olsen
d290c5e6c2 finish redirect dvp interface to dxg.sys
svn path=/branches/reactx/; revision=29593
2007-10-15 08:34:11 +00:00
Magnus Olsen
86b7527ce5 adding more redirect to dxg.sys
svn path=/branches/reactx/; revision=29592
2007-10-15 07:50:59 +00:00
Magnus Olsen
431e7045da do not use entrypoint="0" when dll have dllmain
only when dll does not have dllmain we should use entrypoint="0" 
other wise the orginal dllmain will not be run

svn path=/branches/reactx/; revision=29578
2007-10-14 21:56:02 +00:00
Magnus Olsen
75bf1ba3bc fixed export of EngLockDirectDrawSurface@4, EngUnlockDirectDrawSurface@4, EngDxIoctl@12, EngAllocPrivateUserMem@12, HeapVidMemAllocAligned@20, VidMemFree@8, EngFreePrivateUserMem@8
and add them to ntddraw/eng.c
no code yet

svn path=/branches/reactx/; revision=29577
2007-10-14 21:23:43 +00:00
Magnus Olsen
399dd8f6e5 cleanup from old interface and move new info to right header.
it still can not be build. for not all api have been redirect yet


svn path=/branches/reactx/; revision=29576
2007-10-14 20:42:41 +00:00
Magnus Olsen
a83c927ea6 delete stub.c from ntddraw folder it is not longer need it
add more redirect to dxg.sys
smaller cleanup as well


svn path=/branches/reactx/; revision=29575
2007-10-14 20:05:40 +00:00
Magnus Olsen
f3c20ee1cc more redirect from win32k to dxg.sys
btw no old code exists in current file. 

svn path=/branches/reactx/; revision=29572
2007-10-14 19:45:13 +00:00
Magnus Olsen
8d3e67ab96 start move out logic stuff that should have been move to ddsurf and d3d from ddraw.c
remove the old start up code for dx, it will be in in dxg.sys later. 
win32k only redirect it to dxg.sys

svn path=/branches/reactx/; revision=29571
2007-10-14 19:02:45 +00:00
Magnus Olsen
01ec8d7afe finish the redirect of dxg.sys for the d3d part
svn path=/branches/reactx/; revision=29569
2007-10-14 18:14:04 +00:00
Magnus Olsen
320f753a4e adding more redirect for dvp interface to dxg
svn path=/branches/reactx/; revision=29568
2007-10-14 17:49:55 +00:00
Magnus Olsen
b81a1d62c0 move all dvp stub to dvp.c
start redirect all to dxg.sys

svn path=/branches/reactx/; revision=29567
2007-10-14 16:19:56 +00:00
Magnus Olsen
3b320dfaaa add empty file for directx video port control interface
svn path=/branches/reactx/; revision=29566
2007-10-14 15:18:29 +00:00
Magnus Olsen
9b55f8ca65 redirect whole dd interface to dxg.sys
svn path=/branches/reactx/; revision=29565
2007-10-14 15:03:13 +00:00
Magnus Olsen
0f36e1fde8 Redirect all dx mocomp api (done)
svn path=/branches/reactx/; revision=29563
2007-10-14 13:58:37 +00:00
Magnus Olsen
623fb6808a dxtn License GPL
Need it by OpenGL / DirectX compress textures, at moment for mesa32
Got Alesky aka Fireball permits to add it, so long it use the patent flag.
Some part in this library can contain patent, thing in USA
This library will not be build directly, you are force to
change the patent flags in the config.rbuild file to 1
But todo so, you need check you country patent. 

svn path=/branches/reactx/; revision=29562
2007-10-14 13:03:46 +00:00
Magnus Olsen
3bc97d4fc4 This change can not compile win32k for they are not complete, and it is start on the loading process of dxg.sys
FIXED : One wrong protyped accoding MSDN
ADD   : Load process of DXG.SYS (not completed)
Redrirect : Allot DirectX api from win32k to dxg.sys (allot of code that have been remove will be readdit in new api or in dxg.sys, when it being commit)
Allot cleanup as well

svn path=/branches/reactx/; revision=29557
2007-10-14 12:07:23 +00:00
Johannes Anderwald
5590854701 - halfplement CDefFolderMenu_Create2
svn path=/trunk/; revision=29554
2007-10-13 21:47:09 +00:00
Johannes Anderwald
6066286913 - add prototype for SHCreateDefaultContextMenu and CDefFolderMenu_Create2
These functions are responsible for creating the right context menu for the requested shell item. 

svn path=/trunk/; revision=29552
2007-10-13 20:40:00 +00:00
Aleksey Bragin
72595c9315 - Move Teb's StaticUnicodeString initialisation from ntdll to MmCreateTeb (it's better to initialize it early, and all at once, instead of something here now and something there later).
svn path=/trunk/; revision=29551
2007-10-13 13:39:42 +00:00
Daniel Reimer
eb279e4344 German Translation for Event Viewer.
Updated SVN:Ignore for WordPad.

svn path=/trunk/; revision=29550
2007-10-13 12:18:58 +00:00
Colin Finck
c56d07a5bb - Hardcode the Window class name, there is no need for it to be translated
- Remove all this VS stuff from the english resource file
- Move the icons to "rsrc.rc" as they will be shared between all translations
- Fix a typo

svn path=/trunk/; revision=29548
2007-10-13 10:27:27 +00:00
Colin Finck
3b9ccf3f7d Add an Event Log Viewer coded by Marc Piulachs (marc DOT piulachs AT codexchange DOT net)
The icons were taken from the comctl32.dll.
I did not add it to the "reactos.dff" as ReactOS doesn't support Event Logs yet.
See issue #2602 for more details.

svn path=/trunk/; revision=29547
2007-10-13 10:15:37 +00:00
James Tabor
bdd694ff41 Dc_Attr with DCE:
- Fixed problem with dcattr read and write access in user mode.
- Dcattr data only flows from Kernel to User ATM.
- Cleaned up code.
- Enable GetDCObject for testing.
- Tested with Qemu both Linux and XP, and real hardware. 

svn path=/trunk/; revision=29546
2007-10-13 04:15:37 +00:00
Mike Nordell
00a4696613 Just some more notes about what (likely) is required to make it possible for users to cleanly shut down ROS.
svn path=/trunk/; revision=29545
2007-10-13 03:34:56 +00:00
Daniel Reimer
3afae75a47 Add German Translation and Fix English SUBLANG to our Defaults.
svn path=/trunk/; revision=29544
2007-10-12 17:49:52 +00:00
Christoph von Wittich
ff76e56813 LdrpLoadModule called with LOAD_LIBRARY_AS_DATAFILE returns SUCCESS and a valid BaseAddress but no Module
svn path=/trunk/; revision=29543
2007-10-12 17:15:23 +00:00
Johannes Anderwald
6fda4d5f57 - dont allow creating a link to a shortcut
See issue #2735 for more details.

svn path=/trunk/; revision=29542
2007-10-12 16:07:41 +00:00
Aleksey Bragin
2f452c335b - Don't free a NULL pointer.
svn path=/trunk/; revision=29541
2007-10-12 15:42:08 +00:00
Johannes Anderwald
499e470b9f - fix PickIconDlg prototype
svn path=/trunk/; revision=29540
2007-10-12 15:17:55 +00:00
Johannes Anderwald
1b769acf24 - add PickIconDlg declaration
svn path=/trunk/; revision=29539
2007-10-12 15:17:51 +00:00
Johannes Anderwald
d85b18bd0a - fix build
- set control ids

svn path=/trunk/; revision=29538
2007-10-12 14:49:21 +00:00
Johannes Anderwald
16fd2633a6 - explictely use PROPSHEETHEADERW
- implement _ILIsBitBucket function
- implement a IContextMenu for recycle bin interface but is currently unused see notes shv_item_cmenu.c
- implement recycle property dialog resources in vista style

svn path=/trunk/; revision=29537
2007-10-12 14:25:58 +00:00
Peter Ward
bb6da9c74e - Fix build.
svn path=/trunk/; revision=29536
2007-10-12 12:19:37 +00:00
Johannes Anderwald
7f92d4dc3e - fix warning
svn path=/trunk/; revision=29535
2007-10-12 12:11:00 +00:00
Peter Ward
f5c30d8747 Patch by Marc Piulachs (Issue 2737)
- Imported write.exe plus small fix to compile it as unicode.
(Added to rosapps instead of base/applications though)

svn path=/trunk/; revision=29534
2007-10-12 12:06:05 +00:00
Mike Nordell
d6b434bf9c Beginnings of enabling THREAD_SET_THREAD_TOKEN, to allow ROS to actually be shut down. Mostly skeleton and junk, but the basic infrastructure is at least in place.
svn path=/trunk/; revision=29533
2007-10-12 12:04:50 +00:00
Aleksey Bragin
306e3db1bb Dmitry Chapyshev <lentind@yandex.ru>
- Make the "Information" tab work.
- Improve overall applet's behavior (more correct and more "smart").
- Fixed a bug when switching between tabs.
- Small improvements in the UI, other small fixes.
- If no apps or no updates are installed, then the controls in the respective tabs will be grayed out, and a respective information message will be shown instead of the empty list.

svn path=/trunk/; revision=29532
2007-10-12 10:12:52 +00:00
Aleksey Bragin
a3d5eb47e0 Johannes Anderwald
- Fix the msvcrt exception (because vlc first calls _getmainargs. This function sets the  __argc to 1. Afterwards vlc calls again __wgetmainargs where __argc is now one. When entering the function _wadd, it doesnot allocate the __wargv because __argc is 1. Therefore it crashes).
See issue #821 for more details.

svn path=/trunk/; revision=29531
2007-10-12 09:58:00 +00:00
Mike Nordell
5005c57755 Added some descriptive comments for otherwise hard-to-understand bitwise operations
svn path=/trunk/; revision=29530
2007-10-12 09:52:23 +00:00
Mike Nordell
520357b1d4 NTSHChangeNotifyRegister completed and to spec
svn path=/trunk/; revision=29529
2007-10-12 08:15:37 +00:00
James Tabor
cfb9429c6e Sorry for this! Shell32 should be a Sync->Port not 100% sync. We needed this for a long time too! Good job janderwald!
svn path=/trunk/; revision=29528
2007-10-12 01:08:06 +00:00
James Tabor
51d1952da0 Add notes for NtGdiResetDC and NtGdiOpenDCW.
svn path=/trunk/; revision=29527
2007-10-12 00:47:31 +00:00
Johannes Anderwald
eca272bd00 - start implementing recyclebin (based on Wine's recycle bin implemenation)
svn path=/trunk/; revision=29526
2007-10-11 23:45:36 +00:00
Ged Murphy
126300ce1b Send the right number of bytes when setting an env var
spotted by Christian Fasshauer <chrfas at googlemail dot com>

svn path=/trunk/; revision=29525
2007-10-11 23:36:31 +00:00
Daniel Reimer
de827eb930 Translated the few new lines in this RC.
svn path=/trunk/; revision=29524
2007-10-11 22:45:18 +00:00
Daniel Reimer
1921d75db2 (Very)Small code cleanup for my Cards.dll
svn path=/trunk/; revision=29523
2007-10-11 22:39:37 +00:00
Mike Nordell
363fadba81 Prevent SEGV
svn path=/trunk/; revision=29522
2007-10-11 22:20:22 +00:00
Daniel Reimer
4977ec87af Added German Translation of one missed Dialog.
Fixed tons of coordinates and sizes to fit all Text of the German and English Translation into the Buttons, Checkboxes and Text Fields.
Moved some stuff to better fit into the Dialog.
I mainly kept Johannes's nice small format for the Shortcut etc Dialogs, because it looks nice. This only helps to fit in the Text.

svn path=/trunk/; revision=29521
2007-10-11 22:17:08 +00:00
Mike Nordell
d4dd5b21ce Make cabman build warning-free
svn path=/trunk/; revision=29519
2007-10-11 21:01:39 +00:00
Thomas Bluemel
6f9c72878c Display a context menu for the selected monitor
svn path=/trunk/; revision=29517
2007-10-11 20:23:26 +00:00
Colin Finck
4ae5d0691a Updated Ukrainian translation by Artem Reznikov (temarez AT yandex DOT ru)
See issue #2731 for more details.

svn path=/trunk/; revision=29516
2007-10-11 20:02:58 +00:00
Johannes Anderwald
3a037045bf - update shell32_ros.diff
svn path=/trunk/; revision=29514
2007-10-11 19:43:22 +00:00
Johannes Anderwald
afef41e793 - update doc
svn path=/trunk/; revision=29511
2007-10-11 19:33:05 +00:00
Johannes Anderwald
8b2f309588 - forgot one file
svn path=/trunk/; revision=29510
2007-10-11 19:26:16 +00:00
Johannes Anderwald
01a2631183 - add checkAlarms function
- this function will be used to determine wether expiration alarms are active. If qemu dies or terminates unexpectly, this function will check if it was before an timeout. In that case alarms will be active. Note: if qemu is killed purposely, OsSupport::cancelAlarms must be called to prevent automatic termination of sysreg process

svn path=/trunk/; revision=29509
2007-10-11 18:41:39 +00:00
Johannes Anderwald
8e11e74890 - fix build
svn path=/trunk/; revision=29508
2007-10-11 18:25:00 +00:00
Johannes Anderwald
7f50b9b826 - sync rest of shell32 excluding resources to wine
svn path=/trunk/; revision=29507
2007-10-11 18:07:01 +00:00
Johannes Anderwald
b817f334af Jonathan Ernst <jonathan@ernstfamily.ch>
- Update the address of the Free Software Foundation.
Stefan Leichter <Stefan.Leichter@camline.com>
- Fix the file version string of the version resource.

svn path=/trunk/; revision=29506
2007-10-11 17:07:58 +00:00
Colin Finck
0e152e82fb Change "base" to "installbase" for the <bootstrap> element of "green.rbuild" (the older syntax is no longer valid)
See issue #2706 for more details.

svn path=/trunk/; revision=29505
2007-10-11 16:06:11 +00:00
Daniel Reimer
1a73e268ff We need a rule that updating a RC File forces the dev to do it on ALL Files, not only the English one. German one missed two Dialogs again.
Updated the German RC File of shell32.dll and fixed a typo in the English one. (Nice Work with your new Dialogs For Shortcuts and co, Johannes :-))

svn path=/trunk/; revision=29504
2007-10-11 16:01:18 +00:00
Aleksey Bragin
bf70fa45ea - Insert back the "ugly hack for cut&paste files" (removed by 29499 commit).
svn path=/trunk/; revision=29503
2007-10-11 14:47:10 +00:00
Ged Murphy
07ed4d1ce3 use ChangeListViewText to fill out the service info
svn path=/trunk/; revision=29502
2007-10-11 12:21:06 +00:00
Ged Murphy
8c49001628 only run the change code when we have the changed struct to work with.
svn path=/trunk/; revision=29501
2007-10-11 12:00:19 +00:00
Ged Murphy
d8f1cef2f6 improve the button states in relation to the service
svn path=/trunk/; revision=29500
2007-10-11 11:09:39 +00:00
Johannes Anderwald
12be971541 Dmitry Timoshkov <dmitry@codeweavers.com>
- Switch to using 'long' for INT_PTR type for 64-bit compatibility.
Andrew Talbot <Andrew.Talbot@talbotville.com>
- Exclude unused headers.
Hans Leidekker <hans@it.vu.nl>
- Win64 printf format warning fixes.
James Hawkins <truiken@gmail.com>
- Remove redundant NULL checks before SHFree.
Jonathan Ernst <jonathan@ernstfamily.ch>
- Update the address of the Free Software Foundation.
------------------------
- readd ReactOS changes (the properties menu item was removed, readd it + code to show properties dialogs)

svn path=/trunk/; revision=29499
2007-10-11 10:48:31 +00:00
Hervé Poussineau
3e278e062e Remove unneeded comment (__REACTOS__ is always defined)
svn path=/trunk/; revision=29498
2007-10-11 10:47:25 +00:00
Christoph von Wittich
a49156cbcc disable redrawing of the ListView window before updating the service list
svn path=/trunk/; revision=29497
2007-10-11 10:30:43 +00:00
Ged Murphy
f3d656d276 a better fix for bug 2519
svn path=/trunk/; revision=29496
2007-10-11 10:29:02 +00:00
Hervé Poussineau
8596afd334 Add list of source files in generated makefile
svn path=/trunk/; revision=29495
2007-10-11 10:18:47 +00:00
Hervé Poussineau
54eae92953 Do not change dependancy root directory if not needed
svn path=/trunk/; revision=29494
2007-10-11 10:18:03 +00:00
Christoph von Wittich
aedfd39a7f Disabled service has start button enabled (patch by gabrielilardi at hotmail dot it) - modified by myself (HeapFree, formatting)
See issue #2519 for more details.

svn path=/trunk/; revision=29493
2007-10-11 10:15:46 +00:00
Johannes Anderwald
7d51d9fd56 Jonathan Ernst <jonathan@ernstfamily.ch>
- Update the address of the Free Software Foundation.
Andrew Talbot <Andrew.Talbot@talbotville.com>
- Exclude unused headers.
Aric Stewart <aric@codeweavers.com>
- Update the debug functions to handle Unicode value pidl.
- Add _ILIsUnicode as a simple pidl test.
Michael Stefaniuc <mstefani@redhat.de>
- The Data1 member of the GUID struct needs to be an unsigned int too for Win64 compatibility.
Hans Leidekker <hans@it.vu.nl>
- Win64 printf format warning fixes.

svn path=/trunk/; revision=29492
2007-10-11 10:13:05 +00:00
Johannes Anderwald
a262dfe3cb Mikoaj Zalewski <mikolaj@zalewski.pl>
- Make the shell view control Unicode
- Change some more ANSI calls to Unicode

svn path=/trunk/; revision=29491
2007-10-11 10:00:11 +00:00
Ged Murphy
e45052754a remove some test code which shouldn't have been added.
svn path=/trunk/; revision=29490
2007-10-11 09:15:14 +00:00
Ged Murphy
3a5583c86f add some old code I had floating around. no real in functionality
svn path=/trunk/; revision=29489
2007-10-11 09:07:38 +00:00
Johannes Anderwald
4bcdb4d441 Andrew Talbot <Andrew.Talbot@talbotville.com>
- Exclude unused headers.
Hans Leidekker <hans@it.vu.nl>
- Add a stub implementation for SHMapIDListToImageListIndexAsync.
Jonathan Ernst <jonathan@ernstfamily.ch>
- Update the address of the Free Software Foundation.
Martin Fuchs <martin-fuchs@gmx.net>
- Fix folder icon index when read from registry.
- Change "DWORD dwNr" into "int icon_idx" at several places.
-----------------------------------------
ReactOS specific:
- PrivateExtractIconW is an undocumented user32 function. Dynamically get the function with GetProcAddress at runtime (readd)

svn path=/trunk/; revision=29488
2007-10-11 08:51:11 +00:00
Johannes Anderwald
7d516124e5 --------------------------------------------------
shfldr_mycomp.c:
Rob Shearman <rob@codeweavers.com>
Return Unicode strings from all of the IShellFolder::GetDisplayNameOf functions in not running in Win9x mode.
Hans Leidekker <hans@it.vu.nl>
shell32: Win64 printf format warning fixes.
James Hawkins <truiken@gmail.com>
janitorial: Remove redundant NULL checks before SHFree.
Robert Shearman <rob@codeweavers.com>
shell32: Convert ISF_MyComputer_fnGetDisplayNameOf to Unicode.
--------------------------------------------------
- ReactOS specific:
- return always in unicode

svn path=/trunk/; revision=29487
2007-10-10 23:49:42 +00:00
Peter Ward
3ae0570df2 - Two small Ldr cleanup patches (ntdll and kernel32) by: Mike Nordell
svn path=/trunk/; revision=29486
2007-10-10 23:14:20 +00:00
Johannes Anderwald
fd1c983af4 -----------------------------------------------------
autocomplete.c:
Andrew Talbot <Andrew.Talbot@talbotville.com>
Exclude unused headers Constify some variables.
-----------------------------------------------------
dde.c:
Jonathan Ernst <jonathan@ernstfamily.ch>
Update the address of the Free Software Foundation.
-----------------------------------------------------
dragdrophelper.c:
Jonathan Ernst <jonathan@ernstfamily.ch>
Update the address of the Free Software Foundation.
Hans Leidekker <hans@it.vu.nl>
Win64 printf format warning fixes.
-----------------------------------------------------
enumidlist.c:
Jonathan Ernst <jonathan@ernstfamily.ch>
Update the address of the Free Software Foundation.
Hans Leidekker <hans@it.vu.nl>
Win64 printf format warning fixes.
-----------------------------------------------------
enumidlist.h:
Jonathan Ernst <jonathan@ernstfamily.ch>
Update the address of the Free Software Foundation.
-----------------------------------------------------
shellreg.c:
Andrew Talbot <Andrew.Talbot@talbotville.com>
Exclude unused headers.
Detlef Riekenberg <wine.dev@web.de>
Implement SHRegQueryValueA with RegQueryValueA.
Jonathan Ernst <jonathan@ernstfamily.ch>
Update the address of the Free Software Foundation.
-----------------------------------------------------
shellstring.c:
Jonathan Ernst <jonathan@ernstfamily.ch>
Update the address of the Free Software Foundation.
Hans Leidekker <hans@it.vu.nl>
Win64 printf format warning fixes.
Andrew Talbot <Andrew.Talbot@talbotville.com>
Exclude unused headers.
-----------------------------------------------------
shlfsbind.c
Jonathan Ernst <jonathan@ernstfamily.ch>
Update the address of the Free Software Foundation.
Hans Leidekker <hans@it.vu.nl>
shell32: Win64 printf format warning fixes.
Andrew Talbot <Andrew.Talbot@talbotville.com>
shell32: Exclude unused headers.
-----------------------------------------------------
shlmenu.c:
Dmitry Timoshkov <dmitry@codeweavers.com>
Switch to using 'long' for INT_PTR type for 64-bit compatibility.
Andrew Talbot <Andrew.Talbot@talbotville.com>
Exclude unused headers.
Hans Leidekker <hans@it.vu.nl>
Win64 printf format warning fixes.
James Hawkins <truiken@gmail.com>
janitorial: Remove redundant NULL checks before SHFree.
Francois Gouget <fgouget@free.fr>
Fix spelling of a local variable.
Jonathan Ernst <jonathan@ernstfamily.ch>
Update the address of the Free Software Foundation.
-----------------------------------------------------
shpolicy.c:
Dmitry Timoshkov <dmitry@codeweavers.com>
Make some data static and const.
Jonathan Ernst <jonathan@ernstfamily.ch>
Update the address of the Free Software Foundation.

svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
Johannes Anderwald
a0e410976f sync to wine head
Andrew Talbot <Andrew.Talbot@talbotville.com>
Exclude unused headers.
Mikoaj Zalewski <mikolaj@zalewski.pl>
autocomplete: Don't use sel uninitialized.

svn path=/trunk/; revision=29484
2007-10-10 21:52:22 +00:00
Johannes Anderwald
5bbed73d42 - fix RegLoadMUIStringA|W prototype
svn path=/trunk/; revision=29483
2007-10-10 21:19:05 +00:00
Johannes Anderwald
3d621cf578 - fix RegLoadMUIStringA|W prototype
svn path=/trunk/; revision=29482
2007-10-10 21:18:59 +00:00
Johannes Anderwald
96f724824c - add ntquery.h from Wine (rev 1.3)
svn path=/trunk/; revision=29481
2007-10-10 21:03:27 +00:00
Johannes Anderwald
8dd3300304 - add __MINGW_NOTHROW macro (required for shell32 sync used in dirent.h)
svn path=/trunk/; revision=29480
2007-10-10 20:53:47 +00:00
Aleksey Bragin
5257ae8196 - Copy kernel's IDT entries to the IDT we've got from the bootloader. Fixes boot-process initiated by ntldr-compatible loaders.
svn path=/trunk/; revision=29477
2007-10-10 12:39:54 +00:00
Hervé Poussineau
336b29de42 Cleanup the LinkerScript class and use it
Patch by Marc Piulachs, marc dot puilachs at codexchange dot net
See issue #2721 for more details.

svn path=/trunk/; revision=29476
2007-10-10 08:44:45 +00:00
Hervé Poussineau
bc653c4422 Do not skip executable name, it is not sent to WinMain command line argument
svn path=/trunk/; revision=29475
2007-10-09 19:01:12 +00:00
Daniel Reimer
f187392e6c This should fix the build
svn path=/trunk/; revision=29474
2007-10-09 18:37:48 +00:00
Daniel Reimer
a647e4e19c Try to remove the old wordpad and prepare fr the new one
svn path=/trunk/; revision=29473
2007-10-09 18:35:38 +00:00
Daniel Reimer
2165bf4b96 Backup WordPad to RosApps
svn path=/trunk/; revision=29472
2007-10-09 18:25:19 +00:00
Aleksey Bragin
414b4db8ac Mike Nordell <tamlin>
- Add two checks for infinite loops. The latter gets triggered in some cases, a memory overwrite is suspected, or a race condition.

svn path=/trunk/; revision=29471
2007-10-09 17:00:11 +00:00
Ged Murphy
461c0ad2d1 add wine's wordpad as the default
svn path=/trunk/; revision=29469
2007-10-09 09:00:56 +00:00
Hervé Poussineau
d620fa11c7 Fix indentation
svn path=/trunk/; revision=29468
2007-10-09 09:00:04 +00:00
Ged Murphy
66c3c85e36 Add a much more complete wordpad from one of Wine's SOC projects
svn path=/trunk/; revision=29467
2007-10-09 09:00:02 +00:00
Hervé Poussineau
8b17e00a0e Patch by Carlo Bramini, carlo dot bramix at libero dot it
Fixes for non unicode build
See issue #2711 for more details.

svn path=/trunk/; revision=29466
2007-10-09 08:53:25 +00:00
Hervé Poussineau
c57a4482c2 Put .asm files at the end of the module
See issue #2702 for more details.

svn path=/trunk/; revision=29465
2007-10-09 07:10:05 +00:00
Johannes Anderwald
719694a6b2 - use -nographic option
svn path=/trunk/; revision=29464
2007-10-08 22:08:29 +00:00
Johannes Anderwald
bb471e5852 - fix linux build for build server trial #2
svn path=/trunk/; revision=29463
2007-10-08 21:59:49 +00:00
Johannes Anderwald
cc2d1bffe8 -include errno.h
- temporarly deactivate -vnc 0 option

svn path=/trunk/; revision=29462
2007-10-08 21:38:14 +00:00
Johannes Anderwald
596003e53b - remove stdio debugging (not efficient and unused)
- call mkfifo for randomly created named pipes (linux only)
- sysreg hangs in 2nd stage due to the -vnc 0 option


svn path=/trunk/; revision=29460
2007-10-08 21:22:57 +00:00
Christoph von Wittich
d576ff0223 -fix compilation with msvc
-fix some memory leaks

svn path=/trunk/; revision=29459
2007-10-08 19:18:42 +00:00
Aleksey Bragin
73b6c28cf8 Dmitry Chapyshev <lentind@yandex.ru>
- Modify/Remove action: Wait for the process completion and only then become active again (like Windows' AppWiz does)
- Move Updates to another tab
- Move all include directives to appwiz.h
- Add context menu for applications list
- Slightly change this applet's design
- Add an icon for ReactOS setup and Update tabs
- Add a working Download! button. This button is active only if Download!.exe exists in system32 directory when appwiz.cpl starts
- Other small changes

svn path=/trunk/; revision=29458
2007-10-08 15:56:31 +00:00
Aleksey Bragin
db598dfdbb - Don't try to free a pointer if it was not allocated.
svn path=/trunk/; revision=29456
2007-10-08 12:37:44 +00:00
Hervé Poussineau
c736d81fff Fix rgenstat compilation
svn path=/trunk/; revision=29455
2007-10-08 11:19:46 +00:00
Johannes Anderwald
e4fa627016 - fix linux compilation
svn path=/trunk/; revision=29454
2007-10-08 09:28:04 +00:00
Johannes Anderwald
6cd6fc2c8c - randomize named pipe name
- remove hardcoded path in named pipe reader class

svn path=/trunk/; revision=29453
2007-10-08 09:01:33 +00:00
Johannes Anderwald
1d1547fcc3 - forgot one thing
svn path=/trunk/; revision=29452
2007-10-08 08:17:43 +00:00
Johannes Anderwald
8fe2c38364 - remove non required specialization
svn path=/trunk/; revision=29451
2007-10-08 00:22:39 +00:00
Johannes Anderwald
59f7546716 - remove unicode support (it was mess, a few places only accepting char and then another using wchar compatibel)
- rewrite line extraction (currently if'0)
- add Wine gettimeofday implementation (currently if'0)
- apply sources changes to SymbolFile class
- remove unicode support class
- fix a bug in the createProcess version for windows hosts which randomly led to invalid boot hdd error messages

svn path=/trunk/; revision=29450
2007-10-08 00:18:01 +00:00
Christoph von Wittich
66b7980abf fix building with VS2005
svn path=/trunk/; revision=29448
2007-10-07 23:37:15 +00:00
Christoph von Wittich
b958e36122 used autoformat in MSVC to get the code readable again
svn path=/trunk/; revision=29447
2007-10-07 22:51:05 +00:00
Christoph von Wittich
e907d2737c fix some memory leaks
svn path=/trunk/; revision=29446
2007-10-07 22:43:18 +00:00
Johannes Anderwald
616c7f2be3 - improve error checking
- fix a memory leak

svn path=/trunk/; revision=29445
2007-10-07 20:17:54 +00:00
Johannes Anderwald
44be754751 - improve debugging
svn path=/trunk/; revision=29444
2007-10-07 20:05:27 +00:00
Colin Finck
911a564d4b Some Bulgarian translation updates by Ñòàíåâ (sstpr AT narod DOT ru)
See issue #2728 for more details.

svn path=/trunk/; revision=29443
2007-10-07 19:19:27 +00:00
Hervé Poussineau
14a4a98b96 Do not delete section extension when storing it in the structure
See issue #1147,1845 for more details.

svn path=/trunk/; revision=29441
2007-10-07 17:13:06 +00:00
Aleksey Bragin
2012ccfc2f - Get rid of incompatible strtoull export in msvcrt.dll
- Make dbghelp.dll use strtoui64 instead. Another solution would be to add it to libwine, but it will make code duplication even worse (strtoull is already implemented in two places).

svn path=/trunk/; revision=29440
2007-10-07 16:42:10 +00:00
Colin Finck
69fd113200 Updated italian translations for access.cpl and ncpa.cpl by Paolo Devoti (devotip AT tiscali DOT it)
See issue #2727 for more details.

svn path=/trunk/; revision=29439
2007-10-07 15:38:04 +00:00
Hervé Poussineau
1cf5e31c3b Oops, forgot to save the file before committing ;)
svn path=/trunk/; revision=29435
2007-10-07 12:29:46 +00:00
Hervé Poussineau
147f7c934c Add mingw and msvcrt implicit libraries only if it is a Win32 target
svn path=/trunk/; revision=29434
2007-10-07 12:28:18 +00:00
Hervé Poussineau
c24dcf1da0 ntdll.dll is a native dll
svn path=/trunk/; revision=29433
2007-10-07 12:14:02 +00:00
Christoph von Wittich
278c4a1b03 fix a resource leak
svn path=/trunk/; revision=29432
2007-10-07 00:43:43 +00:00
Christoph von Wittich
25cde1b38b -fix a resource leak and two memory leaks
svn path=/trunk/; revision=29431
2007-10-07 00:21:58 +00:00
Christoph von Wittich
8565a1aab5 -fix a warning in charmap.c
-use LocalFree when memory was allocated by LocalAlloc

svn path=/trunk/; revision=29430
2007-10-07 00:03:57 +00:00
Hervé Poussineau
40fa2a585a Do not call DllInstall, it is a stub
See issue #2719 for more details.

svn path=/trunk/; revision=29428
2007-10-06 21:13:48 +00:00
Timo Kreuzer
2ddf628afc add missing gdi object type
svn path=/trunk/; revision=29427
2007-10-06 21:13:24 +00:00
Christoph von Wittich
f57c7260c2 replace non-existant SUBLANG_PORTUGUESE_PORTUGAL with SUBLANG_PORTUGUESE
svn path=/trunk/; revision=29425
2007-10-06 20:06:11 +00:00
Hervé Poussineau
1962ee8f23 Do not define structures twice
svn path=/trunk/; revision=29424
2007-10-06 19:28:04 +00:00
Hervé Poussineau
340b2adbee Do not define __REACTOS__ twice
svn path=/trunk/; revision=29423
2007-10-06 19:18:55 +00:00
Peter Ward
b2a56ac32a - Fix build.
svn path=/trunk/; revision=29422
2007-10-06 19:13:15 +00:00
Christoph von Wittich
e45ac511e7 remove double controls from the resource
svn path=/trunk/; revision=29421
2007-10-06 18:32:45 +00:00
Hervé Poussineau
388fa4820c Rename _REACTOS_ to __REACTOS__
svn path=/trunk/; revision=29420
2007-10-06 18:04:03 +00:00
Ged Murphy
1beed38801 fix painting of alpha channels in 32bpp icons onto windows/dialogs
svn path=/trunk/; revision=29419
2007-10-06 17:59:21 +00:00
Aleksey Bragin
52c172c002 - Fix incorrect DPRINT.
svn path=/trunk/; revision=29418
2007-10-06 16:04:21 +00:00
Aleksey Bragin
764cda7527 - Fix build.
svn path=/trunk/; revision=29417
2007-10-06 14:35:39 +00:00
Aleksey Bragin
3f6b60365b Dmitry Chapyshev <lentind@yandex.ru>
- Add some more dialogs to input.dll, and even some functionality, but it still needs a lot of work.
- Add input.dll and systeminfo.exe to the bootcd

svn path=/trunk/; revision=29416
2007-10-06 11:47:06 +00:00
Aleksey Bragin
0fb55f0db8 Dmitry Chapyshev <lentind@yandex.ru>
- Fix a typo in the russian translation of taskmgr.
- Improve explorer icons (as usual, remove 4bits, add 16bits, and very slightly edit).
- Add some missing icons to setupapi.dll.

svn path=/trunk/; revision=29415
2007-10-06 11:04:31 +00:00
Aleksey Bragin
bad5a95a60 Dmitry Chapyshev <lentind@yandex.ru>
- Update the icons for sysdm and netid.

svn path=/trunk/; revision=29414
2007-10-06 10:55:13 +00:00
Aleksey Bragin
6f366e58e3 Dmitry Chapyshev <lentind@yandex.ru>
- Add russian translation to clb.
- Regedit's icons: remove 4bit icons, add 16bit icons.

svn path=/trunk/; revision=29413
2007-10-06 10:53:22 +00:00
Aleksey Bragin
62e6f7492d Dmitry Chapyshev <lentind@yandex.ru>
- Add a temporary icon (should be changed to a better one), so that it's displayed in the taskbar and window title.

svn path=/trunk/; revision=29412
2007-10-06 10:50:51 +00:00
Aleksey Bragin
ab9b5860ed Dmitry Chapyshev <lentind@yandex.ru>
- Fix a typo in russian translation of intl.cpl

svn path=/trunk/; revision=29411
2007-10-06 10:46:42 +00:00
Art Yerkes
289ae6c346 Added to trunk.
svn path=/trunk/; revision=29410
2007-10-06 08:34:33 +00:00
Art Yerkes
a21398057a Flipped increment/decrement. Noticed by encoded.
svn path=/trunk/; revision=29408
2007-10-06 08:29:22 +00:00
Art Yerkes
0abf169695 All remaining changes from the PPC branch. Not well tested yet. Many things
are indeed still stubs or WIP code.

Some people have been interested in helping out from some time and I'm sorry
I haven't been able to do this merge finally for a while.

svn path=/trunk/; revision=29407
2007-10-06 07:53:20 +00:00
Aleksey Bragin
9a2d4a0858 - Implement KiTrap19 handler (XMMI exceptions, mostly copied KiTrap7 handler and used mxcsr status word and exceptions there). There will be no weird 0xF BSODs anymore, however I need to investigate about exceptions masking.
- Dynamically enable it, if CPU supports XMMI (was already done in the kernel, but #if0-ed).

svn path=/trunk/; revision=29406
2007-10-06 07:22:59 +00:00
Aleksey Bragin
ac92ed539f - Fix an awful memory-overwrite bug. Buggy code written by Eugene Ingerman, 04-Aug-1988.
- Alex is awarded ReactOS Medal-of-Honour for the great achievement (fix of the oldest bug ever in ReactOS).

svn path=/trunk/; revision=29405
2007-10-05 20:46:25 +00:00
Aleksey Bragin
8d7e49ee86 - Those two are not needed anymore.
svn path=/trunk/; revision=29404
2007-10-05 20:40:29 +00:00
Johannes Anderwald
f341d8a8af - add missing definitions required for wine shell32
svn path=/trunk/; revision=29403
2007-10-05 20:33:03 +00:00
James Tabor
bd65efd9de No need to stop APC when looping.
svn path=/trunk/; revision=29401
2007-10-05 18:16:34 +00:00
Aleksey Bragin
8206cd0b71 - Don't allocate pool with a NULL tag, use ExAllocatePool instead.
svn path=/trunk/; revision=29400
2007-10-05 17:17:49 +00:00
Aleksey Bragin
7b9b1a8536 - Free BusInterface only if it was really alloc'd
- Remove svn:needs-lock property from this [stub]-driver

svn path=/trunk/; revision=29399
2007-10-05 17:13:53 +00:00
Aleksey Bragin
5e5a42e89b - Fix a mistake, led to usage of unitialized memory and then freeing it.
svn path=/trunk/; revision=29398
2007-10-05 17:08:23 +00:00
Johannes Anderwald
5e3641128f - fix english SHELL_EXTENDED_SHORTCUT_DLG resource dialog
- add runas dialog resource definition (not yet used)
- store runas settings in shortcut properties

svn path=/trunk/; revision=29397
2007-10-05 15:12:25 +00:00
Aleksey Bragin
a6b4148654 - Fix DBG=0 build
svn path=/trunk/; revision=29396
2007-10-05 12:07:50 +00:00
Aleksey Bragin
9fe1e6e1d3 - Fix a bug with wrong handling of an ALT key pressed together with a mouse click.
svn path=/trunk/; revision=29395
2007-10-05 09:37:46 +00:00
James Tabor
853d34afaf Fixed an old typo bug from rev 3450 by dwelch. Add support for DCX_NORESETATTRS and fixed up IntWindowFromDC.
svn path=/trunk/; revision=29394
2007-10-05 06:47:42 +00:00
Johannes Anderwald
fe4f628972 - implement create shortcut wizard (works currently only for files)
svn path=/trunk/; revision=29393
2007-10-04 23:51:10 +00:00
Johannes Anderwald
327e65fe96 - fix a bug and warning
svn path=/trunk/; revision=29392
2007-10-04 20:16:11 +00:00
Aleksey Bragin
b16c028e4f - Update two doxyfiles to the newest version and fix paths. Many other doxyfiles remain...
svn path=/trunk/; revision=29391
2007-10-04 17:48:47 +00:00
Aleksey Bragin
e82583fbe8 - Comments, debug prints translation into readable english.
svn path=/trunk/; revision=29389
2007-10-04 08:47:13 +00:00
Aleksey Bragin
a030c28a82 - Change strange greatlord-like sentences to a short and clear one.
svn path=/trunk/; revision=29388
2007-10-04 08:30:01 +00:00
Aleksey Bragin
5cf9e02b1e - Don't try to copy an uninitialized bitmap's contents (it worked only because it was zeroed, and thus zero-size RtlCopy and ExFreePool(NULL)).
svn path=/trunk/; revision=29387
2007-10-03 20:58:44 +00:00
Gregor Brunmar
79ce62a7c3 Fixed bug 2555 (Calendar window does not close automaticaly)
See issue #2555 for more details.

svn path=/trunk/; revision=29386
2007-10-03 20:47:59 +00:00
Aleksey Bragin
6d5d5b6293 - Fix ExAllocatePoolWithTag with a 0 tag.
svn path=/trunk/; revision=29385
2007-10-03 20:30:41 +00:00
Gregor Brunmar
7d65442299 Added context menu on right click in treeviews
svn path=/trunk/; revision=29384
2007-10-03 19:45:39 +00:00
Gregor Brunmar
62cb1ae6bf * Fixed bug 2456 (propsheet's apply button enabling at the wrong time)
See issue #2456 for more details.

svn path=/trunk/; revision=29383
2007-10-03 19:34:34 +00:00
Johannes Anderwald
55df7a560f - deactivate signal handler for linux
svn path=/trunk/; revision=29382
2007-10-03 17:53:03 +00:00
Aleksey Bragin
d2687b4de8 Dmitry Chapyshev <lentind@yandex.ru>
- Change listbox to listview
- Draw icons
- Add a find bar (it works, but will work better in future)
- "Install" button moved to a separate tab, also buttons "Download!" and "Find in the Internet" are added there too
- Applet's width increased
- "Modify/Remove" button will become active only when an application is selected

svn path=/trunk/; revision=29381
2007-10-03 17:50:43 +00:00
Johannes Anderwald
d4891b7759 - fix linux build
svn path=/trunk/; revision=29380
2007-10-03 17:38:18 +00:00
Christoph von Wittich
9dec8191db fix some of the build errors
svn path=/trunk/; revision=29379
2007-10-03 16:52:31 +00:00
Hervé Poussineau
5fecef05ea Add back windres, it is still used after wrc invocation
svn path=/trunk/; revision=29378
2007-10-03 14:17:46 +00:00
Hervé Poussineau
09ab02f6da Remove usewrc attribute in rbuild files ; wrc should be able to compile all resources
svn path=/trunk/; revision=29377
2007-10-03 14:09:45 +00:00
Hervé Poussineau
5c98cc37b5 Remove hack added in r28961. It seems that wrc works well now.
svn path=/trunk/; revision=29376
2007-10-03 14:02:04 +00:00
Hervé Poussineau
69a12a6870 Implement NdisMWriteLogData, enough to see something
svn path=/trunk/; revision=29375
2007-10-03 13:48:51 +00:00
Aleksey Bragin
d3048bf9fd - Silence badly placed debug message. DPRINT1 equals FIXME and ERR, but not TRACE!
svn path=/trunk/; revision=29374
2007-10-03 12:01:13 +00:00
Aleksey Bragin
a68ed2f38a - Use IopLoanUnloadDriver() for calling unload routine too, in the context of system process, when needed.
svn path=/trunk/; revision=29373
2007-10-03 11:54:31 +00:00
Hervé Poussineau
d0ae8b7806 Try to fix Linux build
svn path=/trunk/; revision=29372
2007-10-03 11:24:56 +00:00
Hervé Poussineau
254bdce1b8 Support custom C and C++ compilers, by variables HOST_CC, HOST_CPP, TARGET_CC and TARGET_CPP
Simplify usage of ROS_PREFIX variable

svn path=/trunk/; revision=29371
2007-10-03 11:12:25 +00:00
Aleksey Bragin
2ea98ca374 - NtLoadDriver APIs refactor/improvent:
* Move loading of a driver to the common (in future) routine IopLoadUnloadDriver (name taken from http://wasm.ru/forum/viewtopic.php?pid=166891).
 * Fix a bug: NtLoadDriver should always load drivers in a context of the system process, explanation here: http://www.osronline.com/showthread.cfm?link=114687
 * Reformat NtLoadDriver's code.

svn path=/trunk/; revision=29370
2007-10-03 10:17:04 +00:00
Hervé Poussineau
597b822c7e Separe right code from hack
svn path=/trunk/; revision=29369
2007-10-03 08:28:16 +00:00
Aleksey Bragin
2a55c8944c - Fix a typo in shell32 resources.
See issue #2717 for more details.

svn path=/trunk/; revision=29368
2007-10-03 08:20:13 +00:00
James Tabor
dece4b531e Move DCX_EXCLUDEUPDATE to the psdk where it belongs.
svn path=/trunk/; revision=29367
2007-10-03 04:08:22 +00:00
James Tabor
fbf23a8f57 Add dprint to debug the change to ownership for shutdown. Also free fake save DC if all window DCE are free.
svn path=/trunk/; revision=29366
2007-10-03 00:39:20 +00:00
Daniel Reimer
457f47ba2e You forgot something in your Translation janderwald.
svn path=/trunk/; revision=29365
2007-10-02 23:48:56 +00:00
Johannes Anderwald
8146f33427 - start implementing create shortcut wizard
svn path=/trunk/; revision=29364
2007-10-02 23:34:00 +00:00
Johannes Anderwald
1b282a3cb5 - remove small hack
- enhance debug statement
- port the drive general / tools property dialog to all languages (english translation)

svn path=/trunk/; revision=29363
2007-10-02 22:09:12 +00:00
Daniel Reimer
f15bfece56 Bug 2716: Italian translation for Logoff (folleinvasato@yahoo.it)
svn path=/trunk/; revision=29362
2007-10-02 21:04:32 +00:00
Daniel Reimer
8ece61c8bf Bug 2708: Ukrainian translation update (temarez@yandex.ru)
Bug 2712: Lithuanian translation (cman@cman.us)
Bug 2713: Italian translation for FIND (folleinvasato@yahoo.it)
Bug 2714: Italian translation for MORE (folleinvasato@yahoo.it)

svn path=/trunk/; revision=29361
2007-10-02 20:50:52 +00:00
Aleksey Bragin
5535e33b64 - Temporary revert 29342.
See issue #2715 for more details.

svn path=/trunk/; revision=29360
2007-10-02 20:09:31 +00:00
Johannes Anderwald
2a4148f4c2 - enable cleanup button
- start cleanmgr process on request

svn path=/trunk/; revision=29359
2007-10-02 18:03:15 +00:00
Johannes Anderwald
00b7f338fa - implement drive extra dialog
svn path=/trunk/; revision=29358
2007-10-02 17:41:48 +00:00
Johannes Anderwald
5eef84319c - remove superflious calls to sysreg
svn path=/trunk/; revision=29357
2007-10-02 16:10:11 +00:00
Johannes Anderwald
86ff6bfeaa - perform all boot tests in one launch of sysreg
- check for timeouts in windows version to see if qemu has hung

svn path=/trunk/; revision=29356
2007-10-02 16:09:29 +00:00
Johannes Anderwald
384ad5f156 - draw drive dialog static controls
- use rtl library for calculating [free|used] diskspace 
- add german resource strings

svn path=/trunk/; revision=29355
2007-10-02 16:03:48 +00:00
Hervé Poussineau
c5921b158e Simplify code.
Spotted by Pablo Menichini, pablo at menichini dot com dot ar

svn path=/trunk/; revision=29354
2007-10-02 14:38:14 +00:00
Hervé Poussineau
ba13c6e131 Support "i386" as an alternative name for cdrom directory
svn path=/trunk/; revision=29353
2007-10-02 12:23:40 +00:00
Hervé Poussineau
f649143b56 Do not hardcode cdrom directory
svn path=/trunk/; revision=29352
2007-10-02 12:16:45 +00:00
Hervé Poussineau
68955155b7 Add a default debug channel
svn path=/trunk/; revision=29351
2007-10-02 10:57:00 +00:00
James Tabor
4b10f0559c Fix NtUserGetIconSize prototype.
svn path=/trunk/; revision=29350
2007-10-02 00:56:04 +00:00
Johannes Anderwald
2ec6c16001 - improve drive property dialog a bit
svn path=/trunk/; revision=29349
2007-10-02 00:07:22 +00:00
James Tabor
fb4bacbb5f Win32k/User32:
- Moved NtUserGetCursorIconInfo to NtUserGetIconInfo, update header.
- GetIconInfo is correctly called now.

svn path=/trunk/; revision=29348
2007-10-01 23:15:02 +00:00
Ged Murphy
e05e9dee74 remove the bitmap stuff, we won't be using this for now
svn path=/trunk/; revision=29347
2007-10-01 22:53:09 +00:00
Johannes Anderwald
ae3adacf6f - add GUID_DEVCLASS_DISKDRIVE
svn path=/trunk/; revision=29346
2007-10-01 22:40:15 +00:00
Johannes Anderwald
408fd9b4e8 - remove previously added DRIVE_SHARE_DLG and DRIVE_CONTINGENT_DLG
- the drive share dialog is implemented in rshx32.dll
- the contigent dialog is implemented in dskquoui.dll
- start implementing german general drive dialog

svn path=/trunk/; revision=29345
2007-10-01 21:53:41 +00:00
Johannes Anderwald
108c1a9a60 - start implementing a few shell property dialogs (shelllink, file, drive) and corresponding shell objects (i.e. Desktop properties opens sysdm cpl) etc
svn path=/trunk/; revision=29344
2007-10-01 20:28:45 +00:00
Johannes Anderwald
07c26f24e6 - fix typo
svn path=/trunk/; revision=29343
2007-10-01 20:25:16 +00:00
Aleksey Bragin
fbf1e8f95e - Finally move MmInit1 to MmInitSystem where it should belong, since FreeLdr now properly sets up SharedUserData. (Thanks to Alex for the hint)
svn path=/trunk/; revision=29342
2007-10-01 20:24:01 +00:00
Martin Fuchs
dc3692a04f remove <alloca.h>
svn path=/trunk/; revision=29340
2007-10-01 20:00:24 +00:00
Hervé Poussineau
30a4afa744 Fix build
svn path=/trunk/; revision=29339
2007-10-01 19:54:37 +00:00
Martin Fuchs
b511687db0 update explorer/xmlstorage
svn path=/trunk/; revision=29338
2007-10-01 19:53:58 +00:00
Aleksey Bragin
9c40044087 - Forgot to hit "CTRL+S" in the editor :) (add a FIXME comment about small hack).
svn path=/trunk/; revision=29337
2007-10-01 19:12:09 +00:00
Hervé Poussineau
7d540cf035 Autosyncing with Wine HEAD
svn path=/trunk/; revision=29336
2007-10-01 19:09:53 +00:00
Hervé Poussineau
9a2b3ffc12 Prepare import of browseui.dll
svn path=/trunk/; revision=29335
2007-10-01 19:09:07 +00:00
Aleksey Bragin
843bb30324 - Almost completely fix the hack in IopParseDevice which was resulting in "FIXME: Broken Parse due to invalid DesiredAccess" messages, by changing some calls to IoGetDeviceObjectPointer to use FILE_READ_ATTRIBUTES instead of FILE_READ_DATA (so that the volume doesn't get mounted).
svn path=/trunk/; revision=29334
2007-10-01 18:04:42 +00:00
Hervé Poussineau
fcc8786305 Display error location when possible
svn path=/trunk/; revision=29333
2007-10-01 18:02:45 +00:00
Aleksey Bragin
fe7669dea4 - KeRosCaptureUserStackBackTrace is now created, which calls RtlWalkFrameChain with the user-mode flag, meaning that bugchecks finally show the user-mode stack again!
- KeRosDumpStackFrames is fixed so that if the EIP can't be found in a module list, it's still displayed (just without the module name). Previously the EIP would not be shown, resulting in code running on the heap/stack/somewhere else not being shown as part of the trace.

svn path=/trunk/; revision=29332
2007-10-01 17:58:49 +00:00
Ged Murphy
bb7d880c70 - half implement support for multiple monitors to desk.cpl
- people with more than one monitor can now use this applet in windows without it crashing

svn path=/trunk/; revision=29331
2007-10-01 15:44:53 +00:00
Hervé Poussineau
a4c436a3a3 Rename 'base' to 'installbase' for CdFile, InstallFile and Bootstrap
Patch by Marc Piulachs, marc dot piulachs at codexchange dot net
See issue #2706 for more details.

svn path=/trunk/; revision=29330
2007-10-01 14:19:27 +00:00
Ged Murphy
a6d6a2af53 use w3seek's control for single monitors displays
svn path=/trunk/; revision=29329
2007-10-01 13:54:54 +00:00
Ged Murphy
221f21c62a It's not pretty, but get desk.cpl building in msvc again.
svn path=/trunk/; revision=29328
2007-10-01 13:23:28 +00:00
Ged Murphy
ca1003310b remove some debug output I missed
svn path=/trunk/; revision=29327
2007-10-01 11:59:11 +00:00
Ged Murphy
ecf21c9be9 - partial rewrite of NtGdiGetDIBitsInternal
- wrap all usermode read/writes in seh
- make it more compatible with XP. We now pass all current GetDIBits tests and win32k tests

svn path=/trunk/; revision=29326
2007-10-01 11:53:31 +00:00
Aleksey Bragin
82a49a076e - Make VideoPortCreateSecondaryDisplay() return an error instead of success, so that driver does not assume the SecondaryDeviceExtension was created for it.
- Add one more DPRINT() to show the size of Device Extension miniport has asked for.
See issue #2672 for more details.

svn path=/trunk/; revision=29325
2007-10-01 10:18:53 +00:00
Hervé Poussineau
6f2304890d Disable debug output
svn path=/trunk/; revision=29324
2007-10-01 09:26:46 +00:00
Aleksey Bragin
3d024aa55b - Rewrite IntVideoPortGetProcAddress() implementation to use a lookup table instead of doing a wrong call to ZwQuerySystemInformation() which always returned STATUS_IMAGE_ALREADY_LOADED (it's supposed to return this). MS's VideoPort seems to do it in a similar way, because it doesn't import neither ZwQSI() nor MmLoadSystemImage().
- VMWare's video driver now calls VideoPortCreateSecondaryDisplay(), without much success though (it's unimplemented).

svn path=/trunk/; revision=29323
2007-10-01 08:14:24 +00:00
Hervé Poussineau
434c242504 Add NdisMIndicateReceivePacket
svn path=/trunk/; revision=29322
2007-10-01 07:34:43 +00:00
Timo Kreuzer
d17d86bf5b move last syscalls with wrong number of params into the correct position in the list, so all other syscalls are now xp compatible, at least according their number ;-)
svn path=/trunk/; revision=29321
2007-10-01 00:32:54 +00:00
Colin Finck
24335fd192 Updated slovak translations for desk.cpl, deskadp, deskmon and slayer by Mario Kacmar (kario AT szm DOT sk)
svn path=/trunk/; revision=29320
2007-09-30 21:04:49 +00:00
Timo Kreuzer
5bfdeba3f6 comment out checkbox for version display, as it isn't fully implemented
See issue #2323 for more details.

svn path=/trunk/; revision=29319
2007-09-30 17:48:41 +00:00
Colin Finck
a6c7ba1f4a Ensure that the "Name" column in Task-Manager will always be shown, so a Registry setting can't influence it.
This is necessary as the "Name" column is currently greyed out in the Column Settings dialog, so the user should have no possibility to change that.
Patch by Carlo Bramini (carlo DOT bramix AT libero DOT it)

See issue #2217 for more details.

svn path=/trunk/; revision=29318
2007-09-30 16:27:55 +00:00
Colin Finck
1ab0310d71 Oops, smartpdf was already in the rbuild file, deleted the other occurence now
svn path=/trunk/; revision=29317
2007-09-30 16:14:59 +00:00
Colin Finck
13ef403787 - Use unicode="yes", so a Unicode entry point can be used. This fixes the last linking issue and this way we also don't need the other UNICODE defines
- Add smartpdf to the "directory.rbuild" of rosapps (but commented out, as I'm not sure if it builds well for everyone now)

svn path=/trunk/; revision=29316
2007-09-30 16:01:17 +00:00
Klemens Friedl
c0ff78a908 two linking issues fixed
* _wstr_dup
* _FT_Get_X11_Font_Format (with a work-around)

one weird mingw linking issue remains:
* _WinMain@16


trunk/reactos/lib/3rdparty/mingw/main.c:73: undefined reference to `_WinMain@16'

svn path=/trunk/; revision=29315
2007-09-30 15:43:34 +00:00
Colin Finck
6d800c5f56 Apply the recent changes in the english desk.cpl resource file to all translations.
I only translated them to german, the new strings of the other translations still need to be translated.

svn path=/trunk/; revision=29314
2007-09-30 15:24:04 +00:00
Klemens Friedl
e596c423c0 removed extern-link function, for the meanwhile
3 linking issues left:
* _wstr_dup
* _WinMain@16
* _FT_Get_X11_Font_Format

svn path=/trunk/; revision=29313
2007-09-30 15:10:10 +00:00
Klemens Friedl
5ab6d7ba86 delete unnecessary files
svn path=/trunk/; revision=29312
2007-09-30 14:36:14 +00:00
Timo Kreuzer
925313a32b reorder libs in rbuild file, reducing the number of unresolved references to 4
svn path=/trunk/; revision=29310
2007-09-30 13:48:53 +00:00
Gregor Brunmar
1a98d2a214 Changes to regedit:
* Fixed updating tree view when renaming a key
* Fixed a tree view refresh bug
* Proper updating of the tree view when deleting keys

svn path=/trunk/; revision=29309
2007-09-30 13:31:44 +00:00
Gregor Brunmar
67dadefc81 * Unicode fixes to regedit
* Fixed bug 2494
Patch by Carlo Bramix [carlo (dot) bramix (at) libero (dot) it].
See issue #2494 for more details.

svn path=/trunk/; revision=29308
2007-09-30 13:23:31 +00:00
Hervé Poussineau
b067e31df6 Reference file handle according to previous mode
svn path=/trunk/; revision=29307
2007-09-30 13:11:36 +00:00
Magnus Olsen
c81402138a Adding a text file call notes.txt it is some werid thing I have have not yet figout how it works.
Add testcase for AddFontResourceA

svn path=/trunk/; revision=29306
2007-09-30 11:57:37 +00:00
Aleksey Bragin
96b8978ef3 - ObReferenceObjectByHandle/ObpReferenceProcessByHandle: Properly
return STATUS_INVALID_HANDLE if user-mode tries to reference a
kernel-mode handle.
- ObReferenceObjectByHandle: Properly validate process/thread access
rights before giving a reference to the caller.
- Fix definition of "SizeOfHandle" macro in the handle table
implementation. Fixes handle leaks at process rundown, handle
allocation, and problems with processes that use more than 512
handles.
- Remove checks for "VALID_INHERIT_FLAGS". These flags have nothing to
do with handle table entries and shouldn't appear in them. Please fix
callers if they're attempting to send inherit flags as access masks.
- Thanks to Alex! :)

svn path=/trunk/; revision=29304
2007-09-30 08:32:34 +00:00
Gregor Brunmar
2405beae7a Removed duplicate function entry. Thanks to encoded|lap for finding it.
svn path=/trunk/; revision=29303
2007-09-30 08:27:50 +00:00
Christoph von Wittich
b2a017b28a -cmdinput.c(168) - wrong constant is used. patch by YaronAharonson <yaron dot aharonson at gmail dot com>
See issue #2693 for more details.

svn path=/trunk/; revision=29301
2007-09-29 21:58:24 +00:00
Thomas Bluemel
b595efe8ae Send notification if another monitor is selected
svn path=/trunk/; revision=29300
2007-09-29 19:12:21 +00:00
Thomas Bluemel
e809e77341 Fix displaying the window caption height (SM_CYCAPTION includes SM_CYBORDER)
svn path=/trunk/; revision=29299
2007-09-29 18:28:45 +00:00
Thomas Bluemel
69f3c70b62 Allow altering the monitor arrangement control behavior flags
svn path=/trunk/; revision=29298
2007-09-29 18:04:40 +00:00
Colin Finck
bfdb1965c9 - Remove the unneeded "stdafx.cpp" file
- Remove the files I imported from the boot/freeldr/freeldr/math directory for adding 64-bit division support and use the -lgcc linker flag instead like it's done in ntoskrnl

svn path=/trunk/; revision=29297
2007-09-29 11:39:06 +00:00
Colin Finck
999056cc44 French translation updates by Pierre Schweitzer (heis_spiter AT hotmail DOT com)
Also a small fix for the english translation of "systeminfo"
See issue #2703 for more details.

svn path=/trunk/; revision=29296
2007-09-29 09:39:37 +00:00
Klemens Friedl
435a566751 SmartPDF - lightweight pdf viewer app for rosapps
* sumatrapdf - vendor import
* everything compiles (libjpeg, poppler, fitz, sumatrapdf)
* does NOT link

(remove the comment tags in the parent directory.rbuild file (rosapps dir) to build it)

svn path=/trunk/; revision=29295
2007-09-29 08:39:35 +00:00
Thomas Bluemel
a3e70b2317 Add ability to change/query single monitors and change/query the current selection in the monitor arrangement control
svn path=/trunk/; revision=29291
2007-09-29 06:22:44 +00:00
Thomas Bluemel
dd55de2665 Display monitor number and various bug fixes
svn path=/trunk/; revision=29290
2007-09-29 04:46:34 +00:00
Thomas Bluemel
c033319e24 Add a (not yet functional) control to allow the user to arrange the monitors
svn path=/trunk/; revision=29289
2007-09-29 02:32:14 +00:00
Colin Finck
a395a0f9df - Fix many warnings
- Fix a bug in id_dma.cpp on line 1261: This probably shouldn't be an assignment, but a check, otherwise all ATI chips will be treated as Silicon Image chips

svn path=/trunk/; revision=29288
2007-09-28 22:32:34 +00:00
Colin Finck
3991819297 uniata patch by encoded:
- Make building with QUEUE_STATISTICS possible
- Fix the best_c check. As best_c is a ULONG variable, you cannot check for -1

svn path=/trunk/; revision=29287
2007-09-28 22:00:52 +00:00
Colin Finck
8eab3a3ddb - Add uniata to the build (it's still not copied to the ISO image)
- Give it correct version information

svn path=/trunk/; revision=29286
2007-09-28 21:40:45 +00:00
Colin Finck
1fb1498412 Fix the uniata linking problems. Hope I did everything right :-D
I still disabled building the driver, so someone else can test it first.

- The i386.h, libgcc2.c, libgcc2.h, longlong.h and powerpc.h files were taken from the boot/freeldr/freeldr/math directory.
  They are used for 64-bit division support
- Created a directory "ros_glue" for all this stuff, moved the ros_glue.cpp file there
- Imported the three functions MOV_DD_SWP (the i486 version), MOV_DW2DD_SWP and MOV_DW_SWP from the misc_i386.cpp file of CrossNt into the ros_glue_asm.s file

svn path=/trunk/; revision=29285
2007-09-28 18:57:05 +00:00
Timo Kreuzer
e1b2e7a30f - header update
- add a resource

svn path=/trunk/; revision=29284
2007-09-28 17:26:29 +00:00
Daniel Reimer
dda7fa8fb8 Update r29282 to all rc files
svn path=/trunk/; revision=29283
2007-09-28 16:41:59 +00:00
Thomas Bluemel
f3163e398e Fix the dialog width
svn path=/trunk/; revision=29282
2007-09-28 16:35:34 +00:00
Timo Kreuzer
51c8156d1e update export list
svn path=/trunk/; revision=29281
2007-09-28 16:32:57 +00:00
Aleksey Bragin
604d7ae80f - Add ros_glue.cpp for implementing CrNt stubs.
- Start changing CrNt to actual ReactOS functions (no need for supporting different versions / importing CrossNT lib).

svn path=/trunk/; revision=29280
2007-09-28 12:35:41 +00:00
Hervé Poussineau
ae56de4440 Moved shared define to header file
Patch by Marc Piulachs, marc (dot) piulachs (at) codexchange.net
See issue #2700 for more details.

svn path=/trunk/; revision=29279
2007-09-28 12:17:19 +00:00
Hervé Poussineau
22006f87c9 RtlRandom is now part of NDK since r29254
svn path=/trunk/; revision=29278
2007-09-28 12:13:44 +00:00
Hervé Poussineau
e49bdbeea7 Fix compilation (but not linking!)
svn path=/trunk/; revision=29277
2007-09-28 11:39:34 +00:00
Aleksey Bragin
32ded795d7 - Reenable CrossNT stuff.
- Fix some #else BLAH / #endif BLAH warnings.
- Change SYSTEM_INFORMATION_CLASS structure by what we have in NDK (duplication for now).

svn path=/trunk/; revision=29276
2007-09-28 11:01:10 +00:00
Daniel Reimer
647e9bfc48 Forgot this translated file.
svn path=/trunk/; revision=29275
2007-09-28 10:49:35 +00:00
Hervé Poussineau
d4ddde1905 Fix some corner cases when processing <include> elements in .rbuild files
svn path=/trunk/; revision=29274
2007-09-28 10:46:10 +00:00
Daniel Reimer
3879561ab6 Bug 2699: Ukrainian translation update (temarez@yandex.ru)
German Translation Update too.

svn path=/trunk/; revision=29273
2007-09-28 10:03:38 +00:00
Hervé Poussineau
acc45ff7fe Add missing constants
svn path=/trunk/; revision=29272
2007-09-28 08:56:45 +00:00
Hervé Poussineau
b62929a83a Added history possibilities to right key
See issue #2248 for more details.

svn path=/trunk/; revision=29271
2007-09-28 08:51:04 +00:00
Hervé Poussineau
9f48a535f8 [FORMATTING] Replace spaces by tabs
No code change

svn path=/trunk/; revision=29270
2007-09-28 07:34:30 +00:00
Timo Kreuzer
88cd9f01f0 Add 5th parameter to NtUserFindWindowEx
svn path=/trunk/; revision=29269
2007-09-28 05:01:27 +00:00
Timo Kreuzer
51de002eae add a DPRINT1, stating that HvpWriteLog doesn't work atm
svn path=/trunk/; revision=29268
2007-09-28 04:56:40 +00:00
Timo Kreuzer
0b5bb79dc8 free memory before returning on failure.
Thanks to Yaron Aharonson (yaron.aharonson@gmail.com) for spotting this.
See issue #2694 for more details.

svn path=/trunk/; revision=29267
2007-09-28 04:17:13 +00:00
Thomas Bluemel
68a27d46e4 Allow changing the display refresh frequency
svn path=/trunk/; revision=29266
2007-09-28 04:07:26 +00:00
Timo Kreuzer
6a3291941f win32k compatibility update
- NtUserCreateWindowEx: add 15th parameter
- NtUserCreateWindowStation: add 7th parameter
- rename NtUserDestroyCursorIcon to NtUserDestroyCursor
- rename NtUserSetCursorIconContents to NtUserSetCursorContents
- implement about 50 NtUser stubs

svn path=/trunk/; revision=29265
2007-09-28 01:49:06 +00:00
Christoph von Wittich
e539947c94 fix some bugs
svn path=/trunk/; revision=29264
2007-09-28 00:12:59 +00:00
Timo Kreuzer
b6ebc1b19c add another small test for AddFontResource
svn path=/trunk/; revision=29263
2007-09-27 22:32:09 +00:00
Timo Kreuzer
581e34abb2 remove gdihv.cbp
svn path=/trunk/; revision=29262
2007-09-27 22:30:25 +00:00
Timo Kreuzer
5b816f2612 gdihv:
- add base type mask
- change my email
- add deleted entries
- full row selection

svn path=/trunk/; revision=29261
2007-09-27 22:29:26 +00:00
Aleksey Bragin
945a85f7cb - Add uniata.rbuild, adapt .rc to ReactOS
- Preliminary compilation fixes.
- Remove CrossNt stuff for now.

svn path=/trunk/; revision=29260
2007-09-27 20:45:13 +00:00
Aleksey Bragin
d8d12c55ea - Wrong param was being sent to MiSyncThreadProcessViews(), fix that.
svn path=/trunk/; revision=29259
2007-09-27 20:14:32 +00:00
Thomas Bluemel
b785a1ed6d Some fixes
svn path=/trunk/; revision=29257
2007-09-27 19:38:47 +00:00
Aleksey Bragin
1daf74908e - Copy uniata source code to the drivers/storage/ide directory.
svn path=/trunk/; revision=29256
2007-09-27 18:37:22 +00:00
Aleksey Bragin
8f33e033e4 - Add missing KERNEL_LARGE_STACK_COMMIT definition to DDK.
- Fix typo in MMWSL.
- Add RtlRandom to NDK.
- Add MEMORY_PRIORITY values to NDK.
- Add KeAcquireSpinLockRaiseToSynch to NDK.
- Make MmInitializeProcessAddressSpace take two more parameters: one to specify flags, such as large page support, and another one to define the process being cloned, when fork() support will be added.
- Add KeInvalidAccessAllowed to deal with page faults in the special S-List code. The assembly code currently handles simple faults, but our MmAccessFault handler needs to start verifying the fault too.
- Mark LoaderReserve pages as LoaderFree, it seems they end up this way in Windows.
- Use MmNumberOfPhysicalPages instead of MmStats.NrTotalPages.

All NDK changes are discussed with Alex.

svn path=/trunk/; revision=29254
2007-09-27 18:07:44 +00:00
Thomas Bluemel
2d7f6e6a42 - Display a list of monitors if there's more than one monitor
- Display a list of available refresh rates for the current mode

svn path=/trunk/; revision=29252
2007-09-27 17:53:14 +00:00
Timo Kreuzer
9c009fef95 probe the pointer and some cleanup simplification
svn path=/trunk/; revision=29251
2007-09-27 17:25:40 +00:00
Thomas Bluemel
466ad8f165 Set the current device mode selection to the current one if the mode was changed successfully
svn path=/trunk/; revision=29250
2007-09-27 17:24:07 +00:00
Christoph von Wittich
de304494a0 add shell extension for displaying processor information in device manager
svn path=/trunk/; revision=29249
2007-09-27 17:04:44 +00:00
Timo Kreuzer
f36fe07cbe Basic implementation of NtGdiSetDIBitsToDeviceInternal()
todo: handle XlateObj
Now apparition (open source pdf viewer) works on ros.

svn path=/trunk/; revision=29248
2007-09-27 17:04:29 +00:00
Aleksey Bragin
ccc37f538c - Coalesce all calls to MmUpdatePageDir through a single inlined function - MiSyncProcessThreadViews, and fix callers which assumed that the kernel stack is KERNEL_STACK_SIZE, when in fact, it may be KERNEL_LARGE_STACK_SIZE. We now detect and handle this, fixing a bug in KiAttachProcess.
- Remove all old-scheduler code, it's not needed anymore, nor it's going to be ever supported.

svn path=/trunk/; revision=29247
2007-09-27 16:28:56 +00:00
James Tabor
d4c51f18f7 - First try bug fix for #2698.
svn path=/trunk/; revision=29246
2007-09-27 15:54:51 +00:00
Thomas Bluemel
4562d06142 Set eol-style to native
svn path=/trunk/; revision=29245
2007-09-27 15:50:28 +00:00
Aleksey Bragin
18064031f9 - Fix multiple bugs in RtlWalkFrameChain and secure it against any possibility of a bugcheck while walking the stack.
- Fix bugs in RtlUnwind and RtlExceptionDispatch which assumed the DPC stack size was 4KB instead of 12KB.
- Fix multiple bugs in RtlpGetStackLimits and seure it against bugchecks. Properly detect DPC or invalid stacks.
- PsConvertToGuiThread should acquire a guarded region, not a critical section, to stop all APCs.
- Fix bug in bugzilla reporting which was making things crash.
- Unlock address space before raising to HIGH_LEVEL in KeBugCheck.
- Display blue screen at APC_LEVEL, to avoid the assertion in procobj.c when trying to attach to csrss. This should fix the recursive bugchecking when the GUI is up, and also take down the GUI properly. The fix is a hack.
- Fix bogus implementation of IoGetStackLimits and make it work properly.
- Make MmCreateKernelStack return the base of the stack, not the limit, and fix all callers appropriately.
- Remove svn:needs-lock properties of various files, whose contents either changes too often or whose contents is definately clean.

Bugreports and information - by Alex.

svn path=/trunk/; revision=29244
2007-09-27 13:07:43 +00:00
Aleksey Bragin
5344a0ac1b - Slightly cleanup the code.
- Enable allocation of the adapter channel in case of Start I/O.

svn path=/trunk/; revision=29243
2007-09-27 12:34:53 +00:00
Daniel Reimer
7cc4aa6e80 Bug 2697: Ukrainian translation update
German Translations by me.

svn path=/trunk/; revision=29242
2007-09-27 10:17:05 +00:00
Aleksey Bragin
73d39ce072 - Handle NextLuRequest and ResetDetected in ScsiPortNotification() API
- Add UNIMPLEMENTED into ScsiPortGetBusData() when it's called with Length = 0. Does not happen so far, when tested with BusLogic.sys in our tree.

svn path=/trunk/; revision=29241
2007-09-27 10:04:56 +00:00
Aleksey Bragin
815cfb4aa2 Samuel Erdtman <samuel@erdtman.se>
- Implement 'replace' command in cmd.
- TODO: Update all translations with the new text strings for replace command.

svn path=/trunk/; revision=29240
2007-09-27 08:35:08 +00:00
Thomas Bluemel
cc8fa40f41 Fix typo (copy&paste)
svn path=/trunk/; revision=29239
2007-09-27 06:28:30 +00:00
Thomas Bluemel
f64ff394df Display the resource page in device properties
svn path=/trunk/; revision=29238
2007-09-27 05:51:08 +00:00
Thomas Bluemel
8ecd472083 Let crt parse the command line parameters
svn path=/trunk/; revision=29237
2007-09-27 05:49:46 +00:00
Thomas Bluemel
cb4e2fda79 Add an initial (incomplete, not functional) implementation of the display monitor shell extension for desk.cpl
svn path=/trunk/; revision=29236
2007-09-27 05:45:03 +00:00
Thomas Bluemel
17602f0b45 Once again change back the GUID to the real one...
svn path=/trunk/; revision=29235
2007-09-27 05:27:23 +00:00
Thomas Bluemel
81f8891b9b - Allow changing the screen resolution in the advanced adapter settings through desk.cpl
- desk.cpl doesn't publish a monitor id

svn path=/trunk/; revision=29234
2007-09-27 05:23:58 +00:00
Thomas Bluemel
54ceb2a1f2 Display the display adapter properties with extended pages
svn path=/trunk/; revision=29233
2007-09-27 03:08:45 +00:00
Thomas Bluemel
96186bac97 Fix implementation of DevicePropertiesA/W to show extended pages
svn path=/trunk/; revision=29232
2007-09-27 03:04:52 +00:00
Thomas Bluemel
1f14f9be20 Implement DevicePropertiesA/W by calling DevicePropertiesExA/W and move function prototypes to a private header
svn path=/trunk/; revision=29231
2007-09-27 02:49:31 +00:00
Thomas Bluemel
ab90e188ca Don't show prefix in labels filled with hardware information
svn path=/trunk/; revision=29230
2007-09-27 02:05:23 +00:00
Timo Kreuzer
b088aca338 Ukrainian translations by Artem Reznikov (temarez AT yandex DOT ru)
See issue #2696 for more details.

svn path=/trunk/; revision=29229
2007-09-27 00:25:42 +00:00
Thomas Bluemel
653a40ad14 Select currently selected mode by default
svn path=/trunk/; revision=29228
2007-09-26 23:37:09 +00:00
Thomas Bluemel
95d9c7542d Fix compilation error
svn path=/trunk/; revision=29227
2007-09-26 23:17:48 +00:00
Thomas Bluemel
eb9665eab4 Fix CLSID (accidently committed a change for testing purpose)
svn path=/trunk/; revision=29226
2007-09-26 23:15:42 +00:00
Thomas Bluemel
b212e14609 Implement the "List all modes" dialog, read-only for now
svn path=/trunk/; revision=29225
2007-09-26 23:10:41 +00:00
Thomas Bluemel
aa782313a8 Display adapter information
svn path=/trunk/; revision=29224
2007-09-26 21:19:54 +00:00
Aleksey Bragin
2c239e0bd6 - PS_UNKNOWN_VALUE determines if the process should be created with large pages: rename to PS_LARGE_PAGES
- Do Address Space initialization as per "Windows Internals II" slides, either for the Boot, System, Cloned User or New User Process cases.
- Rename MmCreateProcessAddressSpace to MmInitializeProcessAddressSpace, and MmCopyMmInfo to MmCreateProcessAddressSpace. What ReactOS did is correct as per "Windows Internals II", but the names were inverted.
- Clone the Object Table if we are the boot process, and only initialize part of the address space (since we don't need things like guard page, TEB, etc), however, do initialize and map the shared user data section.
- Make the initial system process and idle process share the same page directory instead of creating a new one.
- Use the same priority class as the parent process, if the process was in the idle or below-normal priority class.
- Only duplicate handles if the caller requested it, instead of always duplicating the process's handles!
- Generate a null image file name for system processes.
- Rename ObpCreateHandleTable to ObInitProcess and better handle race and out-of-memory conditions. Detect if auditing required, but don't do anything about it.
- Initialize the Idle/System process address space much earlier in the boot process, in MmInitSystem.

Thanks to Alex for providing various information, and answering all my questions.

svn path=/trunk/; revision=29223
2007-09-26 20:55:26 +00:00
Daniel Reimer
6433b53657 Another german rc file update
svn path=/trunk/; revision=29222
2007-09-26 20:49:06 +00:00
Thomas Bluemel
3570f78e87 Display the display device adapter name and show device properties
svn path=/trunk/; revision=29221
2007-09-26 20:41:57 +00:00
Ged Murphy
9fa9463d77 - add missing net card interface info to ipifcons.h
- follow on patch from Gregor Brunmar <gregor.brunmar - home - se>

svn path=/trunk/; revision=29220
2007-09-26 20:36:28 +00:00
Ged Murphy
98727fc4a0 - generate the netcard status information and populate the dialog with it
- patch by Gregor Brunmar <gregor.brunmar - home - se>

svn path=/trunk/; revision=29219
2007-09-26 20:34:08 +00:00
Thomas Bluemel
992a4c2d01 Add deskadp.dll to the bootcd and register the shell extension
svn path=/trunk/; revision=29218
2007-09-26 20:12:26 +00:00
Thomas Bluemel
45dc31ac0b Add initial implementation of the display adapter desk.cpl shell extension
svn path=/trunk/; revision=29217
2007-09-26 20:00:07 +00:00
Thomas Bluemel
8e049e50a4 Move routines that can be shared between desk.cpl shell extensions to common header as inlined functions
svn path=/trunk/; revision=29216
2007-09-26 19:42:39 +00:00
Thomas Bluemel
04931ef194 Move desk.cpl shell extension interface definition to shared header file
svn path=/trunk/; revision=29215
2007-09-26 19:23:50 +00:00
Aleksey Bragin
432625614e - Implement InterlockedExchangeAdd/Decrement/Increment16.
- Fix MM_EXTEND_INFO definition.
- Fix MMWSLE definition.
- Fix EPROCESS definition.
- Add quota functions to NDK.
- Add one more parameter to PspMapSystemDll to support mapping large pages.
- Don't make the quota functions do anything for the system process.
- Add page file quota functions.
- Other misc small fixes.

svn path=/trunk/; revision=29214
2007-09-26 16:41:35 +00:00
Daniel Reimer
cb82475b6d Updated German Translation.
svn path=/trunk/; revision=29213
2007-09-26 09:53:48 +00:00
Colin Finck
1efd6d7df7 Ukrainian translations by Artem Reznikov (temarez AT yandex DOT ru)
See issue #2692 for more details.

svn path=/trunk/; revision=29212
2007-09-26 08:48:29 +00:00
James Tabor
ff1881b631 Fix calling conventions.
svn path=/trunk/; revision=29211
2007-09-26 06:26:17 +00:00
Thomas Bluemel
3b6747e11c Display advanced display settings and allow shell extensions to extend it. Not yet fully functional/working
svn path=/trunk/; revision=29210
2007-09-26 06:20:16 +00:00
Thomas Bluemel
ad47c9b3a9 Add stub for SHCreatePropSheetExtArrayEx, temporarily
svn path=/trunk/; revision=29209
2007-09-26 06:14:05 +00:00
Thomas Bluemel
3db8801f43 Fix copy&paste typo in comment
svn path=/trunk/; revision=29208
2007-09-26 04:33:50 +00:00
Thomas Bluemel
6648bd3f85 Allow loading shell extensions
svn path=/trunk/; revision=29207
2007-09-26 04:30:57 +00:00
James Tabor
9f930ed173 Fix calling conventions and do not unload setupapi.dll after registering the notification. Thank you Thomas.
svn path=/trunk/; revision=29206
2007-09-26 01:10:51 +00:00
James Tabor
d42fa2d392 Testing return as default user32 error ERROR_SERVICE_SPECIFIC_ERROR.
svn path=/trunk/; revision=29205
2007-09-25 23:43:28 +00:00
James Tabor
5baf5558ff Implement RegisterDeviceNotificationAW and UnregisterDeviceNotification, based on Gdi32 OpenGL.
svn path=/trunk/; revision=29204
2007-09-25 22:28:35 +00:00
Magnus Olsen
a9892925a1 forget commit Implement of GdiGetLocalBrush, GdiGetLocalDC, GdiGetLocalFont
fix a smaller bug in GdiSetBatchLimit
fix GdiSetLastError to be simluare to windows xp 


svn path=/trunk/; revision=29203
2007-09-25 20:44:53 +00:00
Magnus Olsen
588e62a967 Fix a stupied bug in DdAttachSurface when pSurfaceFrom->hDDSurface is NULL or pSurfaceTo->hDDSurface is null we need create them.
svn path=/trunk/; revision=29202
2007-09-25 16:49:13 +00:00
James Tabor
27a27ff89e IsMetaFile is an easy check used when porting wine static and listbox.
svn path=/trunk/; revision=29201
2007-09-25 14:42:51 +00:00
Ged Murphy
c338775265 - Add usermode checks to GetDIBits
- passes 21 out of 27 tests
- Add GdiSetLastError to the lib instead of forwarding it straight to kernel32

svn path=/trunk/; revision=29200
2007-09-25 13:27:09 +00:00
Ged Murphy
b3c3c9ba5b add more checks for GetDIBits
svn path=/trunk/; revision=29199
2007-09-25 13:20:46 +00:00
Colin Finck
77e82dcd8b Traditional chinese translation for "cacls" by Chaoming Tseng
See issue #2687 for more details.

svn path=/trunk/; revision=29198
2007-09-25 10:32:22 +00:00
Colin Finck
e5402189b9 - Bug 2685: Ukrainian translation for "format" by Rostislav Zabolotny (rstzab AT yandex DOT ru)
- Bug 2686: Ukrainian translation for "regsvr32" by Rostislav Zabolotny (rstzab AT yandex DOT ru)

svn path=/trunk/; revision=29197
2007-09-25 10:08:39 +00:00
Magnus Olsen
92b7462fcb clean up : move EngWideCharToMultiByte from stubs.c to eng.c and mark it as implement
svn path=/trunk/; revision=29195
2007-09-24 19:17:15 +00:00
Magnus Olsen
9b2a7bf67c implmented EngQueryEMFInfo it always return FALSE
it is historic in Windows XP, But not in Windows 2000

svn path=/trunk/; revision=29194
2007-09-24 18:00:49 +00:00
Aleksey Bragin
f38baaaaa2 Dmitry Chapyshev <lentind@yandex.ru>
- Start implementing systeminfo system utility (it already works quite nice, but not complete yet).

svn path=/trunk/; revision=29193
2007-09-24 16:32:12 +00:00
Aleksey Bragin
2e3b975002 - Make PsChargeProcessPoolQuota returning STATUS_SUCCESS
svn path=/trunk/; revision=29192
2007-09-24 16:00:21 +00:00
Ged Murphy
9be6565d51 Add basic tests for NtGdiGetDIBitsInternal
svn path=/trunk/; revision=29191
2007-09-24 15:09:15 +00:00
Ged Murphy
f26bd07f86 Add basic tests for GetDIBits
svn path=/trunk/; revision=29190
2007-09-24 15:02:20 +00:00
Aleksey Bragin
2cbc032859 - Add Ex*Spinlock macros and FLUSH_MULTIPLE_MAXIMUM definitions missing from DDK
- Add KeAcquireQueuedSpinLock / KeAcquireReleaseQueuedSpinLock, RtlCompareMemoryUlong definitions missing from IFS.
- Add actual section object definition to NDK
- More NDK fixes
- Fix incorrect definition of MMPTE_LIST
- Fix incorrect prototype of NtFlushVirtualMemory
- Fix incorrect prototypes of KeAcquire / ReleaseQueuedSpinLock
- Add a second parameter to MmCreateKernelStack to select the NUMA node on which the stack should be allocated
- Avoid usage of PROS_SECTION_OBJECT in Ps where possible
- Unimplement PsChargeProcessQuota. It was not working right
- Use PFN_NUMBER defined in DDK instead of PFN_TYPE internal ROS Type.

svn path=/trunk/; revision=29188
2007-09-24 14:01:54 +00:00
Hervé Poussineau
a7396c359e When depending of a module, also depends of its generated headers
svn path=/trunk/; revision=29186
2007-09-24 13:21:31 +00:00
Hervé Poussineau
7e0ebf1fc6 Add headers dependencies for modules which declare a .idl in their rbuild file
svn path=/trunk/; revision=29185
2007-09-24 12:53:33 +00:00
Hervé Poussineau
9fea5a34a6 Keep standard includes when building C++ modules
svn path=/trunk/; revision=29184
2007-09-24 12:27:00 +00:00
Hervé Poussineau
18bb1da6d2 Fix typo
svn path=/trunk/; revision=29183
2007-09-24 12:22:22 +00:00
Aleksey Bragin
50951397e4 - Small update to the plan (remove what's done already for sure)
svn path=/trunk/; revision=29182
2007-09-24 12:11:14 +00:00
Hervé Poussineau
d7b829fbc7 Depend again of autogenerated psdk headers (was broken in r29176)
svn path=/trunk/; revision=29181
2007-09-24 12:03:10 +00:00
Hervé Poussineau
2ad309f010 Do not use host headers anymore when building target executables/libraries
svn path=/trunk/; revision=29180
2007-09-24 11:43:38 +00:00
Hervé Poussineau
9c968b2b68 Remove this headers set, as they already exist in include/crt
svn path=/trunk/; revision=29179
2007-09-24 11:42:04 +00:00
Hervé Poussineau
682904a871 Copy some headers from RosBE to our include directory. These files are now considered as target headers, whereas those in RosBE are host headers.
svn path=/trunk/; revision=29178
2007-09-24 11:40:54 +00:00
Hervé Poussineau
ea8a8e47da Use user flags when building host tools
svn path=/trunk/; revision=29177
2007-09-24 11:28:52 +00:00
Hervé Poussineau
5dc2b7e865 Do not put .h files in object files, it causes problems at link time
svn path=/trunk/; revision=29176
2007-09-24 11:00:17 +00:00
Hervé Poussineau
c27dad3928 Display a message when a module has been disabled
Support variables in aliased module names

svn path=/trunk/; revision=29175
2007-09-24 09:15:49 +00:00
Hervé Poussineau
d0f1fadb7b Never call TdiCloseDevice when warming up a socket
svn path=/trunk/; revision=29174
2007-09-24 08:39:23 +00:00
James Tabor
e6ed27d2e5 Turn off DcAttr updates for now.
svn path=/trunk/; revision=29173
2007-09-24 04:05:24 +00:00
James Tabor
f924fa55c9 Make sure it is non zero.
svn path=/trunk/; revision=29172
2007-09-24 02:58:22 +00:00
James Tabor
82ad159967 Implement IsGUIThread.
svn path=/trunk/; revision=29171
2007-09-24 02:42:17 +00:00
Eric Kohl
ead5a4f94e Fix a cut & paste bug.
svn path=/trunk/; revision=29170
2007-09-23 22:59:00 +00:00
Magnus Olsen
cacffe3082 fix a spelling mistake
svn path=/trunk/; revision=29169
2007-09-23 19:19:40 +00:00
Magnus Olsen
21687e2157 Start making def Windows XP gdi32 export layout.
svn path=/trunk/; revision=29168
2007-09-23 18:46:47 +00:00
Magnus Olsen
7315ffc1e6 Start making def Windows XP gdi32 export layout.
svn path=/trunk/; revision=29167
2007-09-23 18:18:20 +00:00
Daniel Reimer
0ab1667cb1 Download! is somehow too stupid to use the other link... Now RosBE 0.3.8 will be uploaded to SF.net anyway. And this link seems more XML conformant.
svn path=/trunk/; revision=29166
2007-09-23 17:15:50 +00:00
Colin Finck
39889d2c75 Add the build date and revision number to sysdm.cpl (patch by encoded)
See issue #2683 for more details.

svn path=/trunk/; revision=29165
2007-09-23 17:02:35 +00:00
Daniel Reimer
c5875c6fcd Update to RosBE 0.3.8
svn path=/trunk/; revision=29164
2007-09-23 15:23:54 +00:00
Magnus Olsen
d216c026b2 Fix : UnrealizeObject behoivr as windows 2000/XP see msdn http://msdn2.microsoft.com/en-us/library/ms532602.aspx
Redirect : XFORMOBJ_bApplyXform@20 to NtGdiXFORMOBJ_bApplyXform@20
Redirect : XFORMOBJ_iGetXform@8 to NtGdiXFORMOBJ_iGetXform@8
Redirect : XLATEOBJ_cGetPalette@16 to NtGdiXLATEOBJ_cGetPalette@16
Redirect : XLATEOBJ_hGetColorTransform@4 to NtGdiXLATEOBJ_hGetColorTransform@4

svn path=/trunk/; revision=29163
2007-09-23 14:35:40 +00:00
Magnus Olsen
b34cf0f3ac implement StartFormPage it call on StartPage(hdc); and StartPage is unimplment
Fix : do not redirect TranslateCharsetInfo and StretchDIBits some stuff need be done in user mode. 

svn path=/trunk/; revision=29162
2007-09-23 13:46:20 +00:00
Daniel Reimer
414b736953 Bug 2682: Downloader ressources update (heis_spiter@hotmail.com) (Yeah, I tested it :-P)
svn path=/trunk/; revision=29161
2007-09-23 13:38:32 +00:00
Hervé Poussineau
0b3a854203 Open the process with enough privileges before adjusting them
svn path=/trunk/; revision=29160
2007-09-23 13:14:03 +00:00
Hervé Poussineau
2ff2329ed3 Remove useless code
svn path=/trunk/; revision=29159
2007-09-23 13:10:51 +00:00
Daniel Reimer
17534ab7c6 Fix another Build breaking Bug, I missed...
svn path=/trunk/; revision=29156
2007-09-23 11:42:26 +00:00
Magnus Olsen
76a688a2e2 Fix : RemoveFontResourceA : let it call to RemoveFontResourceExA
Fix : RemoveFontResourceW : let it call to RemoveFontResourceExW
Fix : a comment in SetWorldTransform
Fix : Redirect STROBJ_bEnum@12 to win32k
Fix : Redirect STROBJ_bEnumPositionsOnly@12 to win32k
Fix : Redirect STROBJ_bGetAdvanceWidths@16 to win32k
Fix : Redirect STROBJ_dwGetCodePage@4 to win32k
Fix : Redirect STROBJ_vEnumStart@4 to win32k
Fix : Redirect SetFontEnumeration to win32k
Fix : Redirect SetMagicColors to win32k
Fix : Redirect SetSystemPaletteUse to win32k
Fix : Redirect SetVirtualResolution@20 to win32k
Fix : PtInRegion : Make smaller code in gdi32 for sharememory/metadc
Fix : RectInRegion : Make smaller code in gdi32 for sharememory/metadc 
Fix : SetBrushOrgEx : Make smaller code in gdi32 for sharememory/metadc
Fix : SetDIBits : Make smaller code in gdi32 for sharememory/metadc
Fix : SetGraphicsMode : Make smaller code in gdi32 for sharememory/metadc
Implement RemoveFontResourceExA : it is partly implement it miss flags, and pdv and we also need fix win32k
Implement RemoveFontResourceExW : it is partly implement it miss flags, and pdv and we also need fix win32k

and more stuff

svn path=/trunk/; revision=29154
2007-09-23 11:33:47 +00:00
Colin Finck
a2ae628e84 Fix the intl.cpl build
svn path=/trunk/; revision=29153
2007-09-23 11:30:09 +00:00
Daniel Reimer
31b688ad73 Bug 2677: Ukrainian translation update (rstzab@yandex.ru)
Bug 2678: Dutch translations for all screensavers by Joost de Meij (dreamsmsn@gmail.com)
Bug 2680: Updated (french) translations (heis_spiter@hotmail.com)

svn path=/trunk/; revision=29152
2007-09-23 11:05:44 +00:00
Hervé Poussineau
8ad6033250 Continue rbuild cleanup (AutomaticDependency and SourceFile classes)
svn path=/trunk/; revision=29150
2007-09-23 08:04:24 +00:00
Eric Kohl
c0c201c35d Add missing LPFILTERKEYS and LPTOGGLEKEYS types.
svn path=/trunk/; revision=29149
2007-09-22 20:20:28 +00:00
Colin Finck
8e4f19f80b Slovak translations for the cylfrac, logon, scrnsave and starfield screensavers by Mario Kacmar (kario AT szm DOT sk)
svn path=/trunk/; revision=29148
2007-09-22 19:14:54 +00:00
Thomas Bluemel
f98ba48cef Fix loading pages provided by shell extensions
svn path=/trunk/; revision=29147
2007-09-22 18:59:23 +00:00
Thomas Bluemel
6897e5ee5a - Don't change the current power scheme when displaying the dialog
- Load additional pages provided by shell extensions

svn path=/trunk/; revision=29146
2007-09-22 18:48:02 +00:00
Colin Finck
2018d3408d Slovak translation for sysdm by Mario Kacmar (kario AT szm DOT sk)
svn path=/trunk/; revision=29145
2007-09-22 18:23:06 +00:00
Colin Finck
f143cc5f45 Call ShellExecute with NULL instead of "open", so the default action is used, when a file name does not support "open". (see http://msdn2.microsoft.com/en-us/library/ms647732.aspx)
According to someone in the bug report, this is the behaviour used under Windows XP.
See issue #1461 for more details.

svn path=/trunk/; revision=29143
2007-09-22 16:52:53 +00:00
Colin Finck
7c48ada188 - Change Firefox 1.5 link to the file at svn.reactos.org (FF 1.5 isn't available anymore from Mozilla over HTTP, and our URLDownloadToFile seems to have problems with FTP links)
- Update Firefox 2.0 to 2.0.0.7
- Use a more reliable link for Thunderbird 2.0.0.6

svn path=/trunk/; revision=29142
2007-09-22 16:28:21 +00:00
Daniel Reimer
1c1f0f249b Add German RC Files to the Screensavers.
svn path=/trunk/; revision=29139
2007-09-22 13:00:46 +00:00
Eric Kohl
0916909cbf Don't use hardcoded strings in the configuration message box. Use string resources instead.
svn path=/trunk/; revision=29138
2007-09-22 11:38:32 +00:00
Eric Kohl
847464262c Don't use hardcoded strings in the configuration message box. Use string resources instead.
svn path=/trunk/; revision=29137
2007-09-22 11:26:03 +00:00
Eric Kohl
761e858982 Don't use hardcoded strings in the configuration message box. Use string resources instead.
svn path=/trunk/; revision=29136
2007-09-22 11:20:25 +00:00
Eric Kohl
1c85a28f50 Don't use hardcoded strings in the configuration message box. Use string resources instead.
svn path=/trunk/; revision=29135
2007-09-22 09:09:57 +00:00
Aleksey Bragin
1e19b02082 - Print out hardware information to the debug log in case of a crash (yes, even people like me do mistakes...)
svn path=/trunk/; revision=29133
2007-09-21 20:15:46 +00:00
Aleksey Bragin
e82855f464 - Print out hardware information to the debug log in case of a crash.
svn path=/trunk/; revision=29132
2007-09-21 20:14:34 +00:00
Colin Finck
074c6e9d66 Spanish translations by Javier Remacha (remialdo AT gmail DOT com)
See issue #2669 for more details.

svn path=/trunk/; revision=29131
2007-09-21 18:01:19 +00:00
Hervé Poussineau
1c9e99b2cc Send the right inf file handle to SetupCloseInfFile().
svn path=/trunk/; revision=29130
2007-09-21 13:00:16 +00:00
Hervé Poussineau
b733bd322e Fix typo
svn path=/trunk/; revision=29129
2007-09-21 12:45:39 +00:00
Hervé Poussineau
2136c852eb Add Lithuanian keyboard
Patch by Vytis Girdþijauskas, cman at cman dot us
See issue #2613 for more details.

svn path=/trunk/; revision=29128
2007-09-21 07:22:32 +00:00
James Tabor
b5b2b493c4 - Fixed CMP_UnregisterNotification. Add IN, sorry.
svn path=/trunk/; revision=29127
2007-09-21 00:07:26 +00:00
James Tabor
e5f58a8b91 - Add CMP_RegisterNotification and CMP_UnregisterNotification. Both called from User32.
svn path=/trunk/; revision=29126
2007-09-21 00:05:17 +00:00
Colin Finck
eb2bd45e2a Change the file names of the Catalan resource files from "ca-CA" to "ca-ES". Thanks to Marc Piulachs for noticing this.
Also fixed the sublang in the catalan "msconfig" resource file (thx to EmuandCo :-P)

See issue #2662 for more details.

svn path=/trunk/; revision=29125
2007-09-20 20:57:28 +00:00
Colin Finck
c75d21f350 Updated Ukrainian translations by Artem Reznikov (temarez AT yandex DOT ru)
See issue #2661 for more details.

svn path=/trunk/; revision=29124
2007-09-20 18:40:55 +00:00
Timo Kreuzer
07f78b29da - make gdi object's type field more windows compatible, using only the basetype in the upper 16 bits
- On windows deleted objects have a KernelData value != NULL, so don't check for that when validating a handle, instead check if the type field in the upper 16 bits is 0

svn path=/trunk/; revision=29123
2007-09-20 16:13:55 +00:00
Hervé Poussineau
3a469030ac Do not forget to release the rundown protection.
See issue #2348 for more details.

svn path=/trunk/; revision=29122
2007-09-20 14:54:43 +00:00
James Tabor
08bf20fb83 User32:
- Implement ValidateHandle.
- Copied handle_to_entry and header information from win32k. Yes I know, duplication etc. Just for now.
- Add tested validation object types and as per revision 29105. Those object types now match.
- In dllmain.c, the gHandleTable pointer is set from Win32k GetW32ProcessInfo.
- Tested it, failed. The pointer does match with win32k gHandleTable.

svn path=/trunk/; revision=29121
2007-09-20 14:26:43 +00:00
Hervé Poussineau
8a98cb7fdd [FORMATTING] Tabs vs space, { } placement, ...
No code change

svn path=/trunk/; revision=29120
2007-09-20 13:53:38 +00:00
Ged Murphy
b69d44ab8c forgot to remove the lib I linked for testing
svn path=/trunk/; revision=29119
2007-09-20 13:32:58 +00:00
Ged Murphy
ce62afe2b0 add the correct key name to match the service name
svn path=/trunk/; revision=29118
2007-09-20 13:27:44 +00:00
Ged Murphy
b862010a64 - use correct name when registering.
- use unicode apis exclusively when required.
- fix rbuild file

svn path=/trunk/; revision=29117
2007-09-20 13:26:19 +00:00
Hervé Poussineau
5baee1e5ab Read Characteristics and BusType keys from .inf file, and write them in registry.
This will probably help for installation of 3rd party drivers

svn path=/trunk/; revision=29116
2007-09-20 13:26:18 +00:00
Aleksey Bragin
57a60d9b47 Timo Kreuzer:
- The debug object created by NtCreateDebugObject() is restricted to DEBUG_OBJECT_WAIT_STATE_CHANGE, change to DEBUG_OBJECT_ALL_ACCESS.
See issue #2310 for more details.

svn path=/trunk/; revision=29115
2007-09-20 12:46:58 +00:00
Aleksey Bragin
81ef13c4a1 - Implement a fast->slow leaf conversion (this assert was hit by OO.o setup)
svn path=/trunk/; revision=29114
2007-09-20 10:36:36 +00:00
Hervé Poussineau
87638956af Add missing svn:eol-style=native properties
svn path=/trunk/; revision=29113
2007-09-20 09:47:58 +00:00
Eric Kohl
dffd76151a Move the settings read code into a single function which is called before creating the property sheet.
svn path=/trunk/; revision=29112
2007-09-19 21:31:49 +00:00
Andrew Greenwood
099d7567cb Add prototype for UnregisterDeviceNotifications() to audiosrv.h (bug 2664)
svn path=/trunk/; revision=29111
2007-09-19 20:11:28 +00:00
Hervé Poussineau
b14a0090bc Fix compilation
Remove broken property

svn path=/trunk/; revision=29110
2007-09-19 19:29:40 +00:00
Andrew Greenwood
a3468f83ec Fix EOL style (I think!)
svn path=/trunk/; revision=29109
2007-09-19 19:25:43 +00:00
Andrew Greenwood
4ee8a37af5 Set service to manual start, and implemented a quick debug-logging
solution. ReactOS does not currently have RegisterDeviceNotification
implemented so if this function fails the audio service will still run
but won't receive plug and play event notifications (this is a temporary 
hack.)
Service now starts but won't find any devices (we don't have any yet!)


svn path=/trunk/; revision=29108
2007-09-19 16:54:25 +00:00
Hervé Poussineau
31163f4d3b Add missing svn:eol-style=native property
svn path=/trunk/; revision=29107
2007-09-19 15:18:05 +00:00
Andrew Greenwood
83932a8e2c Correct enumeration of Plug and Play audio devices on Windows using
KSCATEGORY_AUDIO. Also detects existing audio devices in addition to 
dealing with device arrivals. Slight code tidy-up. Also added additional 
GUIDs to ks.h and ksmedia.h


svn path=/trunk/; revision=29106
2007-09-19 14:42:54 +00:00
James Tabor
de7c2c63e3 Win32k:
- Add thread information pointer to the user handle entry. This will be useful for checking handles, if the handle is not part of the current thread.
- Add a test to make sure the current process passes the gHandleTable pointer to user32.
- These changes are important for allowing User32 to read-only the handle object information. Not 100% compatible, we need NtUserProcessConnect and CsrClientConnectToServer. Need a full understanding how they both work with User32.
Ref:
- https://www.microsoft.com/msj/0397/hood/hood0397.aspx
- http://www.winterdom.com/dev/ui/wnd.html

svn path=/trunk/; revision=29105
2007-09-19 13:24:58 +00:00
Hervé Poussineau
a7a5e5a486 Fix weird bug in Project::ResolveProperties(), which was modifying the string given in argument
svn path=/trunk/; revision=29104
2007-09-19 12:06:39 +00:00
Hervé Poussineau
a756421600 Remove rbuild stdlib="host" attribute. That was a workaround to build system deficiency.
Now, base the workaround on presence of C++ files in module

svn path=/trunk/; revision=29103
2007-09-19 11:11:57 +00:00
Hervé Poussineau
afcd5893d5 Fix an old rbuild bug: .gch file now depends of intermediate module directory, and can create it if needed
svn path=/trunk/; revision=29102
2007-09-19 09:34:05 +00:00
Andrew Greenwood
18b8710a37 ReactOS Audio Service. Has not been tested within ReactOS but on Windows
(XP) it now detects when new devices have been attached. This 
information is shared via a mapped file. I have also written a utility 
to read the contents of the mapped file (this is not included - further 
work is required).

Added a few missing #defines to dbt.h and also reformatted some of the 
WinMM code so it was clearer to read.


svn path=/trunk/; revision=29100
2007-09-19 04:13:24 +00:00
Daniel Reimer
d600738b86 Set svn:eol-style = native. (Final, Now you can kick me :-P)
svn path=/trunk/; revision=29099
2007-09-18 21:51:29 +00:00
Daniel Reimer
472da8c8b0 Set svn:eol-style = native
svn path=/trunk/; revision=29098
2007-09-18 21:39:18 +00:00
Daniel Reimer
3ab931ca14 Set svn:eol-style = native
svn path=/trunk/; revision=29097
2007-09-18 21:32:39 +00:00
Daniel Reimer
5daf391b62 Catalan Translations by Marc Tormo i Bochaca (mtbochaca@ya.com) (Bug 2647, 2651, 2652, 2653, 2654, 2655, 2656)
Fixed SUBLANG to DEFAULT and fixed missing "".

svn path=/trunk/; revision=29096
2007-09-18 21:08:09 +00:00
Christoph von Wittich
38cb0b7e17 don't use WNOHANG
svn path=/trunk/; revision=29095
2007-09-18 18:59:53 +00:00
Christoph von Wittich
ee5642eccc fix qemu vnc param
svn path=/trunk/; revision=29094
2007-09-18 17:53:53 +00:00
Ged Murphy
a98103c630 - when converting from a DDB to a DIB, the palette should be the same in the resulting DIB as the original DDB. This fixes the colour issue we had in the taskbar icons. (there's still a bit position problem as highlighted in the 1-4 bitmaps)
- Reformat the NtGdiGetDIBitsInternal code to a more readable state.

*note, this function needs a considerable work.

svn path=/trunk/; revision=29093
2007-09-18 15:24:34 +00:00
James Tabor
90c3978be9 - Win32k: Removed NtUserCreateMenu replacing it with NtUserCallNoParam.
svn path=/trunk/; revision=29092
2007-09-18 13:06:27 +00:00
Christoph von Wittich
22571f9e0f fix a bug in the linux version of OsSupport::createProcess
svn path=/trunk/; revision=29091
2007-09-18 08:15:47 +00:00
James Tabor
4ab750a26f - Implement NtUserValidateHandleSecure and most support functions moved from static and added to their respected headers.
svn path=/trunk/; revision=29090
2007-09-18 05:07:49 +00:00
Andrew Greenwood
8d7c594692 Bare-bones foundations of the ReactOS Audio Service. At present it's
nothing more than a "mutex service". Some info on the planned 
implementation is in the included audiosrv.txt file.


svn path=/trunk/; revision=29089
2007-09-18 02:41:46 +00:00
Eric Kohl
c04f5503a6 Merge all settings in a single struct. This is required to implement the administrative options.
svn path=/trunk/; revision=29088
2007-09-17 22:29:35 +00:00
James Tabor
fec8f2d929 Init stock object buffer only once.
svn path=/trunk/; revision=29087
2007-09-17 22:08:14 +00:00
James Tabor
75b11c60f3 Fixed build.
svn path=/trunk/; revision=29086
2007-09-17 21:46:30 +00:00
James Tabor
5bfa6170c1 Fixed Client Info structure. Moved it to the right file so user apps can access it.
svn path=/trunk/; revision=29085
2007-09-17 21:02:19 +00:00
Aleksey Bragin
c466246f9e - Change RtlIsDosDeviceName_U() implementation to a better Wine implementation
- Winesync RtlIsNameLegalDOS8Dot3()
- "ntdll_winetest.exe path" reduced to 3 failures (which happen on XP too), so considering "path" done 100% now.

svn path=/trunk/; revision=29084
2007-09-17 19:51:32 +00:00
Hervé Poussineau
4ee3207955 Add some missing definitions to PSDK
Patch by Samuel Serapion, samdwise51 at gmail dot com

svn path=/trunk/; revision=29083
2007-09-17 13:52:44 +00:00
Hervé Poussineau
762f833b44 Add missing svn:eol-style native properties
svn path=/trunk/; revision=29082
2007-09-17 13:43:34 +00:00
Hervé Poussineau
661efc7398 Get rid of "Video Save SVGA" group. Clean up group order entries
svn path=/trunk/; revision=29079
2007-09-17 09:42:01 +00:00
Hervé Poussineau
ec81f99348 No need to create a service group only for VBE driver. By using tags, VBE driver can be installed as the first one in the "Video Save" group
svn path=/trunk/; revision=29078
2007-09-17 09:35:31 +00:00
Aleksey Bragin
ceb71f7fcf Cameron Gutman <aicommander@gmail.com>
- Use /SOS to disable bootlogo in the LiveCD too.

svn path=/trunk/; revision=29075
2007-09-17 08:48:14 +00:00
Art Yerkes
0f163e7d12 Add missing include path.
svn path=/trunk/; revision=29074
2007-09-17 06:12:40 +00:00
Art Yerkes
fe9867a61c Microsoft and the open group both specify towupper and towlower as taking int
and returning int of some flavor.  Make this true of ours.

http://msdn2.microsoft.com/en-us/library/45119yx3(VS.80).aspx
http://opengroup.org/onlinepubs/007908799/xsh/towupper.html

svn path=/trunk/; revision=29073
2007-09-17 05:57:54 +00:00
Art Yerkes
028b640f0b Fixen for PPC.
Exclude relocation.  We'll be situated properly by the ELF layer anyway, and
it's x86 specific.
Tweak definitions in _mingw.h

svn path=/trunk/; revision=29072
2007-09-17 05:33:08 +00:00
Art Yerkes
e366497b95 Fix build for new rosbe-ppc.
svn path=/trunk/; revision=29071
2007-09-17 05:32:04 +00:00
Aleksey Bragin
ab5811a512 - Move W32CLTINFO_TEB structure out of NDK, since it's module-internal structure.
- Add a define for easier accessing this field.

svn path=/trunk/; revision=29069
2007-09-16 17:37:41 +00:00
James Tabor
0a844e24f0 Fix def and size for NtUserValidateHandleSecure.
svn path=/trunk/; revision=29068
2007-09-16 15:32:58 +00:00
Eric Kohl
a3862a653e Indentation clean-up. No code changes.
svn path=/trunk/; revision=29067
2007-09-16 13:38:26 +00:00
Eric Kohl
46bd898f3d Enable the filter keys settings when the test area EDITTEXT control gets the focus and disable the settings when the focus leaves the control.
svn path=/trunk/; revision=29066
2007-09-16 13:25:34 +00:00
Aleksey Bragin
f87c698cd3 Gregor Brunmar <gregor.brunmar@home.se>:
- Don't include files that aren't in the source directory to the project generation.
- Fix tab indentation in generated files.

svn path=/trunk/; revision=29065
2007-09-16 12:54:52 +00:00
Hervé Poussineau
d18fdef61f Add back support for files not in the root of the module directory
Patch by Gregor Brunmar, gregor (dot) brunmar (at) home (dot) se

svn path=/trunk/; revision=29064
2007-09-16 09:12:15 +00:00
The Wine Synchronizer
aa5e4e73cb Autosyncing with Wine HEAD
svn path=/trunk/; revision=29063
2007-09-15 17:06:51 +00:00
Colin Finck
9b6a264e7d Rename "Properties::" to "Properties" in the context menu (patch by Mario Kacmar, kario AT szm DOT sk)
svn path=/trunk/; revision=29062
2007-09-15 16:10:10 +00:00
Colin Finck
32a25111cb Add a slovak translation for "desk.cpl" and fix a small mistake in the translation for "timedate.cpl"
Patch by Mario Kacmar (kario AT szm DOT sk)

svn path=/trunk/; revision=29061
2007-09-15 15:45:24 +00:00
Colin Finck
47dea31217 [FORMATTING]
- Use TABs instead of spaces in some more .rbuild files
- No code changes

svn path=/trunk/; revision=29060
2007-09-15 15:20:31 +00:00
Eric Kohl
f51ada884d Use the unicode="yes" attribute in the module element instead of defining UNICODE and _UNICODE.
svn path=/trunk/; revision=29059
2007-09-15 15:12:26 +00:00
Johannes Anderwald
83c8f50776 - move VolumeDlgProc function to own file volume.c
- read default waveout device  (thanks to Silverbade)
- improve volume dialog proc
- update all languages resources which current code changes

svn path=/trunk/; revision=29058
2007-09-15 14:54:01 +00:00
Eric Kohl
3df1f13cd1 Use the currently selected locale id instead of LOCALE_USER_DEFAULT to display and modify currency settings.
svn path=/trunk/; revision=29057
2007-09-15 14:48:40 +00:00
Colin Finck
9960c6fc98 More XML compliance fixes for the .rbuild files by Marc Piulachs (marc DOT piulachs AT codexchange DOT net)
The added '<include base="ntoskrnl" root="intermediate">include</include>' line in "ntoskrnl.rbuild" was left out, as this include path is already added through the "ntoskrnl.h" precompiled header. (thanks to Hervé for figuring this out)
I applied patches 1904 and 1905 of the Bugzilla bug entry.

See issue #2649 for more details.

svn path=/trunk/; revision=29056
2007-09-15 14:37:02 +00:00
The Wine Synchronizer
c287f519bf Autosyncing with Wine HEAD
svn path=/trunk/; revision=29054
2007-09-15 10:52:08 +00:00
Hervé Poussineau
fd7b9ad55e Fix typo
svn path=/trunk/; revision=29053
2007-09-15 09:03:01 +00:00
Hervé Poussineau
f5101f1e6a Continue rbuild cleanup (Directory class)
svn path=/trunk/; revision=29052
2007-09-15 08:47:56 +00:00
Timo Kreuzer
57dd42dde7 revert 29027, because it breaks context menus.
svn path=/trunk/; revision=29051
2007-09-14 22:46:38 +00:00
Johannes Anderwald
b3f967520d - reenable module definition
svn path=/trunk/; revision=29050
2007-09-14 21:44:11 +00:00
Johannes Anderwald
456e4e5a19 - remove a non working hack
svn path=/trunk/; revision=29049
2007-09-14 21:06:38 +00:00
Johannes Anderwald
4e6f9d01d7 - include intermediate path for msvc projects since buildno.h and friends are now generated there
svn path=/trunk/; revision=29048
2007-09-14 21:05:46 +00:00
Colin Finck
e9c97ddea4 This is hopefully the last fix needed to build LiveCD on Unix hosts again
svn path=/trunk/; revision=29047
2007-09-14 19:34:24 +00:00
Colin Finck
d23dadadee Small change in the slovak translation of Solitaire (patch by Mario Kacmar, kario AT szm DOT sk)
svn path=/trunk/; revision=29046
2007-09-14 19:26:20 +00:00
Colin Finck
561a35b16d And here comes the next fix, this time for fixing the LiveCD build
svn path=/trunk/; revision=29045
2007-09-14 19:23:36 +00:00
Colin Finck
2b47cce3f0 Forgot to change these ones as well.
But somehow it compiled fine under Windows, even without these changes.

svn path=/trunk/; revision=29044
2007-09-14 19:13:03 +00:00
Colin Finck
d4a18c707c Forgot to change these ones
svn path=/trunk/; revision=29043
2007-09-14 19:02:21 +00:00
Colin Finck
0429c9f223 - Create a new "include/host" directory for host-only includes.
- Copy the "pshpack*.h", "poppack.h" and "typedefs_host.h" (renamed to "typedefs.h") files to this directory
- Modify the Makefiles of cmlib_host, inflib_host, mkhive, unicode, wmc and wrc to remove the "include/psdk" dependency
- Remove the inclusion of "ntstatus.h" in cmlib_host and mkhive

svn path=/trunk/; revision=29042
2007-09-14 18:55:43 +00:00
Colin Finck
256cab14c1 Revert the changes in r29036 to the file "ReactOS-i386.rbuild". They broke build and look like test code for me.
svn path=/trunk/; revision=29041
2007-09-14 17:34:37 +00:00
Hervé Poussineau
b2327d1918 Update project dtd file based on usage (doesn't mean it is good and can't be changed anymore)
svn path=/trunk/; revision=29040
2007-09-14 17:13:46 +00:00
Hervé Poussineau
47bdba1c9b Update README.WINE after revision 29034
svn path=/trunk/; revision=29039
2007-09-14 17:12:13 +00:00
Hervé Poussineau
58d6c588b0 Delete useless files
svn path=/trunk/; revision=29038
2007-09-14 17:10:48 +00:00
Hervé Poussineau
4e99cc9eea Add missing svn:eol-style=native property
svn path=/trunk/; revision=29037
2007-09-14 17:09:45 +00:00
Hervé Poussineau
4b912ebbbc Clean up .rbuild files and make them xml compliant
Inspired by bug 2627

svn path=/trunk/; revision=29036
2007-09-14 17:07:53 +00:00
James Tabor
6aa84d10f7 - Setting up for the User32 part of the win32k rewrite.
- Pass window handle and pointer to the current teb callback. This will allow easy and fast read access for user space programs.
- Next will be ValidateHwnd and the rest.
- https://www.microsoft.com/msj/0397/hood/hood0397.aspx
- http://www.winterdom.com/dev/ui/wnd.html
- http://www.mvps.org/user32/modal.html
- http://www.tech-archive.net/Archive/Development/microsoft.public.win32.programmer.kernel/2006-05/msg00522.html

svn path=/trunk/; revision=29035
2007-09-14 15:34:41 +00:00
The Wine Synchronizer
b0de8603f3 Autosyncing with Wine HEAD
svn path=/trunk/; revision=29034
2007-09-14 08:03:04 +00:00
Hervé Poussineau
6585935cc4 Add imm.h header (enough to let Wine imm.dll compile)
svn path=/trunk/; revision=29033
2007-09-14 08:01:57 +00:00
Hervé Poussineau
96cdd6485c Autosyncing with Wine HEAD
svn path=/trunk/; revision=29032
2007-09-14 07:22:03 +00:00
James Tabor
05315cb742 It does work. There is another bug in the tree!
svn path=/trunk/; revision=29031
2007-09-14 06:37:08 +00:00
James Tabor
a9a5011479 Need to update or sync with wine.
svn path=/trunk/; revision=29030
2007-09-14 06:30:26 +00:00
James Tabor
eb04671664 Vitaliy Margolen: Dont exit when double-clicking with right button held.
svn path=/trunk/; revision=29029
2007-09-14 06:14:50 +00:00
James Tabor
d5de37fdd3 Fix typo, add extra entry to the structure.
svn path=/trunk/; revision=29028
2007-09-14 05:05:35 +00:00
Timo Kreuzer
fa29846725 make upper 16 bit of gdi table entries type field more windows compatible
svn path=/trunk/; revision=29027
2007-09-14 02:53:49 +00:00
James Tabor
1c35130224 Add window client information structure to TEB.
svn path=/trunk/; revision=29026
2007-09-13 16:57:53 +00:00
Daniel Reimer
c182bbd8d8 Reformat the RC Files of the cpls to use rsrc.rc for including additional languages.
*Nameofcpl*.rc should be LANG_NEUTRAL SUBLANG_NEUTRAL.
Add manifest.xml to all CPLs to support skinning from now on.

svn path=/trunk/; revision=29025
2007-09-13 11:40:16 +00:00
Johannes Anderwald
612cdea22b - implement reading/displaying audio schemes
svn path=/trunk/; revision=29024
2007-09-13 03:11:15 +00:00
Johannes Anderwald
e4d4dd3eaa - implement loading of sound items
svn path=/trunk/; revision=29023
2007-09-12 20:22:41 +00:00
Ged Murphy
329da883d0 Set the main icon resource number to 3004. This should ensure SetupDiLoadClassIcon loads it correctly.
svn path=/trunk/; revision=29022
2007-09-12 19:00:36 +00:00
Johannes Anderwald
088f9d7355 - start implementing sound scheme dialog
svn path=/trunk/; revision=29021
2007-09-12 17:51:51 +00:00
Daniel Reimer
fde1731b49 Translate the Keyboard Settings too.
svn path=/trunk/; revision=29019
2007-09-12 15:17:15 +00:00
Ged Murphy
9fdc73bf65 - rewrite the Control code
- smooth the progress bar movement
- clean up various other bits

svn path=/trunk/; revision=29018
2007-09-12 13:50:51 +00:00
Ged Murphy
8732a04d4a Use the handle for ControlService too. This allows me to start and stop my test service (but tcpsvcs hangs on stop)
svn path=/trunk/; revision=29017
2007-09-12 09:27:33 +00:00
Ged Murphy
3d95120a59 silence a couple of debug messages I missed
svn path=/trunk/; revision=29016
2007-09-12 09:08:11 +00:00
Ged Murphy
4092f435c3 add a client handle to the private interface
svn path=/trunk/; revision=29015
2007-09-12 08:47:06 +00:00
Ged Murphy
af45f6b22d - Share a client service handle with the SCM and use it to identify services.
- This fixes the problem where a service name created via CreateService (reg key name) can be different than the one supplied in the call to StartServiceCtrlDispatcher. Windows can still start services in this situation, previously we would fail to find the right service.

svn path=/trunk/; revision=29014
2007-09-12 08:46:00 +00:00
Ged Murphy
b29eee1b73 Receive a client service handle from advapi32 so we can get a permenant link between the SCM and the service
svn path=/trunk/; revision=29013
2007-09-12 08:41:00 +00:00
Hervé Poussineau
873c9d539e Cleanup GetDirectory(), GetFilename() and GetExtension() usage
svn path=/trunk/; revision=29012
2007-09-12 07:04:32 +00:00
Andrew Greenwood
b453ee14e3 Modified WINE's winmm.dll to support loading of user-installable drivers
from the registry 'Drivers' and 'Drivers32' keys, as Windows does. Also 
silenced the beep-MIDI driver (which is supported by winmm! - but 
doesn't seem to do much, at least under vmware.)

Added some Drivers32 entries to be loaded by default, to the hivesft.inf 
file.


svn path=/trunk/; revision=29011
2007-09-12 00:29:07 +00:00
Ged Murphy
48345d7b1d make the apps icon a bit neater
svn path=/trunk/; revision=29010
2007-09-11 21:56:25 +00:00
Ged Murphy
2f0dcbcdef delete comments
svn path=/trunk/; revision=29006
2007-09-11 13:06:20 +00:00
Ged Murphy
b7d1b4a8f8 - Send the SERVICE_STATUS_HANDLE to the SCM so SetServiceStatus has something to work with
- Add control code to stop, pause and resume services and forward it onto the service control handler

svn path=/trunk/; revision=29005
2007-09-11 12:59:38 +00:00
Ged Murphy
c047522694 - store the SERVICE_STATUS_HANDLE and use it for setting service status
- add functionality for controlling services

svn path=/trunk/; revision=29004
2007-09-11 12:56:22 +00:00
Aleksey Bragin
108d48388e - When media is changed, set VolumeDevice's DO_VERIFY_VOLUME flag so it actually gets verified.
- IoVerifyVolume() actually gives two successful statuses - STATUS_SUCCESS and STATUS_WRONG_VOLUME. Respect that when processing an device ioctl.
- "Inability to change CD after boot" issue is fixed.

svn path=/trunk/; revision=29002
2007-09-11 10:29:03 +00:00
Hervé Poussineau
cf9e10327c Rename strFile/strDirectory to a more meaningful name, and move them to appropriate place
svn path=/trunk/; revision=29000
2007-09-11 07:14:32 +00:00
Ged Murphy
5425875734 fix the service name to match the registry key
svn path=/trunk/; revision=28999
2007-09-10 22:28:34 +00:00
Eric Kohl
f9e9cc03c6 - Enumerate short and long date formats.
- Use the currently selected locale id instead of LOCALE_USER_DEFAULT.

svn path=/trunk/; revision=28998
2007-09-10 22:16:01 +00:00
Eric Kohl
9fe96d7b9b Add missing definitions of EnumDateFormats.
svn path=/trunk/; revision=28997
2007-09-10 22:13:52 +00:00
Eric Kohl
edc540afb1 - Enumerate time formats.
- The user must able to change the locale id. Move it into a global structure.
- User the selected locale id instead of LOCALE_USER_DEFAULT.

svn path=/trunk/; revision=28996
2007-09-10 20:46:27 +00:00
Eric Kohl
4c8cd18f0e - Change the currently selected locale id instead of LOCALE_USER_DEFAULT.
- Let the user choose between 0 and 9 fractional digits.
- Fix a typo: SendMesssgeW --> SendMessage.

svn path=/trunk/; revision=28995
2007-09-10 20:40:27 +00:00
Aleksey Bragin
6f31706927 - Separate creating partitions objects into a different function (CreatePartitionsObject()).
- Slightly improve the logic of accessing the partitions list.

svn path=/trunk/; revision=28993
2007-09-10 16:25:48 +00:00
Eric Kohl
743a10f834 Add missing quotation mark and enable the german translation again.
svn path=/trunk/; revision=28992
2007-09-10 13:31:48 +00:00
Hervé Poussineau
0ee69eac89 Fix File::GetFullPath()
svn path=/trunk/; revision=28991
2007-09-10 13:20:32 +00:00
Hervé Poussineau
d1a39218b2 Continue rbuild cleanup (File class)
svn path=/trunk/; revision=28990
2007-09-10 13:13:16 +00:00
Hervé Poussineau
f19c8990fb Disable german resource file as it breaks build
svn path=/trunk/; revision=28989
2007-09-10 13:00:42 +00:00
Hervé Poussineau
5f5a00646d Fix rbuild files
svn path=/trunk/; revision=28988
2007-09-10 12:21:50 +00:00
Daniel Reimer
c04b494d38 Bug 2643: Ukrainian translation update (temarez@yandex.ru)
Fixes in English RC file of Input and a German Translation by myself.

svn path=/trunk/; revision=28987
2007-09-10 10:59:21 +00:00
Hervé Poussineau
621618fbbb Continue rbuild cleanup (Include class)
svn path=/trunk/; revision=28986
2007-09-10 06:52:07 +00:00
James Tabor
f53a2fd07d We are using it now,,, so clean up before use.
svn path=/trunk/; revision=28985
2007-09-10 05:37:57 +00:00
Aleksey Bragin
f22e04dc25 - Use IoBuildAsynchronousFsdRequest() instead of IoBuildDeviceIoControlRequest()
- Use completion routine for completing that type of requests

svn path=/trunk/; revision=28984
2007-09-09 18:32:30 +00:00
Aleksey Bragin
19dc9c4a64 - Make sure CLASS2 driver returns STATUS_UNSUCCESSFUL if receiving a RESET_DEVICE ioctl.
svn path=/trunk/; revision=28983
2007-09-09 17:06:14 +00:00
Aleksey Bragin
109fe2a8fd - IoMapTransfer(NULL, ..) is an old-fashioned way, for DMA master. Changing this back to NULL, since ReactOS's implementation seem to take this into account.
svn path=/trunk/; revision=28982
2007-09-09 16:19:24 +00:00
Aleksey Bragin
6481e255c2 - Revert 27476: another attempt (previously, dgorbachev tried to "fix" this code) to double-release spinlocks. There are even comments in some uncertain cases about this.
For future generations: Have a look at SpiGetNextLunRequest(), it's full of KeReleaseSpinLock()s.

svn path=/trunk/; revision=28980
2007-09-09 14:45:38 +00:00
Colin Finck
45acb6f960 Revert r28972, the pshpack*.h and poppack.h headers are in "include/psdk".
So we're still sharing some small headers with host and target :-(

svn path=/trunk/; revision=28979
2007-09-09 13:12:28 +00:00
Aleksey Bragin
4521f6387a - Revert 28967, and fix the real issue where an overwrite occured (in KiMoveApcState()).
svn path=/trunk/; revision=28978
2007-09-09 13:00:14 +00:00
Eric Kohl
621fbe2cc1 - Remove the WS_SORT style from all comboboxes but the language and location lists in order to display list items in the desired order.
svn path=/trunk/; revision=28977
2007-09-09 12:44:33 +00:00
Aleksey Bragin
0857585ce4 - HACK: Create a missing VRefresh key when installing VMWare's video driver. This solution was proposed long time ago by Herve Poussineau and very recently by Gregor Brunmar. Now VMWare's video driver finally can work as expected, resolution setting works also (tested up to 1400x1050).
- TODO: VRefresh key is absent in the installation .inf, and should be somehow either ignored, or created by something else (not the installer).

svn path=/trunk/; revision=28976
2007-09-09 12:42:45 +00:00
Aleksey Bragin
19b92eb8ab - Improve videoprt's debug messages when accessing registry parameters.
svn path=/trunk/; revision=28975
2007-09-09 12:39:11 +00:00
Art Yerkes
4c33a58449 Mask values that control inheritability of the handle, and don't affect access.
svn path=/trunk/; revision=28973
2007-09-09 12:21:22 +00:00
Colin Finck
1f2057ff37 Remove the references to the "include/psdk" directory from "unicode", "wmc" and "wrc". Due to recent changes, they are not needed anymore.
svn path=/trunk/; revision=28972
2007-09-09 12:12:19 +00:00
Art Yerkes
10b515935a Don't dereference the object unless we actually referenced it. Cygwin apps
no longer bugcheck reactos when abnormally terminating.

svn path=/trunk/; revision=28971
2007-09-09 11:09:56 +00:00
Aleksey Bragin
b4bf4d4ce9 Changes partly based on a patch and ideas by Gregor Brunmar <gregor.brunmar@home.se>:
- Fix size argument in calls to RegQueryValueEx() (if some fails, it may not be equal to sizeof(DWORD)).
- If it's impossible to read settings from vmware's registry key, obtain current screen settings and pass them.

svn path=/trunk/; revision=28970
2007-09-09 11:04:22 +00:00
Aleksey Bragin
87351e3290 - Fix typos in debug messages.
svn path=/trunk/; revision=28969
2007-09-09 10:36:52 +00:00
Aleksey Bragin
2769ad4a93 - Fix build by adding Wine-specific language definitions to WRC
- Revert 28965 and 28966 as unnecessary

svn path=/trunk/; revision=28968
2007-09-09 10:11:04 +00:00
Art Yerkes
1fa5be2cf7 Correct size of KAPC_STATE to fit in the [23] window of PKTHREAD. This is
neccessary, otherwise the APC booleans interfere with FreezeCount.

svn path=/trunk/; revision=28967
2007-09-09 09:49:35 +00:00
Magnus Olsen
8b5e1d5a72 comment out ESPERANTO and WALON languishes file, for it is not supported in windows
svn path=/trunk/; revision=28966
2007-09-09 09:44:43 +00:00
Magnus Olsen
b90953ec15 comment out ESPERANTO languishes file, for it is not supported in windows
svn path=/trunk/; revision=28965
2007-09-09 09:38:55 +00:00
Hervé Poussineau
5d0fb46096 Continue rbuild cleanup (Module class)
svn path=/trunk/; revision=28964
2007-09-09 07:53:40 +00:00
Art Yerkes
8be848bceb Fix inverted logic in suspending process. Now this is symmetric with the
corresponding thaw.

svn path=/trunk/; revision=28963
2007-09-09 07:39:45 +00:00
Art Yerkes
4c4c882824 Add 2-byte packing for the DWORD size that follows the 'BM' signature.
svn path=/trunk/; revision=28962
2007-09-09 05:04:32 +00:00
Colin Finck
d9bcc676f8 Temporary "fix" to get explorer to build again.
Someone please look why wrc fails for this particular file (logov.bmp). I'm out of ideas.

svn path=/trunk/; revision=28961
2007-09-08 22:32:24 +00:00
Eric Kohl
1f47962cc3 - Add sorting page and show it if a language that supports multiple sorting methods has been selected.
svn path=/trunk/; revision=28960
2007-09-08 22:27:41 +00:00
Colin Finck
3c9b25c337 - Revert my previous attempts to fix the "wmc" and "wrc" builds
- Use "typedefs_host.h" in both components now
- wrc needs *MANY* definitions from the Windows headers, therefore I created a new file "wrcrostypes.h", which contains all these definitions.

svn path=/trunk/; revision=28959
2007-09-08 21:40:36 +00:00
Colin Finck
47eb99dcf6 - Solve our wchar_t host problems the easy way by defining WCHAR to "unsigned short" (thx KJK for the hint)
- Revert my changes to the "unicode" module in r28411 and r28423
- Include "typedefs_host.h" instead of the Windows headers in "wine/unicode.h", this component doesn't depend on target headers anymore.
  To get it to work completely without Windows headers, I also had to copy some definitions from <winnls.h> to the "wine/unicode.h" file.

svn path=/trunk/; revision=28957
2007-09-08 19:50:20 +00:00
Hervé Poussineau
252118319f Let ImportLibrary class use the FileLocation concept.
I disabled def files in codeblocks and msvc backends, someone will have to update them

svn path=/trunk/; revision=28956
2007-09-08 19:27:07 +00:00
Colin Finck
f77c414397 - Set g_nMatrixSpeed to 10 as the default value (150 is higher than the maximum value). Same fix is also found in Version 3.0 of the original Matrix ScreenSaver.
Under Windows NT, 2000 and XP up to SP1, this fix is not needed as the SetTimer behaviour is different there, but XP SP2 and Server 2003 have a different SetTimer behaviour (which now also applies to ReactOS).
  See http://msdn2.microsoft.com/en-us/library/ms644906.aspx for more details.
- Remove all the MSVC stuff from the translation files to get them to compile with MSVC ^^
  Sounds stupid, but the files include a non-existing "afxres.h", which lead to an error in MSVC.
- Include <stdlib.h> in "settings.c" for malloc.
- Use UCHAR values instead of int's for ParseCommandLine and chOption.
  MSVC has an assertion (ch >= 0 && ch <= 255) in the isdigit function, so negative values would lead to an error here. (for example, when no arguments are given and the variable contains lots of crap)

We still need to "merge" the cool new stuff from Matrix 3.0 :-)

svn path=/trunk/; revision=28955
2007-09-08 19:04:47 +00:00
Aleksey Bragin
19a10e41da - Don't unlock a not locked TEXTOBJ. Solves booting issue under vmware.
svn path=/trunk/; revision=28954
2007-09-08 18:44:33 +00:00
Colin Finck
98a0a729e4 Enable the Windows Server 2003 behaviour for SetTimer.
Finally, Matrix Screensaver does not work anymore under ReactOS, so we are compatible with Windows XP SP2 and Windows Server 2003 in this case :-D

svn path=/trunk/; revision=28953
2007-09-08 18:43:36 +00:00
Aleksey Bragin
58f3f36a48 - Remove intl_new.cpl
svn path=/trunk/; revision=28952
2007-09-08 17:42:23 +00:00
Eric Kohl
6dd949a054 - Update language samples upon selection of a new language.
- Add a workaround for a special case: "Spanish (Spain)" uses two sorting methods but two sublang ids are used to distinguish them instead of two sort ids. Ensure they don't appear twice in the language list.
- Add "Spanish (Spain)" as a translatable string resource.

svn path=/trunk/; revision=28950
2007-09-08 15:43:19 +00:00
James Tabor
9ef9435f83 Reset DC if MemoryDC or SaveLevelDC.
svn path=/trunk/; revision=28949
2007-09-08 14:30:39 +00:00
Colin Finck
fe71c58954 Forgot to change the names of the actual .lnk files
svn path=/trunk/; revision=28947
2007-09-08 14:17:36 +00:00
Colin Finck
b66cac8ea8 - Change "CharMap" to "Character Map" in the english translation
- Translate "System Tools" and "Character Map" to german

svn path=/trunk/; revision=28946
2007-09-08 14:10:01 +00:00
Johannes Anderwald
5999335021 - add input.dll baseaddress
svn path=/trunk/; revision=28945
2007-09-08 13:27:10 +00:00
Johannes Anderwald
0c146f766c - add input.dll baseaddress
svn path=/trunk/; revision=28944
2007-09-08 13:27:09 +00:00
Christoph von Wittich
ca777771ce handle CachedMode->dmSize
svn path=/trunk/; revision=28943
2007-09-08 12:13:49 +00:00
Aleksey Bragin
844247bb15 - Get rid of NTLPC configuration var completely.
svn path=/trunk/; revision=28942
2007-09-08 12:07:45 +00:00
Aleksey Bragin
9b8e768a59 - NTLPC always 1 now, remove deprecated code
- Unlock SMSS: authors are clearly known, history of smss goes to the beginnings of the project. Code needs cleaning up (headers, formatting).

svn path=/trunk/; revision=28941
2007-09-08 12:02:52 +00:00
James Tabor
912e0b2f35 Fix bootcd problem and found another one.
svn path=/trunk/; revision=28940
2007-09-08 11:57:40 +00:00
Colin Finck
fabeba93d2 Change some prompts in the German translation of Explorer and Shell32, the previous ones sounded a bit strange
svn path=/trunk/; revision=28938
2007-09-08 11:28:19 +00:00
Colin Finck
acb99f2a9f Accept the parameters case-insensitive in shutdown as well
svn path=/trunk/; revision=28937
2007-09-08 09:55:42 +00:00
Colin Finck
1540ce885b - Accept the parameters case-insensitive
- Replace the "/h" option by a "/?" option as described in the Usage text
- Use a consistent indentation
- Change the Usage text a bit

svn path=/trunk/; revision=28936
2007-09-08 09:04:51 +00:00
Colin Finck
a1a8df5ad2 Add a "logevent" utility for adding an event to the EventLog, developed by Marc Piulachs (marc DOT piulachs AT codexchange DOT net)
See issue #2598 for more details.

svn path=/trunk/; revision=28935
2007-09-08 08:31:56 +00:00
Christoph von Wittich
30dc779d1c -fix a bug in GetDisplayNumberFromDeviceName
-don't overwrite memory in IntEnumDisplaySettings

svn path=/trunk/; revision=28934
2007-09-08 07:43:45 +00:00
James Tabor
6a0d3658f6 - Remove DCU_UpdateUserXForms from files for now.
- 28932: Wrong Meta Tag!
- Starting the implementation of thread locking of GDI objects.
- Ref: http://www.winehq.org/pipermail/wine-cvs/2007-August/035810.html

svn path=/trunk/; revision=28933
2007-09-08 01:27:49 +00:00
James Tabor
0f6b993fbd - Reordered IntGdiGet/SetDCState and separated the copy sections.
- When creating DCE for window handles, allocate a DC structure for the default window DC.
- Return Dhpdev if not zero for NtGdiOpenDCW.
- Reordered the DC object. 

svn path=/trunk/; revision=28932
2007-09-08 01:05:27 +00:00
Christoph von Wittich
ede2779483 use the same version number for the dx libraries
svn path=/trunk/; revision=28931
2007-09-07 22:42:09 +00:00
Aleksey Bragin
8a38525cef Dmitry Chapyshev <lentind@yandex.ru>:
- Implement basics of input.dll (does not work yet, just has dialogs/resources).

svn path=/trunk/; revision=28930
2007-09-07 18:22:43 +00:00
Johannes Anderwald
f7db2e960b - store setting BootCDRegtestActive
- only show dbgprint when required

svn path=/trunk/; revision=28929
2007-09-07 18:11:55 +00:00
Aleksey Bragin
93818e712d Dmitry Chapyshev <lentind@yandex.ru>:
- Fix small thing in russian translation of explorer-ru.rc
- Add russian translation of intl.cpl

svn path=/trunk/; revision=28928
2007-09-07 18:06:24 +00:00
Aleksey Bragin
0070af341c Dmitry Chapyshev <lentind@yandex.ru>:
- Fix icon to contain 24bpp and 16bpp images (as all other icons in this directory do)

svn path=/trunk/; revision=28927
2007-09-07 17:47:59 +00:00
Sylvain Petreolle
86c2f05611 fix LANGUAGE directive
svn path=/trunk/; revision=28926
2007-09-07 16:09:52 +00:00
Hervé Poussineau
c4be097a4e Fix bootcd / livecd
svn path=/trunk/; revision=28925
2007-09-07 15:44:44 +00:00
Hervé Poussineau
b1a07a3e6b Some rbuild cleanup:
- Move AutoRegister class to its own file
- Add an enum to replace strings "$(OUTPUT)", "$(INTERMEDIATE)"..., except when writing them to makefile.auto
- Add the FileLocation class to identify a file (root dir, relative path and name)
- Use it to simplify CDFile and InstallFile classes
- Use the FileLocation class when possible
This leads also to good things which were unexpected, like not creating unneeded directories in output directory, removal of some hardcoded strings and a few fixusp in the generated makefile.auto

svn path=/trunk/; revision=28924
2007-09-07 14:59:23 +00:00
Ged Murphy
51a42b98f3 - We shouldn't use the same text as Windows does for descriptions
- Add display names for each service

svn path=/trunk/; revision=28923
2007-09-07 14:05:55 +00:00
Ged Murphy
2e29b0060f fix 1 description and add a new one
See issue #2639 for more details.

svn path=/trunk/; revision=28922
2007-09-07 13:19:37 +00:00
Daniel Reimer
1f4f631661 Bug 2638: Ukrainian translation update (temarez@yandex.ru)
Bug 2640: MSCONFIG: fixes to italian translation by Carlo Bramix (carlo.bramix@libero.it)
This time with RECENT RC Files only. :-)

svn path=/trunk/; revision=28921
2007-09-07 13:16:24 +00:00
Colin Finck
3f97e49561 Also change the download URLs to the Mozilla apps in trunk (see r28919)
svn path=/trunk/; revision=28920
2007-09-07 12:26:46 +00:00
James Tabor
bd954074fa - Reordered IntGdiGet/SetDCState and separated the copy sections.
- When creating DCE for window handles, allocate a DC structure for the default window DC.
- Return Dhpdev if not zero for NtGdiOpenDCW.
- Reordered the DC object. 

svn path=/trunk/; revision=28918
2007-09-07 12:21:26 +00:00
Eric Kohl
5b0be27588 Add the serial keys settings dialog.
svn path=/trunk/; revision=28917
2007-09-07 11:17:09 +00:00
Johannes Anderwald
fec89333bd - use raw hdd image for linux and use vmdk for windows hosts
svn path=/trunk/; revision=28916
2007-09-07 11:16:05 +00:00
Eric Kohl
21850a3f75 Delete the bulgarian translation and revert the polish one because they are outdated. Dialogs and controls are missing or were removed by dreimers latest patch!
svn path=/trunk/; revision=28915
2007-09-07 11:14:51 +00:00
Ged Murphy
fd90cd9c8a adjust the pointers on the server side to match what the client is sending
svn path=/trunk/; revision=28914
2007-09-07 10:55:16 +00:00
Ged Murphy
dae207d99a Fix the client side of the ChangeServiceConfig2 RPC call to send the text in the lpDescription pointer of SERVICE_DESCRIPTION tagged onto the end of the struct.
This fixes setting service descriptions

svn path=/trunk/; revision=28913
2007-09-07 10:52:43 +00:00
Timo Kreuzer
2dbf3f528e - add NTMW_INTERNAL structure
- better structure implementation for ENUMFONTDATAW
- change NewEnumFontFamiliesEx to use the new structure
- some fixes and comments

svn path=/trunk/; revision=28911
2007-09-07 03:33:00 +00:00
Johannes Anderwald
19aed1070b - format hdd images with raw format
- improve error checking

svn path=/trunk/; revision=28910
2007-09-06 22:49:05 +00:00
Ged Murphy
4304ad2ff7 silence debug output
svn path=/trunk/; revision=28909
2007-09-06 21:37:58 +00:00
Johannes Anderwald
1c3f08d9ab - fix bug in GetCPFileNameFromRegistry spotted by Daniel Zimmermann ;)
svn path=/trunk/; revision=28908
2007-09-06 20:18:15 +00:00
Johannes Anderwald
80e9bef2b0 - terminate comment by Marc Puilachs
See issue #2611 for more details.

svn path=/trunk/; revision=28907
2007-09-06 20:00:19 +00:00
Johannes Anderwald
2af89e434c - fix memory leak in GetCPFileNameFromRegistry
- bug report + patch by Daniel Zimmermann / netzimme@aol.com
See issue #2637 for more details.

svn path=/trunk/; revision=28906
2007-09-06 19:57:19 +00:00
Johannes Anderwald
58f165a052 - there can be only one instance of the device manager
svn path=/trunk/; revision=28905
2007-09-06 19:45:26 +00:00
Aleksey Bragin
ac5a5581cd - Fix LoaderPagesSpanned calculation.
svn path=/trunk/; revision=28903
2007-09-06 17:18:42 +00:00
Ged Murphy
2784609696 - Shutdown services when the SCM is terminated
- Add basic code for shutting down of the SCM
- Fix the headers

svn path=/trunk/; revision=28902
2007-09-06 14:51:38 +00:00
Johannes Anderwald
7106e65cde - end the configuration commit war
svn path=/trunk/; revision=28901
2007-09-06 13:57:55 +00:00
Timo Kreuzer
b232c33052 - add the missing macro
What the last change does and I missed last commit:
- use individual pool tags for each gdi object type
- allow object allocation w/o lookaside list
- don't search for the lookaside list/cleanup proc, the index into the lists is now calculated from type

svn path=/trunk/; revision=28900
2007-09-06 13:14:21 +00:00
Andrew Munger
77a5b5a508 Gracefully handle the case where the BIOS insists there is a floppy drive, but there is no controller. Patch by Cameron Gutman (aicommander at gmail dot com) from Bug 1508.
svn path=/trunk/; revision=28899
2007-09-06 12:36:05 +00:00
Andrew Munger
f63bea010c Remove Byte-Order-Mark from rc file. Fixes my solitaire. ;0)
svn path=/trunk/; revision=28898
2007-09-06 12:14:43 +00:00
Ged Murphy
e995f11cfd Add a hack to fix the build.
Timo, can you revert this and add the missing macro when you can please.

svn path=/trunk/; revision=28897
2007-09-06 09:41:00 +00:00
Ged Murphy
fae293c143 add the account name to the QueryServiceConfig RPC call
svn path=/trunk/; revision=28896
2007-09-06 09:18:23 +00:00
Hervé Poussineau
6bd9e7bed6 Explain why some binutils are blacklisted
svn path=/trunk/; revision=28895
2007-09-06 08:25:57 +00:00
Hervé Poussineau
0eccb4aa9d Add method to get target arch in rbuild
svn path=/trunk/; revision=28894
2007-09-06 07:46:48 +00:00
Hervé Poussineau
7338e88f05 As described in documentation, default TEMPORARY variable to current directory (".") instead of nothing ("")
This permits TEMPORARY followed by the directory separator to be "./" instead of "/" (root dir)
Spotted by Andrew Munger on IRC

svn path=/trunk/; revision=28893
2007-09-06 07:17:33 +00:00
Timo Kreuzer
ad90579751 - use the new ObjectType list with fixed indices
svn path=/trunk/; revision=28892
2007-09-06 02:54:17 +00:00
Timo Kreuzer
2aaf1f0e51 - cleanup EXTPENS and PENS in BRUSH_Cleanup, remove EXTPEN_Cleanup
- add new new ObjectTypeInfo structure. It's unused atm, but it will be soon.


svn path=/trunk/; revision=28891
2007-09-06 01:04:18 +00:00
Timo Kreuzer
35bf0957bc - use NtDd api directly instead of using old syscall function.
- remove some old definitions
- fix build to make Wax happy

svn path=/trunk/; revision=28890
2007-09-06 00:42:51 +00:00
Timo Kreuzer
ccca2fc546 - move dx gdi object type definitions from intddraw.h to ntgdihdl.h, change 2 type values to make them match windows, comment out 2 unused types for now.
- add pool tags for gdi objects
- add a bitmask for basic type (0x01 - 0x1f)

svn path=/trunk/; revision=28889
2007-09-06 00:28:04 +00:00
Ged Murphy
2525c2ea6a don't try to free a NULL pointer
svn path=/trunk/; revision=28888
2007-09-05 22:44:46 +00:00
Ged Murphy
b1833d8186 - Implement the RPC server calls for QueryServiceConfig2 and ChangeServiceConfig2 (SmcrChangeServiceConfig2 is untested)
- This fixes the retrieval of the service description in servman

svn path=/trunk/; revision=28887
2007-09-05 22:35:51 +00:00
Aleksey Bragin
396346644c - Fix IntEaLength's type (ULONG -> LONG), so it could actually become negative, and corresponding check will be performed.
svn path=/trunk/; revision=28886
2007-09-05 21:35:09 +00:00
Aleksey Bragin
e598b5b7ae UINT -> ULONG
svn path=/trunk/; revision=28885
2007-09-05 21:32:04 +00:00
Johannes Anderwald
1c8e960090 - delete pidfile if it exists before launching emulator
- delete pidfile on exit
- close pidfile on failure

svn path=/trunk/; revision=28884
2007-09-05 21:00:32 +00:00
Timo Kreuzer
fe82da5539 New implementation of EnumFontFamiliesExW, based on NtGdiEnumFontXxx, does not work on ros, because those apis are not implemented yet, but it works on Windows XP.
svn path=/trunk/; revision=28883
2007-09-05 19:32:37 +00:00
Timo Kreuzer
b35b3e0ff7 different implementation of ENUMFONTDATA structure
svn path=/trunk/; revision=28882
2007-09-05 19:27:16 +00:00
Christoph von Wittich
7cc946b793 -allocate the buffer for the NamedPipeReader on Linux too
-use linux path as default in txtmode.cfg

svn path=/trunk/; revision=28881
2007-09-05 17:02:30 +00:00
Christoph von Wittich
7e1ef16736 fix some bugs in the linux version (not working yet)
svn path=/trunk/; revision=28880
2007-09-05 16:52:45 +00:00
Hervé Poussineau
e49226799b Fix ReactOS temporary directory name
svn path=/trunk/; revision=28879
2007-09-05 16:33:41 +00:00
Ged Murphy
5d16caaca6 fix description spelling
svn path=/trunk/; revision=28878
2007-09-05 14:47:15 +00:00
Eric Kohl
0addcc009e - Forgot to enable the GeoId code.
- Fixed another hardcoded Unicode string.
- More indentation fixes.
- No code changes.

svn path=/trunk/; revision=28877
2007-09-05 14:42:24 +00:00
Eric Kohl
63d106c29f - Replace the hardcoded calls to Unicode-Functions. Use the module configuration to build a Unicode version instead.
- Cleaned up a lot of coding-style and indentation issues.
- No code changes.

svn path=/trunk/; revision=28876
2007-09-05 14:24:45 +00:00
Hervé Poussineau
9674b37837 Synchronize with Wine WIDL 0.9.44 (and a few patches by Dan Hipschman found on wine-patches ML)
svn path=/trunk/; revision=28873
2007-09-05 11:15:09 +00:00
Hervé Poussineau
72e2ba5445 Duplicate widl tool to widl_new
svn path=/trunk/; revision=28872
2007-09-05 11:11:31 +00:00
Ged Murphy
05e11ee73f sync rpcrt4_new to Wine 0.9.44
svn path=/trunk/; revision=28871
2007-09-05 10:21:30 +00:00
Hervé Poussineau
0e970f97eb Finally let Wine package version depend of ReactOS version
svn path=/trunk/; revision=28870
2007-09-05 09:27:40 +00:00
Hervé Poussineau
256a24ca42 Let tools including the version number depend of buildno.h
Remove useless tool tools-check (replaced by a rbuild check)
Add .phony targets for gendib and nci

svn path=/trunk/; revision=28869
2007-09-05 09:22:14 +00:00
Aleksey Bragin
d2816c6491 - Fix a typo in the code (thanks to "zimme" for spotting).
svn path=/trunk/; revision=28868
2007-09-05 08:20:03 +00:00
Aleksey Bragin
4cb2b785c3 - Apply 28852 changes to setupldr.c (fixes bootcd).
svn path=/trunk/; revision=28867
2007-09-05 08:10:41 +00:00
Johannes Anderwald
14a7e07da8 - no comment
svn path=/trunk/; revision=28866
2007-09-04 23:47:16 +00:00
Christoph von Wittich
0412c4b0ae fix linux build
svn path=/trunk/; revision=28865
2007-09-04 22:51:21 +00:00
Johannes Anderwald
e46b50d110 - split boot cmd into tokens
svn path=/trunk/; revision=28864
2007-09-04 22:44:01 +00:00
Ged Murphy
d17bf3ab31 remove 4bpp bitmaps, add 24bpps and clean them all up.
svn path=/trunk/; revision=28863
2007-09-04 22:10:57 +00:00
Ged Murphy
e2db8738fe add 24 and 8 bit bitmaps
svn path=/trunk/; revision=28861
2007-09-04 21:32:35 +00:00
Ged Murphy
8976fa2e03 - fix SetupDiLoadClassIcon to load 32x22 for the large icon
- fix SetupDiGetClassImageList to load 16x16 icons for the device image list.
- devmgmt now loads up the correct sizes for both the treeview and the property page

svn path=/trunk/; revision=28860
2007-09-04 21:30:22 +00:00
Christoph von Wittich
4bfe0df0be fix linux build
svn path=/trunk/; revision=28859
2007-09-04 21:12:27 +00:00
Ged Murphy
cc461f5920 preset in case of failure
svn path=/trunk/; revision=28858
2007-09-04 20:28:44 +00:00
Johannes Anderwald
60cddd9562 - finish immediately on unattended second stage install
svn path=/trunk/; revision=28857
2007-09-04 20:26:02 +00:00
Christoph von Wittich
9487793fe7 fix some of the linux build issues
svn path=/trunk/; revision=28856
2007-09-04 20:19:57 +00:00
Ged Murphy
8f7e520058 - read ClassGUID from the registry instead of sending GUID_NULL
- fixes part of SetupDiOpenDeviceInfo which now allows loading of icons in the devmgr.dll property sheets

svn path=/trunk/; revision=28855
2007-09-04 20:18:39 +00:00
Johannes Anderwald
a1de0509ed - readd named pipe support for linux by Christoph_vW
- simplify named pipe code
- only allocate buffer for reading once 
- dont format default hdd if it exists
- delay read at right position
- fix ROS_DELAY_READ option in config file - value is expected to be in seconds not milliseconds

svn path=/trunk/; revision=28854
2007-09-04 19:53:49 +00:00
Johannes Anderwald
a04c49f61c - fix a bug
svn path=/trunk/; revision=28853
2007-09-04 19:41:58 +00:00
Aleksey Bragin
301681680f - Use real NT KPCR address (0xFFDFF000).
- Remove all hacked KPCR_BASE definitions.
- Make FreeLDR give address of PageDirectoryStart/End addresses. This was being ignored/incorrect until now and the page directory could've gotten overwritten.
- Properly setup the HAL PDE, instead of having different PDEs for KUSER_SHARED_DATA, KPCR and ACPI I/O.
- Do not over-write shared user data with ACPI I/O anymore. This was probably a bad idea.
- Do not mark almost a meg of space as KPCR_USERD_SHARED data anymore, and don't mess up the CPU TLB anymore.
- Give a dedicated page to KUSER_SHARED_DATA (Page 2, physical address 0x2000) right after the KPCR, isntead of a random address that probably ended up overwritten later during the OS's lifetime.
- Fix FS selector in the GDT.
- Remove hack in Trap Fault Handler.
- Add a little hack to allow mapping Page 2 into user-space even though it's marked as used, this is for the Shared User Data page.

svn path=/trunk/; revision=28852
2007-09-04 18:19:59 +00:00
Colin Finck
7a0b809846 Silence two warnings in cmlib.
This makes the livecd part compiling warning-free on 32-bit systems. On 64-bit hosts, we still need to squash out this __cdecl warning.

svn path=/trunk/; revision=28851
2007-09-04 16:05:44 +00:00
James Tabor
128482c59c Moved code. Finding out when changing ownership, it will require the deallocation and allocation of old and new dcattr.
svn path=/trunk/; revision=28850
2007-09-04 15:59:21 +00:00
Christoph von Wittich
a83bfb4c33 forgot to commit this file
svn path=/trunk/; revision=28849
2007-09-04 14:50:11 +00:00
Christoph von Wittich
8ce3ea704d changed path to dbgprint.exe
svn path=/trunk/; revision=28848
2007-09-04 14:47:47 +00:00
Daniel Reimer
45cef14031 Bug 2528: Few updates to Italian rc files (devotip@tiscali.it) except access.cpl, which was not diffed to HEAD.
svn path=/trunk/; revision=28847
2007-09-04 14:41:22 +00:00
Christoph von Wittich
6bead1805a add dbgprint to bootcd until a better solution is found
svn path=/trunk/; revision=28846
2007-09-04 14:39:53 +00:00
Christoph von Wittich
a920a77e55 re-add dbgprint - now as win32 module
svn path=/trunk/; revision=28845
2007-09-04 14:28:29 +00:00
Colin Finck
a1493f0b00 Correctly define LONG_PTR, ULONG_PTR and SIZE_T in "typedefs_host.h".
This should silence many warnings and might fix the Live-CD build problems of our 64-bit Buildslave.

svn path=/trunk/; revision=28844
2007-09-04 14:12:27 +00:00
Johannes Anderwald
53fd100f02 - remove dbgprint from tools
- dbgprint needs to be win32 application and must be moved

svn path=/trunk/; revision=28843
2007-09-04 14:05:35 +00:00
Johannes Anderwald
79f383df0b - fix target
svn path=/trunk/; revision=28842
2007-09-04 13:56:21 +00:00
Johannes Anderwald
a6b6e781a2 - add disk param when booting from cdrom
- hardcode vnc 0 option to linux build
- make -no-reboot option available for windows hosts only

svn path=/trunk/; revision=28841
2007-09-04 13:47:08 +00:00
Christoph von Wittich
7700f97898 -fix build
svn path=/trunk/; revision=28840
2007-09-04 13:37:09 +00:00
Johannes Anderwald
88ced411c7 - fix serious bug in createHDDImage
- delay reading if requested

svn path=/trunk/; revision=28839
2007-09-04 13:31:03 +00:00
James Tabor
59a03d6577 Fix processid mask, update gdi handle entry, shift mask and VM memory alloc.
svn path=/trunk/; revision=28838
2007-09-04 11:30:49 +00:00
Christoph von Wittich
e7b744d5c5 fix compilation on linux
svn path=/trunk/; revision=28837
2007-09-04 11:10:17 +00:00
Johannes Anderwald
9187115f22 - silence debug message
- dont hardcode paths in regression testing code

svn path=/trunk/; revision=28836
2007-09-04 11:03:16 +00:00
Johannes Anderwald
c99304bb69 - include unattend.inf per default in the bootcd
- unattend setup is disabled by the key UnattendSetupEnabled
- to enable set key to "yes" without quotes

svn path=/trunk/; revision=28835
2007-09-04 10:36:22 +00:00
Johannes Anderwald
711785c421 Copied remotely
svn path=/trunk/; revision=28834
2007-09-04 10:33:32 +00:00
Daniel Reimer
888aba31bc Luckily I forgot these files. So I can add a missing line in the commit message :-P
Bug 2534: Few translations (temarez@yandex.ru)

svn path=/trunk/; revision=28833
2007-09-04 10:24:41 +00:00
Daniel Reimer
2d0b61b212 Massive Translations commit:
Bug 2628: New intl.cpl italian translation by Gabirel Ilardi (gabrielilardi@hotmail.it)
Bug 2626: Modifications for solitaire catalan translation by Marc Tormo i Bochaca (mtbochaca@ya.com)
Bug 2625: Catalan translation for msconfig by Marc Tormo i Bochaca (mtbochaca@ya.com)
Bug 2612: Spanish translation for explorer_new and updated translation for explorer by Marc Piulachs (marc.piulachs@codexchange.net)
Bug 2606: Bulgarian translation of ReactOS. (sstpr@narod.ru)
Bug 2603: userenv es-ES localization by Marc Piulachs (marc.piulachs@codexchange.net)
Bug 2534: Few translations (temarez@yandex.ru)

svn path=/trunk/; revision=28832
2007-09-04 09:59:46 +00:00
Johannes Anderwald
9b5863ddfb - rename sleep to delayExecution
- delayExecution accepts the value now in seconds
- should fix the linux crash

svn path=/trunk/; revision=28831
2007-09-04 09:36:00 +00:00
Christoph von Wittich
0c92f06002 fix some issues found by prefast
svn path=/trunk/; revision=28830
2007-09-03 23:56:04 +00:00
Art Yerkes
9786ea3b93 My hack isn't needed anymore.
svn path=/trunk/; revision=28829
2007-09-03 23:03:33 +00:00
Ged Murphy
ccf991c1b7 add an IDE disk controller icon. All basic device manager items should now have an icon. If anyone comes across anything that doesn't, let me know as we still have a few more icons to add yet.
svn path=/trunk/; revision=28828
2007-09-03 22:23:50 +00:00
Ged Murphy
196cfe951b fix the icon licence notes
svn path=/trunk/; revision=28827
2007-09-03 21:53:15 +00:00
Colin Finck
091a80b5ff Make these two "registry_callback() failed" messages different, so it is easier to see where our 64-Bit Buildslave fails
svn path=/trunk/; revision=28826
2007-09-03 20:54:54 +00:00
Ged Murphy
8f37a9e42e add a new tango style usb icon which better matches the reactos icon theme
svn path=/trunk/; revision=28825
2007-09-03 20:50:02 +00:00
Colin Finck
095a2016c5 Lithuanian translations for several base applications by Vytis Girdzijauskas (cman AT cman DOT us)
See issue #2532 for more details.

svn path=/trunk/; revision=28824
2007-09-03 20:45:58 +00:00
Ged Murphy
7470d72c18 fix serial icon
svn path=/trunk/; revision=28823
2007-09-03 19:39:52 +00:00
Colin Finck
bd36046a96 Build fixes for MSVC, now mkhive can be built with MSVC again
svn path=/trunk/; revision=28822
2007-09-03 19:33:03 +00:00
Christoph von Wittich
a478151d4c fix a small bug in set and added missing german translations
svn path=/trunk/; revision=28821
2007-09-03 17:40:30 +00:00
Ged Murphy
3b51bcc560 add a new serial port icon. I'll do the hard disk controller one later
svn path=/trunk/; revision=28820
2007-09-03 16:03:31 +00:00
Johannes Anderwald
2f0ada9276 - improve error checking
svn path=/trunk/; revision=28819
2007-09-03 16:02:26 +00:00
Ged Murphy
e35de311ed Add the icon mask to the imagelist. The device manager icons now look correct
svn path=/trunk/; revision=28818
2007-09-03 15:40:24 +00:00
Ged Murphy
55fd514cf3 set the correct icon image for the Keyboard class
svn path=/trunk/; revision=28817
2007-09-03 14:53:46 +00:00
Ged Murphy
ce162db686 - load icon resources using LoadImage. ExtractIcon loads sequential numbers, not resource numbers.
- fixes the device image list

svn path=/trunk/; revision=28816
2007-09-03 14:51:06 +00:00
Eric Kohl
21c0efe8cd - Convert RADIOBUTTONs to AUTORADIOBUTTONs.
- Replace Trackbars by Comboboxes in the filter keys dialogs.
- Fix some typos and minor translation issues in the german dialogs.
- Add missing functionality for the repeat key dialog.

@dreimer: Did I fix all bugs?


svn path=/trunk/; revision=28815
2007-09-03 14:44:08 +00:00
Hervé Poussineau
825a2f98fa Build openfirmware interface tool only if target is powerpc
svn path=/trunk/; revision=28814
2007-09-03 13:50:31 +00:00
Hervé Poussineau
a864054304 Check a Windows host by _WIN32 define, not WINDOWS_HOST
svn path=/trunk/; revision=28813
2007-09-03 13:43:39 +00:00
Daniel Reimer
2260a4339e Updated access.cpl German Translation. Some texts don't fit, but I have absolutely NO Idea how this RC File works. Eric, explain me. :-P
svn path=/trunk/; revision=28812
2007-09-03 10:57:06 +00:00
Art Yerkes
8d262dd954 Add 16-byte alignment for ppc (required by eabi too)
svn path=/trunk/; revision=28811
2007-09-03 10:29:14 +00:00
Hervé Poussineau
b3ab8c804e Align stack to 16 bytes on mips
svn path=/trunk/; revision=28810
2007-09-03 10:22:13 +00:00
Hervé Poussineau
b60824e779 Fix build #2
svn path=/trunk/; revision=28809
2007-09-03 09:31:48 +00:00
Hervé Poussineau
fbde3e7d44 Fix build
svn path=/trunk/; revision=28808
2007-09-03 08:57:19 +00:00
Hervé Poussineau
5b3a9d3b2d Add a generic implementation of InterlockedBitTestAndSet/InterlockedBitTestAndReset/BitScanReverse
svn path=/trunk/; revision=28807
2007-09-03 08:50:06 +00:00
Hervé Poussineau
af1226ddc6 Swap boot sector on big endian systems, even if DEBUG is not defined. Debug and release builds should behave the same
svn path=/trunk/; revision=28806
2007-09-03 08:17:55 +00:00
Hervé Poussineau
c0614ecb59 Add missing svn:eol-style=native properties
svn path=/trunk/; revision=28805
2007-09-03 07:39:30 +00:00
Art Yerkes
39ed067ac8 Fix swapping for fat recognition.
svn path=/trunk/; revision=28804
2007-09-03 06:58:25 +00:00
Art Yerkes
2123b0666e Fix building of libcntpr on ppc.
We now get a proper bootcd image.

svn path=/trunk/; revision=28803
2007-09-03 06:29:13 +00:00
James Tabor
4149385d00 Turn off support for now due to user land exception.
svn path=/trunk/; revision=28802
2007-09-03 05:30:45 +00:00
Art Yerkes
930b718aa7 Move mismerged segment to the right place; claim from openfirmware if we
don't have enough reserve.

svn path=/trunk/; revision=28801
2007-09-03 05:29:03 +00:00
Hervé Poussineau
12b88bedcb Few indentation fixes
Generate again boot programs in output directory

svn path=/trunk/; revision=28800
2007-09-03 04:12:48 +00:00
Hervé Poussineau
4cb8151f10 Supports a few more ACPI devices
Patch by Cameron Gutman (aicommander at gmail dot com)

svn path=/trunk/; revision=28799
2007-09-03 04:01:28 +00:00
Johannes Anderwald
fe58401893 - scroll window with ScrollWindowEx
- fix a bug in GuiConsoleWndProc
- scrolling does not work yet

svn path=/trunk/; revision=28798
2007-09-03 03:49:23 +00:00
James Tabor
bb300c0259 - Win32k: DC_ATTR: Moved to it.
- We need to decide how to optimize the syncing. CreateD/IC/CompatibleDC, GetDCState and SelectObject use the sync in one form. This can become ugly. Some DC handles do not belong to the current process. We need to reorder the mess in dc.c and clean it up.
- Gdi32: The only ones using it are GetCurrentObject and with out updates Get/SetDCBrush/PenColor.
- Implemented an example of RealizePalette. Moved SetBk/TextColor into dc.c, don't use them.
- Update gdi32.def.

svn path=/trunk/; revision=28797
2007-09-03 03:43:21 +00:00
Johannes Anderwald
89628d18b4 - halfplement console scrolling support
svn path=/trunk/; revision=28796
2007-09-03 03:29:18 +00:00
Art Yerkes
574eb2daac Straggler edits.
svn path=/trunk/; revision=28795
2007-09-03 01:59:48 +00:00
Johannes Anderwald
9b81b3ab92 - add hActiveBuffer member to struct to ensure that modifying the screenbuffer is secured
- fix a bugs in the screen buffer resize code
- resizing now "works" (unfortunately a few drawing bugs show up)

svn path=/trunk/; revision=28794
2007-09-03 01:58:43 +00:00
Art Yerkes
81f092736f Added freeldr and hal from PPC branch, along with needed headers and
build changes.

Next ntoskrnl and add ppc dir under libcntptr, which didn't exist when I 
forked.

svn path=/trunk/; revision=28793
2007-09-03 01:57:36 +00:00
Daniel Reimer
533b371674 Activated German RC File.
Add BS_MULTILINE to one Checkbox.
Fixed some Text Lengths to fit.

svn path=/trunk/; revision=28792
2007-09-02 23:34:31 +00:00
Daniel Reimer
cf4a1dfd42 I missed a Dialog in my Translation :-P
svn path=/trunk/; revision=28791
2007-09-02 23:04:40 +00:00
Daniel Reimer
574d5f0dd0 Updated German Resource File. I was NOT able to test it, because intl seems to be broken, but before anybody else commits a translation...
svn path=/trunk/; revision=28790
2007-09-02 22:39:17 +00:00
Johannes Anderwald
9392cd7ab8 - improve error checking
- add hasQemuNoRebootOption stub

svn path=/trunk/; revision=28789
2007-09-02 22:27:03 +00:00
Johannes Anderwald
ef3fd8d176 - verify provided boot_cmd
- create also hdd images for manual boot cmds
 

svn path=/trunk/; revision=28788
2007-09-02 21:47:07 +00:00
Johannes Anderwald
b57a996929 - hardcode the bios directory on linux system to /usr/share/qemu
- store the pid.txt in ROS_OUTPUT
- check on linux system if the emulator was successfully launched

svn path=/trunk/; revision=28787
2007-09-02 21:11:12 +00:00
Aleksey Bragin
3a3645aa1e Dmitry Chapyshev <lentind@yandex.ru>:
- Improve intl.cpl, include almost all code from intl_new branch (it's pending for deletion now)
 - ReactOS's intl.cpl now works and behaves similar to Windows XP's intl.cpl, only the last tab is unfinished
 - Tested in Windows and ReactOS (in ROS it obviously has reduced functionality, since some of needed registry entries are absent)
 - As a result, all other languages (other than en-us) need to be re-translated.

svn path=/trunk/; revision=28786
2007-09-02 20:42:08 +00:00
Hervé Poussineau
0eb52138ba Fix Linux build
svn path=/trunk/; revision=28785
2007-09-02 19:46:23 +00:00
Hervé Poussineau
6982b02da4 Remove local header debug.h, and use the global one
svn path=/trunk/; revision=28784
2007-09-02 19:42:22 +00:00
Hervé Poussineau
056f1f734f Use typedefs_host.h header when building inflib for host
svn path=/trunk/; revision=28783
2007-09-02 19:23:43 +00:00
Hervé Poussineau
93b424d064 Do not disable asserts
svn path=/trunk/; revision=28782
2007-09-02 19:22:26 +00:00
Eric Kohl
d04f683b06 - Add the repeat key settings dialog. It does not work yet.
- Update the bounce key settings dialog.
- Update the general page.

svn path=/trunk/; revision=28781
2007-09-02 19:12:41 +00:00
Magnus Olsen
6f69483d34 update ntgdibad.h before I forget thuse details that are need be done.
svn path=/trunk/; revision=28780
2007-09-02 19:03:50 +00:00
Johannes Anderwald
1f4fc15d27 - implement screenbuffer resizing(required for console scrolling support)
- still quite buggy :)

svn path=/trunk/; revision=28779
2007-09-02 18:21:36 +00:00
Hervé Poussineau
b2454a486f Make some i386 code conditional
Add missing svn:eol-style=native property

svn path=/trunk/; revision=28778
2007-09-02 18:05:16 +00:00
Hervé Poussineau
2d5d8783a9 Fix warnings, and compilation of dib24bppc.c/dib32bppc.c
svn path=/trunk/; revision=28777
2007-09-02 16:33:00 +00:00
Magnus Olsen
f503e01b03 implement SetDeviceGammaRamp in gdi32 (leftdo check win32k if it implement or not)
svn path=/trunk/; revision=28776
2007-09-02 14:36:48 +00:00
Magnus Olsen
0d6c6a0913 add smaller check to SetDIBColorTable
svn path=/trunk/; revision=28775
2007-09-02 14:11:28 +00:00
Magnus Olsen
8e85947cea sorry fix the the build
svn path=/trunk/; revision=28774
2007-09-02 13:54:26 +00:00
Magnus Olsen
8dd3f58473 partly implement SetBoundsRect
svn path=/trunk/; revision=28773
2007-09-02 13:31:41 +00:00
Magnus Olsen
3ec9aeaa02 implement SelectFontLocal
svn path=/trunk/; revision=28772
2007-09-02 13:19:07 +00:00
Magnus Olsen
d9d416611c implement SelectBrushLocal
svn path=/trunk/; revision=28771
2007-09-02 13:09:50 +00:00
Hervé Poussineau
8f965b75c6 Search a property by its name
svn path=/trunk/; revision=28770
2007-09-02 13:08:00 +00:00
Magnus Olsen
7faf7e1de8 fix smaller bug in SelectClipRgn
svn path=/trunk/; revision=28769
2007-09-02 12:58:35 +00:00
Magnus Olsen
9c2159e7f6 implement RemoveFontMemResourceEx (left todo fix it in win32k)
svn path=/trunk/; revision=28768
2007-09-02 12:18:34 +00:00
Magnus Olsen
ef2cee7158 implement stub for NtGdiSelectBitmap, NtGdiSelectBrush, NtGdiSelectFont, NtGdiSelectPen, NtGdiSetBitmapAttributes, NtGdiSetFontEnumeration, NtGdiSetFontXform, NtGdiSetLinkedUFIs, NtGdiSetMagicColors, NtGdiGetDeviceWidth, NtGdiMirrorWindowOrg, NtGdiSetLayout, NtGdiStretchDIBitsInternal, NtGdiUnloadPrinterDriver, NtGdiUnmapMemFont
svn path=/trunk/; revision=28767
2007-09-02 11:28:34 +00:00
Art Yerkes
3833d9dc03 Ignore elf.
svn path=/trunk/; revision=28766
2007-09-02 11:14:58 +00:00
Art Yerkes
fa7d1ae29f Ignore elf executables.
svn path=/trunk/; revision=28765
2007-09-02 11:10:27 +00:00
Magnus Olsen
245a9fc0b7 implement stub for NtGdiIcmBrushInfo, NtGdiInit, NtGdiMakeFontDir, NtGdiMakeInfoDC, NtGdiMonoBitmap, NtGdiMoveTo
svn path=/trunk/; revision=28764
2007-09-02 10:50:25 +00:00
Magnus Olsen
d0fb82d2cf implement stub for NtGdiGetEmbUFI, NtGdiGetUFIPathname, NtGdiGetEmbedFonts, NtGdiChangeGhostFont, NtGdiAddEmbFontToDC, NtGdiGetWidthTable, NtGdiSTROBJ_bEnum, NtGdiSTROBJ_bEnumPositionsOnly, NtGdiSTROBJ_bGetAdvanceWidths, NtGdiSTROBJ_vEnumStart, NtGdiSTROBJ_dwGetCodePage, NtGdiGetDhpdev
svn path=/trunk/; revision=28763
2007-09-02 10:33:02 +00:00
Magnus Olsen
5cb3200f34 Implement stub for NtGdiGetServerMetaFileBits, NtGdiGetStats, NtGdiPolyTextOutW, NtGdiRemoveFontResourceW, NtGdiRemoveFontMemResourceEx, NtGdiSetBrushAttributes, NtGdiSetupPublicCFONT,
NtGdiSetVirtualResolution, NtGdiSetSizeDevice, NtGdiXLATEOBJ_cGetPalette, NtGdiXLATEOBJ_iXlate, NtGdiXLATEOBJ_hGetColorTransform, NtGdiXFORMOBJ_bApplyXform, NtGdiXFORMOBJ_iGetXform

svn path=/trunk/; revision=28762
2007-09-02 10:14:28 +00:00
Art Yerkes
da634e3215 Empty OARCH.
svn path=/trunk/; revision=28761
2007-09-02 09:59:45 +00:00
Art Yerkes
4f9da98a43 Small change to make OARCH optional.
svn path=/trunk/; revision=28760
2007-09-02 09:59:11 +00:00
Art Yerkes
bc79808b38 Remove hack-coff and le2be. We make an elf booter now.
svn path=/trunk/; revision=28759
2007-09-02 09:17:46 +00:00
Art Yerkes
1b0de699dd Adding misc ppc tools.
svn path=/trunk/; revision=28758
2007-09-02 09:11:10 +00:00
Art Yerkes
debfd91189 Add interface generator for open firmware calls.
svn path=/trunk/; revision=28757
2007-09-02 09:02:12 +00:00
James Tabor
4a7979cd3e Working Dc_Attr support, tested and it worked. Will plugin the rest later.
svn path=/trunk/; revision=28756
2007-09-02 07:59:12 +00:00
James Tabor
108ae6fb76 Fix BootCD!!!!! Watch your commit GL! LOL!
svn path=/trunk/; revision=28755
2007-09-02 05:31:00 +00:00
Timo Kreuzer
c82d56cc94 Revert wars! ;-)
I talked with GL, he agrees, it is correct.

svn path=/trunk/; revision=28754
2007-09-01 23:11:16 +00:00
Timo Kreuzer
2b31cf640d - Add test for AddFontResourceEx showing that the function accepts 0 as flags.
- remove header inclusion in test files

svn path=/trunk/; revision=28753
2007-09-01 22:06:05 +00:00
Magnus Olsen
34647baaf1 add PatBlt, PolyPatBlt to user mode
redirect PATHOBJ_bEnum@8 to NtGdiPATHOBJ_bEnum@8, PATHOBJ_bEnumClipLines@12 to NtGdiPATHOBJ_bEnumClipLines@12, PATHOBJ_vEnumStart@4 to NtGdiPATHOBJ_vEnumStart@4, PATHOBJ_vEnumStartClipLines@16 to NtGdiPATHOBJ_vEnumStartClipLines@16, PATHOBJ_vGetBounds@8 to NtGdiPATHOBJ_vGetBounds@8
update the good api list

svn path=/trunk/; revision=28752
2007-09-01 21:36:44 +00:00
Aleksey Bragin
9bb3aa1130 - Finish the memory map code, so it now actually creates a real memory map, with all reserved, unusable pages marked
- Add a memory type enum and use it in memory descriptors
- Improvements in KiRosFrldrLpbToNtLpb() (separate the code into different functions, bugfixes)

svn path=/trunk/; revision=28751
2007-09-01 20:54:02 +00:00
Magnus Olsen
290cc1ffd4 revert 28748 that change are incorrect,
it shall only check if the bits are set or not, 
if no flag are set we shall fail, if one flag are set we shall doing the call. 

svn path=/trunk/; revision=28750
2007-09-01 20:25:50 +00:00
Christoph von Wittich
94d3aeebb3 set eol-style:native
svn path=/trunk/; revision=28749
2007-09-01 19:53:06 +00:00
Timo Kreuzer
8afb55f5f5 fix AddFontResourceExAW parameter check
svn path=/trunk/; revision=28748
2007-09-01 19:32:20 +00:00
Johannes Anderwald
d0bc8873a1 - dont show same wallpaper twice
- bug report + patch by Vytis Girdzijauskas, "CMan", cman[at]cman[dot]us
See issue #2601 for more details.

svn path=/trunk/; revision=28747
2007-09-01 17:18:00 +00:00
Johannes Anderwald
ab1415d99c - fix loading of resources
svn path=/trunk/; revision=28746
2007-09-01 16:34:22 +00:00
Johannes Anderwald
67f1c2a0e9 - load icon from the right HINSTANCE handle
svn path=/trunk/; revision=28745
2007-09-01 16:03:12 +00:00
Johannes Anderwald
2733ed92aa - load resources from the dll handle
- loop untill the real stop condition is found
- this makes the console properties menu working again 
See issue #1827 for more details.

svn path=/trunk/; revision=28744
2007-09-01 15:54:16 +00:00
Magnus Olsen
f3d89dd0ed implement stub for NtGdiPATHOBJ_vGetBounds, NtGdiPATHOBJ_vEnumStart, NtGdiPATHOBJ_vEnumStartClipLines
svn path=/trunk/; revision=28743
2007-09-01 15:10:17 +00:00
Magnus Olsen
8454705d07 implement stub for NtGdiPATHOBJ_bEnum, NtGdiPATHOBJ_bEnumClipLines
svn path=/trunk/; revision=28742
2007-09-01 14:13:53 +00:00
Magnus Olsen
ae949a4864 update the good api list
svn path=/trunk/; revision=28741
2007-09-01 13:22:40 +00:00
Magnus Olsen
c3e3a01734 fix two typo thx ged
svn path=/trunk/; revision=28740
2007-09-01 13:10:36 +00:00
Magnus Olsen
14d7a9c6ea fast bugfix, NtGdiExtEscape should accpect a NULL hdc.
svn path=/trunk/; revision=28739
2007-09-01 13:05:33 +00:00
Magnus Olsen
01758ff86f add stub for : IsValidEnhMetaRecord and IsValidEnhMetaRecordOffExt, I have not search after any info about thuse api
follow api need have some part done in user mode : OffsetRgn, GetTextCharsetInfo, IntersectClipRect, OffsetClipRgn.
Implement partly NamedEscape we need metadc support to finish full implement 
follow api have been move from redirect to smaller code into hacks.c for they are ros own syscall and 
does not exists in windows, GetStretchBltMode, GetTextAlign, GetTextColor, MoveToEx, OffsetViewportOrgEx, OffsetWindowOrgEx.
redirect HT_Get8BPPMaskPalette, HT_Get8BPPFormatPalette, GetSystemPaletteUse to win32k

svn path=/trunk/; revision=28738
2007-09-01 12:52:23 +00:00
Art Yerkes
26eaf001f3 Set needed sizes for return buffers when we return an insufficient buffer
error.

svn path=/trunk/; revision=28737
2007-09-01 11:14:25 +00:00
Eric Kohl
bef3f9c7db Make all "OK" buttons default push buttons.
svn path=/trunk/; revision=28736
2007-09-01 10:37:01 +00:00
Art Yerkes
6b8a1ee32c Don't check inherit flags when checking access.
svn path=/trunk/; revision=28735
2007-09-01 10:04:15 +00:00
Magnus Olsen
5498466cc2 implement GetTextFaceAliasW <- the win32k part was already implement :)
svn path=/trunk/; revision=28734
2007-09-01 09:21:11 +00:00
James Tabor
1e038f4524 - Removed NtGdiPoly/Bezier/To and lineTo/Polyline/line. Updated w32ksvc.db and ntgdibad.h.
- Update gdi32.def.

svn path=/trunk/; revision=28733
2007-09-01 04:23:08 +00:00
James Tabor
e52ae16a81 Remove fixme in GetCurrentObject.
svn path=/trunk/; revision=28732
2007-09-01 02:54:36 +00:00
James Tabor
c8892c844b - Removed NtGdiPaintRgn and renamed NtGdiGetCurrentObject to NtGdiGetDCObject and NtGdiSetPixelV to GdiSetPixelV, w32ksvc.db and updated ntgdibad.h.
- Full use of painting.c, imp GetCurrentObject and update gdi32.def.

svn path=/trunk/; revision=28731
2007-09-01 02:51:48 +00:00
Magnus Olsen
b7c7180b3a fix implement of GetTextFaceW checking if the param is vaild or not
svn path=/trunk/; revision=28730
2007-09-01 00:23:48 +00:00
Magnus Olsen
112625358d implement GetTextExtentExPointI
svn path=/trunk/; revision=28729
2007-08-31 23:56:11 +00:00
Magnus Olsen
25340773cc implement GetTextExtentExPointWPri
svn path=/trunk/; revision=28728
2007-08-31 23:41:07 +00:00
Magnus Olsen
cb8070f587 redirect GetTextCharsetInfo to win32k
implement GetTextExtentPointI

svn path=/trunk/; revision=28727
2007-08-31 23:32:54 +00:00
Magnus Olsen
d9ec9c0779 implement GetStringBitmapA (left todo implement it in win32k.sys)
svn path=/trunk/; revision=28726
2007-08-31 22:33:53 +00:00
Magnus Olsen
abe208bcc5 implement GetStringBitmapW (left todo, implement it in win32k)
svn path=/trunk/; revision=28725
2007-08-31 22:21:35 +00:00
Magnus Olsen
f7d3b17972 implement stub for NtGdiGetStringBitmapW
svn path=/trunk/; revision=28724
2007-08-31 22:15:37 +00:00
Johannes Anderwald
d398f1b8d1 - fix typo
svn path=/trunk/; revision=28723
2007-08-31 21:22:19 +00:00
Magnus Olsen
77aba72c44 update the good api list
svn path=/trunk/; revision=28722
2007-08-31 20:55:10 +00:00
Magnus Olsen
196d2756e2 Add hacks.c contain api using only ros home made syscall
follow api have been move in there so far : GetPolyFillMode, GetGraphicsMode, GetROP2, SetDIBitsToDevice, SetBkMode, SetBkColor, SelectObject, GetMapMode
make follow in user mode : GetRgnBox, GetPixel
redirect GetMiterLimit to win32k.sys

svn path=/trunk/; revision=28721
2007-08-31 20:26:02 +00:00
Ged Murphy
282872d201 fix building of the new explorer
svn path=/trunk/; revision=28720
2007-08-31 19:26:11 +00:00
Magnus Olsen
bfee8ab1fd fix correct implemtions of GetRegionData in gdi32.dll
svn path=/trunk/; revision=28719
2007-08-31 18:48:30 +00:00
Magnus Olsen
87dc60c75b fix correct implement of GetPath
svn path=/trunk/; revision=28718
2007-08-31 18:19:09 +00:00
Magnus Olsen
dfa9b6f56f implement GetMetaRgn left todo fix it in win32k.sys
svn path=/trunk/; revision=28717
2007-08-31 17:46:06 +00:00
Hervé Poussineau
a86b4289ac Better assert + add LPDWORD type
Fix typo preventing livecd to be built

svn path=/trunk/; revision=28716
2007-08-31 17:21:41 +00:00
Magnus Olsen
7d2d0b3329 implement GetKerningPairsW (left todo implement it to win32k.sys)
svn path=/trunk/; revision=28715
2007-08-31 16:59:12 +00:00
Magnus Olsen
02c180f13c update the good api list
svn path=/trunk/; revision=28714
2007-08-31 16:23:33 +00:00
Magnus Olsen
10bd1e1854 Move more history api to the history file.
follow api have been move 
DdSwapTextureHandles aka gdientry16, GdiReleaseLocalDC, GdiDeleteLocalDC, DeviceCapabilitiesExA, DeviceCapabilitiesExW, FixBrushOrgEx to historic.c 
 

svn path=/trunk/; revision=28713
2007-08-31 16:17:28 +00:00
Ged Murphy
c1ef245d9e disable the dependancies dialog for now, there's no reason to show it until it's working
svn path=/trunk/; revision=28712
2007-08-31 15:57:48 +00:00
Magnus Olsen
36a71365d2 move dummy api / old api, that does not do anything to historic.c, they are left in gdi32.dll for make it backwords compatble with older program
follow api moves from stubs.c to historic.c 
GdiPlayDCScript, GdiPlayJournal, GdiPlayScript, GdiConvertBitmap, GdiConvertBrush, GdiConvertDC, GdiConvertFont, GdiConvertPalette, GdiConvertRegion, GdiSetAttrs, GdiSetServerAttr.

svn path=/trunk/; revision=28711
2007-08-31 15:49:19 +00:00
Eric Kohl
f81d4e1677 Implement key bounce options dialog. The test area does not work yet!
svn path=/trunk/; revision=28710
2007-08-31 15:43:51 +00:00
Magnus Olsen
ec96e8225c redirect GetFontUnicodeRanges to win32k.sys
svn path=/trunk/; revision=28709
2007-08-31 15:09:51 +00:00
Magnus Olsen
d365bf2125 implement stub for NtGdiGetFontUnicodeRanges
svn path=/trunk/; revision=28708
2007-08-31 15:08:37 +00:00
James Tabor
5ea25d9303 Move GetDCObject to dc.c.
svn path=/trunk/; revision=28707
2007-08-31 14:41:01 +00:00
Magnus Olsen
4d772974cc implement GetFontAssocStatus.
do correct implement of GetFontData, if the lpvBuffer are NULL in user mode, gdi32.dll always send in cbData as 0 to win32k.sys

svn path=/trunk/; revision=28706
2007-08-31 14:38:48 +00:00
Magnus Olsen
58b517d1c1 implement stub for NtGdiQueryFontAssocInfo
svn path=/trunk/; revision=28704
2007-08-31 14:35:07 +00:00
Hervé Poussineau
9dff58ee42 Fix boot
svn path=/trunk/; revision=28703
2007-08-31 14:10:49 +00:00
Magnus Olsen
488437098d Update the good api list
svn path=/trunk/; revision=28701
2007-08-31 12:32:40 +00:00
Magnus Olsen
e57e366637 implement GetEUDCTimeStampExW but still unimplement in win32k
svn path=/trunk/; revision=28700
2007-08-31 12:16:45 +00:00
Hervé Poussineau
69bf414aee Fix build
svn path=/trunk/; revision=28699
2007-08-31 11:38:51 +00:00
Magnus Olsen
3af7c913e6 revert back the typo change I did in AddFontResourceExW
svn path=/trunk/; revision=28698
2007-08-31 11:36:44 +00:00
Magnus Olsen
0904489152 Fix typo in : AddFontResourceExW
Redirect    : GetColorAdjustment, GetCharWidthInfo to win32k.sys
implement   : GetEUDCTimeStamp
add smaller code in user mode : GetDeviceCaps, GetCurrentPositionEx, GetCurrentObject, GetClipBox, GetCharWidthFloatW, GetCharWidth32W, GetCharABCWidths

svn path=/trunk/; revision=28697
2007-08-31 11:28:45 +00:00
Ged Murphy
4e695a6ed0 not sure how/why I copied the number instead of the id
svn path=/trunk/; revision=28696
2007-08-31 11:08:26 +00:00
Ged Murphy
2738379118 fix controlling a service from the properties dialog and update the listview accordingly
svn path=/trunk/; revision=28695
2007-08-31 11:03:29 +00:00
Daniel Reimer
76504577f3 Update the German Translation of Ged's Service Manager.
svn path=/trunk/; revision=28694
2007-08-31 09:54:27 +00:00
Hervé Poussineau
03980448f8 Implement IsUserAnAdmin(), by copying implementation of IsUserAdmin() in setupapi (was implemented by Eric Kohl)
Redirect setupapi.IsUserAdmin to shell32.IsUserAnAdmin

svn path=/trunk/; revision=28693
2007-08-31 09:49:48 +00:00
Ged Murphy
3095e9d9e8 only enable the delete and create service buttons for administrators
svn path=/trunk/; revision=28692
2007-08-31 09:27:11 +00:00
Ged Murphy
32841791ae - report successful deletion
- refresh service list upon creation

svn path=/trunk/; revision=28691
2007-08-31 08:21:47 +00:00
Ged Murphy
144f0b2c27 make the create service code a little more readable and reliable.
svn path=/trunk/; revision=28690
2007-08-30 23:06:12 +00:00
Magnus Olsen
2c1780806e implement GetDeviceGammaRamp
svn path=/trunk/; revision=28689
2007-08-30 22:20:16 +00:00
Magnus Olsen
4fd8100175 update the good api list
svn path=/trunk/; revision=28688
2007-08-30 21:02:45 +00:00
Magnus Olsen
439c9ab215 implement : GetBoundsRect
remove redirect for follow api for they are need more stuff in user mode
GetBkColor, GetBkMode, GetBrushOrgEx, GetCharABCWidthsFloatW

svn path=/trunk/; revision=28687
2007-08-30 20:55:31 +00:00
Magnus Olsen
7c02bd07a1 add <define name="LANGPACK" /> should fix the build
svn path=/trunk/; revision=28686
2007-08-30 20:18:38 +00:00
Magnus Olsen
417c217247 do not hide stub with a DPRINT1 print it
svn path=/trunk/; revision=28685
2007-08-30 20:01:59 +00:00
Peter Ward
67896de824 French translations by Pierre Schweitzer (see bug 2618):
- Translation for win32csr.
- Fix two mistakes in the servman translation.

svn path=/trunk/; revision=28684
2007-08-30 19:56:50 +00:00
Magnus Olsen
5ba61edda1 implement stub for NtGdiHT_Get8BPPFormatPalette, NtGdiHT_Get8BPPMaskPalette, NtGdiUpdateTransform, NtGdiSetPUMPDOBJ, NtGdiBRUSHOBJ_DeleteRbrush, NtGdiUMPDEngFreeUserMem, NtGdiDrawStream
svn path=/trunk/; revision=28683
2007-08-30 19:35:59 +00:00
Magnus Olsen
5fefe33526 implement stub for NtGdiGetGlyphIndicesW, NtGdiGetGlyphIndicesWInternal, NtGdiGetLinkedUFIs, NtGdiGetMonitorID, NtGdiGetObjectBitmapHandle, NtGdiGetRealizationInfo
svn path=/trunk/; revision=28681
2007-08-30 19:24:17 +00:00
Magnus Olsen
0096b32061 implement GdiConvertPalette, GdiConvertRegion
svn path=/trunk/; revision=28680
2007-08-30 19:05:43 +00:00
Magnus Olsen
d21581599d redirect GdiSetLastError to SetLastError (who did forget GdiSetLastError and SetLastError are same, now it is implement as well)
svn path=/trunk/; revision=28679
2007-08-30 18:52:57 +00:00
Magnus Olsen
eb1bff28c5 fix the build
svn path=/trunk/; revision=28678
2007-08-30 18:39:08 +00:00
Magnus Olsen
9780c9b363 fix a typo
svn path=/trunk/; revision=28677
2007-08-30 18:38:31 +00:00
Magnus Olsen
15499d174f Implement GdiReleaseLocalDC, GdiFlush, GdiPlayDCScript, GdiPlayJournal, GdiPlayScript, GdiConvertBitmap, GdiConvertBrush, GdiConvertDC, GdiConvertFont, GdiSetAttrs
Redirect GdiConsoleTextOut, FontIsLinked, GdiDescribePixelFormat, GdiSetPixelFormat, GdiSwapBuffers, GdiFullscreenControl, GdiQueryFonts, GdiInitSpool to win32k.sys
do not redirect add smaller code in gdi32 and use share memory : GdiGradientFill, FrameRgn, GdiTransparentBlt
stub : GdiPrinterThunk, GdiConvertBitmapV5
update good api list. 

svn path=/trunk/; revision=28676
2007-08-30 18:06:35 +00:00
Magnus Olsen
280e3b52d4 implement stub for NtGdiInitSpool, NtGdiQueryFonts, NtGdiGetSpoolMessage.
the NtGdiGetSpoolMessage missing the protypes. 

svn path=/trunk/; revision=28675
2007-08-30 17:38:40 +00:00
Johannes Anderwald
c7b707f3fc - create a batch file to execute the commands required for sysreg
svn path=/trunk/; revision=28674
2007-08-30 17:20:32 +00:00
Magnus Olsen
19bf3dba24 adding prototype for NtGdiInitSpool()
svn path=/trunk/; revision=28673
2007-08-30 16:28:28 +00:00
Daniel Reimer
461943f891 Translate the new Restart Button into German
svn path=/trunk/; revision=28672
2007-08-30 16:26:24 +00:00
Ged Murphy
1fc9170197 update the visual service count when a service is deleted
svn path=/trunk/; revision=28671
2007-08-30 13:39:59 +00:00
Ged Murphy
5bdb637cb7 - implement setting the service description
- fix deleting of a service

svn path=/trunk/; revision=28670
2007-08-30 12:27:11 +00:00
Ged Murphy
4862094dd0 fix build. didn't realise this was still used.
svn path=/trunk/; revision=28669
2007-08-30 09:57:08 +00:00
Ged Murphy
1bf6653228 - remove the last of the reactos hacks of reading directly from the service's registry keys.
- servman appears to be broken in reactos at the moment, but it is actually implemented correctly now. It awaits widl / rpcrt4 updates and a working services.exe.

svn path=/trunk/; revision=28668
2007-08-30 09:29:45 +00:00
Hervé Poussineau
7395ac2cc6 [FORMATTING] Fix spaces/tabs mess
No code change.

svn path=/trunk/; revision=28667
2007-08-30 08:38:30 +00:00
Johannes Anderwald
157fa523ae - add linux path
- fix bug in getDefaultHDDImage
- sysreg can now create the hdd image and start the emulator

svn path=/trunk/; revision=28665
2007-08-30 00:05:29 +00:00
Ged Murphy
c8026e017e release the image resource once it's assigned
svn path=/trunk/; revision=28664
2007-08-29 23:05:23 +00:00
Johannes Anderwald
d374f7cbb0 - always create a hdd image if theres no default one
svn path=/trunk/; revision=28663
2007-08-29 22:38:44 +00:00
Johannes Anderwald
8d1c787d57 - missed that
svn path=/trunk/; revision=28662
2007-08-29 22:28:30 +00:00
Johannes Anderwald
4adb5cb9a7 - in theory arguments start at argv[1] - so this needs to be passed to qemu-img
svn path=/trunk/; revision=28661
2007-08-29 22:27:30 +00:00
Johannes Anderwald
0dd03527da - silence debug messages
svn path=/trunk/; revision=28660
2007-08-29 22:14:47 +00:00
Johannes Anderwald
be17f95ee8 - check if qemu-img exists for attempting to create hdd image
svn path=/trunk/; revision=28659
2007-08-29 22:09:07 +00:00
Johannes Anderwald
628a33b902 - add options required for sysreg
svn path=/trunk/; revision=28658
2007-08-29 21:10:42 +00:00
Johannes Anderwald
7d883c8352 - fix 2 bugs in unattend setup
- add option to start dbgprint.exe on 3rd boot when unattend key BootCDRegtestActive key is found (this makes sysreg detect that the 3rd boot has completed successfully)


svn path=/trunk/; revision=28657
2007-08-29 21:10:05 +00:00
Ged Murphy
592433992d add the remaining code for changing the list view text
svn path=/trunk/; revision=28656
2007-08-29 20:20:23 +00:00
Johannes Anderwald
0dd73d72c9 - add description for LocalID setting
svn path=/trunk/; revision=28655
2007-08-29 20:18:16 +00:00
Johannes Anderwald
3e77d24896 - close unattend inf in case of errors
- correctly convert provided LCID (with base 16)
- verify provided LCID with installed languages
- thanks to Colin_Fink

svn path=/trunk/; revision=28654
2007-08-29 20:13:27 +00:00
Ged Murphy
dcae8a5dc5 use the provided apis instead of reading directly from the registry
svn path=/trunk/; revision=28653
2007-08-29 19:36:58 +00:00
Ged Murphy
25ad5d5103 split the code, some files were getting too long
svn path=/trunk/; revision=28652
2007-08-29 18:10:58 +00:00
Ged Murphy
4ab28a9dcf - implement changing of the startup type from the properties dialog
- add functionality for changing the startup type listview text
- fix a couple of bugs

svn path=/trunk/; revision=28651
2007-08-29 15:46:52 +00:00
Peter Ward
dc17eb77d0 _really fix it this time. (and on with the language saga)
svn path=/trunk/; revision=28650
2007-08-29 13:31:04 +00:00
Peter Ward
39088be599 - Fix the friggin language file.
svn path=/trunk/; revision=28649
2007-08-29 13:23:24 +00:00
Peter Ward
985938a35d Forgot the eol style as well...
svn path=/trunk/; revision=28648
2007-08-29 12:56:18 +00:00
Peter Ward
80cf392257 Forgot this file... somehow
svn path=/trunk/; revision=28647
2007-08-29 12:46:14 +00:00
Peter Ward
1d2dcde9b5 Updated french translations by Pierre Schweitzer for:
- servman, explorer, access, mmsys, sysdm and syssetup.

svn path=/trunk/; revision=28646
2007-08-29 12:33:50 +00:00
Eric Kohl
639a2712f4 Implement basic filter keys settings
svn path=/trunk/; revision=28645
2007-08-29 11:47:37 +00:00
Ged Murphy
a4ebd5b085 Add functionality for changing the service config. unused at the moment.
svn path=/trunk/; revision=28644
2007-08-29 09:42:31 +00:00
Art Yerkes
8da0438ac6 Move creation of global objects to csrss as specified in the fixmes. Whatever
was broken before that prevented this seems to have been resolved.

svn path=/trunk/; revision=28643
2007-08-29 05:57:00 +00:00
Christoph von Wittich
72d3e9bd7e fix linux build
svn path=/trunk/; revision=28642
2007-08-28 23:47:54 +00:00
Johannes Anderwald
247523e709 - always wait and then kill the emulator
svn path=/trunk/; revision=28640
2007-08-28 22:48:40 +00:00
Johannes Anderwald
f918874665 - fix compilation
svn path=/trunk/; revision=28639
2007-08-28 22:47:16 +00:00
Johannes Anderwald
f2f35ad546 - remove hack
svn path=/trunk/; revision=28638
2007-08-28 22:36:21 +00:00
Johannes Anderwald
b0f1744735 - remove hack
svn path=/trunk/; revision=28637
2007-08-28 22:28:56 +00:00
James Tabor
cfae2a0eeb - Removed NtGdiPoly/Polygon from source, w32ksvc.db and updated ntgdibad.h.
- Renamed the Nt function to GdiCreatePolyPolygonRgn, it is not safe so it will not be named to IntGdiXxX.

svn path=/trunk/; revision=28636
2007-08-28 22:11:55 +00:00
Johannes Anderwald
063ab9a152 - if'd ROS_EMU_TYPE
- check for cdrom images + hdd images
- check provided image and qemu paths
- search for default cdrom image + hdd image

svn path=/trunk/; revision=28635
2007-08-28 22:07:54 +00:00
James Tabor
11cb1770c2 Plugin PolyPolygon, Polygon uses the same code and tested good.
svn path=/trunk/; revision=28634
2007-08-28 21:29:03 +00:00
Ged Murphy
bdcae44cbc missed a return type
svn path=/trunk/; revision=28633
2007-08-28 20:13:42 +00:00
Ged Murphy
d19fc5d52d fix IsUserAnAdmin
svn path=/trunk/; revision=28632
2007-08-28 20:13:09 +00:00
Colin Finck
68c9a2c5a0 Include "windef.h" in "mkstemps.c" for our wchar_t check.
This is just a temporary solution for fixing the compilation on Mac OS X hosts until host and target headers are fully separated.

svn path=/trunk/; revision=28631
2007-08-28 20:03:15 +00:00
Ged Murphy
07c2f6d0c5 - improve the start code
- add an edit button on the properties dialog to give admins the option to modify the service config

svn path=/trunk/; revision=28630
2007-08-28 19:54:25 +00:00
Johannes Anderwald
c94ecb5367 - update documentation
- implement wait for linux

svn path=/trunk/; revision=28626
2007-08-28 19:06:02 +00:00
Johannes Anderwald
2d0f7aa512 - silence a few debug messages
- implement creating of disk images with qemu-img for windows

svn path=/trunk/; revision=28624
2007-08-28 18:41:08 +00:00
Johannes Anderwald
df0b2c80d4 - include unattend.inf from boot/bootdata/bootcdregtest
svn path=/trunk/; revision=28623
2007-08-28 17:32:30 +00:00
Johannes Anderwald
edc4c2dc67 - add unattend.inf for bootcdregtest
svn path=/trunk/; revision=28622
2007-08-28 17:32:05 +00:00
Colin Finck
b04c880c20 Uncomment german translation again, this change accidentally got into my previous commit
svn path=/trunk/; revision=28621
2007-08-28 16:01:59 +00:00
Colin Finck
3124187a40 - Remove most of the Usage text from the german translation. It was just copied from the Windows "more" utility and our tool does not support any of the extended options yet.
I changed the text, so it only includes the features we currently support.
- Change SUBLANG_DEFAULT to SUBLANG_NEUTRAL in the german translation
- Add an English (US) translation
- Use a consistent indentation in "more.c"
- Exit the tool if reading IDS_CONTINUE fails instead of falling back to a hardcoded string

svn path=/trunk/; revision=28620
2007-08-28 15:54:19 +00:00
Timo Kreuzer
b91657fe81 - rename ASSERT1 to ASSERT
- link to w32kdll instead of implementing all syscalls as stubs. I will remove the rest of the syscall code as soon as our syscall db is more complete
- more TEST -> RTEST
- update w32kdll_ros.def
- add tests for NtGdiEngCreatePalette, NtGdiEnumFontOpen
- Add some gdi handle table code to w32knapi
- header cleanup

svn path=/trunk/; revision=28619
2007-08-28 15:06:36 +00:00
Ged Murphy
fd255663f3 - don't read the description directly from the registry
- give each property dialog it's own service data instead of relying on the the global current. This will eventually allow us to have multiple property dialogs open.

svn path=/trunk/; revision=28618
2007-08-28 14:49:47 +00:00
Hervé Poussineau
66747af942 Install VBE and VGA drivers when a compatible graphic adapter is detected
See issue #2589 for more details.

svn path=/trunk/; revision=28617
2007-08-28 14:27:23 +00:00
Johannes Anderwald
3e30ff41ef - search for ReactOS installation cd and try locate directly the unattend.inf. This allows us to use the _same_ unattend.inf which is used in usetup. As a result we no longer need to put a second unattend.inf in the reactos.cab which revives the bootcdregtest
svn path=/trunk/; revision=28616
2007-08-28 14:00:24 +00:00
Hervé Poussineau
c7416046e2 Revert r28603 and add the correct fix
svn path=/trunk/; revision=28615
2007-08-28 13:40:56 +00:00
Hervé Poussineau
a326fd84cb Forgot one file
svn path=/trunk/; revision=28614
2007-08-28 06:35:54 +00:00
Johannes Anderwald
3a6d290604 - implement AutoPartioning
- set AutoPartition = 1 if you want unattended setup to create one partition with maximum size of disk

svn path=/trunk/; revision=28613
2007-08-27 20:03:06 +00:00
Ged Murphy
415b655dfe - update the stored service status after attempting to change it
- add functionality for changing the list view text and use it to change the status text
- various other bits and bobs

svn path=/trunk/; revision=28612
2007-08-27 19:31:09 +00:00
Johannes Anderwald
8512542ef5 - fix typo and compilation under windows
svn path=/trunk/; revision=28610
2007-08-27 18:53:31 +00:00
Colin Finck
082b2c7533 Also add mIRC 6.21 to the "downloader.xml" in Trunk
svn path=/trunk/; revision=28609
2007-08-27 18:50:30 +00:00
Johannes Anderwald
b60c3ecf5a - autopartition setting and DisableVmInst should not be in the GuiRunOnce section
svn path=/trunk/; revision=28607
2007-08-27 18:48:23 +00:00
Johannes Anderwald
aade40eea8 - add description for AutoPartition setting to unattend.inf.sample
svn path=/trunk/; revision=28606
2007-08-27 18:41:53 +00:00
Johannes Anderwald
98a0698dc8 - implement an AutoPartition setting in usetup (needs to be tested though yet)
svn path=/trunk/; revision=28605
2007-08-27 18:40:02 +00:00
Hervé Poussineau
abcc833c45 qsort() prototype in stdlib.h doesn't specify that callback function must be __cdecl
svn path=/trunk/; revision=28603
2007-08-27 15:26:39 +00:00
Hervé Poussineau
a011fbf1c2 Define NTAPI and WINAPI to nothing, because host tools can use the default calling convention.
This change is correct because we are *not* linking host tools with Windows/ReactOS libraries

svn path=/trunk/; revision=28602
2007-08-27 14:56:14 +00:00
Hervé Poussineau
7cd48df5b6 Do not include <ntddk.h> when compiling cmlib_host. This file defines too much things.
svn path=/trunk/; revision=28599
2007-08-27 12:47:56 +00:00
Peter Ward
62a91eb656 - Fix a warning reported by Gregor Brunmar.
svn path=/trunk/; revision=28598
2007-08-27 11:57:02 +00:00
Hervé Poussineau
18af7ec60d Link to wine library if we are using Wine-style debug macros
svn path=/trunk/; revision=28597
2007-08-27 11:43:50 +00:00
Hervé Poussineau
513a12418d Rely only on host headers (+ target ntstatus.h) to build mkhive
svn path=/trunk/; revision=28596
2007-08-27 09:32:52 +00:00
Hervé Poussineau
36235f6d7f Use host crt when building mkhive tool
svn path=/trunk/; revision=28595
2007-08-27 07:36:25 +00:00
Hervé Poussineau
58f1fa340a Rename CFLAGS to HOST_FLAGS, CPPFLAGS to HOST_CPPFLAGS, LFLAGS to HOST_LFLAGS
svn path=/trunk/; revision=28594
2007-08-27 07:21:26 +00:00
Hervé Poussineau
7b6bb2a6fd Update shell32 tests
svn path=/trunk/; revision=28593
2007-08-27 07:03:32 +00:00
James Tabor
11b12696f1 Add new gdi object type. Discovered and documented by Timo Kreuzer.
svn path=/trunk/; revision=28592
2007-08-27 06:57:46 +00:00
Hervé Poussineau
6c31cb21d1 Add some missing definitions
Fix wrong structure alignment

svn path=/trunk/; revision=28591
2007-08-27 06:56:39 +00:00
James Tabor
abf715b9b2 Update ENUMFONTDATAW structure based on returned data.
svn path=/trunk/; revision=28590
2007-08-27 06:38:51 +00:00
Art Yerkes
067d30c566 Slight improvement: When terminating the process, kill sibling threads first.
We'll need this for synchronization at process termination among other things.
Thanks alex for pointing out that we didn't do this.

svn path=/trunk/; revision=28589
2007-08-27 05:00:03 +00:00
Johannes Anderwald
2c932d0e3a - fix warning
svn path=/trunk/; revision=28588
2007-08-26 23:56:05 +00:00
Johannes Anderwald
c48c7cff18 - add restart button by Vytis Girdzijauskas, "CMan", cman[at]cman[dot]us
- the icon is taken from the tango project (see view-refresh.svg)

See issue #2599 for more details.

svn path=/trunk/; revision=28587
2007-08-26 23:41:04 +00:00
Magnus Olsen
40ae71f23d fix the build
svn path=/trunk/; revision=28586
2007-08-26 23:01:18 +00:00
Johannes Anderwald
9b57eaeea0 - dont show the same resolution multiple times
- sort the resolution according to width, height and bits per pixel

See issue #2594 for more details.

svn path=/trunk/; revision=28585
2007-08-26 22:43:51 +00:00
Magnus Olsen
8598e12a2a Implement stub for NtGdiDvpGetVideoPortField, NtGdiDvpGetVideoPortFlipStatus, NtGdiDvpGetVideoPortInputFormats, NtGdiDvpGetVideoPortLine, NtGdiDvpGetVideoPortOutputFormats, NtGdiDvpGetVideoPortConnectInfo, NtGdiDvpGetVideoSignalStatus, NtGdiDvpUpdateVideoPort, NtGdiDvpWaitForVideoPortSync, NtGdiDvpAcquireNotification, NtGdiDvpReleaseNotification, NtGdiDxgGenericThunk,
NtGdiDeleteColorTransform, NtGdiGetPerBandInfo, NtGdiDoBanding, NtGdiEnumFontChunk, NtGdiEnumFontClose, NtGdiEnumFontOpen, NtGdiEudcLoadUnloadLink, NtGdiExtTextOutW, NtGdiForceUFIMapping, NtGdiFullscreenControl, NtGdiGetAppClipBox, NtGdiGetCharABCWidthsW, NtGdiGetCharacterPlacementW, NtGdiGetCharWidthW, NtGdiGetCharWidthInfo, NtGdiGetColorSpaceforBitmap, NtGdiGetDCforBitmap, NtGdiGetDCObject, NtGdiGetDeviceCapsAll, NtGdiGetETM, NtGdiGetEudcTimeStampEx

svn path=/trunk/; revision=28584
2007-08-26 22:03:02 +00:00
Johannes Anderwald
ed306957a1 - creation of empty environment variables should not be possible (tested under Windows XP SP2)
- dont create variables when cancel is hit
- bug report + patch by Gregor Schneider (aka DosX)
See issue #2600 for more details.

svn path=/trunk/; revision=28583
2007-08-26 21:42:48 +00:00
Magnus Olsen
ac5c71eddd Implement stub for NtGdiClearBrushAttributes, NtGdiColorCorrectPalette, NtGdiComputeXformCoefficients, NtGdiConsoleTextOut, NtGdiConvertMetafileRect, NtGdiCreateColorTransform, NtGdiDvpCanCreateVideoPort, NtGdiDvpColorControl, NtGdiDvpCreateVideoPort, NtGdiDvpDestroyVideoPort, NtGdiDvpFlipVideoPort, NtGdiDvpGetVideoPortBandwidth
svn path=/trunk/; revision=28582
2007-08-26 20:33:56 +00:00
Magnus Olsen
c01447f00f redirect FONTOBJ_cGetAllGlyphHandles, FONTOBJ_cGetGlyphs, FONTOBJ_pQueryGlyphAttrs, FONTOBJ_pfdg, FONTOBJ_pifi, FONTOBJ_pvTrueTypeFontFile, FONTOBJ_pxoGetXform, FONTOBJ_vGetInfo to win32k.sys
do not redirect ExcludeClipRect, ExtSelectClipRgn, FillRgn to win32k.sys, make a smaller functions in gdi32 for now, we need write more thing in user mode. 

svn path=/trunk/; revision=28581
2007-08-26 20:00:40 +00:00
Eric Kohl
0d9818dc28 Add cursor options to the display page.
svn path=/trunk/; revision=28580
2007-08-26 19:58:13 +00:00
Magnus Olsen
2f4d36ee4d Implement stub for NtGdiAddFontResourceW, NtGdiAddRemoteFontToDC, NtGdiAddFontMemResourceEx, NtGdiRemoveMergeFont, NtGdiAddRemoteMMInstanceToDC, NtGdiFontIsLinked, NtGdiCheckBitmapBits, NtGdiClearBitmapAttributes, NtGdiCreateDIBitmapInternal, NtGdiCreateMetafileDC, NtGdiCreatePaletteInternal, NtGdiCreateServerMetaFile, NtGdiGetUFI, NtGdiFONTOBJ_vGetInfo, NtGdiFONTOBJ_pxoGetXform, NtGdiFONTOBJ_cGetGlyphs, NtGdiFONTOBJ_pifi, NtGdiFONTOBJ_pfdg, NtGdiFONTOBJ_pQueryGlyphAttrs, NtGdiFONTOBJ_pvTrueTypeFontFile, NtGdiFONTOBJ_cGetAllGlyphHandles
svn path=/trunk/; revision=28579
2007-08-26 19:56:06 +00:00
Hervé Poussineau
d45b397464 Remove psdk dependency, as it is automatically added
svn path=/trunk/; revision=28578
2007-08-26 19:06:31 +00:00
Johannes Anderwald
6085c5e625 - if partition cannot be selected, let user create partition themselves
- autopartitioning still needs to be done
See issue #2593 for more details.

svn path=/trunk/; revision=28576
2007-08-26 18:19:23 +00:00
Aleksey Bragin
aad59dfc19 - Fix boot (thx hpoussin for hint).
svn path=/trunk/; revision=28575
2007-08-26 18:18:48 +00:00
Hervé Poussineau
149ea4f5f4 Try to fix infinite loop in "make depends"
svn path=/trunk/; revision=28574
2007-08-26 12:52:14 +00:00
Hervé Poussineau
dec7775361 Fix {module}_depends targets
svn path=/trunk/; revision=28573
2007-08-26 12:31:12 +00:00
Hervé Poussineau
c34ec8ad1d Transform psdk into a real dependency, instead of a target only created after rbuild.
Fixes case where compilation wasn't stopping if rbuild was failing/crashing

svn path=/trunk/; revision=28572
2007-08-26 12:06:28 +00:00
Magnus Olsen
718e6afb4c patch from Gregor Brunmar (gregor dot brunmar at home dot se)
* Added folder support for msvc+solution generation in rbuild
 * map up pch .h file as include file in vc project files.


svn path=/trunk/; revision=28571
2007-08-26 09:57:30 +00:00
Andrew Munger
63872a8e79 NtQueryInformationProcess:
Return STATUS_INFO_LENGTH_MISMATCH where appropriate, and return the needed length in any case.
"ntdll_winetest info" now has 5 failures.

svn path=/trunk/; revision=28570
2007-08-26 07:51:51 +00:00
Andrew Munger
03f90f222d NtQuerySystemInformation:
Do not blindly zero the buffer with the size sent in by the caller. This fixes the stack smash "ntdll_winetest info" was seeing. Thanks to arty for catching it.
Remove the nested SEH.
"ntdll_winetest info" now has 16 failures.

svn path=/trunk/; revision=28569
2007-08-26 07:39:29 +00:00
James Tabor
8fd9f85a76 AXESLIST, AXISINFO and ENUMTEXTMETRIC structures. Updated ENUMFONTDATAW structure with my best guess. It needs testing with Timo program.
svn path=/trunk/; revision=28568
2007-08-26 01:50:14 +00:00
Colin Finck
92877709d1 Some french additions and file header changes by Pierre Schweitzer (heis_spiter AT hotmail DOT com)
See issue #2530 for more details.

svn path=/trunk/; revision=28567
2007-08-25 22:17:35 +00:00
Colin Finck
b7c9a43ec4 More build fixes for Mac OS X by changing the header order (wrc.h, which includes windef.h, which includes winnt.h has to be included before stdlib.h)
I know that this is another change in a Wine-shared component, but as long as we don't come to a better solution for these problems, I'll continue doing such small changes for fixing the build.

svn path=/trunk/; revision=28566
2007-08-25 22:12:24 +00:00
Colin Finck
d465769732 Catalan translation of Solitaire by Marc Tormo i Bochaca (mtbochaca AT ya DOT com)
See issue #2580 for more details.

svn path=/trunk/; revision=28565
2007-08-25 21:36:07 +00:00
Magnus Olsen
7b5444b1e9 Alex is god of haven and shall rise to the sky ... (my poem to alex for he found I did a mistake)
in protypes for NtGdiEngCreateDeviceSurface, NtGdiEngCreateDeviceBitmap, NtGdiEngCreateBitmap
Part (2/2)

svn path=/trunk/; revision=28560
2007-08-25 19:25:24 +00:00
Magnus Olsen
630763066e Alex is god of haven and shall rise to the sky ... (my poem to alex for he found I did a mistake)
in protypes for NtGdiEngCreateDeviceSurface, NtGdiEngCreateDeviceBitmap, NtGdiEngCreateBitmap
Part (1/2)

svn path=/trunk/; revision=28559
2007-08-25 19:24:20 +00:00
Johannes Anderwald
4598afc8bb - fix typo
svn path=/trunk/; revision=28558
2007-08-25 18:40:23 +00:00
Johannes Anderwald
cf7c5bc702 -fix build some broke
svn path=/trunk/; revision=28557
2007-08-25 18:35:14 +00:00
Daniel Reimer
0a7ed18bbc Some fixes in my translation to let the text better fit.
svn path=/trunk/; revision=28556
2007-08-25 17:38:23 +00:00
Magnus Olsen
e4e94438f6 implement EngUnlockSurface
svn path=/trunk/; revision=28555
2007-08-25 17:36:45 +00:00
Magnus Olsen
2144841165 implement NtGdiEngLockSurface (not tested)
svn path=/trunk/; revision=28554
2007-08-25 17:34:03 +00:00
Colin Finck
9bb0ac0bd6 - Hardcode the Window Class string, there is no reason for it to be in localized resource files
- Remove duplicate header inclusions

svn path=/trunk/; revision=28553
2007-08-25 17:24:27 +00:00
Magnus Olsen
1fe725113b partly implement EngComputeGlyphSet in eng.c
move EngMultiByteToWideChar, EngQueryLocalTime, EngReleaseSemaphore from stub.c to eng.c
start implement of EngQueryEMFInfo need bit more figout how it is done

svn path=/trunk/; revision=28552
2007-08-25 17:12:59 +00:00
Magnus Olsen
02eec98371 implement stub for NtGdiEngComputeGlyphSet
svn path=/trunk/; revision=28551
2007-08-25 17:09:10 +00:00
Ged Murphy
0cdfc0038a fix the contact address
svn path=/trunk/; revision=28550
2007-08-25 15:57:27 +00:00
Ged Murphy
b0f23f18e1 - implement restarting of services
- update the main interface to reflect the state of the service after an attempt to change it's status

svn path=/trunk/; revision=28549
2007-08-25 15:51:55 +00:00
Daniel Reimer
8ec5ae847a German Translation for Magnifier. (Made by myself)
svn path=/trunk/; revision=28548
2007-08-25 15:39:51 +00:00
Ged Murphy
3e6a02c31d fix a typo
svn path=/trunk/; revision=28547
2007-08-25 15:18:45 +00:00
Ged Murphy
652314013e send the correct control message
svn path=/trunk/; revision=28546
2007-08-25 14:55:02 +00:00
Ged Murphy
28fcd88033 fix stop / pause / resume
svn path=/trunk/; revision=28545
2007-08-25 14:51:36 +00:00
Colin Finck
213b5a62d7 French translation for Magnify by Pierre Schweitzer (heis_spiter AT hotmail DOT com)
See issue #2531 for more details.

svn path=/trunk/; revision=28544
2007-08-25 14:36:22 +00:00
Magnus Olsen
4227e0ee25 move EngFreeModule, EngGetCurrentCodePage, EngGetPrinterDataFileName, EngLoadModule from stub.c to eng.c
svn path=/trunk/; revision=28543
2007-08-25 14:23:48 +00:00
Magnus Olsen
96fc91c2b8 add a new file call eng.c
remove EngAcquireSemaphore, EngCreateSemaphore, EngDeleteSemaphore, EngFindResource implement from stub.c to eng.c 
rewrite smaller part of EngFindResource so it works likes windows xp.
 

svn path=/trunk/; revision=28542
2007-08-25 14:07:00 +00:00
Ged Murphy
1adba33d1e code improvements and various bug fixes
svn path=/trunk/; revision=28541
2007-08-25 13:41:44 +00:00
Magnus Olsen
850675cbdd make AddFontResourceExA lite faster.
svn path=/trunk/; revision=28540
2007-08-25 11:38:35 +00:00
Magnus Olsen
2b7a66234a Fix : make AddFontResourceA acts like AddFontResourceW
Fix : smaller typo in AddFontResourceW 

svn path=/trunk/; revision=28539
2007-08-25 11:34:16 +00:00
Sylvain Petreolle
2c540b735a report freeldr bugs at ros-dev@reactos.org
svn path=/trunk/; revision=28538
2007-08-25 09:58:30 +00:00
Aleksey Bragin
37ae229f62 - Do not ignore BIOS memory map anymore. Private BIOS ranges (such as ACPI, SMBIOS, VideoROM, etc) are not assumed "free" anymore (which would result in hardware failure, crashes and/or corrupted memory).
- Enhance the FreeLDR 2 NTLDR Compatibility Layer:
 * Use a special routine for grabbing static memory descriptors, so that if we ever run out, we will bugcheck.
 * The descriptors need to contain physical addresses, not virtual. Do proper fixups to handle this.
 * Add a "Free" memory descriptor for all memory on the system. This needs to be fragmented later.
 * Add memory descriptors for each reserved entry in the BIOS memory map.
 * Add memory descriptors for the PDE and KPCR pages that FreeLDR allocates.
 * Add a memory descriptor for page 0, which is reserved.
 * Add a memory descriptor for the Video frame buffer at 0xA0000. This is the location on most systems, and also the location that ReactOS hard-codes in other Mm code.
- Bug found and NTLDR memory descriptor analysis by Alex.


svn path=/trunk/; revision=28537
2007-08-25 09:38:13 +00:00
Colin Finck
9ec7d785cb Revert r28526 for now until a problem for the livecd breakage has been found
svn path=/trunk/; revision=28536
2007-08-25 09:00:19 +00:00
Magnus Olsen
c8983b1354 forget some stubs
svn path=/trunk/; revision=28535
2007-08-24 23:54:44 +00:00
Magnus Olsen
5f81ef10bf update the good list of api
svn path=/trunk/; revision=28534
2007-08-24 22:46:38 +00:00
Magnus Olsen
2b32773575 * redirect EngCopyBits, EngCreateBitmap, EngCreatePalette, EngDeletePalette, EngDeletePath, EngDeleteSurface, EngEraseSurface, EngFillPath, EngMarkBandingSurface, EngPaint, EngPlgBlt, EngStrokeAndFillPath, EngStrokePath, EngTextOut, EngTransparentBlt to win32k.sys
* add smaller code for Ellipse
* redirect EngMultiByteToUnicodeN to RtlMultiByteToUnicodeN
* redirect EngUnicodeToMultiByteN to RtlUnicodeToMultiByteN

svn path=/trunk/; revision=28533
2007-08-24 22:44:36 +00:00
Magnus Olsen
fa0d1f8d20 add stub for NtGdiEngPlgBlt, NtGdiEngMarkBandingSurface, NtGdiEngFillPath, NtGdiEngPaint, NtGdiEngLineTo, NtGdiEngGradientFill, NtGdiEngStretchBltROP
svn path=/trunk/; revision=28532
2007-08-24 22:24:26 +00:00
Timo Kreuzer
71b085c651 - Simplify w32knapi. It now always uses w32kdll.dll
Copy the right dll into the same folder as w32knapi.exe (name must be w32kdll.dll) to make it work of different windows versions and ros of cause.
Tested on win xp.

svn path=/trunk/; revision=28531
2007-08-24 22:23:44 +00:00
Magnus Olsen
2154cc31a3 add stub for NtGdiEngDeleteSurface, NtGdiEngEraseSurface, NtGdiEngStrokeAndFillPath, NtGdiEngDeletePath
svn path=/trunk/; revision=28530
2007-08-24 21:57:50 +00:00
Timo Kreuzer
f268892b03 - move NtGdiGetAspectRatioFilterEx from text.c to dc.c
- move 2 prototypes from text.c to text.h

svn path=/trunk/; revision=28529
2007-08-24 21:49:12 +00:00
Magnus Olsen
a992736766 add stub for NtGdiEngCreateBitmap, NtGdiEngCreatePalette, NtGdiEngCopyBits, NtGdiEngDeletePalette, NtGdiEngStrokePath, NtGdiEngTransparentBlt, NtGdiEngTextOut
svn path=/trunk/; revision=28528
2007-08-24 21:42:06 +00:00
Magnus Olsen
44b52a90f7 NtGdiEngCreateBitmap got one undoc param
svn path=/trunk/; revision=28527
2007-08-24 21:39:49 +00:00
Colin Finck
31995f945e rbuild enhancements by Marc Piulachs (marc DOT piulachs AT codexchange DOT net):
- Provided an unifed way to resolve path macros ($Output) , ($Intermediate) , ($CDOUTPUT) and ($INSTALL)
- Removed some redundant code and place it in a global function 
- Modify media/inf/inf.rbuild to point to the correct location of the autogenerated syssetup.inf in ($Ouput) folder
- Other minor enhancements and modifications


See issue #2567 for more details.

svn path=/trunk/; revision=28526
2007-08-24 21:31:37 +00:00
Magnus Olsen
ef684f8eac mark EngReleaseSemaphore is implement
svn path=/trunk/; revision=28525
2007-08-24 20:20:18 +00:00
Magnus Olsen
f0942416ad mark EngQueryLocalTime are implement
svn path=/trunk/; revision=28524
2007-08-24 20:14:30 +00:00
Magnus Olsen
3a8089197d Bugfix : EngFreeModule
svn path=/trunk/; revision=28523
2007-08-24 18:39:19 +00:00
Magnus Olsen
df77afe61e bugfix : EngGetCurrentCodePage
svn path=/trunk/; revision=28522
2007-08-24 18:36:38 +00:00
Ged Murphy
6aa2fcb6f6 Start the move towards a partial rewrite of servman
Too many changes for me to bother listing

svn path=/trunk/; revision=28521
2007-08-24 18:27:12 +00:00
Magnus Olsen
00e28fca7d sorry fix the build
svn path=/trunk/; revision=28520
2007-08-24 17:46:43 +00:00
Magnus Olsen
1195f389f1 Kill of NtGdiCreatePolyPolygonRgn from the syscall list, it being use only internal in win32k. it should be rename to intGdiCreatePolyPolygonRgn
svn path=/trunk/; revision=28519
2007-08-24 17:43:11 +00:00
Magnus Olsen
10f4522cb9 Fix CreatePolygonRgn : use NtGdiPolyPolyDraw, old way was using NtGdiCreatePolyPolygonRgn, NtGdiCreatePolyPolygonRgn does not exists in windows NT 2000/XP/2003/VISTA
Fix CreatePolyPolygonRgn : use NtGdiPolyPolyDraw, old way was using NtGdiCreatePolyPolygonRgn, NtGdiCreatePolyPolygonRgn does not exists in windows NT 2000/XP/2003/VISTA
Redirect : EnableEUDC@4 to NtGdiEnableEudc@4, EngAssociateSurface@12 to NtGdiEngAssociateSurface@12, EngCheckAbort@4 to NtGdiEngCheckAbort@4, EngDeleteClip@4 to NtGdiEngDeleteClip@4
Redirect : EngCreateClip@0 to NtGdiEngCreateClip@0, EngCreateDeviceSurface@16 to NtGdiEngCreateDeviceSurface@16,  EngCreateDeviceBitmap@16 to NtGdiEngCreateDeviceBitmap@16


svn path=/trunk/; revision=28518
2007-08-24 17:37:53 +00:00
Magnus Olsen
79bd659def implement stub for NtGdiEnableEudc, NtGdiEngAssociateSurface, NtGdiEngCreateDeviceSurface, NtGdiEngCreateDeviceBitmap, NtGdiEngCreateClip, NtGdiEngDeleteClip, NtGdiEngCheckAbort
svn path=/trunk/; revision=28517
2007-08-24 14:49:53 +00:00
Magnus Olsen
7abd27da8c the NtGdiEngCreateDeviceSurface got 4 param, see syscall table. and official doc from msdn and osr say only 3, we can clear see it is 4 param in the syscall table.
and I name it the four param as UNKNOWN for now. 

svn path=/trunk/; revision=28516
2007-08-24 14:46:06 +00:00
Magnus Olsen
bd1e7500b2 NtGdiEngCreateDeviceBitmap need four param the last param are undoc in msdn/osr
at moment I do have small clude what it is use for. But I name it to UNKNOWN, 
you can check the syscall table and u see it is 4 param not 3 it need. 

svn path=/trunk/; revision=28515
2007-08-24 14:24:49 +00:00
Magnus Olsen
d419e5b695 Bug Fix from Gregor Brunmar (gregor dot brunmar at home dot se), IRC nick ALiENiD
we getting change display working again with this bugfix. details
* Added missing info from PrimarySurface.DMW when display driver defaults back to the video drivers standard mode
* Fixed caching system in IntEnumDisplaySettings when run more than once
* Hacked a way around the bug in FindDDIDriver

svn path=/trunk/; revision=28514
2007-08-24 12:10:10 +00:00
The Wine Synchronizer
c18bbbf9a7 Autosyncing with Wine HEAD
svn path=/trunk/; revision=28513
2007-08-24 09:42:29 +00:00
Hervé Poussineau
95797b4cf7 Update status of shlwapi
svn path=/trunk/; revision=28512
2007-08-24 09:40:17 +00:00
The Wine Synchronizer
6d150b1c57 Autosyncing with Wine HEAD
svn path=/trunk/; revision=28511
2007-08-24 09:07:52 +00:00
The Wine Synchronizer
bbc41d3721 Autosyncing with Wine HEAD
svn path=/trunk/; revision=28510
2007-08-24 09:07:34 +00:00
Aleksey Bragin
e1bf65e84c Daniel Zimmerman <netzimme@aim.com>:
- Test app for IoCheckEaBufferValidity() implementation (not included into the build system yet).

svn path=/trunk/; revision=28507
2007-08-24 07:59:29 +00:00
Aleksey Bragin
262a6322c1 Daniel Zimmerman <netzimme@aim.com>:
- Implement IoCheckEaBufferValidity()

svn path=/trunk/; revision=28506
2007-08-24 07:55:14 +00:00
Andrew Munger
e6b469c9c0 Free memory with the proper tag.
Spotted by Gregor Brunmar (gregor dot brunmar at home dot se).

svn path=/trunk/; revision=28505
2007-08-24 07:43:42 +00:00
James Tabor
dea1da8be6 Fixed it. Pluged in Polygon to use NtGdiPolyPolyDraw.
svn path=/trunk/; revision=28504
2007-08-24 05:25:21 +00:00
James Tabor
0d1fa60060 Pluged in NtGdiPolyPolyDraw. Does not work yet, still testing it.
svn path=/trunk/; revision=28503
2007-08-24 04:49:38 +00:00
Johannes Anderwald
cffe612011 - make more util mui-aware
- english translation needs to be done

svn path=/trunk/; revision=28502
2007-08-23 23:52:59 +00:00
James Tabor
f7da3af16d Fix math and add notes.
svn path=/trunk/; revision=28501
2007-08-23 22:29:37 +00:00
Aleksey Bragin
c2de09f61a - Make freeldr do identity memory mapping. This simplifies a lot of things throughout the code, and finally places the kernel at the same addresses where NT kernel is located.
- Fix code in ntoskrnl which was based on (wrong) assumptions.

svn path=/trunk/; revision=28497
2007-08-23 21:29:28 +00:00
Johannes Anderwald
7cc80286e0 - add german translation
svn path=/trunk/; revision=28495
2007-08-23 20:47:53 +00:00
Magnus Olsen
ee0dd7fa6e implement DeviceCapabilitiesExA and DeviceCapabilitiesExW, both always return -1
redirect DeleteColorSpace@4 to NtGdiDeleteColorSpace@4


svn path=/trunk/; revision=28494
2007-08-23 20:47:43 +00:00
Daniel Reimer
49b4adc779 Fix a typo.
svn path=/trunk/; revision=28493
2007-08-23 20:30:11 +00:00
Johannes Anderwald
40b600253d - turn back cursor on screensaver exit
- display fullscreen instead of maximized
- patch by Vytis Girdzijauskas, "CMan", cman[at]cman[dot]us
See issue #2583 for more details.

svn path=/trunk/; revision=28492
2007-08-23 20:25:20 +00:00
Aleksey Bragin
fd759f410c - Add some early skeleton for OHCI. This code isn't called by anything, so it can't break something.
svn path=/trunk/; revision=28491
2007-08-23 20:14:45 +00:00
Johannes Anderwald
a616c6c485 - part 2/2
- update french translation for sysdm by Pierre Schweitzer (heis_spiter at hotmail dot com)

See issue #2588 for more details.

svn path=/trunk/; revision=28490
2007-08-23 20:11:28 +00:00
Johannes Anderwald
cd2bd2ad1e - part 1/2
- add french translation for logoff by Pierre Schweitzer (heis_spiter at hotmail dot com)
- also add german translation
See issue #2588 for more details.

svn path=/trunk/; revision=28489
2007-08-23 20:10:36 +00:00
Daniel Reimer
23b758b293 - Update all SF Links to one of the fastest Mirrors. puzzle is EVIL!
- Fix some broken Links
- Update some Files to newer Versions.

svn path=/trunk/; revision=28488
2007-08-23 20:03:37 +00:00
Magnus Olsen
9b03238d39 commit my verify list with api that been tested and works same/simluare as windows xp, in windows 2000/xp
svn path=/trunk/; revision=28487
2007-08-23 19:56:57 +00:00
Aleksey Bragin
6ccab0cf5a - Set NULL Io cancel routine, fixes an assert when using usb storage driver.
svn path=/trunk/; revision=28486
2007-08-23 19:41:38 +00:00
Magnus Olsen
6b5a7d3908 Kill reactos own syscall api NtGdiCreatePolygonRgn, it have been redirect to another ros own syscall named NtGdiCreatePolyPolygonRgn. see my last commit for gdi32
svn path=/trunk/; revision=28485
2007-08-23 19:33:21 +00:00
Magnus Olsen
75fff0653f remove redirect of CreatePolyPolygonRgn@16 and implement own stub for it, it is hacked, it should doing, return (HRGN) NtGdiPolyPolyDraw(fnPolyFillMode, lppt, lpPolyCounts, nCount, 6 );
remove redirect of CreatePolygonRgn@12 and implement own stub for it, it is hacked, it should doing return NtGdiPolyPolyDraw(fnPolyFillMode,lppt,cPoints,1,6);
remove redirect of CreateRectRgn@16 and implement own stub for it,  some part need be done in user mode
Fix CreateRectRgnIndirect it call now on CreateRectRgn for some part need be done in user mode, and it crash if NULL comes in as param, like windows does. 
Fix CreatePenIndirect ir call now on CreatePen for some stuff need be done in user mode. 
Add comment to CreatePen it need be fix. 



svn path=/trunk/; revision=28484
2007-08-23 19:21:16 +00:00
Aleksey Bragin
d88b419c3a - Small NDK headers update
svn path=/trunk/; revision=28483
2007-08-23 19:20:28 +00:00
James Tabor
bae87c517b Fix build?
svn path=/trunk/; revision=28482
2007-08-23 18:35:46 +00:00
Timo Kreuzer
58091ef92d move NtGdiGetSetBoundsrect from paintobj.c to dc.c, remove paintobj.c
svn path=/trunk/; revision=28481
2007-08-23 17:28:24 +00:00
Magnus Olsen
5e95a39358 Remove NtGdiCreatePalette it was a ros specfify api in win32k syscall list. It have been replace with NtGdiCreatePaletteInternal
svn path=/trunk/; revision=28480
2007-08-23 17:22:27 +00:00
Timo Kreuzer
e60a2c2441 move NtGdiExtFloodFill from bitblt.c to filshap.c
svn path=/trunk/; revision=28479
2007-08-23 17:04:28 +00:00
Timo Kreuzer
c74dd37de0 - rename painting.c to bitblt.c
- move NtGdi/Int(Poly)PatBlt to bitblt.c

svn path=/trunk/; revision=28478
2007-08-23 16:38:23 +00:00
Magnus Olsen
3883e58615 Fix : CreatePalette@4 calling NtGdiCreatePaletteInternal
svn path=/trunk/; revision=28477
2007-08-23 16:19:51 +00:00
Magnus Olsen
a224171ac5 fast implementions of NtGdiCreatePaletteInternal
it is base on NtGdiCreatePalette

svn path=/trunk/; revision=28476
2007-08-23 15:36:20 +00:00
Ged Murphy
b5210a6c16 odd, this doesn't fail on my machine but it does on the buildserver
svn path=/trunk/; revision=28475
2007-08-23 15:30:49 +00:00
Ged Murphy
f68661bb9c add new file to rbuild file and fix gcc complaints
svn path=/trunk/; revision=28474
2007-08-23 15:23:10 +00:00
Magnus Olsen
122ab0a2bb Remove redirect of CreateDIBitmap@24 to NtGdiCreateDIBitmap@24, and create stub for it. we need do some stuff in user mode
Fix : CreateDiscardableBitmap shall be call on CreateCompatibleBitmap not the NtGdiCreateCompatibleBitmap, for we need do some thing in user mode
Fix : CreateEllipticRgnIndirect it crash now, if the param is NULL, that goes same for all windows NT I tested 

svn path=/trunk/; revision=28473
2007-08-23 15:03:13 +00:00
Ged Murphy
0c529df2e0 simplify some code
svn path=/trunk/; revision=28472
2007-08-23 14:57:44 +00:00
Magnus Olsen
520d244fe2 create stub for both CreateCompatibleDC and CreateCompatibleBitmap instead for redirect them, they need share memory, and it need do some stuff in user mode
svn path=/trunk/; revision=28470
2007-08-23 14:02:10 +00:00
Magnus Olsen
ed494d70d2 remove redirect of CombineRgn and CreateBitmap some part are need be done in user mode. not in win32k,
implement it as stub, and doing the syscall until some got time review and rewrite this code right

svn path=/trunk/; revision=28469
2007-08-23 12:54:09 +00:00
Magnus Olsen
0c8c94eb0d sorry fixed break in comping
svn path=/trunk/; revision=28468
2007-08-23 12:43:06 +00:00
Magnus Olsen
14b913746c Redirect : BRUSHOBJ_pvGetRbrush@4 to NtGdiBRUSHOBJ_pvGetRbrush@4
Redirect : BRUSHOBJ_ulGetBrushColor@4 to NtGdiBRUSHOBJ_ulGetBrushColor@4
Redirect : CLIPOBJ_bEnum@12 to  NtGdiCLIPOBJ_bEnum@12
Redirect : CLIPOBJ_cEnumStart@20  to  NtGdiCLIPOBJ_cEnumStart@20
Redirect : CLIPOBJ_ppoGetPath@4 to NtGdiCLIPOBJ_ppoGetPath@4

svn path=/trunk/; revision=28467
2007-08-23 12:10:13 +00:00
Magnus Olsen
46fb3ca2dc Implement stub : NtGdiCLIPOBJ_bEnum
Implement stub : NtGdiCLIPOBJ_cEnumStart
Implement stub : NtGdiCLIPOBJ_ppoGetPath
Implement stub : NtGdiBRUSHOBJ_ulGetBrushColor
Implement stub : NtGdiBRUSHOBJ_pvAllocRbrush
Implement stub : NtGdiBRUSHOBJ_pvGetRbrush

svn path=/trunk/; revision=28466
2007-08-23 12:07:37 +00:00
Magnus Olsen
94e74e9b8b Bugfix : AddFontResourceExW, SetLastError to invaild param when the fl are not set.
Redirect : AnyLinkedFonts@0 to NtGdiAnyLinkedFonts@0 (stubed in win32k)
Redirect : BRUSHOBJ_hGetColorTransform@4 to NtGdiBRUSHOBJ_hGetColorTransform@4 (stubed in win32k)
Redirect : BRUSHOBJ_pvAllocRbrush@8 to  NtGdiBRUSHOBJ_pvAllocRbrush@8  (stubed in win32k)
partly working : GdiAddFontResourceW is parttly working but it does not works as windows version, instead for being stub, it is not finish implementions of it. This is nassry to clean up some mess. 


svn path=/trunk/; revision=28465
2007-08-23 09:52:31 +00:00
Magnus Olsen
851f4ff721 adding stub for NtGdiAnyLinkedFonts, NtGdiBRUSHOBJ_hGetColorTransform, NtGdiBRUSHOBJ_pvAllocRbrush
svn path=/trunk/; revision=28464
2007-08-23 09:44:26 +00:00
Aleksey Bragin
1ca48793e3 Dmitry Chapyshev <lentind@yandex.ru>:
- Add a shortcut to a charmap tool, create start menu group for it.

svn path=/trunk/; revision=28463
2007-08-23 09:05:04 +00:00
Aleksey Bragin
ade3d4b9af Dmitry Chapyshev <lentind@yandex.ru>
- Change control panel icon to a better one

svn path=/trunk/; revision=28462
2007-08-23 08:05:05 +00:00
James Tabor
81666beff6 Add NtGdiFlushUserBatch callback.
svn path=/trunk/; revision=28461
2007-08-23 01:51:22 +00:00
Timo Kreuzer
dd008296b0 maze as a screensaver ;-)
svn path=/trunk/; revision=28460
2007-08-23 00:43:25 +00:00
Timo Kreuzer
95ba212738 - NtGdiAnimatePalette, NtGdiGe/SetPaletteEntries, NtGdiGetSystemPaletteEntries, NtGdiGet/SetDIBColorTable: rename into IntXxx, remove SEH and remove functions from w32ksvc.db
- implement NtGdiDoPalette calling the Int functions using SEH & ProbeForXxx and add it to w32ksvc.db
- change parameters of NtGdiDoPalette: HPALETTE -> HGDIOBJ, as it also accepts HDC, LPPALETTENTRY -> LPVOID as it also accepts RGBQUAD*
- implement stub functions in gdi32.dll calling NtGdiDoPalette instead of redirecting to the old NtGdixxx functions
- update ntgdibad.h


svn path=/trunk/; revision=28459
2007-08-23 00:31:26 +00:00
Timo Kreuzer
e2167fe00e one more TEST -> RTEST for NtGdiGetRandomRgn
svn path=/trunk/; revision=28458
2007-08-23 00:20:30 +00:00
Timo Kreuzer
3385ef604e some tests for NtGdiDoPalette
svn path=/trunk/; revision=28457
2007-08-23 00:19:00 +00:00
Timo Kreuzer
d99309335f win32k syscall dlls for win xp and 2k
svn path=/trunk/; revision=28456
2007-08-22 21:49:49 +00:00
James Tabor
28dafc3348 - Removed NtGdiGetDIBits from w32ksvc.db and updated ntgdibad.h.
- Created support function for GetDIBits when calling NtGdiGetDIBitsInternal.
- Connected the gdi32 parts.

svn path=/trunk/; revision=28455
2007-08-22 19:45:06 +00:00
Johannes Anderwald
12d4e8967e - fix description by Pierre Schweitzer (heis spiter at hotmail com)
svn path=/trunk/; revision=28454
2007-08-22 18:29:20 +00:00
Hervé Poussineau
00ea7e6ada Move generic part of ReactOS-$(ARCH).rbuild to ReactOS-generic.rbuild
svn path=/trunk/; revision=28453
2007-08-22 15:06:43 +00:00
James Tabor
33c9fa8993 Removed NtUserReleaseDC, replaced it with CallOneParam.
svn path=/trunk/; revision=28452
2007-08-22 14:12:55 +00:00
Art Yerkes
01d8c61545 Bug found by arty, thanks to alex for helping fix it:
Process termination fixes part 1: don't suicide our process when we're killing
a sibling.

 - Clarify the use of KillByHandle.  It does *not* mean "suicide".
 - In fact, we had considered the use of KillByHandle backward, that is,
   our process would commit suicide if it was killing a sibling process.
 - Make suicide contingent on killing the same process.
 - Properly handle DBG_TERMINATE_PROCESS semidocumented debugger hack.

svn path=/trunk/; revision=28451
2007-08-22 07:28:45 +00:00
James Tabor
2858198372 Win32 User32 rewrite example.
svn path=/trunk/; revision=28450
2007-08-22 02:54:22 +00:00
James Tabor
7dc8712f1b Cleanup, dont call inside SEH with SEH. IntGdiModifyWorldTransform calls DC_UpdateXforms which calls DCU_UpdateUserXForms and it calls SEH. Moved NtGdiFlush to dcutil.c
svn path=/trunk/; revision=28449
2007-08-21 23:27:44 +00:00
Johannes Anderwald
272d2be738 - Some typos and fixes for greek resource file for ncpa by Apostolos Alexiadis aka Apal (djapal at gmail dot com)
See issue #2582 for more details.

svn path=/trunk/; revision=28447
2007-08-21 16:34:23 +00:00
James Tabor
1deecb4b19 - Removed NtGdiSetMapMode from w32ksvc.db and updated ntgdibad.h.
- Moved NtGdiSetMapMode to an internal function.
- Changed NtGdiPaintRgn and added IntdiPaintRgn.
- Cleaned up win32k path.c.
- Connected the gdi32 parts.


svn path=/trunk/; revision=28446
2007-08-21 09:28:51 +00:00
James Tabor
c27ffbed0c Sorry missed this one. Turn it off.
svn path=/trunk/; revision=28445
2007-08-21 07:45:02 +00:00
James Tabor
1cdbcdc32e Turn Dc_Attr off.
svn path=/trunk/; revision=28444
2007-08-21 07:21:26 +00:00
James Tabor
ba4d4c6863 Turn off copy to user for now.
svn path=/trunk/; revision=28443
2007-08-21 06:47:49 +00:00
James Tabor
e308fab607 - Started the use of DC_ATTR. Created dcutil.c to handle xfers. I choose XForms this time and still trouble shooting it. If anyone wants to join in and help. Optimize syncing the data packets, add more, etc. Don't be shy!
- Removed NtGdiGetWorldTransform from w32ksvc.db and updated ntgdibad.h.
- Implemented GetTransform redirect to NtGdiGetTransform.
- Connected the gdi32 parts.


svn path=/trunk/; revision=28442
2007-08-21 05:01:00 +00:00
James Tabor
e2e96c6bc8 Bug patch 2382 by Zavyalov Alexey. GetCurrencyFormatW() added superfluous group sign in negative numbers and reformatting code.
svn path=/trunk/; revision=28441
2007-08-20 22:55:48 +00:00
Johannes Anderwald
d708f1133e - Some typos and fixes for greek resource file for newdev by Apostolos Alexiadis aka Apal (grad0621 at di dot uoa dot gr)
See issue #2576 for more details.

svn path=/trunk/; revision=28440
2007-08-20 22:29:40 +00:00
Johannes Anderwald
12fb19e113 - set check when theres a timeout
svn path=/trunk/; revision=28439
2007-08-20 22:10:55 +00:00
Johannes Anderwald
7f430604fd - implement writing startup recovery options
svn path=/trunk/; revision=28438
2007-08-20 22:01:54 +00:00
Johannes Anderwald
4871c23639 - implement reading startup / recovery options
svn path=/trunk/; revision=28437
2007-08-20 21:41:05 +00:00
Magnus Olsen
0b103054a4 Fix NtUserGetClipboardViewer in w32ksvc a smaller typo
svn path=/trunk/; revision=28436
2007-08-20 21:02:25 +00:00
Johannes Anderwald
e7fd85126b - support reading multiple boot configuration
- support saving prefered boot configuration (freeldr / boot ini style)
- parsing of boot options needs to be done

svn path=/trunk/; revision=28433
2007-08-20 19:21:54 +00:00
Magnus Olsen
7253f38afd Remove some expremnt code, need rehink how I can get current range of video memory pointer
svn path=/trunk/; revision=28432
2007-08-20 15:17:06 +00:00
Hervé Poussineau
07277867b0 Fix typo
svn path=/trunk/; revision=28431
2007-08-20 12:06:12 +00:00
Hervé Poussineau
bd443f4d74 Add rbuild file for winsta.dll, and add it to bootcd
See issue #2574 for more details.

svn path=/trunk/; revision=28430
2007-08-20 09:34:18 +00:00
Johannes Anderwald
7a1bf66462 - update available software items in configuration file by Pierre Schweitzer (heis_spiter at hotmail com)
See issue #2566 for more details.

svn path=/trunk/; revision=28429
2007-08-20 09:19:07 +00:00
Timo Kreuzer
0e85f8a438 - rename NtGdiSelectPalette to NtUserSelectPalette, move it to ntuser/windc.c and implement stub function SelectPalette in gdi32.dll calling it (Don't ask me why it is named this way, but it is on windows)
- rename NtGdiSetDIBitsToDevice to NtGdiSetDIBitsToDeviceInternal and implement stub function in gdi32.dll
- update ntgdibad.h

svn path=/trunk/; revision=28428
2007-08-19 23:49:47 +00:00
Ziliang Guo
263feb7b7d Fix kdbg disasm bug, patch by SamB
See issue #2408 for more details.

svn path=/trunk/; revision=28427
2007-08-19 22:51:10 +00:00
Johannes Anderwald
b4c3f2b5e3 more.c should not close INVALID_HANDLE_VALUE
patch by Apal
remove tab and quit when failing to open file (tested with Windows XP SP2)

svn path=/trunk/; revision=28426
2007-08-19 20:16:10 +00:00
Colin Finck
82f18756f0 - mkhive's "registry.c" used wcsncmp for comparing two strings. But this function seems to work different on different hosts (probably due to different handling of wchar_t's or whatever).
To avoid this problem, use memcmp now to compare the strings as it's done two lines later. This fixes the Live-CD on Linux/Unix hosts.
  (For the first time, Live-CDs created by our 64-Bit Debug Buildslave are usable :-)
- Change __volatile to volatile in "winddk.h". This fixes compilation problems under MSVC.
- Make the prototype of RtlCompareMemory in "winnt.h" similar to the one in "winddk.h". Fixes a compilation problem in MSVC.
- Define the prototype for xwcschr in "mkhive.h". Silences a warning in MSVC.
- Add some casts to "reginf.c" to silence some warnings in MSVC.
- Add a MSVC 2005 project file for mkhive. mkhive can be compiled under MSVC with this project file, when cmlib and inflib_host are compiled.
- Remove the duplicate definition of CMLIB_HOST in "cmlib.mak".

svn path=/trunk/; revision=28425
2007-08-19 19:37:47 +00:00
Eric Kohl
0f123ca26f - Implement the mouse keys dialog.
- Fix a tiny bug in the mouse keys dialog resource.
- Update file header.

svn path=/trunk/; revision=28424
2007-08-19 16:11:04 +00:00
Colin Finck
cddcaa508e - Always include "wine/unicode.h" before all other headers, when we need the wchar_t type.
unicode.h includes windef.h, which includes winnt.h, which has the handling for the wchar_t type. As it's the first included header, no other wchar_t type will be defined before.
- Remove the wchar_t definition from the Makefile as the winnt.h header will define it as "unsigned short" automatically.

svn path=/trunk/; revision=28423
2007-08-19 15:38:21 +00:00
Colin Finck
fd468bc98a Change the wchar_t logic once more to make it a bit simplier.
A host can only have one special wchar_t definition, so we don't need to define all. Also _WCHAR_T_DEFINED is the only definition used for overriding the wchar_t setting by applications.
So use the previous logic to check and define the wchar_t definitions for the host and at the end check for _WCHAR_T_DEFINED. In all cases, define _WCHAR_T_DEFINED.

Additionally, __need_wchar_t has to be undefined after including "ctype.h" as "ctype.h" defines it.

svn path=/trunk/; revision=28422
2007-08-19 14:04:20 +00:00
Sylvain Petreolle
4a878b945f update ncpa french translation
svn path=/trunk/; revision=28421
2007-08-19 12:49:29 +00:00
Eric Kohl
ec36584855 Add resources for the mouse keys settings dialog.
svn path=/trunk/; revision=28420
2007-08-19 10:52:59 +00:00
Art Yerkes
f6051eed12 Add async name functions, imported from wine. Modified for ReactOS, original
copyright assigment:

 * Copyright (C) 1993,1994,1996,1997 John Brezak, Erik Bos, Alex Korobka.
 * Copyright (C) 1999 Marcus Meissner

async.c was original licensed under the GNU Lesser General Public License v2.1

svn path=/trunk/; revision=28419
2007-08-19 10:39:26 +00:00
James Tabor
7330591df4 Implemented an easy API, XLATEOBJ_piVector. Just leave them in stubs for now.
svn path=/trunk/; revision=28418
2007-08-19 09:16:38 +00:00
James Tabor
5f7a8012cd Implemented a handfull of easy Eng APIs. Just leave them in stubs for now.
svn path=/trunk/; revision=28417
2007-08-19 08:16:01 +00:00
Art Yerkes
d149b737c0 (customize-variable 'indent-tabs-mode) ; nil
svn path=/trunk/; revision=28416
2007-08-19 05:11:54 +00:00
Art Yerkes
7acf61114d Fix part two of the bug:
The actual problem was that we'd overrun the end of the handle count array
when decrementing.  This also led to a handle leak (observed).  Stop correctly
when we find the handle we want.

svn path=/trunk/; revision=28415
2007-08-19 05:02:31 +00:00
Colin Finck
edceb16713 Use host_gpp instead of host_gcc for building "ssprintf.cpp" and "tools.cpp".
These are C++ files, so they should be built with g++ like it's done for the other tools. Usually they can also be built with gcc, but Collibri from IRC reported that broken gcc interfaces exist, which lead to problems with these files.

svn path=/trunk/; revision=28414
2007-08-18 22:06:00 +00:00
Colin Finck
5f5941543f Always include "wrc.h" before including "ctype.h".
wrc.h includes wrctypes.h, which includes windef.h, which includes winnt.h. And winnt.h contains our wchar_t check, which has to be done before including ctype.h to enable building on Mac OS X hosts.

svn path=/trunk/; revision=28413
2007-08-18 21:41:26 +00:00
Colin Finck
f4d00d9532 Mac OS X already defines iswdigit, so don't define it again on this host OS.
svn path=/trunk/; revision=28412
2007-08-18 21:14:20 +00:00
Colin Finck
7c2606f0a3 Include windef.h, which then includes winnt.h, which uses our wchar_t check and reports the wchar_t definition back to the host.
Then the host finally knows that it should not define wchar_t again.

svn path=/trunk/; revision=28411
2007-08-18 21:10:14 +00:00
Colin Finck
b92649d370 Fix the logic for the wchar_t checks.
We don't only need to check if wchar_t has already been defined, but also report this to all known hosts and operating systems.

svn path=/trunk/; revision=28410
2007-08-18 20:30:12 +00:00
Colin Finck
44840c6db3 Move the wchar_t check above the "#include <ctype.h>" line (this is needed for Mac OS X host compatibility)
svn path=/trunk/; revision=28409
2007-08-18 19:49:53 +00:00
Colin Finck
3d0bdbac16 forgot the #endif :-/
svn path=/trunk/; revision=28408
2007-08-18 19:33:36 +00:00
Colin Finck
6674258f80 Add a check for the wchar_t existence for Mac OS X hosts
svn path=/trunk/; revision=28407
2007-08-18 19:25:43 +00:00
Colin Finck
4bb5fb5f3c Build fixes for Mac OS X, thanks to Alex
svn path=/trunk/; revision=28406
2007-08-18 19:07:13 +00:00
Eric Kohl
b5c0564c8e Get rid of the space reserved for icons to make the dialogs look more XP-like.
svn path=/trunk/; revision=28404
2007-08-18 16:02:28 +00:00
Magnus Olsen
fb897e20fb fixing smaller FIXME in win32kdxtest
svn path=/trunk/; revision=28403
2007-08-18 15:54:03 +00:00
Magnus Olsen
f594821726 adding few mixing DDHALINFO_ISPRIMARYDISPLAY, DDHALINFO_MODEXILLEGAL
svn path=/trunk/; revision=28402
2007-08-18 15:53:03 +00:00
Colin Finck
1fe9b53b9e Fix an "implicit declaration of wcslen" warning on Linux/Unix hosts
svn path=/trunk/; revision=28401
2007-08-18 15:47:33 +00:00
Magnus Olsen
1d6628eb0c Adding one new define #define DDCAPS_STEREOVIEW aka DDCAPS_RESERVED1
svn path=/trunk/; revision=28399
2007-08-18 15:43:25 +00:00
Colin Finck
f49af53def Show whether the IP address was assigned by DHCP or manually configured. I also added the german translation strings for this.
Patch by Frode Lillerud (frode AT enkelt DOT no)
See issue #2570 for more details.

svn path=/trunk/; revision=28398
2007-08-18 14:32:03 +00:00
Colin Finck
d7248a8454 Send a LBN_SELCHANGE notification after selecting the first network component entry, so the description text gets updated.
Patch by Gregor Brunmar (gregor DOT brunmar AT home DOT se)
See issue #2577 for more details.

svn path=/trunk/; revision=28397
2007-08-18 14:03:12 +00:00
Colin Finck
64e01f1c3a Fix cabman build breakage, when compiling it on Windows hosts with GCC
(this is true, other tested build configurations did not make any problems :-P)

svn path=/trunk/; revision=28396
2007-08-18 13:46:12 +00:00
Colin Finck
3f2d0a1c8d Use typedefs64.h in wmc instead of defining the types in the Makefile.
The definition of wchar_t can also be removed as this type is defined in windef.h if it was not defined before.

svn path=/trunk/; revision=28395
2007-08-18 13:21:31 +00:00
Colin Finck
ddf6aa9ca0 Also use typedefs64.h in wrc instead of defining the types in the Makefile.
svn path=/trunk/; revision=28394
2007-08-18 13:09:55 +00:00
Colin Finck
2ebabda1fb - Use typedefs64.h also for 64-bit host system compatibility in cabman.
This unifies the way of 64-bit compatibility and also enables cabman to compile with MSVC.
  The remaining "unsigned long"'s have to be used for casting pointers as the pointers are always 64-bit on 64-bit machines.
- Silence some warnings in MSVC 2005 and also add a MSVC project file.
  When you compiled the zlib library with RosBE, you can now easily use this project file without any changes to compile cabman with MSVC.

svn path=/trunk/; revision=28393
2007-08-18 13:08:58 +00:00
Colin Finck
eca3c5411c Fix the mkhive bug on 64-bit systems, this time correct.
See issue #2272 for more details.

svn path=/trunk/; revision=28392
2007-08-18 10:27:23 +00:00
Colin Finck
fa63b1102e Revert r28389 as it causes a build break, when you perform a full clean build
I'll commit a correct fix later

svn path=/trunk/; revision=28391
2007-08-17 23:08:12 +00:00
Colin Finck
bcb482f04c [AUDIT]
I had to break some SVN locks to add my latest commit. Here I'm undoing some of them now:

builddep.h - Remains unlocked. It just contains basic type definitions and include statements
infcommon.h - Just unlocked this file. It just contains one basic definition and two type definitions
infhost.h - Remains unlocked. It just contains the function prototypes for functions in the other source files
infhostgen.c - Locked again as I did not check this file
infhostget.c - Locked again as I did not check this file
infhostglue.c - Remains unlocked. It just contains a DbgPrint function, which can be found in many ReactOS source files
infhostput.c - Locked again as I did not check this file
inflib.mak - Just unlocked this file. No reason for a makefile to be locked.
README.txt - Just unlocked this file. No reason for a readme file to be locked.

svn path=/trunk/; revision=28390
2007-08-17 22:32:52 +00:00
Colin Finck
fe41b9be51 Fix the long-standing mkhive bug on 64-bit systems
This is now done by adding a "typedefs64.h" header file, which uses int's instead of long's for 32-bit values. As far as I know, this is the only way to avoid the problem that a long has a size of 64-bit on 64-bit systems.
This header file is now used in the host makefiles of cmlib, inflib and mkhive. It is also suitable for the other host tools, which need 32-bit values (will do some changes there in the next few days).

Unfortunately, Live-CDs still do not work because of another bug (see bug #2290).
But I compared the hives created by 32-bit Debian Linux and 64-bit Debian Linux and after these changes, they are exactly the same.
See issue #2272 for more details.

svn path=/trunk/; revision=28389
2007-08-17 22:17:13 +00:00
Magnus Olsen
c4bb3a9eb4 fixing the build and adding wine d3d8 and wined3d to bootcd
svn path=/trunk/; revision=28388
2007-08-17 19:41:23 +00:00
Magnus Olsen
3e5582c97f adding wine dx to the build all, wined3d and d3d8 is from wine cvs server date 17/8-2007
svn path=/trunk/; revision=28387
2007-08-17 19:24:59 +00:00
Magnus Olsen
7d9fb66422 This is a temporary solution to our DX problem
it will take some times getting native DirectX working in user mode. 
Wine Have manger ported their DirectX to Windows, And after some help 
from wine (Roderick Colenbrander aka Thunderbird), That mean we got 
now DirectX8 support in ReactOS from wine DirectX (base on opengl).
(rember disable the SSE in mesa before trying it, and it is untested
in ReactOS)
    

svn path=/trunk/; revision=28386
2007-08-17 18:29:23 +00:00
James Tabor
aa4f2c2037 Add the rest of the dcattr structure, LocalIcm and flags with VDS size.
svn path=/trunk/; revision=28385
2007-08-17 17:55:56 +00:00
James Tabor
0774d97b40 Add 4 more dcattr units.
svn path=/trunk/; revision=28384
2007-08-17 16:24:28 +00:00
Magnus Olsen
188728e7c5 forget remove a wine hack from this headers
svn path=/trunk/; revision=28383
2007-08-17 15:41:54 +00:00
Magnus Olsen
2eb1586e0a updating wine dx headers, adding some new wine dx header, from wine cvs date 17/08-2007
svn path=/trunk/; revision=28380
2007-08-17 13:59:31 +00:00
James Tabor
a02bfc6197 Fix NtUserLoadKeyboardLayoutEx size.
svn path=/trunk/; revision=28378
2007-08-17 02:06:36 +00:00
James Tabor
e2d01e0703 Use Gdi32 DeleteDC now. Soon tests will start with most Get functions using dcattr.
svn path=/trunk/; revision=28377
2007-08-17 00:40:57 +00:00
James Tabor
dc8b712ce4 Removed two unsupported types.
svn path=/trunk/; revision=28376
2007-08-17 00:10:37 +00:00
James Tabor
2a6ac07ef7 Fix memory DC so CreateCompatibleDC with null will create it. Based on msdn2 info, we need to setup display surface, etc.
svn path=/trunk/; revision=28375
2007-08-17 00:08:48 +00:00
James Tabor
f0415590e9 Removed NtGdiSetWorldTransform. Made the code info updates. Need to report from wine Path.c in win32k. I guess around in the next two weeks will be ok.
svn path=/trunk/; revision=28374
2007-08-16 22:08:02 +00:00
Ged Murphy
047296bb00 Revert 28351. The bug lies elsewhere
svn path=/trunk/; revision=28373
2007-08-16 20:17:39 +00:00
James Tabor
c0622d865c Added note to EngQueryEMFInfo.
svn path=/trunk/; revision=28368
2007-08-16 00:41:26 +00:00
James Tabor
3e972976a4 Implemented a handfull of easy Eng APIs.
svn path=/trunk/; revision=28367
2007-08-16 00:12:10 +00:00
Aleksey Bragin
fa6d836c61 - Uncomment ukranian language, since the translation was fixed in r27745.
svn path=/trunk/; revision=28366
2007-08-15 20:44:26 +00:00
Aleksey Bragin
0364357251 Feng Yuning <fengyuning1984@gmail.com>:
- Fix ntfs reading problem (occurs when trying to load Windows from an NTFS partition, reading always failed).

svn path=/trunk/; revision=28364
2007-08-15 20:04:50 +00:00
Daniel Reimer
85c976b666 Fix some mistakes I made
svn path=/trunk/; revision=28363
2007-08-15 17:52:57 +00:00
Daniel Reimer
fbba3e614a Updated German Translations for access and mmsys CPLs
svn path=/trunk/; revision=28362
2007-08-15 16:45:24 +00:00
Colin Finck
0afb01de39 Somehow the "resource.h" and "rsrc.rc" files were missing in Fireball's commit.
This fixes the build of "find".

svn path=/trunk/; revision=28360
2007-08-15 16:07:32 +00:00
Daniel Reimer
2995c86adb German RC Files Update
charmap, devmgmt, servman, wordpad, fedebug: updated the License to a German Translation from Notepad
matrix, explorer, syssetup: small RC File fixes
desk, newdev, translated new stuff
Still tbd: access and mmsys

svn path=/trunk/; revision=28358
2007-08-15 15:48:42 +00:00
Aleksey Bragin
e129710f4a Dmitry Chapyshev <lentind@yandex.ru>:
- Fix so that letters like "p" or "y" are correctly displayed in messageboxes.

svn path=/trunk/; revision=28351
2007-08-15 14:49:44 +00:00
Aleksey Bragin
dfbe549c81 Dmitry Chapyshev <lentind@yandex.ru>:
- Russian translation fixes
- Separation of hardcoded strings into resource files

svn path=/trunk/; revision=28350
2007-08-15 14:46:36 +00:00
Ged Murphy
4e51142f10 move mmsys icons into the resources folder
svn path=/trunk/; revision=28346
2007-08-15 12:50:21 +00:00
Aleksey Bragin
6ed2f68a65 Dmitry Chapyshev <lentind@yandex.ru>:
- Add some icons to mmsys.
- Change ugly powercfg icons to better one.

svn path=/trunk/; revision=28345
2007-08-15 12:41:24 +00:00
Andrew Munger
421174102d Fixup the R_MAGIC code.
svn path=/trunk/; revision=28344
2007-08-15 07:45:55 +00:00
Art Yerkes
b8921e7fad Fix size of handle count database. We really didn't want to change the size
we remembered for the old one, and the newly computed size was wacky too.
We just want to add 4 to i and 4 * entry size to the size.

This was found by Wax.

svn path=/trunk/; revision=28343
2007-08-15 05:30:32 +00:00
James Tabor
9b8fc0d903 GdiComment, example port from Wine.
svn path=/trunk/; revision=28342
2007-08-15 01:41:30 +00:00
Timo Kreuzer
6f54ba60ab - Rename NtGdiCreateBitmap to IntGdiCreateBitmap and remove SEH
- implement new NtGdiCreateBitmap, calling IntGdiCreateBitmap with SEH
- Use only IntGdiCreateBitmap internally
- implement BITMAPOBJ_GetRealBitsPixel, finding an appropriate value for unsupported values of BitsPixel
- make parameter validation more windows compatible

svn path=/trunk/; revision=28341
2007-08-14 23:22:07 +00:00
Hervé Poussineau
d91a924361 Do not import RtlDuplicateUnicodeString from ntoskrnl, it doesn't exist on MS Windows XP
svn path=/trunk/; revision=28340
2007-08-14 17:15:16 +00:00
Hervé Poussineau
7278d4e247 Implement BackupEventLogA/W, ClearEventLogA/W, CloseEventLog, DeregisterEventSource, GetNumberOfEventLogRecords, GetOldestEventLogRecord, OpenBackupEventLogA/W, OpenEventLogA/W, ReadEventLogA/W, RegisterEventSourceA/W by calling appropriate method in eventlog.exe
Add correct implementation for ReportEventW, but do not activate it (WIDL doesn't support the prototype)

svn path=/trunk/; revision=28338
2007-08-14 13:20:14 +00:00
Hervé Poussineau
3bf2d78767 Forward RegisterEventSourceW and DeregisterEventSource to eventlog service
svn path=/trunk/; revision=28337
2007-08-14 08:49:29 +00:00
Hervé Poussineau
91add81a87 Start the RPC server in eventlog service
svn path=/trunk/; revision=28336
2007-08-14 08:48:02 +00:00
Hervé Poussineau
979222a38c Add back idl for eventlog
svn path=/trunk/; revision=28335
2007-08-14 08:01:01 +00:00
Ged Murphy
bea20932d4 only display resolutions which match the current frequency
svn path=/trunk/; revision=28333
2007-08-13 23:33:48 +00:00
Ged Murphy
26fb8f8d76 remove double comment
svn path=/trunk/; revision=28326
2007-08-13 21:09:49 +00:00
Ged Murphy
e22ac7131d add a temp fix to bypass our incomplete urlmon.idl
svn path=/trunk/; revision=28325
2007-08-13 21:06:05 +00:00
Ged Murphy
ea8a786bc0 - fix the code, untested
*note, shouldn't this be in rosapps?

svn path=/trunk/; revision=28324
2007-08-13 20:52:47 +00:00
Ged Murphy
95a14312ca Don't overshoot the for loop, fixes a memory leak
svn path=/trunk/; revision=28323
2007-08-13 20:20:31 +00:00
Maarten Bosma
cb14899998 Add a tiny command line download tool.
svn path=/trunk/; revision=28322
2007-08-13 20:09:47 +00:00
Hervé Poussineau
a8653e49fb Silent mmdrv a bit
svn path=/trunk/; revision=28320
2007-08-13 15:55:41 +00:00
Hervé Poussineau
0d694c9494 Check username/password when unlocking the workstation
Fix typo

svn path=/trunk/; revision=28318
2007-08-13 14:54:14 +00:00
Hervé Poussineau
6047f75c71 Add missing LOGON32_* constants
svn path=/trunk/; revision=28317
2007-08-13 14:51:02 +00:00
Hervé Poussineau
92e384aee9 Use the profile returned by GINA before calling LoadUserProfileW()
Destroy the environment when not needed anymore
Better cleanup in case of error

svn path=/trunk/; revision=28316
2007-08-13 14:23:03 +00:00
Hervé Poussineau
e65bdff8a0 Cleanup WlxInitialize(), WlxStartApplication() and WlxActivateUserShell()
Allocate and return a valid PWLX_PROFILE structure in DoLoginTasks
Fix some warnings

svn path=/trunk/; revision=28315
2007-08-13 14:20:36 +00:00
Hervé Poussineau
c13edbee03 Take care of lpProfileInfo->lpProfilePath in LoadUserProfileW
Return required size in GetUserProfileDirectoryW if buffer is too small

svn path=/trunk/; revision=28314
2007-08-13 14:18:49 +00:00
Hervé Poussineau
e78d113358 Convert language file for UTF8 to ASCII.
See issue #2569 for more details.

svn path=/trunk/; revision=28313
2007-08-13 12:04:54 +00:00
Art Yerkes
3dbef74491 Make boot options for the bootcd dependent on DBG. Suggested by Caemyr.
svn path=/trunk/; revision=28311
2007-08-13 03:10:40 +00:00
Timo Kreuzer
007aa094f9 65 tests for NtGdiCreateBitmap
svn path=/trunk/; revision=28308
2007-08-12 22:33:21 +00:00
Eric Kohl
6ffa8db23a Fix a typo.
svn path=/trunk/; revision=28307
2007-08-12 21:50:37 +00:00
Eric Kohl
9072c8ce96 Add some mouse keys settings and general settings.
svn path=/trunk/; revision=28306
2007-08-12 21:19:52 +00:00
Timo Kreuzer
939a564d17 - add gdihv to rosapps build
- comment out OpenProcess, it crashes ros again

svn path=/trunk/; revision=28305
2007-08-12 20:12:21 +00:00
Colin Finck
ff30235bb7 Metadata enhancement for rbuild and version report by Marc Piulachs (marc DOT piulachs AT codexchange DOT net)
See issue #2547 for more details.

svn path=/trunk/; revision=28304
2007-08-12 19:17:00 +00:00
Timo Kreuzer
79b789d4b7 move NtGdiBitBlt, NtGdiTransparentBlt, NtGdiExtFloodFill, NtGdiMaskBlt, NtGdiPlgBlt, NtGdiStretchBlt, NtGdiAlphaBlend from bitmaps.c to painting.c
svn path=/trunk/; revision=28302
2007-08-12 16:20:29 +00:00
Colin Finck
5bb7f86ce6 Finally uncomment the Norwegian keyboard layout again, the bug is really fixed by recent changes :-)
See issue #2414 for more details.

svn path=/trunk/; revision=28301
2007-08-12 15:55:56 +00:00
Timo Kreuzer
2342abfc76 rename NtGdiGetBitmapDimensionEx to NtGdiGetBitmapDimension, update ntgdibad.h
svn path=/trunk/; revision=28300
2007-08-12 15:20:09 +00:00
Magnus Olsen
f41e3a0f1a win32kdxtest does not contain any more test for NtGdiDdQueryDirectDrawObject
So now I start adding new test, that I did manual testing for and reading debugout put for. 
we still missing test for NtGdiDdQueryDirectDrawObject

svn path=/trunk/; revision=28299
2007-08-12 14:11:00 +00:00
Magnus Olsen
b694e14566 update with more test for w32knapi
svn path=/trunk/; revision=28298
2007-08-12 12:31:10 +00:00
Hervé Poussineau
cc185a5b73 Update code to add back support for ACPI
svn path=/trunk/; revision=28297
2007-08-12 08:37:38 +00:00
James Tabor
fcd3ddadc4 Added two new subroutines in support for writing data to and from user space. Fixed calc in CoordCnvP to use float not fixed.
svn path=/trunk/; revision=28296
2007-08-12 07:34:23 +00:00
Christoph von Wittich
66469de606 put typelibs which are embedded in win32dlls into $(INTERMEDIATE)
svn path=/trunk/; revision=28295
2007-08-11 21:42:02 +00:00
Christoph von Wittich
b95a167c31 don't touch absolute paths
this fixes the build when using absolute paths in ROS_INTERMEDIATE or ROS_OUTPUT

svn path=/trunk/; revision=28294
2007-08-11 21:22:00 +00:00
Eric Kohl
e379a4d781 Add high contrast settings
svn path=/trunk/; revision=28293
2007-08-11 20:53:52 +00:00
Aleksey Bragin
8dae7ddffe - Last part of Alex's work on CM before he left ReactOS development. It was unfinished, so I had to insert a few hacks and comment out some code to make it working in trunk.
- Implement subkey creation code (for NtCreateKey and CmiConnectHive) based on the new Cm branch code (just as all the other routines were changed previously).
- Also support creating hash leaves, used in XP hives, since all the new code was already able to read them.

svn path=/trunk/; revision=28292
2007-08-11 19:03:00 +00:00
James Tabor
edaf84b215 Added a set option to ModifyWorldTransform.
svn path=/trunk/; revision=28291
2007-08-11 18:15:02 +00:00
Magnus Olsen
01d9041103 adding more dx test to w32knapi, convert from win32kdxtest tool
svn path=/trunk/; revision=28290
2007-08-11 15:48:50 +00:00
Magnus Olsen
2b8f46f472 adding more dx test to w32knapi, convert from win32kdxtest tool
svn path=/trunk/; revision=28288
2007-08-11 14:35:44 +00:00
Thomas Bluemel
6dc469edbb CallWindowProc returns 0 if lpPrevWndFunc is NULL
svn path=/trunk/; revision=28285
2007-08-11 11:55:17 +00:00
Magnus Olsen
e6980dd58b update with some more dx test
svn path=/trunk/; revision=28284
2007-08-11 10:11:19 +00:00
Aleksey Bragin
056b071be7 - Minor code changes, plus a temporary (DPRINT1) change for the HandleCount != 0 problem.
svn path=/trunk/; revision=28280
2007-08-11 09:04:17 +00:00
Magnus Olsen
58272e652f Adding dx test from my win32kdxtest to win32knapi test.
win32kdxtest are more like a analysis tools to examine some struct and dumping it, 
win32knapi is true test tools 

svn path=/trunk/; revision=28279
2007-08-11 08:52:38 +00:00
James Tabor
56edf011f1 Added EMF and MF support to Ext-FloodFill. Changed gdi32.def too.
svn path=/trunk/; revision=28278
2007-08-11 07:57:46 +00:00
James Tabor
634225118c Add Wine port Metafile call to SetTextCharacterExtra.
svn path=/trunk/; revision=28277
2007-08-11 07:34:57 +00:00
James Tabor
e00125a8d6 Add Set-ModifyWorldTransform to gdi32. Added error set in GdiGetHandleUserData.
svn path=/trunk/; revision=28276
2007-08-11 07:25:35 +00:00
James Tabor
87243c8c1a Removed Ex from NtGdiSetBitmapDimensionEx and NtGdiSetBrushOrgEx.
svn path=/trunk/; revision=28275
2007-08-11 06:29:31 +00:00
Timo Kreuzer
08bb46f842 add syscall list for windows 2000 SP4, so GreatLord can do testing
svn path=/trunk/; revision=28274
2007-08-10 23:55:54 +00:00
Aleksey Bragin
8b82da55a1 - RtlpCreateUnicodeString() -> RtlCreateUnicodeString()
svn path=/trunk/; revision=28273
2007-08-10 18:41:14 +00:00
James Tabor
63316363bd Added CriticalRegions at locations working with FirstDce.
svn path=/trunk/; revision=28272
2007-08-10 18:14:38 +00:00
James Tabor
be5bce8b2a - Removed NtGdiLPTODP/DPTOLP from w32ksvc.db and updated ntgdibad.h.
- Connected the gdi32 parts.

svn path=/trunk/; revision=28270
2007-08-10 07:39:46 +00:00
James Tabor
1ed0850348 Needed the w32ksvc.db too.
svn path=/trunk/; revision=28269
2007-08-10 06:55:18 +00:00
James Tabor
12fdc9f38e - Removed NtGdiPie from w32ksvc.db, leaving NtGdiPie in fillshap.c and updated ntgdibad.h.
- Separated printing.c to printing.c and coord.c. This was for LP to DP.
- Fixed flags.

svn path=/trunk/; revision=28268
2007-08-10 06:47:00 +00:00
James Tabor
674c1a507f Fix a problem in metafile deallocation.
svn path=/trunk/; revision=28267
2007-08-10 05:52:26 +00:00
Colin Finck
3c1d31c4a9 Changes in the slovak translation of taskmgr by Mario Kacmar (kario AT szm DOT sk)
See issue #2552 for more details.

svn path=/trunk/; revision=28266
2007-08-09 16:53:31 +00:00
Timo Kreuzer
b395135182 fix icon display
svn path=/trunk/; revision=28265
2007-08-09 14:42:33 +00:00
Timo Kreuzer
e7e1292fea add myself to CREDITS
svn path=/trunk/; revision=28264
2007-08-09 12:47:07 +00:00
Magnus Olsen
e915e72713 win32k
Implement NtGdiEngStretchBlt, NtGdiEngLockSurface                              

gdi32
Implement EngStretchBlt, EngLockSurface                              

Fix small typo in NtGdiEngBitBlt

svn path=/trunk/; revision=28261
2007-08-09 10:11:47 +00:00
Magnus Olsen
b7aca87de2 fix a typo thx jimtablor
svn path=/trunk/; revision=28260
2007-08-09 09:36:15 +00:00
Aleksey Bragin
90307e077e One of Alex's uncommitted patches while he was working on the Cm branch:
- Fix CmpCacheTable and CmpNameCacheTable definition.
- Fix GET_HASH_ENTRY definition.
- Add KCB Lock Acquire/Release macros by Index and Key.
Has no effect on current code, but fixes some bugs in the branch-based code

svn path=/trunk/; revision=28259
2007-08-09 08:35:11 +00:00
Aleksey Bragin
79d430fe4a - Fix DBG=KDBG=0 build
svn path=/trunk/; revision=28257
2007-08-09 07:50:31 +00:00
Aleksey Bragin
a21d95da1f - Set correct hive version in the hive structure
svn path=/trunk/; revision=28256
2007-08-09 07:39:47 +00:00
James Tabor
6de3763291 - Removed NtGdiSetAbortProc and NtGdiEscape from w32ksvc.db, leaving NtGdiEscape in print.c and updated ntgdibad.h.
svn path=/trunk/; revision=28255
2007-08-09 07:21:12 +00:00
Aleksey Bragin
77ea930fcb - Fix definition of _DESCRIPTOR/KDESCRIPTOR
- Fix all code/data structures of GDT/IDT to match new definition
- Kernel is now MSVC/WDK compilable (but not linkable yet)
- Remove two previous fixes for bootvid/kdcom MSVC/WDK compiling

svn path=/trunk/; revision=28254
2007-08-09 07:12:59 +00:00
James Tabor
56ed3e702f - Fixed NtGdiAlphaBlend prototype.
- Changed name for NtGdiSetIcmMode, updated ntgdibad.h.
- Fix size issue in w32ksvc.db.

svn path=/trunk/; revision=28253
2007-08-09 06:48:07 +00:00
Magnus Olsen
e11b16d9e7 gdi32
implement EngBitBlt
win32k
implement NtGdiEngBitBlt

svn path=/trunk/; revision=28252
2007-08-08 23:53:58 +00:00
Magnus Olsen
bc272f3edd Implement NtGdiEngAlphaBlend
Implement EngAlphaBlend

svn path=/trunk/; revision=28251
2007-08-08 23:03:46 +00:00
Daniel Reimer
54c4a1be66 Add Cardsbav.dll to Build of RosApps
svn path=/trunk/; revision=28250
2007-08-08 22:05:04 +00:00
Colin Finck
83a2f634bd Slovak translations for Explorer, Taskmgr and Winhelp by Mario Kacmar (kario AT szm DOT sk)
See issue #2543,2551,2552 for more details.

svn path=/trunk/; revision=28249
2007-08-08 19:23:53 +00:00
James Tabor
cce849b312 - Removed NtGdiGet/SetArcDirection and NtGdiGetSetTextCharExtra, update ntgdibad.h.
- Updated NtGdiGet/AndSet/DCDword.
- Changes to other files to reflect the updates and removals.

svn path=/trunk/; revision=28248
2007-08-08 18:58:06 +00:00
Sylvain Petreolle
812a9e4d7b use unicode directive
svn path=/trunk/; revision=28247
2007-08-08 16:41:25 +00:00
Sylvain Petreolle
c03ea6d0ce use unicode directive
svn path=/trunk/; revision=28246
2007-08-08 16:34:54 +00:00
Colin Finck
5e9cfe8af3 Never use spaces in rbuild files!
Also re-unlock the file again

svn path=/trunk/; revision=28245
2007-08-08 15:22:02 +00:00
Hervé Poussineau
e1fb5a56a5 Replace a call to undocumented function CreateUserProfile by its documented equivalent (LogonUser + LoadUserProfile)
In all cases, this code should be removed once NtUnloadKey is implemented
Add a message to remind when to remove this hack

svn path=/trunk/; revision=28244
2007-08-08 13:44:03 +00:00
Hervé Poussineau
583043c3b0 Be less alarming in a debug message
svn path=/trunk/; revision=28243
2007-08-08 10:46:03 +00:00
Hervé Poussineau
7707da030b Add SCESTATUS_* constants
svn path=/trunk/; revision=28242
2007-08-08 08:58:58 +00:00
Hervé Poussineau
6d37743cf2 Improve LoadUserProfileW, by creating the profile if it doesn't exist
svn path=/trunk/; revision=28241
2007-08-08 08:26:44 +00:00
Hervé Poussineau
32789f3a9e Implement LsaLookupSids
Add a fake implementation to LsaLookupNames to return some information

svn path=/trunk/; revision=28240
2007-08-08 08:24:32 +00:00
James Tabor
982677792e Removed NtGdiGetRelAbs. Use GetDCDWord in gdi32. Update ntgdibad.h.
svn path=/trunk/; revision=28239
2007-08-08 02:20:43 +00:00
Timo Kreuzer
2fdc0258c0 remove NtGdiGetClipRgn from win32k
svn path=/trunk/; revision=28238
2007-08-08 02:03:25 +00:00
James Tabor
d89aa3a672 Add two more Dc_Attr Dirty flags.
svn path=/trunk/; revision=28237
2007-08-08 01:28:36 +00:00
Timo Kreuzer
a10bbf4d75 GetClipRgn: use NtGdiGetRandomRgn
svn path=/trunk/; revision=28236
2007-08-08 01:03:54 +00:00
James Tabor
3976fc7361 Removed AbortProc from WIN_DC_INFO. AbortProc is handled in gdi32 and stored in the Dc_Attr->pvLDC (LDC) structure. LDC structure is used for printing and EMF functions. WIN_DC_INFO is still useful and might stick around for a while.
svn path=/trunk/; revision=28235
2007-08-08 01:02:32 +00:00
James Tabor
2ccda083f9 Moved CurrentPos to Dc_Attr.ptlCurrent. Plugged in NtGdiGet-AndSetDCDword with out any internal support code. Still sorting out internal calls to old NtGdi functions. Ntgdibad.h will be updated on each removed external call of these functions are gone from w32ksvc.db.
svn path=/trunk/; revision=28234
2007-08-08 00:46:11 +00:00
Timo Kreuzer
18f3bc28a0 make NtGdiGetRandomRgn behave more like on XP, 33/34 tests now passing in w32knapi test
svn path=/trunk/; revision=28233
2007-08-08 00:28:08 +00:00
Timo Kreuzer
8f82a2f3ed - restructure syscall code, add edi to RosSyscall clobber list
- more NtGdiGetRandomRgn tests
- more TEST -> RTEST

svn path=/trunk/; revision=28232
2007-08-07 23:13:25 +00:00
Timo Kreuzer
ac4a0d249c fix build part 2
svn path=/trunk/; revision=28231
2007-08-07 23:06:51 +00:00
Ziliang Guo
e21a6e279a Fix build part 1, add precomp.h into bootvid.rbuild
svn path=/trunk/; revision=28230
2007-08-07 23:04:19 +00:00
James Tabor
d64282be7c Don't write to user space after an error. We do write if TRUE.
svn path=/trunk/; revision=28229
2007-08-07 22:19:32 +00:00
Christoph von Wittich
61583dabbe add support for Visual Studio 2008 (Orcas)
svn path=/trunk/; revision=28228
2007-08-07 21:19:22 +00:00
Aleksey Bragin
b5c613692e - WDK support for bootvid and kdcom.
svn path=/trunk/; revision=28227
2007-08-07 20:58:55 +00:00
Christoph von Wittich
d076ba3951 revert more.c to r25042
svn path=/trunk/; revision=28226
2007-08-07 20:52:55 +00:00
Aleksey Bragin
47bb187225 - Force using ReactOS's ntverp.h instead of the WDK.
- Don't include ntverp.h twice.

svn path=/trunk/; revision=28225
2007-08-07 20:51:50 +00:00
Aleksey Bragin
4224d31e22 - Make CSQ compatible with MSVC/WDK.
svn path=/trunk/; revision=28224
2007-08-07 20:49:09 +00:00
Aleksey Bragin
0e450718cd - Rename exception.c to except.c to avoid conflict with another exception.c in rtl project.
- Fix WDK compatibility.

svn path=/trunk/; revision=28223
2007-08-07 20:46:24 +00:00
Aleksey Bragin
ed479b0bf9 - Fix build (remove RtlUnwind redeclarations).
svn path=/trunk/; revision=28222
2007-08-07 20:20:15 +00:00
Aleksey Bragin
735dbb12c6 - Add RtlUnwind to headers, and make list.h MSVC-compatible.
- Rename framebased.asm to framebased.S and write in GAS compatible assembly, instead of using nasmw.
- Fix WDK compatibility.

svn path=/trunk/; revision=28221
2007-08-07 20:11:21 +00:00
Christoph von Wittich
b95ab0c9d7 fix release build
svn path=/trunk/; revision=28220
2007-08-07 20:04:46 +00:00
James Tabor
b82f6444f6 Don't write to user space with after an error.
svn path=/trunk/; revision=28219
2007-08-07 19:29:48 +00:00
Hervé Poussineau
434e1ef9df Support absolute paths for intermediate/output directories
Never put real intermediate/output directory names in generated makefile, use $(INTERMEDIATE) and $(OUTPUT) instead

svn path=/trunk/; revision=28218
2007-08-07 15:08:09 +00:00
Hervé Poussineau
ebb26326a5 Remove some debug messages
scsiport.c: Do not try to open Device subkey if we don't have a service key
cmhardwr.c: Write BIOS information only if we succeeded to open the key

svn path=/trunk/; revision=28217
2007-08-07 11:45:30 +00:00
Aleksey Bragin
9f62e7d5b8 - Remove empty init.S
svn path=/trunk/; revision=28216
2007-08-07 10:24:06 +00:00
The Wine Synchronizer
704b69f83f Autosyncing with Wine HEAD
svn path=/trunk/; revision=28215
2007-08-07 07:27:43 +00:00
James Tabor
eadf106405 Move Break Extra and Count justification to Dc_Attr.
svn path=/trunk/; revision=28214
2007-08-07 07:27:12 +00:00
Hervé Poussineau
8039a51a3d Add mlang.dll to bootcd
svn path=/trunk/; revision=28213
2007-08-07 06:54:21 +00:00
The Wine Synchronizer
2deacc72e3 Autosyncing with Wine HEAD
svn path=/trunk/; revision=28212
2007-08-07 06:52:34 +00:00
Hervé Poussineau
c86fc22726 Prepare import of mlang library. This revision does not compile.
svn path=/trunk/; revision=28211
2007-08-07 06:48:01 +00:00
James Tabor
914d831991 Removed NtGdiGetDCOrgEx, GetViewportExt/OrgEx, GetWindowExt/OrgEx. Added NtGdiGetDCPoint.
Will update ntgdibad.h once we sort out the internal use of these functions.

svn path=/trunk/; revision=28209
2007-08-07 05:58:29 +00:00
Timo Kreuzer
e54ae7b31f update ntgdibad.h
svn path=/trunk/; revision=28208
2007-08-07 01:28:02 +00:00
Timo Kreuzer
234451155e call IntGdiExtSelectClipRgn from inside win32k instead of NtGdiSelectClipRgn
remove NtGdiSelectClipRgn from win32k

svn path=/trunk/; revision=28207
2007-08-07 01:27:17 +00:00
Timo Kreuzer
4237ee71bd SelectClipRgn: call NtGdiExtSelectClipRgn with RGN_COPY
svn path=/trunk/; revision=28206
2007-08-07 00:56:12 +00:00
Magnus Olsen
e7b5eb420f Remove init.s and put Thomas's code into boot.s, so we don't have 2 files for the same purpose.
Write the few lines of C code that were part of the "final" code into boot.S as 
well, to avoid yet another trampoline jump. and
Thanks again to Thomas for finding and fixing the bug.

svn path=/trunk/; revision=28205
2007-08-06 23:55:35 +00:00
Timo Kreuzer
67759e297b fix build
svn path=/trunk/; revision=28204
2007-08-06 23:47:36 +00:00
Magnus Olsen
eac8e57854 Update win32k syscall table layout to win32xp sp2
this is not finish update, we are missing allot stub in 
win32k. before this layout are finish we need thuse stub in place. 

svn path=/trunk/; revision=28203
2007-08-06 19:57:58 +00:00
Daniel Reimer
f3c126accd Decrease cards.dll size by 700 kB by cuttung down all files to 8-Bit Colors.
svn path=/trunk/; revision=28202
2007-08-06 19:43:14 +00:00
Daniel Reimer
efbd79dea9 - Forgot two wrong sizes.
- Reverted to 24 bit Color. ROS's whole Cards.dll uses it, so I keep the colors here too.
- Freecard is now a monochrome Bitmap. This results in a Semi Transparent Card (= Dark Green) instead of a grey square. Try in XP Solitaire. Looks way better and its the way MS does it too.

svn path=/trunk/; revision=28201
2007-08-06 19:33:16 +00:00
Colin Finck
541deeba86 Expand environment strings in the szWallpaper variable. (patch by Marc Piulachs, marc DOT piulachs AT codexchange DOT net)
This is the same way how Windows XP does it (allowing environment variables in the "Wallpaper" registry value, but not as an argument for SystemParametersInfo, SPI_SETDESKWALLPAPER)

See issue #2536 for more details.

svn path=/trunk/; revision=28200
2007-08-06 19:07:34 +00:00
Hervé Poussineau
0838232088 Add more uuids in uuid lib
svn path=/trunk/; revision=28199
2007-08-06 16:17:55 +00:00
Hervé Poussineau
f6cd5eefb6 Generate as much headers as possible from idl
svn path=/trunk/; revision=28198
2007-08-06 16:16:57 +00:00
Hervé Poussineau
c5a567cffc Add some prototypes
svn path=/trunk/; revision=28197
2007-08-06 16:05:08 +00:00
Daniel Reimer
ea3c1cdddb - Resize wrong sized Backgrounds.
- Add the one from Bug 2535 (thx to Rhy Thornton (rhy <AT> leperkhanz <DOT> com) for it.) and replace the ugly Bird in Background 9. Right now only a resized one, but it still looks nice.

svn path=/trunk/; revision=28196
2007-08-06 15:23:11 +00:00
Colin Finck
270493f197 Starfield Screensaver by Marc Piulachs (marc DOT piulachs AT codexchange DOT net)
I committed the latest attachment (the C version) from bug #2510
See issue #2510 for more details.

svn path=/trunk/; revision=28195
2007-08-06 14:56:17 +00:00
Hervé Poussineau
c88c4b4ad1 Set setup type to 0 before the end of 2nd stage in syssetup instead of winlogon
svn path=/trunk/; revision=28194
2007-08-06 14:41:05 +00:00
Magnus Olsen
e753659117 fix a smaller issue with win32ksys, when u did delete win32k.s or type make win32ksys_clean
this file was not being rebuild or remove.  

svn path=/trunk/; revision=28193
2007-08-06 13:20:31 +00:00
Daniel Reimer
064b0ec043 Reduce from 24 Bit Colors to 8 Bit. No real difference in Quality, but waaay smaller. 3 MB reduced size.
svn path=/trunk/; revision=28192
2007-08-06 13:12:01 +00:00
Hervé Poussineau
8642e3d307 Enable shutdown privilege before trying to reboot
svn path=/trunk/; revision=28191
2007-08-06 11:57:15 +00:00
Hervé Poussineau
ca34acb3d6 Remove ARCH define in config.template.rbuild.
It is a duplicate of the ROS_ARCH environment variable.

svn path=/trunk/; revision=28189
2007-08-06 09:25:03 +00:00
Hervé Poussineau
9d77e4fff4 Add -D option to add variables in generated file
svn path=/trunk/; revision=28188
2007-08-06 09:19:25 +00:00
James Tabor
5a8a0a1af7 Moved Brush Origin to Dc_attr.
svn path=/trunk/; revision=28186
2007-08-06 08:28:54 +00:00
James Tabor
3137bd861c Fix typo.
svn path=/trunk/; revision=28185
2007-08-06 06:28:39 +00:00
James Tabor
2619101eee Move Window and Viewport Ext and Org to Dc_Attr. Tested it with qemu.
svn path=/trunk/; revision=28184
2007-08-06 05:13:47 +00:00
James Tabor
556e9b7da8 Moved most of the old Win struct to Dc_Attr structure. Tested it with qemu.
svn path=/trunk/; revision=28183
2007-08-06 02:48:09 +00:00
Timo Kreuzer
174418b0d1 - convert a bunch of tests to regression tests as they succeed on ros
- add tests for NtGdiGetRandomRgn

svn path=/trunk/; revision=28182
2007-08-05 23:05:02 +00:00
James Tabor
619203c31c Start of the dcattr migration.
svn path=/trunk/; revision=28181
2007-08-05 22:02:12 +00:00
Daniel Reimer
ecfdde12b9 My Present for ya all. A new cards.dll with bigger, photorealistic Bavarian Style Cards. I theory Number 2-5 are NON existant. But to be fully compatible I sat down and made them by myself. Its fully compatible to Windows Solitaire, not ROS Solitaire, which does not like the bigger cards. This needs a fix. Btw if someone finds out how to modify the edges on the cards to be transparent, plz tell me. They need to be waay more round.
svn path=/trunk/; revision=28180
2007-08-05 20:38:19 +00:00
Eric Kohl
c55a8d231d Add the status bar.
svn path=/trunk/; revision=28179
2007-08-05 18:56:39 +00:00
Sylvain Petreolle
ec345d7f85 fix build
svn path=/trunk/; revision=28178
2007-08-05 14:58:58 +00:00
Aleksey Bragin
56c73282c2 - More MSVC fixes
svn path=/trunk/; revision=28174
2007-08-05 11:27:39 +00:00
Eric Kohl
f3af35532e Implement toggle keys option.
svn path=/trunk/; revision=28173
2007-08-05 09:48:34 +00:00
James Tabor
dfd772ea97 Started CreateMetaFile, port from wine. Made changes to the structures. Added new support routines.
svn path=/trunk/; revision=28172
2007-08-05 09:21:00 +00:00
Aleksey Bragin
e8847e55ed - Comment out those lines again (sorry), to prevent having lots of uninstallable revisions built by buildbot. Please re-commit when the real bug is fixed.
svn path=/trunk/; revision=28171
2007-08-05 08:27:41 +00:00
Timo Kreuzer
f00375696c delete gdi32 test from win32 folder, as it is all in apitests folder now
svn path=/trunk/; revision=28170
2007-08-05 03:38:42 +00:00
Timo Kreuzer
58c6a293bc - make apitest.c into a static lib to be used by different tests
- add a gdi32 api test, based on the one in the win32 folder
- add a user32 api test
- change type of test functions to int
- implement a quick 'n dirty html api status output
- uncomment NtGdiTransormPoints in w32kdll.def
- add ASSERT1 macro (ASSERT is already used)
- include some more headers

svn path=/trunk/; revision=28169
2007-08-05 03:32:24 +00:00
James Tabor
342efc07e7 Removed non Enh Metafile stubs from win32k:
- Updated ntgdibad.h.
- List of known functions:
  NtGidConvertMetafileRect
  NtGdiCreateMetafileDC
  NtGdiCreateServerMetaFile
  NtGdiGetServerMetaFileBits
  NtGdiSetMetaRgn
- No updates for Enh Metafile.


svn path=/trunk/; revision=28166
2007-08-04 22:02:39 +00:00
James Tabor
0fc46e2a68 Copy Metafile.c to EnhMFile.c. Separating the code.
svn path=/trunk/; revision=28165
2007-08-04 21:02:55 +00:00
Daniel Reimer
a7c1fcdf5b revert some accidently commited changes in my tree.
svn path=/trunk/; revision=28164
2007-08-04 20:51:54 +00:00
Daniel Reimer
3dd7170968 Add 8 new Backgrounds to cards.dll. thx to Mario Kacmar (kario@szm.sk) (Bug 2416)
svn path=/trunk/; revision=28162
2007-08-04 20:13:19 +00:00
Timo Kreuzer
5f857c9cba small bugfix
svn path=/trunk/; revision=28161
2007-08-04 16:51:10 +00:00
Timo Kreuzer
2669c54fcc - implement quick 'n dirty HTML api status output
- change test function return type to INT
- add ASSERT macro
- include some more headers

svn path=/trunk/; revision=28160
2007-08-04 16:45:12 +00:00
Eric Kohl
cbba52ddde Add remaining sticky keys options.
svn path=/trunk/; revision=28159
2007-08-04 16:41:30 +00:00
Christoph von Wittich
c1152ad29c Fix scanning affinity in IoConnectInterrupt (patch by w3seek)
svn path=/trunk/; revision=28158
2007-08-04 15:52:17 +00:00
Sylvain Petreolle
21876ed8a8 C uses / as dir separator, not \
svn path=/trunk/; revision=28157
2007-08-04 13:22:48 +00:00
Ged Murphy
8db125b5c8 revert the unicode build for now as it causes a problem with our gcc build
svn path=/trunk/; revision=28156
2007-08-04 11:19:51 +00:00
Aleksey Bragin
1e9162f086 - Fix kernel32 compile.
svn path=/trunk/; revision=28155
2007-08-04 10:59:01 +00:00
Eric Kohl
2f2abb39d0 - Ask the user when he closes the window only if the game is still running.
svn path=/trunk/; revision=28154
2007-08-04 10:22:44 +00:00
Aleksey Bragin
415aa5eb49 - Fix NtSetInformationThread(ThreadBasePriority)
- Fix buffer overflow in KeRosDumpStackFrames
- Fix usage of garbage/uninitialized handle entry local variable in ObpCreateHandle
- Fix buffer overflow and logic bug in IoConnectInterrupt
- Fix MSVC warnings

svn path=/trunk/; revision=28153
2007-08-04 08:49:47 +00:00
Aleksey Bragin
ce187084c2 - Appropriate changes to kmtest
svn path=/trunk/; revision=28152
2007-08-04 08:47:52 +00:00
Aleksey Bragin
ac4295e788 - WDK and MSVC compatibility fixes.
svn path=/trunk/; revision=28151
2007-08-04 08:26:58 +00:00
James Tabor
bccb44324c Dc.c :
- Update Get/SetDCBrush/PenColor code.
  * Added dcattr sync flags to Set functions.
  * if'ed out, does compile.
Painting.c :
- Update LP to DP to LP code.
  * Added update flags for Xforms, the best way I understand them.
  * if'ed out.
- Moved Fixme line down and above GetDCObject.

svn path=/trunk/; revision=28150
2007-08-04 07:37:27 +00:00
Timo Kreuzer
9c457ea930 fix some names
svn path=/trunk/; revision=28149
2007-08-03 22:31:55 +00:00
Colin Finck
0ebf3b75fd - Define one LANGUAGE, SUBLANG pair per resource file and not per resource.
This makes it easier for translators and also fixes a mix-up of languages.
- Move the brazilian translations from pt-PT.rc to a new pt-BR.rc file.
- Remove the "#ifdef LANG_WALON" statement from wa-WA.rc and disable this resource file in rsrc.rc instead like it's done for eo-EO.rc.
  These are WINE-specific LANG defines. We also have them in include/reactos/wine/winnt.h, but this file is not included. It has to be decided later how to handle these languages.

See issue #2523 for more details.

svn path=/trunk/; revision=28148
2007-08-03 21:36:53 +00:00
Eric Kohl
a83c2f3d54 Enable "Deck" menu item.
svn path=/trunk/; revision=28146
2007-08-03 18:04:34 +00:00
Ged Murphy
423e234726 build sol as unicode
svn path=/trunk/; revision=28145
2007-08-03 18:01:04 +00:00
Ged Murphy
e4a100a916 don't rename the executable for make install. This should keep w3seek happy for a while :)
svn path=/trunk/; revision=28144
2007-08-03 17:48:24 +00:00
Ged Murphy
85145f3477 don't link to a non existent lib
svn path=/trunk/; revision=28143
2007-08-03 17:34:55 +00:00
Ged Murphy
38acb524ac don't ask everytime the user wants to close the window
svn path=/trunk/; revision=28142
2007-08-03 17:25:22 +00:00
Hervé Poussineau
d68373d641 Fix non mingw backend invocations
svn path=/trunk/; revision=28139
2007-08-03 16:09:09 +00:00
Hervé Poussineau
95029fea84 Create resource output directory before calling bin2res
svn path=/trunk/; revision=28138
2007-08-03 15:33:45 +00:00
Thomas Bluemel
4595bee66c Patch by Frode Lillerud <frode@enkelt.no>
- Basic implementation of logoff.exe
See issue #2509 for more details.

svn path=/trunk/; revision=28137
2007-08-03 15:14:49 +00:00
Colin Finck
e0997c086c Updated ukrainian translations by Artem Reznikov (temarez AT yandex DOT ru)
See issue #2524 for more details.

svn path=/trunk/; revision=28136
2007-08-03 15:12:08 +00:00
Hervé Poussineau
d5527355ec syssetup.inf really belongs to output directory, not intermediate one
svn path=/trunk/; revision=28135
2007-08-03 14:33:43 +00:00
Hervé Poussineau
623ca2cf0a Extract resources to intermediate directory
svn path=/trunk/; revision=28134
2007-08-03 13:51:19 +00:00
Hervé Poussineau
28a8baa325 Add -O option, to define where are stored extracted resources
svn path=/trunk/; revision=28133
2007-08-03 13:47:51 +00:00
Daniel Reimer
df1611977b Translate new stuff in German RC File.
svn path=/trunk/; revision=28132
2007-08-03 12:57:12 +00:00
Ged Murphy
ebe6b85b1b add language resources
svn path=/trunk/; revision=28131
2007-08-03 12:54:41 +00:00
Ged Murphy
7de49332f6 add a few more card back bitmaps
svn path=/trunk/; revision=28130
2007-08-03 12:50:49 +00:00
Ged Murphy
4c9ad2ec8a - add a dialog to allow users to change the card backs
- highlights a few drawing bugs in ros

svn path=/trunk/; revision=28129
2007-08-03 12:47:40 +00:00
Hervé Poussineau
85d3e8b1d1 Add missing include directory
svn path=/trunk/; revision=28128
2007-08-03 12:12:41 +00:00
Colin Finck
eb840bfc08 Check if the same Monitor ID (= 10 bytes from the EDID, which can be used to uniquely identify a monitor) appears two times and stop the enumeration in this case.
This is needed for some older monitors (1994-1999), which transmit the EDID data according to the VBE/DDC Standard 1.0.
We assumed that the function for reading the EDID fails, when we input higher controller unit numbers, but some older monitors don't care about the controller unit number and always return valid EDID data.
More information is available at: http://www.vesa.org/public/VBE/VBEDDC11.PDF

See issue #2239 for more details.

svn path=/trunk/; revision=28127
2007-08-03 12:10:43 +00:00
Hervé Poussineau
df770c6d06 Move some more autogenerated files to intermediate directory
Remove POSTAUTO hack in Makefile

svn path=/trunk/; revision=28126
2007-08-03 11:54:33 +00:00
Hervé Poussineau
1a47ede2ff Add ROS_ARCH environment variable
Set -r option of rbuild as mandatory

svn path=/trunk/; revision=28124
2007-08-03 11:35:01 +00:00
Thomas Bluemel
e94c193f12 Revert r28121 as it removes an optimization
svn path=/trunk/; revision=28122
2007-08-03 10:23:19 +00:00
Thomas Bluemel
ff44e1ea45 Improve calculation of new buffer size
svn path=/trunk/; revision=28121
2007-08-03 10:21:59 +00:00
Thomas Bluemel
401e48338f Fix buffer overflow
See issue #2516 for more details.

svn path=/trunk/; revision=28120
2007-08-03 10:12:25 +00:00
Hervé Poussineau
f74d31a796 Create directory before rbuild tries to access it
svn path=/trunk/; revision=28119
2007-08-03 10:12:03 +00:00
Hervé Poussineau
10cc6c5d40 Autogenerate syssetup.inf file in intermediate directory
svn path=/trunk/; revision=28118
2007-08-03 09:41:42 +00:00
Hervé Poussineau
cfda12103c Create the invisible SAS window even in setup mode
Explicitly reboot at the end of 2nd stage
See issue #2431 for more details.

svn path=/trunk/; revision=28116
2007-08-03 09:28:01 +00:00
Thomas Bluemel
eedac786ea Remove GetClassLong hack for GCL_MENUNAME, this is no longer needed
svn path=/trunk/; revision=28115
2007-08-03 08:19:47 +00:00
Thomas Bluemel
a866dc9db1 Patch by Carlo Bramix <carlo.bramix@libero.it>
- Get rid of some code duplication
See issue #2517 for more details.

svn path=/trunk/; revision=28114
2007-08-03 07:35:39 +00:00
Ged Murphy
c5997cd18b activate the properties option in the menu, also make it bold
See issue #2522 for more details.

svn path=/trunk/; revision=28113
2007-08-02 23:31:32 +00:00
Timo Kreuzer
867e2eb7f4 0x124a is NtUserValidateTimerCallback, thanks jimtabor for finding this out.
svn path=/trunk/; revision=28112
2007-08-02 23:29:43 +00:00
Timo Kreuzer
e97388eec3 small bugfix: don't zero terminate the szCSDVersion sting beyond the buffer.
svn path=/trunk/; revision=28111
2007-08-02 22:23:27 +00:00
Timo Kreuzer
9e4807d6e5 NtGdiGetSetBitmapBits:
- use SEH and probe the user mode buffers
- SetLastWin32Error on invalid handle
- move the copying to IntGetSetBitmapBits
- only use IntGetSetBitmapBits from inside win32k
- move NtGdiGetBitmapBits to bitmap.c
- allow copying a number of bytes not matching one entire line, like on windows
I think that was all changes.

svn path=/trunk/; revision=28110
2007-08-02 22:14:32 +00:00
James Tabor
20f9953389 Add NtGdiTransformPoints stub.
svn path=/trunk/; revision=28109
2007-08-02 22:02:23 +00:00
Timo Kreuzer
041123983d remove NtGdiArc, NtGdiArcTo and NtGdiChord from ntgdibad.h
svn path=/trunk/; revision=28107
2007-08-02 21:50:05 +00:00
Timo Kreuzer
603ac00e50 an API test kit + win32k native API test app.
It does syscalls on ros by linking to w32kdll.dll
On windows it uses syscall tables (only winxp sp2 available atm)

svn path=/trunk/; revision=28106
2007-08-02 21:42:37 +00:00
Hervé Poussineau
24de999ac2 Support "root" attribute in <directory> elements
svn path=/trunk/; revision=28102
2007-08-02 14:14:19 +00:00
Thomas Bluemel
d645b9c6d7 Add keyboard layouts again that were removed in r27723
svn path=/trunk/; revision=28099
2007-08-02 10:26:52 +00:00
Thomas Bluemel
5165b3275e Remove cmd_test for now...
svn path=/trunk/; revision=28097
2007-08-02 07:39:55 +00:00
Thomas Bluemel
4f2a8ebce4 Fix compiling rostests
svn path=/trunk/; revision=28096
2007-08-02 06:59:36 +00:00
Thomas Bluemel
e83fc637ea Include stddef.h for ptrdiff_t
svn path=/trunk/; revision=28095
2007-08-02 04:19:52 +00:00
Thomas Bluemel
5a7f727906 Fix buffer overflow in InfpAddSection.
See issue #2516 for more details.

svn path=/trunk/; revision=28094
2007-08-02 04:09:19 +00:00
Christoph von Wittich
4932311395 fix a crash
svn path=/trunk/; revision=28093
2007-08-02 03:08:17 +00:00
Christoph von Wittich
e470bad721 fix null pointer check
svn path=/trunk/; revision=28092
2007-08-02 01:45:02 +00:00
Timo Kreuzer
48428871b5 remove NtGdiArc, NtGdiArcTo and NtGdiChord from win32k, they are not used any longer.
svn path=/trunk/; revision=28091
2007-08-02 01:44:59 +00:00
Christoph von Wittich
2e7009f963 fix another memory leak
svn path=/trunk/; revision=28090
2007-08-02 01:13:28 +00:00
Timo Kreuzer
2ab8c8635c update ntgdibad.h
svn path=/trunk/; revision=28089
2007-08-02 00:25:02 +00:00
Timo Kreuzer
a0c19eb6f9 rename NtGdiSetDCState to IntGdiSetDCState
svn path=/trunk/; revision=28088
2007-08-02 00:23:48 +00:00
Timo Kreuzer
9574b5dbe1 rename NtGdiSetHookFlags into IntGdiSetHookFlags
svn path=/trunk/; revision=28087
2007-08-02 00:16:31 +00:00
Timo Kreuzer
bedc89bb5f rename NtGdiGetDCState to IntGdiGetDCState
svn path=/trunk/; revision=28086
2007-08-02 00:10:15 +00:00
Christoph von Wittich
1ef29d0d83 fix a memory leak
svn path=/trunk/; revision=28085
2007-08-01 22:50:58 +00:00
Christoph von Wittich
953da5af6e fix a memory leak
svn path=/trunk/; revision=28084
2007-08-01 22:41:35 +00:00
Christoph von Wittich
5440600381 don't double free hFile
See issue #2499 for more details.

svn path=/trunk/; revision=28083
2007-08-01 22:04:04 +00:00
Thomas Bluemel
8d60466f8a Special handling for some fake dos devices
svn path=/trunk/; revision=28081
2007-08-01 19:50:28 +00:00
James Tabor
29241f09f4 Move meta code from painting to arc. Including the new Pie function with ifed out.
svn path=/trunk/; revision=28079
2007-08-01 19:26:55 +00:00
Thomas Bluemel
e6e690ba9a Don't output "file not found" messages in recursive searches
svn path=/trunk/; revision=28078
2007-08-01 18:55:47 +00:00
Thomas Bluemel
604b0f6c03 Fix displaying the free space on the volume
svn path=/trunk/; revision=28077
2007-08-01 18:36:23 +00:00
Thomas Bluemel
790a3ef810 Improve output of directory summaries
svn path=/trunk/; revision=28076
2007-08-01 18:18:26 +00:00
Thomas Bluemel
e098f7d858 - Correctly detect volume changes when querying in multiple directories
- "dir directory" displays the contents of a directory

svn path=/trunk/; revision=28075
2007-08-01 17:48:08 +00:00
Thomas Bluemel
1f6dec06f4 Simplify and fix code by using GetFullPathName and GetVolumePathName instead of re-inventing the wheel once again.
See issue #2041 for more details.

svn path=/trunk/; revision=28074
2007-08-01 16:20:16 +00:00
Thomas Bluemel
e42a8d41ff Fix a memory leak in the dir command
svn path=/trunk/; revision=28073
2007-08-01 14:32:57 +00:00
Thomas Bluemel
c16f477a80 Fix buffer overflow bug in mkdir command
See issue #2499 for more details.

svn path=/trunk/; revision=28072
2007-08-01 13:34:48 +00:00
Thomas Bluemel
f5b38b5d3b Remove debug statements I accidently committed
svn path=/trunk/; revision=28071
2007-08-01 13:27:16 +00:00
Thomas Bluemel
c8479ce1cb - Detect memory leaks when cmd exits
- Use _tmain

svn path=/trunk/; revision=28070
2007-08-01 12:34:49 +00:00
Timo Kreuzer
9787ba0ce3 implement Arc, ArcTo, Chord, calling NtGdiArcInternal
svn path=/trunk/; revision=28069
2007-08-01 12:34:38 +00:00
Thomas Bluemel
683519ff1c Compile memory heap corruption detection code with _DEBUG_MEM and define it by default (for now)
svn path=/trunk/; revision=28068
2007-08-01 12:04:49 +00:00
Thomas Bluemel
8026c569b2 Improve debug message
svn path=/trunk/; revision=28067
2007-08-01 10:41:22 +00:00
Thomas Bluemel
fc6d0b3bc7 Allocate correct amount of memory.
See issue #2499 for more details.

svn path=/trunk/; revision=28066
2007-08-01 10:39:49 +00:00
Thomas Bluemel
df91a99233 - Add code to detect buffer overflows and buffer underflows on memory operations. This code is only enabled if _DEBUG is defined.
- Change all calls to malloc, realloc and free to cmd_alloc, cmd_realloc and cmd_free

svn path=/trunk/; revision=28065
2007-08-01 10:17:13 +00:00
Ged Murphy
9da2ad12a6 - update cards.dll to use GPL cards which don't resemble the Windows counterparts
- cards taken from http://sourceforge.net/projects/macsolitairex

svn path=/trunk/; revision=28064
2007-08-01 09:30:28 +00:00
Timo Kreuzer
478d0d4bc5 Implement ExtEscape, MaskBlt, PlgBlt, wich were linked to the Nt functions before. But those have a different parameter count. Fixes compilation.
svn path=/trunk/; revision=28063
2007-08-01 02:07:15 +00:00
Timo Kreuzer
369bfa51f2 NtGdiMaskBlt has 13 params not 12
NtGdiPlgBlt has 11 params not 10
NtGdiSetPixelFormat has 2 params not 3

svn path=/trunk/; revision=28062
2007-08-01 02:05:24 +00:00
Timo Kreuzer
e80f3b112e fix parameter count for NtGdiExtEscape in w32ksvc.db (8 parameters not 6)
svn path=/trunk/; revision=28061
2007-08-01 00:57:17 +00:00
Timo Kreuzer
4ef86834f9 fix nci tool to only generate one stub file for our win32ksys lib to silence the warning. Fix some comments.
svn path=/trunk/; revision=28060
2007-07-31 23:00:31 +00:00
Ged Murphy
2412a1aeb1 convert timedate.cpl to unicode
svn path=/trunk/; revision=28059
2007-07-31 22:17:07 +00:00
Magnus Olsen
71705afb69 revers guiconsole.c changes that was mistake committed in r28057
svn path=/trunk/; revision=28058
2007-07-31 21:41:15 +00:00
Magnus Olsen
d848c8c8f4 adding win32ksys the syscall lib for win32k
waring 
type make clean, 
delete makefile.auto
make clean does not delete the gdi32/misc/i386 delete that folder and need delete it u self
make clean does not delete the user32/misc/i386 delete that folder and need delete it u self



svn path=/trunk/; revision=28057
2007-07-31 21:38:52 +00:00
Ged Murphy
1fb9e7536b - don't write more bytes to the reg key than is required. fixes bug 2402
- use unicode explicitly
See issue #2402 for more details.

svn path=/trunk/; revision=28056
2007-07-31 21:17:57 +00:00
Magnus Olsen
59bf5f271d user32 cleanup lite
redirect the InvalidateRect@12 to NtUserInvalidateRect@12 in the def file

nci tools changes (done of timo and me)
frist part moving the w32ksvc.db and sysfuncs.lst where they belong


svn path=/trunk/; revision=28055
2007-07-31 20:22:13 +00:00
James Tabor
6428c40f66 Add NtGdiCreate-DeleteClientObj to win32k. This is used for Metafile not EnhMeta.
svn path=/trunk/; revision=28054
2007-07-31 07:06:06 +00:00
James Tabor
9d0415f7a7 Remove NtGdiGdiGet-SetBatchLimit.
svn path=/trunk/; revision=28053
2007-07-31 04:41:24 +00:00
Christoph von Wittich
fd37f2607a don't allow renaming of root keys
See issue #2508 for more details.

svn path=/trunk/; revision=28052
2007-07-30 23:27:52 +00:00
Christoph von Wittich
b430b691ac add a NULL pointer check
See issue #2508 for more details.

svn path=/trunk/; revision=28050
2007-07-30 21:04:38 +00:00
Christoph von Wittich
cb9cf60a0d Norwegian translation for msgina and mmc path by Frode Lillerud (frode at enkelt dot no)
See issue #2507 for more details.

svn path=/trunk/; revision=28049
2007-07-30 18:28:55 +00:00
Colin Finck
a98c23a440 Revert w3seek's changes from r27978, mkhive segfaults with them on 64-bit systems
svn path=/trunk/; revision=28047
2007-07-30 16:02:00 +00:00
Thomas Bluemel
ac648888c7 Only return valid values from WM_NOTIFYFORMAT with NF_QUERY in DefWindowProc
svn path=/trunk/; revision=28046
2007-07-30 15:16:15 +00:00
Timo Kreuzer
a2171e8ec6 - implement NtUserHideCaret, make NtUserShowCaret prototype match XP ones.
- update w32ksvc.db
- update ntuser.h
- remove implementations of ShowCaret and HideCaret from user32, redirectexports to nt functions
- add macros for ShowCaret / HideCaret to user32p.h to resolve user32 internal references

svn path=/trunk/; revision=28045
2007-07-30 15:08:14 +00:00
Hervé Poussineau
7855dd896f Remove ExportDriver concept.
If you want a driver which exports some functions, simply set it as kernelmodedriver and add a .def file

svn path=/trunk/; revision=28043
2007-07-30 13:18:35 +00:00
Daniel Reimer
1c474e61da Make output of "vol" command (more) compatible with windows (Bug 2255) from Coviti (coviti {at} gmail {dot} com)
svn path=/trunk/; revision=28042
2007-07-30 13:16:42 +00:00
Ged Murphy
41ba310733 remove the 'enterprise' text, I don't think we're worthy of it just yet.
svn path=/trunk/; revision=28040
2007-07-30 10:17:20 +00:00
Colin Finck
a2b61f49fb Add a Logon screensaver similar to the one of Windows developed by Marc Piulachs (marc DOT piulachs AT codexchange DOT net)
I modified the code, so the screensaver is listed as "Logon ScreenSaver" instead of "Default ScreenSaver"

I also added the other screensavers we have to the Boot-CD.
Some of them highlight some bugs in ReactOS, when you try to use them.
See issue #2505 for more details.

svn path=/trunk/; revision=28038
2007-07-30 09:36:32 +00:00
Christoph von Wittich
a629f387b9 fix broken condition in CallWindowProc
svn path=/trunk/; revision=28037
2007-07-30 08:44:52 +00:00
Timo Kreuzer
c5eb377a58 use NtUserInvalidateRect and NtUserInvalidateRgn in user32. Should be redirected directly in.def file, but it breaks a lot of references, so currently only calling it.
svn path=/trunk/; revision=28036
2007-07-30 04:03:00 +00:00
Timo Kreuzer
3b7f8774ac add NtUserInvalidateRect and NtUserInvalidateRgn to w32ksvc.db
svn path=/trunk/; revision=28035
2007-07-30 03:42:40 +00:00
Timo Kreuzer
54d13b61db add NtUserInvalidateRect and NtUserInvalidateRgn
svn path=/trunk/; revision=28034
2007-07-30 03:41:48 +00:00
Timo Kreuzer
52b31af55d implement NtUserInvalidateRect and NtUserInvalidateRgn
svn path=/trunk/; revision=28033
2007-07-30 03:30:55 +00:00
Timo Kreuzer
59d3012d08 simplify VIS_ComputeVisibleRegion
svn path=/trunk/; revision=28032
2007-07-30 02:49:11 +00:00
Timo Kreuzer
b8c09110a6 fix a DPRINT
svn path=/trunk/; revision=28031
2007-07-30 02:29:52 +00:00
Timo Kreuzer
133adbc1a6 update ntgdibad.h
svn path=/trunk/; revision=28030
2007-07-30 02:24:48 +00:00
Timo Kreuzer
ce40832234 rename NtGdiSelectVisRgn to IntGdiSelectVisRgn
svn path=/trunk/; revision=28029
2007-07-30 02:24:08 +00:00
Timo Kreuzer
0aa1be9e3f probe and copy hdc from usermode PAINTSTRUCT using SEH
svn path=/trunk/; revision=28028
2007-07-30 01:39:26 +00:00
Timo Kreuzer
7f423ecbdb remove useless NtGdiOffsetRgn
svn path=/trunk/; revision=28027
2007-07-30 01:26:57 +00:00
Timo Kreuzer
984be48dd5 - rename NtGdiGetTextMetrics to NtGdigetTextMetricsW and add cj parameter
- GetTextMetricsAW: call NtGdigetTextMetricW with cj set to sizeof(TMW_INTERNAL), use TextMetric member
- update w32ksvc.db
- update ntgdibad.h

svn path=/trunk/; revision=28026
2007-07-30 01:10:35 +00:00
Eric Kohl
380e7f70eb - Add sticky keys settings and make the existing settings work.
- Add empty filter keys dialog and toggle keys dialog.

svn path=/trunk/; revision=28024
2007-07-29 21:07:41 +00:00
Colin Finck
ddfbe083e9 Various cmd fixes by Carlo Bramini (carlo DOT bramix AT libero DOT it)
See issue #2232 for more details.

svn path=/trunk/; revision=28022
2007-07-29 19:53:17 +00:00
Christoph von Wittich
8fd67d96e0 Fix bug in IsValidLocale(), GetNumberFormatW(), GetCurrencyFormatW()
patch by Zavyalov Alexey (reactos at ilimschool dot ru)
See issue #2374 for more details.

svn path=/trunk/; revision=28020
2007-07-29 19:04:03 +00:00
Christoph von Wittich
e137a5326a Implement IsValidLanguageGroup, EnumDateFormatsExA, EnumDateFormatsExW
patch by Zavyalov Alexey (reactos at ilimschool dot ru)
See issue #2368 for more details.

svn path=/trunk/; revision=28019
2007-07-29 18:42:18 +00:00
Magnus Olsen
f1fce2a5f3 remove the title name hack some did
comment why popup menu does not working in cmd, it seam we never getting the process name, why ??

svn path=/trunk/; revision=28018
2007-07-29 18:39:32 +00:00
Christoph von Wittich
98ddfb0831 Load correct screensaver's name patch by piulachs (marc dot piulachs at codexchange dot net)
See issue #2500 for more details.

svn path=/trunk/; revision=28016
2007-07-29 18:09:42 +00:00
Christoph von Wittich
6ae0b2c8a0 remove ZeroMemory - not needed anymore since GetLogicalDriveStrings is fixed
svn path=/trunk/; revision=28015
2007-07-29 18:03:41 +00:00
Christoph von Wittich
d631ee5509 fix GetLogicalDriveStringsA/W
svn path=/trunk/; revision=28014
2007-07-29 18:02:31 +00:00
Christoph von Wittich
dff1e93f29 Norwegian translation for regedit patch by Frode Lillerud (frode at enkelt dot no)
See issue #2502 for more details.

svn path=/trunk/; revision=28013
2007-07-29 17:36:08 +00:00
Christoph von Wittich
7875f9d609 fix bug introduced in r27994
svn path=/trunk/; revision=28012
2007-07-29 17:30:21 +00:00
Magnus Olsen
e36095538d NtGdiGetCurrentObject
1. add OBJ_EXTPEN, it is same as OBJ_PEN, now some smaller graphice glitch are fixed. 

svn path=/trunk/; revision=28011
2007-07-29 16:54:00 +00:00
Magnus Olsen
336c8d7905 partly implement animations GET/SET spi, the value are store, but win32k ignore them
svn path=/trunk/; revision=28010
2007-07-29 15:55:09 +00:00
Magnus Olsen
06b622635a NtGdiGetCurrentObject
activate palette, so it sending back a palette objects
NtGdiCreateHalftonePalette
fix support for halftone palette for other color deep that is higher 8bits
This letting us passing some more winetest

svn path=/trunk/; revision=28006
2007-07-29 14:24:10 +00:00
Colin Finck
a8a2168214 These ones were missing in r27997, sorry...
svn path=/trunk/; revision=28005
2007-07-29 14:02:15 +00:00
Christoph von Wittich
e020821f2c GetTimeFormat should use LocalTime instead of SystemTime
See issue #1601 for more details.

svn path=/trunk/; revision=28004
2007-07-29 13:51:54 +00:00
Magnus Olsen
719e7db47a partly implement NtGdiGetRandomRgn, we do not support metadc, so we will fail on thuse wine test for this api.
The implemetions are base partly on wine and msdn 

svn path=/trunk/; revision=28001
2007-07-29 13:12:20 +00:00
Colin Finck
ee4bffbbb4 Bulgarian translations by Станев (sstpr AT narod DOT ru)
I slightly modified the patch to reflect recent changes
See issue #2412 for more details.

svn path=/trunk/; revision=27997
2007-07-29 13:01:45 +00:00
Christoph von Wittich
d44f78fb8a Fix warnings patch by Heis Spiter (heis_spiter at hotmail dot com)
See issue #2138 for more details.

svn path=/trunk/; revision=27996
2007-07-29 12:08:15 +00:00
Colin Finck
76144d8e7a Fix fontview build
See issue #2477 for more details.

svn path=/trunk/; revision=27995
2007-07-29 10:56:23 +00:00
Christoph von Wittich
b9f016c611 fix bug "Regedit will let you create two identical keys."
See issue #2496 for more details.

svn path=/trunk/; revision=27994
2007-07-29 10:33:17 +00:00
Magnus Olsen
d675ad4eb0 fixing swedish rc syntax fault
svn path=/trunk/; revision=27993
2007-07-29 10:12:04 +00:00
Christoph von Wittich
7cace070fb greek translations by Apal (grad0621 at di dot uoa dot gr)
See issue #2483 for more details.

svn path=/trunk/; revision=27992
2007-07-29 09:53:59 +00:00
Magnus Olsen
2a953aba59 fixing the langues show right,
no more wrong langues show ;)

svn path=/trunk/; revision=27991
2007-07-29 09:06:41 +00:00
Magnus Olsen
eeb75032d2 fixing the langues show right,
no more wrong langues show ;)

svn path=/trunk/; revision=27990
2007-07-29 09:05:42 +00:00
Magnus Olsen
5e57b86e57 fixing the langues show right,
no more wrong langues show ;)

svn path=/trunk/; revision=27989
2007-07-29 09:04:53 +00:00
Magnus Olsen
142e5c4d8b fixing the langues show right,
no more wrong langues show ;)

svn path=/trunk/; revision=27988
2007-07-29 09:03:29 +00:00
Magnus Olsen
805f0170b6 fixing the langues show right,
no more wrong langues show ;)

svn path=/trunk/; revision=27987
2007-07-29 09:02:29 +00:00
Magnus Olsen
f6b835f2e9 fixing the langues show right,
no more germany in english ;)

svn path=/trunk/; revision=27986
2007-07-29 08:58:24 +00:00
Thomas Bluemel
8ea64f258b Handle error case more correctly
svn path=/trunk/; revision=27985
2007-07-29 08:16:50 +00:00
Thomas Bluemel
690351d90a Simplify code by using dialog functions
svn path=/trunk/; revision=27984
2007-07-29 08:14:38 +00:00
Thomas Bluemel
e7faae18fc Fix buffer overflow on unicode builds introduced in r27982
svn path=/trunk/; revision=27983
2007-07-29 07:59:17 +00:00
Christoph von Wittich
5cd0ce3185 fix a crash and the selchange notification code
svn path=/trunk/; revision=27982
2007-07-29 00:27:08 +00:00
Christoph von Wittich
105b544d6c fix crash on linux systems when an invalid backend is specified
svn path=/trunk/; revision=27981
2007-07-28 23:38:59 +00:00
Christoph von Wittich
ff42fce079 -replace the ListView in swappage dialog with a ListBox
-fix some minor issues

svn path=/trunk/; revision=27980
2007-07-28 22:34:42 +00:00
Thomas Bluemel
d6bbe9b6e8 Fix repaint issue in the last row of the control
svn path=/trunk/; revision=27979
2007-07-28 21:59:05 +00:00
Thomas Bluemel
0172ae8384 Make sure LONG/ULONG is correctly defined for both cmlib and mkhive
svn path=/trunk/; revision=27978
2007-07-28 21:33:23 +00:00
Thomas Bluemel
ff56fe5fb3 Some more function prototype fixes and pointer type warning fixes
svn path=/trunk/; revision=27977
2007-07-28 21:30:16 +00:00
Christoph von Wittich
40c483fa1a fix compilation of usetup
svn path=/trunk/; revision=27976
2007-07-28 20:32:16 +00:00
Christoph von Wittich
c50397f0e4 fix no confirmation before format
See issue #2498 for more details.

svn path=/trunk/; revision=27975
2007-07-28 20:12:31 +00:00
Thomas Bluemel
979d2a51d4 Don't redefine HRESULT if already defined
svn path=/trunk/; revision=27974
2007-07-28 20:09:00 +00:00
Eric Kohl
2f450a8880 Check the menu items in the view submenu according to the selected type of view.
svn path=/trunk/; revision=27973
2007-07-28 20:03:06 +00:00
Thomas Bluemel
3b5160fc40 More function prototype fixes
svn path=/trunk/; revision=27972
2007-07-28 20:02:37 +00:00
Ziliang Guo
483007c6f5 update the bootdata readme
svn path=/trunk/; revision=27971
2007-07-28 20:00:20 +00:00
Thomas Bluemel
1c2063ec0f Fix the DisplayApplet function definition
svn path=/trunk/; revision=27970
2007-07-28 19:56:15 +00:00
Johannes Anderwald
bc9fefefbf - fix internet time update button for the languages which had it wrong
- add missing internet update time dialog to spanish resource file - needs to be translated

svn path=/trunk/; revision=27969
2007-07-28 19:48:00 +00:00
Christoph von Wittich
518d4a6885 display path in statusbar again when a menu is closed (doesn't seem to work properly on ReactOS yet)
See issue #2495 for more details.

svn path=/trunk/; revision=27968
2007-07-28 19:43:22 +00:00
Thomas Bluemel
025c8a964b Fix some prototypes
svn path=/trunk/; revision=27967
2007-07-28 19:20:30 +00:00
Thomas Bluemel
2c89355466 Fix some functions to match their prototypes
svn path=/trunk/; revision=27966
2007-07-28 19:15:10 +00:00
Johannes Anderwald
3fc2770451 - added slovak translation by Mario Kacmar
See issue #2486 for more details.

svn path=/trunk/; revision=27965
2007-07-28 19:11:09 +00:00
Thomas Bluemel
25ff32dbf6 Fix incompatible pointer type warning
svn path=/trunk/; revision=27964
2007-07-28 18:51:49 +00:00
Thomas Bluemel
87388c9075 Fix function callback prototype
svn path=/trunk/; revision=27963
2007-07-28 18:44:49 +00:00
Thomas Bluemel
f82b9c2321 Fix incompatible pointer type warnings
svn path=/trunk/; revision=27962
2007-07-28 18:42:36 +00:00
Thomas Bluemel
b6b71503a4 Fix incompatible pointer type warnings
svn path=/trunk/; revision=27961
2007-07-28 18:24:09 +00:00
Thomas Bluemel
f3ad83cca1 Make the InfpBuildFileBuffer prototype match it's definition
svn path=/trunk/; revision=27960
2007-07-28 18:09:51 +00:00
Thomas Bluemel
b837ae3d3c Make the prototypes match those defined in the .idl files
svn path=/trunk/; revision=27959
2007-07-28 18:06:51 +00:00
Thomas Bluemel
eb673ff506 Fix definition of DbgPrint to be compatible
svn path=/trunk/; revision=27958
2007-07-28 18:03:17 +00:00
Thomas Bluemel
15036a5b02 Fix incompatible pointer types
svn path=/trunk/; revision=27957
2007-07-28 18:01:30 +00:00
Thomas Bluemel
c9a7f7f8f2 Fix return types
svn path=/trunk/; revision=27956
2007-07-28 17:55:58 +00:00
Johannes Anderwald
c697530b17 - fix cmd not to crash when just typing "start" [enter]
See issue #2294 for more details.

svn path=/trunk/; revision=27955
2007-07-28 17:48:23 +00:00
Thomas Bluemel
0a931f1a75 Remove duplicate definition of SHChangeNotification_Lock
svn path=/trunk/; revision=27954
2007-07-28 17:47:49 +00:00
Thomas Bluemel
653ff24f1a Fix warnings with -O3
svn path=/trunk/; revision=27953
2007-07-28 17:44:39 +00:00
Thomas Bluemel
f00ee22138 Correctly calculate message time. Fixes slow clicks being interpreted as double clicks.
See issue #2238 for more details.

svn path=/trunk/; revision=27952
2007-07-28 17:16:51 +00:00
Johannes Anderwald
832362635d - set USERNAME environment variable
See issue #2487 for more details.

svn path=/trunk/; revision=27951
2007-07-28 16:29:33 +00:00
Thomas Bluemel
8e88ed96e4 Also hand 0 read bytes to XML_Parse to make sure we always signal that we're done reading the document
svn path=/trunk/; revision=27950
2007-07-28 15:47:56 +00:00
Eric Kohl
9952b46b92 - Load and save game settings.
- Disable unused dialog controls and menu items.

svn path=/trunk/; revision=27949
2007-07-28 13:03:13 +00:00
Christoph von Wittich
d585f1041b delete ocidl.h and autogenerate it from the idl
svn path=/trunk/; revision=27948
2007-07-28 12:51:59 +00:00
Thomas Bluemel
bcacb656fe Fix stack corruption
svn path=/trunk/; revision=27947
2007-07-28 12:48:02 +00:00
Thomas Bluemel
85928f924c turn assertion on again, this bug should be fixed now
svn path=/trunk/; revision=27946
2007-07-28 12:22:27 +00:00
Christoph von Wittich
4337ad0e49 add hh.exe to bootcd
svn path=/trunk/; revision=27945
2007-07-28 12:13:31 +00:00
Christoph von Wittich
12aef723e3 Updated Norwegian language file for explorer patch by Frode Lillerud (frode at enkelt dot no)
See issue #2491 for more details.

svn path=/trunk/; revision=27944
2007-07-28 12:03:46 +00:00
Thomas Bluemel
7bf577c9ba The menu names are on the user heaps now
svn path=/trunk/; revision=27943
2007-07-28 11:35:08 +00:00
Christoph von Wittich
03f66e49b1 fixed "invalid window handle" error msg
svn path=/trunk/; revision=27942
2007-07-28 11:11:27 +00:00
Thomas Bluemel
5222d1d7a2 Simplify and fix handling of menus for classes
svn path=/trunk/; revision=27941
2007-07-28 11:05:33 +00:00
Christoph von Wittich
ed85477766 better control placement for syssetup Italian rc file patch by devpao (devotip at tiscali.it)
See issue #2475 for more details.

svn path=/trunk/; revision=27940
2007-07-28 10:29:23 +00:00
Christoph von Wittich
b9fbd58a93 german text did not fit into the static controls
svn path=/trunk/; revision=27939
2007-07-28 10:04:52 +00:00
Christoph von Wittich
c6260888e2 -fix linking when entrypoint is set to "0"
See issue #2489 for more details.

svn path=/trunk/; revision=27938
2007-07-28 09:42:27 +00:00
Thomas Bluemel
d59de2819e Remove incorrect error check
svn path=/trunk/; revision=27937
2007-07-27 20:03:05 +00:00
Thomas Bluemel
ed630922e9 Disable debug output by default
svn path=/trunk/; revision=27936
2007-07-27 19:26:11 +00:00
Thomas Bluemel
2a672fc18c - Search for user32 window classes before searching for system classes
- Register the user32 base address with win32k. Technically this is not really neccessary because user32's base address is fixed

svn path=/trunk/; revision=27935
2007-07-27 19:23:22 +00:00
Hervé Poussineau
fb76bb0053 Add missing LIST_FOR_EACH_ENTRY_REV macro
svn path=/trunk/; revision=27932
2007-07-27 15:07:07 +00:00
Ged Murphy
c6b03c24b9 set the text in the mem and cpu graphs to use the default GUI font. This cleans up the appearance
svn path=/trunk/; revision=27931
2007-07-27 13:47:28 +00:00
Hervé Poussineau
c5cabb165a "entrypoint=0" is now auto-generated
svn path=/trunk/; revision=27930
2007-07-27 13:14:35 +00:00
Christoph von Wittich
3b6565d0fb -fix 2nd stage setup
svn path=/trunk/; revision=27928
2007-07-27 12:54:03 +00:00
The Wine Synchronizer
7cf2fea853 Autosyncing with Wine HEAD
svn path=/trunk/; revision=27927
2007-07-27 11:36:07 +00:00
Hervé Poussineau
660c29094c Fix hhctrl.ocx build
svn path=/trunk/; revision=27926
2007-07-27 11:19:19 +00:00
Ged Murphy
882a314408 fix the comment
svn path=/trunk/; revision=27925
2007-07-27 11:18:03 +00:00
Ged Murphy
59f123b12e revert r27504. translation shouldn't be added to Wine libs
svn path=/trunk/; revision=27924
2007-07-27 11:10:37 +00:00
Hervé Poussineau
5558f59489 Update status
svn path=/trunk/; revision=27923
2007-07-27 10:22:17 +00:00
The Wine Synchronizer
aff6899f29 Autosyncing with Wine HEAD
svn path=/trunk/; revision=27922
2007-07-27 10:20:13 +00:00
The Wine Synchronizer
071c7429f1 Autosyncing with Wine HEAD
svn path=/trunk/; revision=27921
2007-07-27 10:17:42 +00:00
The Wine Synchronizer
f5e0c36863 Autosyncing with Wine HEAD
svn path=/trunk/; revision=27920
2007-07-27 10:12:10 +00:00
The Wine Synchronizer
0c37710c2c Autosyncing with Wine HEAD
svn path=/trunk/; revision=27919
2007-07-27 10:11:12 +00:00
The Wine Synchronizer
f0f9ff6251 Autosyncing with Wine HEAD
svn path=/trunk/; revision=27918
2007-07-27 10:07:14 +00:00
The Wine Synchronizer
9bd259e856 Autosyncing with Wine HEAD
svn path=/trunk/; revision=27917
2007-07-27 10:05:21 +00:00
The Wine Synchronizer
3f23ffe17b Autosyncing with Wine HEAD
svn path=/trunk/; revision=27916
2007-07-27 10:03:59 +00:00
The Wine Synchronizer
914e5f3480 Autosyncing with Wine HEAD
svn path=/trunk/; revision=27915
2007-07-27 10:00:38 +00:00
The Wine Synchronizer
ba29140448 Autosyncing with Wine HEAD
svn path=/trunk/; revision=27914
2007-07-27 09:59:17 +00:00
The Wine Synchronizer
c82cab29ec Autosyncing with Wine HEAD
svn path=/trunk/; revision=27913
2007-07-27 09:52:38 +00:00
The Wine Synchronizer
a0b832df14 Autosyncing with Wine HEAD
svn path=/trunk/; revision=27912
2007-07-27 09:49:52 +00:00
The Wine Synchronizer
e2d4cbc97d Autosyncing with Wine HEAD
svn path=/trunk/; revision=27911
2007-07-27 09:46:28 +00:00
The Wine Synchronizer
2a21dbe77b Autosyncing with Wine HEAD
svn path=/trunk/; revision=27910
2007-07-27 09:45:02 +00:00
The Wine Synchronizer
cb1824c717 Autosyncing with Wine HEAD
svn path=/trunk/; revision=27909
2007-07-27 09:41:02 +00:00
The Wine Synchronizer
374593a187 Autosyncing with Wine HEAD
svn path=/trunk/; revision=27908
2007-07-27 09:38:44 +00:00
The Wine Synchronizer
35e9e5253f Autosyncing with Wine HEAD
svn path=/trunk/; revision=27907
2007-07-27 09:37:47 +00:00
The Wine Synchronizer
0f86de1a3a Autosyncing with Wine HEAD
svn path=/trunk/; revision=27906
2007-07-27 09:34:02 +00:00
Hervé Poussineau
cdcd38e9ae Add missing HH_SAFE_DISPLAY_TOPIC constant
svn path=/trunk/; revision=27905
2007-07-27 09:33:28 +00:00
The Wine Synchronizer
8f774e30a3 Autosyncing with Wine HEAD
svn path=/trunk/; revision=27904
2007-07-27 09:30:09 +00:00
The Wine Synchronizer
2513a18ec3 Autosyncing with Wine HEAD
svn path=/trunk/; revision=27903
2007-07-27 09:28:40 +00:00
Hervé Poussineau
7d642d88fb Update structure
svn path=/trunk/; revision=27902
2007-07-27 09:24:21 +00:00
The Wine Synchronizer
f29227b580 Autosyncing with Wine HEAD
svn path=/trunk/; revision=27901
2007-07-27 09:21:42 +00:00
The Wine Synchronizer
deaaa434f3 Autosyncing with Wine HEAD
svn path=/trunk/; revision=27900
2007-07-27 09:17:03 +00:00
The Wine Synchronizer
d5c96e105e Autosyncing with Wine HEAD
svn path=/trunk/; revision=27899
2007-07-27 09:12:45 +00:00
The Wine Synchronizer
42ff7ff0fa Autosyncing with Wine HEAD
svn path=/trunk/; revision=27898
2007-07-27 09:10:10 +00:00
The Wine Synchronizer
933a0dc886 Autosyncing with Wine HEAD
svn path=/trunk/; revision=27897
2007-07-27 09:03:12 +00:00
Hervé Poussineau
1cda0af518 Merge SetupGetFileCompressionInfo[Ex]A/W, SetupDecompressOrCopyFileA/W, SetupGetSourceFileLocationA/W, SetupGetSourceInfoA/W, SetupGetTargetPathA/W, SetupQueryInfOriginalFileInformationA/W from Wine
Misc fixes by me and Wine team

svn path=/trunk/; revision=27896
2007-07-27 09:02:18 +00:00
Hervé Poussineau
e95c6843c0 Revert r27863, and add the correct fix
svn path=/trunk/; revision=27895
2007-07-27 07:23:34 +00:00
Daniel Reimer
34dac511bc - Commit the modified Norwegian RC Files to the autosynched Wine DLLs, too. My Plan is to edit the diffs myself and let a dev look over my modifications before I commit them then. This speeds up the stuff a bit. We could need a new sync now that 0.3.7 is almost out, but we cant...
svn path=/trunk/; revision=27894
2007-07-27 07:11:35 +00:00
Steven Edwards
95e420e66e - Added the "(at your option) any later version" clause to the NDK license with
permission of the author. 

- Clarify the license requirements by breaking it to its own section and in this
case requiring the NDK to still be released as LGPLv2.1 or GPLv2 even if it is
released with a GPLv3 application.

- Minor spelling error fix


svn path=/trunk/; revision=27893
2007-07-27 03:19:23 +00:00
Timo Kreuzer
7f36f5002f Rename NtGdiGettextFace into NtGdiGetTextFaceW and add bAliasName parameter. Change parameter names in GetTextFaceW. Update ntgdibad.h
svn path=/trunk/; revision=27892
2007-07-26 23:02:47 +00:00
Timo Kreuzer
f08a04538a update ntgdibad.h
svn path=/trunk/; revision=27891
2007-07-26 22:37:20 +00:00
Timo Kreuzer
eb3712b47d - rename NtGdiGetTextExentExPoint to NtGdiGetTextExtentExW and add 8th parameter (currently unhandled)
svn path=/trunk/; revision=27890
2007-07-26 22:37:08 +00:00
Christoph von Wittich
c4aa25f1aa add shell32_ros.diff
svn path=/trunk/; revision=27889
2007-07-26 21:53:05 +00:00
Christoph von Wittich
ea206e8a12 -fix crash in shell32 caused by clamwin installer (patch by w3seek)
svn path=/trunk/; revision=27887
2007-07-26 21:43:22 +00:00
Timo Kreuzer
da22f48dfd - add painting.c to gdi32.def
- implement FloodFill, calling NtGdiExtFloodFill
- implement CreateRectRgnIndirect, calling NtGdiCreateRectRgn
- remove NtGdiCreateRectRgnIndirect, NtGdiFloodFill from win32k
- update ntgdibad.h

svn path=/trunk/; revision=27883
2007-07-26 19:52:51 +00:00
Timo Kreuzer
8a32a579d8 sorry forgot this one
svn path=/trunk/; revision=27872
2007-07-26 18:17:32 +00:00
Timo Kreuzer
f626203e0c update ntgdibad.h
svn path=/trunk/; revision=27866
2007-07-26 17:39:56 +00:00
Timo Kreuzer
fc315e7116 - fix parameter count for NtGdiCreatePen in w32ksvc.db (4 params, not 3)
- implement CreatePen, calling NtGdiCreatePen@16 instead of forwarding to NtGdiCreatePen@12, wich does not exist
- implement CreatePenIndirect, calling NtGdiCreatePen, instead of forwarding to NtGdiCreatePenIndirect
- remove NtGdiCreatePenIndirect from w32ksvc.db and win32k

svn path=/trunk/; revision=27865
2007-07-26 17:38:49 +00:00
Colin Finck
6e95387504 Fix the Winhelp build
I know this is a pretty bad "fix", but as long as we have nothing better and Winhelp builds again, we have to use it ;-)

svn path=/trunk/; revision=27863
2007-07-26 17:07:24 +00:00
Timo Kreuzer
ce4721237b update ntgdibad.h
svn path=/trunk/; revision=27860
2007-07-26 16:41:09 +00:00
Timo Kreuzer
e71ca90a57 remove NtGdiCreateEllipticRegionIndirect from win32k
svn path=/trunk/; revision=27859
2007-07-26 16:40:23 +00:00
Timo Kreuzer
1a455c9c06 remove NtGdiCreateEllipticRegionIndirect from w32ksvc.db
svn path=/trunk/; revision=27858
2007-07-26 16:39:27 +00:00
Timo Kreuzer
75fec6f6f9 implement CreateEllipticRgnIndirect, calling NtGdiCreateEllipticRgn, instead of redirecting to NtGdiCreateEllipticRgnIndirect
svn path=/trunk/; revision=27857
2007-07-26 16:27:47 +00:00
Timo Kreuzer
16306b2ce0 update ntgdibad.h
svn path=/trunk/; revision=27855
2007-07-26 16:02:37 +00:00
Timo Kreuzer
531bc84358 remove NtGdiCreateCompatibleBitmap from win32k
svn path=/trunk/; revision=27854
2007-07-26 16:01:58 +00:00
Timo Kreuzer
6488d2a0a3 remove NtGdiCreateCompatibleBitmap from syscall db
svn path=/trunk/; revision=27853
2007-07-26 16:01:13 +00:00
Timo Kreuzer
e81c617c19 implement CreateDiscardableBitmap, calling NtGdiCreateCompatibleBitmap instead of redirecting to NtGdiCreateDiscardableBitmap
svn path=/trunk/; revision=27852
2007-07-26 15:59:44 +00:00
Timo Kreuzer
ca6fc5cff9 - implement CreateBitmapIndirect, calling NtGdicreateBitmap
- NtGdiCreateBitmap: directly do the job instead of calling IntCreateBitmapIndirect
- remove IntCreateBitmapIndirect
- remove NtGdiCreateBitmapIndirect
- update ntgdibad.h

svn path=/trunk/; revision=27851
2007-07-26 15:20:29 +00:00
Hervé Poussineau
bc4b14c9c4 Don't abuse debug system
svn path=/trunk/; revision=27850
2007-07-26 15:13:36 +00:00
Christoph von Wittich
0cd283447c fix condition in rosglCopyContext patch by Dirus (DannyDaemonic at gmail.com)
See issue #2375 for more details.

svn path=/trunk/; revision=27849
2007-07-26 15:12:39 +00:00
Thomas Bluemel
bf93eab031 Removed hacks from findfirst/findnext APIs
See issue #1736 for more details.

svn path=/trunk/; revision=27847
2007-07-26 15:07:07 +00:00
Christoph von Wittich
4473df2e66 get sysdm to work with freeldr.ini as well
See issue #2302 for more details.

svn path=/trunk/; revision=27846
2007-07-26 14:56:01 +00:00
Johannes Anderwald
a27339eabc - fix duplicate control id constant by Carlo Bramini (carlo dot bramix at libero dot it)
See issue #2479 for more details.

svn path=/trunk/; revision=27845
2007-07-26 14:54:55 +00:00
Daniel Reimer
be3aec5033 Commited Workaround in userenv, too. ReactOS does not like Greek letters in Folder Names... See Bug 2478. (from Giannis Adamopoulos)
svn path=/trunk/; revision=27844
2007-07-26 14:53:15 +00:00
Johannes Anderwald
a276740842 - update italian translation and a few code simplifications by Carlo Bramini (carlo dot bramix at libero dot it)
- fix a few issues (remove SIZEOF macro + SUBLANG_ITALIAN...)
See issue #2365 for more details.

svn path=/trunk/; revision=27843
2007-07-26 14:48:47 +00:00
Timo Kreuzer
caeec5d190 - TextOutW: call NtGdiExtTextOut
- remove NtGdiTextOut from win32k
todo: NtGdiExtTextOut -> NtGdiExtTextOutW (does someone know what the 9th parameter is?)

svn path=/trunk/; revision=27840
2007-07-26 13:57:17 +00:00
Colin Finck
308132efa0 - Remove the main() procedure as we already have a WinMain() procedure and we need the hInstance value
- Use RegisterClass with WNDCLASS instead of RegisterClassEx with WNDCLASSEX, so we don't need to care about the small icon

svn path=/trunk/; revision=27838
2007-07-26 12:31:56 +00:00
Colin Finck
768fc82ee4 - Make some check boxes wider, so the text is fully displayed (patch by Nathan Davidson, coviti AT gmail DOT com)
- Also do that for the other languages
- Fix the Norwegian and Thai translation, where even control names and boot parameters were translated
  Translators, don't do that, that's highly wrong! (but funny anyway... :-D )
See issue #2343 for more details.

svn path=/trunk/; revision=27837
2007-07-26 12:14:14 +00:00
Colin Finck
8443ad9e13 Updated slovak translation for explorer-new by Mario Kacmar (kario AT szm DOT sk)
svn path=/trunk/; revision=27836
2007-07-26 11:46:10 +00:00
Colin Finck
8647578fc1 Apply a Downloader translation by Paolo Devoti (devotip AT tiscali DOT it) from bug 2027, so this bug can finally be closed now :-)
See issue #2027 for more details.

svn path=/trunk/; revision=27835
2007-07-26 11:42:59 +00:00
Daniel Reimer
174affb36d eol:style = native
svn path=/trunk/; revision=27834
2007-07-26 11:08:19 +00:00
Daniel Reimer
df75cfd9de Apply patches from BugZilla:
- Brazilian Portuguese translation for winmm (Bug 2442) from Marcelo Zamperetti (marcelohz AT gmail DOT com) (2nd bin with both Portugese RCs)
- Updated french translation for syssetup (Bug 2462) from Pierre Schweitzer (heis_spiter AT hotmail DOT com)
- Fixes to italian translation for powercfg applet (Bug 2467) from Carlo Bramini (carlo DOT bramix AT libero DOT it)
- Update for greek translation (Bug 2478) from Giannis Adamopoulos (johnyadams AT hotmail DOT com) except userenv.diff

svn path=/trunk/; revision=27833
2007-07-26 11:03:00 +00:00
Colin Finck
bd3f848ef4 Brazilian Portuguese translation for regedit by Marcelo Zamperetti (marcelohz AT gmail DOT com)
For the record, this seems to be the first program that we now have in both Brazilian Portuguese and Portuguese from Portugal :-)

If someone has time, please look at the regedit code and find out which dialogs are really still needed.
For me it looks like the layout of the resource files was changed some time ago and now we have files with the old and with the new layout.
See issue #2440 for more details.

svn path=/trunk/; revision=27832
2007-07-26 10:40:18 +00:00
Colin Finck
cdc93ad52e Brazilian Portuguese translation by Marcelo Zamperetti (marcelohz AT gmail DOT com)
I changed SUBLANG_PORTUGUESE_BRAZILIAN to SUBLANG_NEUTRAL, so the translation is also used as long as we have no other portuguese translation
See issue #2439 for more details.

svn path=/trunk/; revision=27831
2007-07-26 10:17:37 +00:00
Colin Finck
d031691221 Updated portuguese keyboard layout by João Jerónimo.
See issue #2436 for more details.

svn path=/trunk/; revision=27830
2007-07-26 10:09:30 +00:00
Colin Finck
4096e1a913 Updated polish translation by Artek Wiśniewski (aart3k AT gmail DOT com)
See issue #2433 for more details.

svn path=/trunk/; revision=27829
2007-07-26 10:04:46 +00:00
Colin Finck
23dd40bdad Fix the german "Run" dialog as requested by Christoph
svn path=/trunk/; revision=27828
2007-07-26 09:58:40 +00:00
Colin Finck
ca0081aaf6 Ah, forgot this one :-(
svn path=/trunk/; revision=27827
2007-07-26 09:50:03 +00:00
Colin Finck
53a6e85507 - Fix the mnemonic keys for the english translation and add a slovak translation (patch by Mario Kacmar, kario AT szm DOT sk)
- Fix the mnemonic keys in the other translations myself
- Fix the german configuration dialog
See issue #2472 for more details.

svn path=/trunk/; revision=27826
2007-07-26 09:45:18 +00:00
Colin Finck
34ba650217 Updated norwegian translation my Lars Martin Hambro (lars_martin4 AT hotmail DOT com)
See issue #1741 for more details.

svn path=/trunk/; revision=27825
2007-07-26 09:15:25 +00:00
Colin Finck
5663aa0b6f Ukrainian translations by Artem Reznikov (temarez AT yandex DOT ru)
See issue #2477 for more details.

svn path=/trunk/; revision=27824
2007-07-26 09:09:45 +00:00
Colin Finck
e97732e87c Slovak translation for netid by Mario Kacmar (kario AT szm DOT sk)
svn path=/trunk/; revision=27823
2007-07-26 08:18:08 +00:00
Colin Finck
e7f9003e73 Small fix in the slovak translation
svn path=/trunk/; revision=27822
2007-07-26 08:00:41 +00:00
Colin Finck
025355738a - Remove all the VS stuff from the english resource file and make it readable/editable/translateable
- Remove some redundant resources
- Fix some typos
- Use RegisterClass instead of RegisterClassEx in the MyRegisterClass function: This way we don't need a resource for the small icon, but it works the same
- Add a "rsrc.rc" file

svn path=/trunk/; revision=27821
2007-07-26 07:43:01 +00:00
Timo Kreuzer
c277abc3bb gdiobjects patch:
- stockmask and reuse counter are stored in the lower 16 bits of the typeinfo field in the entry, not in the upper 16 bits!
- take care of this when trying to lock an object (compare upper 16 bits of handle with lower 16 bits of typeinfo field)
- some variable renaming
- remove code duplication by moving debugoutput to an extra function
- move checking for expected object type to a different location, should be removed completely later
Fixes possible crashes if messing around with deleted / reused objects.

svn path=/trunk/; revision=27818
2007-07-25 22:39:14 +00:00
Timo Kreuzer
9a5a65a65b Add some type definitions and macros for gdi object entries. Needed for upcoming gdiobj patch.
svn path=/trunk/; revision=27817
2007-07-25 22:22:38 +00:00
Timo Kreuzer
e4aff98165 UserScrollDC (complete rewrite):
- include the region that could not be copied (invisible before) into invalid region
- use less regions and calculations
- return the type of the invalidated region (used by NtUserScrollWindowEx)
- Remove LPtoDP and DPtoPL. Everything is now in logical coordinates.
NtUserScrollDC:
- use SEH for buffer transfer
NtUserScrollWindowEx:
- use SEH for buffer transfer instead of MmCopyFromCaller
- use SEH to write back to usermode
- return the type of invalid region not of the invalidated region (nothing if SW_INVALIDATE is not set)
- use members of WINDOW_OBJECT instead of calling IntWinListChildren
Use hungarian notation for variables

fixes bug 2237
See issue #2237 for more details.

svn path=/trunk/; revision=27815
2007-07-25 21:51:56 +00:00
Christoph von Wittich
d3703b4fe6 don't stub a function we already have
svn path=/trunk/; revision=27813
2007-07-25 19:19:54 +00:00
Colin Finck
bdf7b50774 Updated language files by Olaf Siejka (caemyr AT gmail DOT com)
See issue #2438 for more details.

svn path=/trunk/; revision=27812
2007-07-25 18:25:16 +00:00
Colin Finck
654cb79562 Add a "magnify" application developed by Marc Piulachs (marc.piulachs AT codexchange DOT net)
Isn't finished and lights up some bugs in ReactOS, but at least it's a start
See issue #2463 for more details.

svn path=/trunk/; revision=27811
2007-07-25 18:00:56 +00:00
Christoph von Wittich
a7b34c7f12 -fix an endless loop when a rbuild file has an invalid date
See issue #2466 for more details.

svn path=/trunk/; revision=27810
2007-07-25 15:11:06 +00:00
Colin Finck
df43dc0653 Lithuanian translations by Vytis Girdzijauskas (cman AT cman DOT us)
See issue #2461 for more details.

svn path=/trunk/; revision=27809
2007-07-25 14:23:41 +00:00
Colin Finck
a2d6945b0a Norwegian translation for newdev.dll by Frode Lillerud (frode AT enkelt DOT no)
See issue #2474 for more details.

svn path=/trunk/; revision=27808
2007-07-25 14:03:09 +00:00
Colin Finck
e189c41b51 Slovak translation by Mario Kacmar (kario AT szm DOT sk)
svn path=/trunk/; revision=27807
2007-07-25 13:55:10 +00:00
Colin Finck
9789d03063 Change the width of one control to 110 as it's done in the other translations
svn path=/trunk/; revision=27806
2007-07-25 12:52:05 +00:00
Colin Finck
46740b8d9f Updated Czech translation by Kamil Hornicek (tykef AT atlas DOT cz)
svn path=/trunk/; revision=27805
2007-07-25 11:06:31 +00:00
James Tabor
7705c7b9d4 Removed Dce from the DC handle table. Tested bootcd, Explorer and Taskmgr.
svn path=/trunk/; revision=27804
2007-07-25 03:35:59 +00:00
Colin Finck
c440e3860d Remove the description for a temporary hack, which was already removed in r26451
svn path=/trunk/; revision=27803
2007-07-24 19:47:57 +00:00
Daniel Reimer
c09ba08b78 Commit final fixes for RC files except for Wine autosynched files. I will not change anything on them right now, no reverts, no further fixes. First I want a official course from our captain.
svn path=/trunk/; revision=27802
2007-07-24 18:40:25 +00:00
Colin Finck
9788276e00 New and updated greek translations by Apostolos Alexiadis (grad0621 AT di DOT uoa DOT gr)
Fixes a part of bug 2464
See issue #2464 for more details.

svn path=/trunk/; revision=27801
2007-07-24 17:12:40 +00:00
Colin Finck
996c22e459 Slovak translations by Mario Kacmar (kario AT szm DOT sk)
See issue #2465 for more details.

svn path=/trunk/; revision=27800
2007-07-24 16:50:52 +00:00
Ged Murphy
6f73fa7812 fix flex generated file
svn path=/trunk/; revision=27799
2007-07-24 15:28:12 +00:00
Daniel Reimer
39d069122f Small fixes in some RC Files
svn path=/trunk/; revision=27798
2007-07-24 10:20:37 +00:00
Colin Finck
025e513c98 Remove the second LANGUAGE setting from each file, we only need it one time in each translation file.
svn path=/trunk/; revision=27797
2007-07-24 09:33:20 +00:00
Aleksey Bragin
61cde810eb - Remove usewrc=false, I'm not sure what is a better option, but at least this fixes the problems with wrong language.
svn path=/trunk/; revision=27796
2007-07-24 09:14:18 +00:00
Aleksey Bragin
e8edd63af3 Magnus: THINK, then THINK, then THINK once more! and only then hit COMMIT button.
Reverting 27783 changes, since it's just a complete mess (setting LANG_NEUTRAL, then including langauge-specific resource files?! wtf?).

svn path=/trunk/; revision=27795
2007-07-24 09:13:14 +00:00
Ged Murphy
4a9419289a add a diff so rpcrt4 can be synched with Wine
svn path=/trunk/; revision=27794
2007-07-24 08:20:12 +00:00
Ged Murphy
b4fe4fe1f5 - new rpcrt4 from Wine-0_9_41 which is a big move from our current implementation, thus I've added it as a separate module for now until we have it working.
- includes an additional file, unix_func.c, which implements 3 unix API's which aren't available in Windows (poll, socketpair, inet_ntop)
- It builds, but it's completely untested.

svn path=/trunk/; revision=27793
2007-07-23 22:26:34 +00:00
Colin Finck
64d9543194 Remove the IDS_CMT_WINEFILE and IDS_CMT_IBROWSER strings in all translations.
Thanks to Apostolos Alexiadis for noticing this.

svn path=/trunk/; revision=27792
2007-07-23 18:38:15 +00:00
Colin Finck
2055852ec9 Greek translations by Apostolos Alexiadis (grad0621 AT di DOT uoa DOT gr)
Fixes a part of bug 2459
See issue #2459 for more details.

svn path=/trunk/; revision=27791
2007-07-23 18:28:55 +00:00
Colin Finck
9a7b3267ce Remove the TABs again, sorry that was a bad idea
At least we have a consistent indentation in the sysdm files now :-)

svn path=/trunk/; revision=27789
2007-07-23 16:32:04 +00:00
Ged Murphy
282435cac7 change the notepad icon for the GPL notepad++ icon until a suitable replacement can be found.
svn path=/trunk/; revision=27788
2007-07-23 15:19:20 +00:00
Colin Finck
5252fd9823 - Get rid of an unneeded variable in GetSystemInformation
- Minor changes to the GetProcNameString function
- Fix unselecting the license text. EM_SETSEL only works after the edit control has been drawn, so we cannot send this message in the WM_INITDIALOG message handler.
  Instead we use PostMessage now. See KB96674 for more details.
- Downloaded the latest GPL 2.0 text from the GNU website and use that as the "gpl.txt" now.
  Now we don't have these annoying "box" characters in the license dialog box anymore.

svn path=/trunk/; revision=27786
2007-07-23 11:48:55 +00:00
Colin Finck
e2cb9802d4 [FORMATTING] Use a consistent indentation (TABs) for all parts of sysdm.cpl
No code changes

svn path=/trunk/; revision=27785
2007-07-23 10:26:55 +00:00
Colin Finck
b17938545b Show a right title for the last setup page (Patch by Cameron Gutman, aicommander AT gmail DOT com)
I also fixed that in the german translation, other translation still need to be fixed.
See issue #2206 for more details.

svn path=/trunk/; revision=27784
2007-07-23 08:05:08 +00:00
Magnus Olsen
df23f0679e fixing intl are on english
here is the issue, either it is gcc bugs being tricked for wrc (I do not think it is this case)
or it is a bug in windres for some rc syntax. I think it is this issue, only way to workaround 
this bug are move en-us.rc to top of the langues list so it comes the frist langues for select



svn path=/trunk/; revision=27783
2007-07-22 21:26:38 +00:00
Johannes Anderwald
c33462b975 - make sysreg working on linux
svn path=/trunk/; revision=27782
2007-07-22 20:41:51 +00:00
Colin Finck
3087c56ea1 - Bugfix: As szBuf was not null-terminated after the _tcscpy, the Processor Name String could have been wrapped wrong (ie. when it contained more spaces after character 30)
- Use a consistent indentation in SetProcNameString

svn path=/trunk/; revision=27781
2007-07-22 19:31:29 +00:00
Aleksey Bragin
108a7ce988 - Patch by Dmitry Chapyshev <lentind@yandex.ru>:
* Add russian translation to shutdown app
 * Fix russian translation and fix text placement in timedate CPL applet

svn path=/trunk/; revision=27780
2007-07-22 17:04:20 +00:00
Colin Finck
e91abfbed8 Updated Slovak User32 translation by Mario Kacmar (kario AT szm DOT sk)
Fixes part of bug 2435
See issue #2435 for more details.

svn path=/trunk/; revision=27779
2007-07-22 16:47:00 +00:00
Colin Finck
2be60ffd29 Updated Slovak Notepad translation by Mario Kacmar (kario AT szm DOT sk)
See issue #2434 for more details.

svn path=/trunk/; revision=27778
2007-07-22 16:37:08 +00:00
Colin Finck
e71afc2d50 Updated Slovak WineMine translation by Mario Kacmar (kario AT szm DOT sk)
See issue #2395 for more details.

svn path=/trunk/; revision=27776
2007-07-22 15:55:45 +00:00
Thomas Bluemel
01934c7aad Merge freetype-2.3.5 to trunk
svn path=/trunk/; revision=27774
2007-07-22 11:39:18 +00:00
Magnus Olsen
0e180d02e0 adding missing guid IID_IShellFolderViewCB
svn path=/trunk/; revision=27769
2007-07-21 23:58:51 +00:00
Magnus Olsen
cf0aabe39c patch from : Paolo Devoti (email devotip at tiscali dot it)
-----------------------------------------------------------
Fixed right hdc being save/restore , the #if 0 change was not accpected. 
the code works fine without it. it was problare cause by another bug.
all wine test for gdi32_winetest dc pass now, without any foualt. 
See issue #2055 for more details.

svn path=/trunk/; revision=27768
2007-07-21 18:41:06 +00:00
Magnus Olsen
e54ea177eb fixed so metafile works bit better, do not crash on alloc memory
but we still does not implement it to 100%, it contain allot of bugs

svn path=/trunk/; revision=27767
2007-07-21 17:28:26 +00:00
Thomas Bluemel
891f537c3e Patch by Frode Lillerud <frode@enkelt.no>
- Updated Norwegian keyboard layout
See issue #2419 for more details.

svn path=/trunk/; revision=27765
2007-07-21 10:51:05 +00:00
Sylvain Petreolle
e3469b4e06 fix 2 mistyped \n
svn path=/trunk/; revision=27764
2007-07-20 23:17:42 +00:00
Timo Kreuzer
d0c7e3cf5e recommit part of previous patch: validate parent on moving windows. Fixes redraw problem when moving the slider of regedit etc.
svn path=/trunk/; revision=27763
2007-07-20 22:59:21 +00:00
Johannes Anderwald
f8e8ed2f81 - added slovak translation by Mario Kacmar
svn path=/trunk/; revision=27762
2007-07-20 20:26:19 +00:00
Colin Finck
b264c8b08a Updated italian translation for ImageSoft by Carlo Bramini (carlo DOT bramix AT libero DOT it)
See issue #2227 for more details.

svn path=/trunk/; revision=27761
2007-07-20 19:51:02 +00:00
Colin Finck
979b7cf89d - Fix the WineMine Icon in the Main window and About window (parts of the patch in bug #2397 by Mario Kacmar (kario AT szm DOT sk) applied)
- Make the dialogs of all languages consistent
See issue #2397 for more details.

svn path=/trunk/; revision=27760
2007-07-20 19:18:35 +00:00
Johannes Anderwald
5b1cf1f67f - make sysreg work again under Windows
svn path=/trunk/; revision=27759
2007-07-20 18:55:03 +00:00
Magnus Olsen
a67d29ae20 reform the code.
less warings and errors in vc

svn path=/trunk/; revision=27758
2007-07-20 16:59:44 +00:00
Magnus Olsen
7fd0ba2791 reform the code.
less warings and errors in vc

svn path=/trunk/; revision=27757
2007-07-20 16:57:59 +00:00
Johannes Anderwald
f57c2b81f4 - move cacls.rc to right directory
svn path=/trunk/; revision=27756
2007-07-20 14:00:23 +00:00
Ged Murphy
371e11e16c add missing API's in order to link an updated rpcrt4
svn path=/trunk/; revision=27755
2007-07-20 13:49:41 +00:00
Johannes Anderwald
8e87d40d23 Updated Norwegian language file for syssetup by Frode Lillerud
See issue #2430 for more details.

svn path=/trunk/; revision=27754
2007-07-20 13:39:44 +00:00
Colin Finck
d1815f4dcf Greek translations for cacls and devmgmt by Apostolos Alexiadis (grad0621 AT di DOT uoa DOT gr)
I couldn't apply all translations from bug 1908 as getfirefox and ibrowser were removed and the Solitaire translation is outdated
See issue #1908 for more details.

svn path=/trunk/; revision=27753
2007-07-20 13:36:46 +00:00
Johannes Anderwald
6df3c18077 - sndvol32 Slovak translation by Mario Kacmar
See issue #2396 for more details.

svn path=/trunk/; revision=27752
2007-07-20 13:26:47 +00:00
Johannes Anderwald
bc0d068040 - winemine Slovak translation by Mario Kacmar
See issue #2395 for more details.

svn path=/trunk/; revision=27751
2007-07-20 13:23:47 +00:00
Johannes Anderwald
f7dd1cc102 - French translation for vmwinst by Pierre Schweitzer (heis_spiter at hotmail com)
See issue #2427 for more details.

svn path=/trunk/; revision=27750
2007-07-20 13:14:46 +00:00
Johannes Anderwald
55bdc8aab4 - Norwegian resource file for shutdown.exe
- Written by Frode Lillerud
- change SUBLANG_NORWEGIAN_BOKMAL to SUBLANG_NEUTRAL
See issue #2426 for more details.

svn path=/trunk/; revision=27749
2007-07-20 13:12:00 +00:00
Colin Finck
32d235b53d Fix cmd build, when compilation units are turned off
svn path=/trunk/; revision=27748
2007-07-20 13:08:25 +00:00
Johannes Anderwald
58d9f1e777 - French translation for shutdown (based on en-US.rc) by Pierre Schweitzer (heis_spiter at hotmail com)
See issue #2425 for more details.

svn path=/trunk/; revision=27747
2007-07-20 13:04:55 +00:00
Johannes Anderwald
97299b0c55 - update norwegian translation by Frode Lillerud
See issue #2424 for more details.

svn path=/trunk/; revision=27746
2007-07-20 12:58:02 +00:00
Johannes Anderwald
899a4c3f8a - ukrainian translation from bug 2420
- the msi translation should be sent to wine cause we only autosync it...

svn path=/trunk/; revision=27745
2007-07-20 12:44:36 +00:00
Hervé Poussineau
97ba754ab3 [FORMATTING] Replace tabs by spaces
No code change

svn path=/trunk/; revision=27744
2007-07-20 10:22:58 +00:00
Colin Finck
7dcf35b862 Remove an unused Buffer variable in the SetupCopyFile function
Thanks to HeisSpiter for noticing this

svn path=/trunk/; revision=27741
2007-07-19 20:53:33 +00:00
Ged Murphy
6148da7aa2 add the start menu logo graphic
svn path=/trunk/; revision=27739
2007-07-19 20:19:41 +00:00
Johannes Anderwald
dd82a17f15 - fix warning
- simplify sysreg configuration options (implementation is coming next)

svn path=/trunk/; revision=27728
2007-07-19 13:43:49 +00:00
Aleksey Bragin
4a6f22cbbf - Remove compilation units support from win32k, because it often leads to problems and untested code. ReactOS kernel is compiled w/o cunits, and so should win32k be done.
- Fix TAB/spaces mess in win32k. Can't you, developers, finally understand that .rbuild uses TAB-only indentation? Is it too hard?

svn path=/trunk/; revision=27727
2007-07-19 12:55:58 +00:00
Aleksey Bragin
3c7b25d58e - Revert vis.c and winpos.c changes from 27672, due to a bug 2409.
- Fix win32k compiling without compilation units.

See issue #2409 for more details.

svn path=/trunk/; revision=27726
2007-07-19 12:43:54 +00:00
Aleksey Bragin
68f474c5af Patch by Dmitry Chapyshev <lentind@yandex.ru>:
- Make downloader icon in multiple color depths.
- Remove a newline character from winver's window title.

svn path=/trunk/; revision=27725
2007-07-19 12:14:08 +00:00
Aleksey Bragin
5d5733ba1f - Comment those 2 keyboard layouts so that trunk is installable. Uncommenting them reveals a bug in Config Manager, which is being investigated.
- DPRINT -> DPRINT1 for a critical error message.

svn path=/trunk/; revision=27724
2007-07-18 21:49:10 +00:00
Colin Finck
d759e74461 Remove the wrong \0 character
svn path=/trunk/; revision=27723
2007-07-18 20:00:26 +00:00
Colin Finck
244d310147 Add the missing "help <command>" functionality in cmd (patch by Pierre Schweitzer, heis_spiter AT hotmail DOT com)
I slightly modified the patch to include a terminating null character
See issue #2406 for more details.

svn path=/trunk/; revision=27722
2007-07-18 19:41:25 +00:00
Colin Finck
13f80b1452 - Localize the Usage message of "shutdown" and add a german localization
- Also add a version resource

Translators, feel free to make translations for this tool :-)

svn path=/trunk/; revision=27721
2007-07-18 18:40:07 +00:00
Colin Finck
fc5c5f5b46 Slovak translation for calc by Mario Kacmar (kario AT szm DOT sk)
See issue #2405 for more details.

svn path=/trunk/; revision=27720
2007-07-18 13:51:37 +00:00
Thomas Bluemel
6f93d6ebe5 Fix crash due to wrong calling convention
svn path=/trunk/; revision=27718
2007-07-18 12:23:29 +00:00
Andrew Munger
f8f289daef [AUDIT] kdbg is a custom ReactOS component, written and improved upon by numerous developers. It's nearly as old as the codebase itself.
svn path=/trunk/; revision=27717
2007-07-18 12:18:41 +00:00
Thomas Bluemel
aaad49980c Make use of Set/QuerySecurityAccessMask
svn path=/trunk/; revision=27715
2007-07-18 10:50:55 +00:00
Thomas Bluemel
974c3eaf16 Implement SetSecurityAccessMask
svn path=/trunk/; revision=27714
2007-07-18 10:50:48 +00:00
Thomas Bluemel
10ceb1dc62 Implement the ANSI stub EncryptFileA
svn path=/trunk/; revision=27713
2007-07-18 10:40:58 +00:00
Thomas Bluemel
1a9fa20283 Implement QuerySecurityAccessMask
svn path=/trunk/; revision=27712
2007-07-18 09:47:05 +00:00
Aleksey Bragin
c79612b989 - Fix an obvious bug in the code (patch by Thomas).
svn path=/trunk/; revision=27711
2007-07-18 07:17:25 +00:00
Thomas Bluemel
f2bbc79cf7 Fix warnings I introduced, forgot typecasts...
svn path=/trunk/; revision=27710
2007-07-17 14:56:02 +00:00
Thomas Bluemel
532d977072 Patch by Frode Lillerud <frode@enkelt.no>
- Norwegian keyboard layout
See issue #2419 for more details.

svn path=/trunk/; revision=27709
2007-07-17 14:28:49 +00:00
Thomas Bluemel
f1948e0bc2 Fix remaining incorrect dialog definitions using DS_SHELLFONT as an extended style.
svn path=/trunk/; revision=27708
2007-07-17 14:18:38 +00:00
Thomas Bluemel
d68854511a Fix the dialog manager to ignore WS_EX_MDICHILD.
See issue #2289 for more details.

svn path=/trunk/; revision=27707
2007-07-17 13:52:36 +00:00
Thomas Bluemel
14e9f977d9 Revert r27705. This change is incorrect and breaks MDI applications.
svn path=/trunk/; revision=27706
2007-07-17 13:51:00 +00:00
Christoph von Wittich
10c5cdc533 -forgot to save the file before committing - this is the actual fix from 27703
svn path=/trunk/; revision=27705
2007-07-16 23:02:29 +00:00
Christoph von Wittich
0a51ea233b -don't set DS_SHELLFONT as EXSTYLE
svn path=/trunk/; revision=27704
2007-07-16 22:57:35 +00:00
Christoph von Wittich
2bc61e5962 -get rid of DS_SHELLFONT when set as EXSTYLE, it is a STYLE flag
See issue #2289 for more details.

svn path=/trunk/; revision=27703
2007-07-16 22:56:04 +00:00
Colin Finck
4f3f3a53bc Readd the removed line from the patch and add more information about the Usage of the "-f" option (see comment #6 of bug #2379)
The "-f" option now works like in Windows: If you did not specify any other parameter, it will also log off from the current session.

svn path=/trunk/; revision=27702
2007-07-16 21:50:50 +00:00
Johannes Anderwald
3467fa05cc - add ukrainian translation by Artem Reznikov
See issue #2411 for more details.

svn path=/trunk/; revision=27700
2007-07-16 19:30:12 +00:00
Ged Murphy
e55869be78 call the correct event on system boot
svn path=/trunk/; revision=27699
2007-07-16 18:43:13 +00:00
Ged Murphy
87bd668b8c fix the startup event name as per r27697
svn path=/trunk/; revision=27698
2007-07-16 17:48:57 +00:00
Ged Murphy
70f3b132fa revert r27695 as it's already implemented in advapi32. My tests failed because it's incorrectly named.
svn path=/trunk/; revision=27697
2007-07-16 17:47:12 +00:00
Ged Murphy
1a14c5a8db don't leak handles
svn path=/trunk/; revision=27696
2007-07-16 17:17:34 +00:00
Ged Murphy
972d9788d0 Wait for the SCM to be fully initialized before calling allowing a call to OpenSCManager
svn path=/trunk/; revision=27695
2007-07-16 16:00:37 +00:00
Hervé Poussineau
e47b3f0dfa Resize the string table when needed
Fix a few warnings

svn path=/trunk/; revision=27694
2007-07-16 15:32:13 +00:00
Ged Murphy
029287899f fix SCM sync event name
svn path=/trunk/; revision=27693
2007-07-16 14:29:49 +00:00
Thomas Bluemel
4aa6574ca2 Implement Heap32First and Heap32Next based on the documentation on http://securityxploded.com/enumheaps.php
svn path=/trunk/; revision=27692
2007-07-16 12:21:38 +00:00
Aleksey Bragin
938646d914 - Don't do ObInsertObject() for a key object, but use CmpCreateHandle() instead.
- Remove some dead code from CmiConnectHive() and move freeing of the create information to a different place.

svn path=/trunk/; revision=27690
2007-07-15 21:35:16 +00:00
Johannes Anderwald
0d051c196e - update slovakian solitaire translation
See issue #2353 for more details.

svn path=/trunk/; revision=27685
2007-07-15 14:32:21 +00:00
Sylvain Petreolle
3f9f01b3b3 unicode compatibility
svn path=/trunk/; revision=27684
2007-07-15 13:53:28 +00:00
Ged Murphy
c0ccb82f23 remove redundant string
svn path=/trunk/; revision=27680
2007-07-15 12:53:03 +00:00
Ged Murphy
2bd18ec234 fix the start menu icon to be the right way up
svn path=/trunk/; revision=27675
2007-07-15 11:57:52 +00:00
Colin Finck
085f7002ae Add a "shutdown" utility written by Frode Lillerud (frode AT enkelt DOT no), which is more compatible with the syntax of the Windows "shutdown" utility
I applied the second patch of bug #2379 and made the following changes to it:

- Removed the LocalFree line
  LocalFree can only be used if the memory is allocated with LocalAlloc. The memory doesn't need to be freed explicitly here.
- Removed the "uncertain if this is needed. Do boolean struct members default to TRUE?" comment
  Independent of the value, this setting is needed here.
- Removed a wrong 'exitOpts.shouldExit = TRUE;' in line 101.
  shouldExit was already set before and resetting it here to TRUE would also lead to TRUE if the user only sets opts.force, but not any of the other shutdown options.
- Use a consistent indentation and coding style
- Modified the Usage text a little bit, so all lines fit into console lines (max. 80 characters)
See issue #2379 for more details.

svn path=/trunk/; revision=27674
2007-07-15 11:15:27 +00:00
Thomas Bluemel
544cdbf9dd Finally get the fake (and broken by design) DOS device check to work
svn path=/trunk/; revision=27673
2007-07-15 08:33:49 +00:00
Timo Kreuzer
5a95124349 - fix IntValidateParent
- validate Parent windows on moving pixels
(both was fine earlier, but has been messed up recently)
- move sending of WM_SIZE and WM_MOVE from co_WinPosShowWindow to co_WinPosSetWindowPos
co_WinPosSetWindowPos:
- instantly erase when drawing windows or exposing region
- Invalidate child windows on BeginPaint
This should fix most window redrawing bugs and also (hopefully) speed up the gui (less redrawing).

svn path=/trunk/; revision=27672
2007-07-15 03:30:03 +00:00
Magnus Olsen
99e20bb44c Copied remotely
CMIDriver to Trunk
on silverblade request

svn path=/trunk/; revision=27671
2007-07-14 23:52:33 +00:00
Thomas Bluemel
0d910647aa Simplify code
svn path=/trunk/; revision=27668
2007-07-14 22:49:47 +00:00
Thomas Bluemel
bd6665924c - Fix caching of directory queries, FindFirstFile(Ex) should no longer return garbage occasionally
- These changes re-introduce the problem with searches for fake DOS devices that I claimed to have fixed in r27634

svn path=/trunk/; revision=27667
2007-07-14 22:29:42 +00:00
Timo Kreuzer
8cd2e2a887 fix German resource
svn path=/trunk/; revision=27666
2007-07-14 21:57:22 +00:00
Magnus Olsen
191ff40f7f wrong spi value in allot SPI_
Rewrote all SPI_ to make sure no one got wrong value
hopply this prevent wax crash in spi. 


svn path=/trunk/; revision=27665
2007-07-14 16:47:48 +00:00
Ged Murphy
7249536db8 Patch by Dmitry Chapyshev <lentind@yandex.ru>:
- Add icon more image formats and clean up existing ones
- Fix some Russian translations

svn path=/trunk/; revision=27664
2007-07-14 16:17:45 +00:00
Sylvain Petreolle
ac6f734427 fix french resource file
svn path=/trunk/; revision=27663
2007-07-14 16:14:11 +00:00
Johannes Anderwald
5c48c77054 - add terminate emulator option :)
svn path=/trunk/; revision=27662
2007-07-14 15:23:56 +00:00
Johannes Anderwald
47dc768408 - remove obsolete pid option
svn path=/trunk/; revision=27661
2007-07-14 15:10:17 +00:00
Magnus Olsen
06fbf99e3f add activate of screensaver when they are being selected.
we do not set or read register value for it yet, so defualt is the screensaver offline until u go into desk.cpl and select a screensaver.

svn path=/trunk/; revision=27660
2007-07-14 14:52:10 +00:00
Magnus Olsen
b2272ba67c adding SPI_SETSCREENSAVEACTIVE now, it can be set to false or true
false for no screen saver and true for screensaver. 

svn path=/trunk/; revision=27657
2007-07-14 14:17:54 +00:00
Magnus Olsen
b63aeeb74d fixing the limit of hover maxium time for SPI_SETMOUSEHOVERTIME
see msdn : http://msdn2.microsoft.com/en-us/library/ms724947.aspx

svn path=/trunk/; revision=27656
2007-07-14 13:56:24 +00:00
Magnus Olsen
4baff3cd38 Patch by David Lenon <DavidL@126.com>:
fixing some spi that was retutring using wrong param in retutin and setting spi
-------------------------------------------------------------------------------
1. I did add formating of the code and two debug msg. so it getting easy debug
waxdragon crashs

svn path=/trunk/; revision=27654
2007-07-14 13:18:25 +00:00
Aleksey Bragin
e5c1383b31 Patch by Dmitry Chapyshev <lentind@yandex.ru>:
- Fix russian translation.

svn path=/trunk/; revision=27651
2007-07-14 12:28:54 +00:00
Aleksey Bragin
0dd033e04d Patch by Dmitry Chapyshev <lentind@yandex.ru>:
- Fix russian translation of calc, charmap, msconfig, mscutils and taskmgr.
- Fix mistakes in russian translation of explorer.
- Move title of servman to translation resources and translate to russian language.

svn path=/trunk/; revision=27650
2007-07-14 12:11:50 +00:00
Thomas Bluemel
008fc0b1ca Patch by David Lenon <DavidL@126.com>:
- Fix overflow check in RtlUpcaseUnicodeStringToCountedOemString
See issue #2403 for more details.

svn path=/trunk/; revision=27649
2007-07-14 10:59:18 +00:00
Johannes Anderwald
1309c3f3eb - fix commandline arguments
svn path=/trunk/; revision=27648
2007-07-14 10:28:58 +00:00
Johannes Anderwald
d07065ab90 - fix command line handlung
- fix configuration and file parser
- remove hack

svn path=/trunk/; revision=27647
2007-07-14 10:24:02 +00:00
Thomas Bluemel
bdd2ecc99e Hide the clock in setupldr
svn path=/trunk/; revision=27646
2007-07-14 10:04:32 +00:00
Johannes Anderwald
f07d18172d - make sysreg compilable under linux
svn path=/trunk/; revision=27645
2007-07-14 10:01:09 +00:00
Thomas Bluemel
3a4932988f Don't strip the trailing backslash if the path is only a drive
svn path=/trunk/; revision=27644
2007-07-14 08:01:01 +00:00
Thomas Bluemel
a0637bc3ac Display junction points
svn path=/trunk/; revision=27643
2007-07-14 07:16:05 +00:00
James Tabor
4aa8a9db0f Fix build.
svn path=/trunk/; revision=27642
2007-07-13 23:20:36 +00:00
Christoph von Wittich
79ae53bf4b -fix some linux build issues
svn path=/trunk/; revision=27641
2007-07-13 23:19:04 +00:00
Thomas Bluemel
111b3553aa Adjust the owner edit field on page resizes
svn path=/trunk/; revision=27640
2007-07-13 22:56:32 +00:00
Johannes Anderwald
0f27116821 - blame svn
svn path=/trunk/; revision=27639
2007-07-13 22:16:15 +00:00
Johannes Anderwald
4592bbb147 - update slovak translation by Kario <kario@szm.sk>
See issue #2353 for more details.

svn path=/trunk/; revision=27638
2007-07-13 22:13:52 +00:00
Johannes Anderwald
7007712b2f - update french translation by Pierre Schweitzer
See issue #2399 for more details.

svn path=/trunk/; revision=27637
2007-07-13 21:51:13 +00:00
Thomas Bluemel
0cfece1c1e Add support for user quotas in GetDiskFreeSpaceExW
svn path=/trunk/; revision=27636
2007-07-13 21:42:44 +00:00
Thomas Bluemel
8acdce6856 Sync GetTempFileNameW to wine HEAD
svn path=/trunk/; revision=27635
2007-07-13 20:23:26 +00:00
Thomas Bluemel
532f7fecc5 Rewrite parts of FindFirstFileEx to:
- Fix searches relative to the current directory using the features RtlDosPathNameToNtPathName_U provides instead of hacking around them
- Enable searches for fake DOS devices. Some installers like NSIS use this feature to determine if a drive exists, this works now.

svn path=/trunk/; revision=27634
2007-07-13 19:43:09 +00:00
Magnus Olsen
5bce20b1be patch from Preston Pigglessworth email : tykef at atlas dot cz
---------------------------------------------------------------
update the translations for CZ
See issue #1958 for more details.

svn path=/trunk/; revision=27630
2007-07-13 13:43:46 +00:00
Daniel Reimer
f7105f9acb Fix Translation.
svn path=/trunk/; revision=27629
2007-07-13 13:43:02 +00:00
Magnus Olsen
ad43654e07 patch from Preston Pigglessworth email : tykef at atlas dot cz
---------------------------------------------------------------
update the translations for CZ
See issue #1958 for more details.

svn path=/trunk/; revision=27628
2007-07-13 13:38:26 +00:00
Magnus Olsen
846d92706e patch from Pierre Schweitzer (aka Heis Spiter) heis_spiter at hotmail dor com
------------------------------------------------------------------------------
1. remove one hard code line.
2. cleanup one rc file


See issue #2400 for more details.

svn path=/trunk/; revision=27627
2007-07-13 11:42:20 +00:00
Thomas Bluemel
062ffc428c Fix unoptimized builds
svn path=/trunk/; revision=27626
2007-07-13 09:53:48 +00:00
Johannes Anderwald
ea4c53340d - fix Buffer overflow in CmpHiveRootSecurityDescriptor
- patch by w3seek
See issue #2401 for more details.

svn path=/trunk/; revision=27625
2007-07-13 09:34:16 +00:00
Christoph von Wittich
456cbf9376 -revert my last change - I confused it with regedt32.exe
svn path=/trunk/; revision=27624
2007-07-12 23:26:19 +00:00
Johannes Anderwald
99ba170554 - add system.ini property page resource definition
svn path=/trunk/; revision=27623
2007-07-12 23:20:28 +00:00
Christoph von Wittich
1a4b3833af -change shortcut targetdir to system32
svn path=/trunk/; revision=27622
2007-07-12 23:16:16 +00:00
Christoph von Wittich
b690c23325 -install regedit in system32
svn path=/trunk/; revision=27621
2007-07-12 23:15:41 +00:00
Magnus Olsen
e8c11f0d71 patch from Yaroslav Ponomarenko yarryp at gmail dot com
-------------------------------------------------------
This is a small hack, instead send invaild data we are sending 
a hardcode value for few unimplement spi, This solv some problem 
with firefox, like icon is not longer gray out, frist time u start 
firefox, it also fix some other werid problem, 




svn path=/trunk/; revision=27620
2007-07-12 22:14:40 +00:00
Ged Murphy
b0309a9b22 add a note as to why I hackfixed it, so I don't forget
svn path=/trunk/; revision=27619
2007-07-12 22:02:47 +00:00
Magnus Olsen
924a230291 patch from w3seek
------------------
Don't mess with the stack in inline assembly because it cannot be
assumed that the compiler magically knows where the local variables are located
after changing the stack pointer manually.


See issue #2364 for more details.

svn path=/trunk/; revision=27618
2007-07-12 19:48:27 +00:00
Colin Finck
2f178e8cb6 Updated Italian translation by Paolo Devoti (devotip AT tiscali DOT it)
See issue #2391 for more details.

svn path=/trunk/; revision=27617
2007-07-12 16:44:15 +00:00
Ged Murphy
447975d4e0 fix shortcut icons
svn path=/trunk/; revision=27616
2007-07-12 15:50:19 +00:00
Aleksey Bragin
277f2718d0 - Firstly mark the IRP as pending, and only then release the lock (otherwise IRP is firstly completed/freed, and then tried to be marked as pending). This makes FireFox 1.5 working again.
- NULLify handle in case of TdiOpenDevice() failure.

svn path=/trunk/; revision=27615
2007-07-12 12:38:25 +00:00
Colin Finck
90ce81d302 Somehow this translation contained duplicate data, removed the duplicates
svn path=/trunk/; revision=27614
2007-07-12 12:28:42 +00:00
Colin Finck
cd5888ebd5 Small changes in the german translation of syssetup.dll
svn path=/trunk/; revision=27613
2007-07-12 11:29:29 +00:00
Thomas Bluemel
e0bf78bad7 Fix the semantics of SetFilePointer as described by Raymond Chen on http://blogs.msdn.com/oldnewthing/archive/2007/07/11/3805135.aspx
svn path=/trunk/; revision=27612
2007-07-12 10:56:00 +00:00
Johannes Anderwald
87d4c1e2b4 - update polish translation
See issue #2388 for more details.

svn path=/trunk/; revision=27611
2007-07-12 10:52:15 +00:00
Johannes Anderwald
8b1fea2111 - update french translation by Pierre Schweitzer
See issue #2390 for more details.

svn path=/trunk/; revision=27610
2007-07-12 10:47:07 +00:00
Christoph von Wittich
6368c774ec -export _strtoull - now dbghelp.dll should load
svn path=/trunk/; revision=27609
2007-07-12 10:05:28 +00:00
Ged Murphy
a6182da3f4 - Allow a greater distance between the underscore and the text for aesthetics
- Patch by David Leon (david at 126 dot com)

svn path=/trunk/; revision=27608
2007-07-12 08:13:18 +00:00
Andrew Munger
9f3137e69e Restore a missing " so I can build again.
svn path=/trunk/; revision=27607
2007-07-12 04:31:25 +00:00
Daniel Reimer
f5b6b4b6d1 Ged, you wanted a translation. ;-)
svn path=/trunk/; revision=27606
2007-07-11 23:40:21 +00:00
Thomas Bluemel
69a12fc06c Add missing structures
svn path=/trunk/; revision=27605
2007-07-11 23:12:54 +00:00
Daniel Reimer
4cfa3cd17e set eol:style native
svn path=/trunk/; revision=27604
2007-07-11 22:42:20 +00:00
Daniel Reimer
44df677a32 Add five new German translations.
svn path=/trunk/; revision=27603
2007-07-11 22:38:24 +00:00
Magnus Olsen
ea5e738541 patch from Yaroslav Ponomarenko yarryp at gmail dot com
1. adding support for  SPI_GETNONCLIENTMETRICS,  SPI_GETICONMETRICS, SPI_SETICONTITLELOGFONT, 
2. adding few unsupport spi and print it out, it mean we do not need do a context switch for them
3. and bugfix other spi as well



svn path=/trunk/; revision=27602
2007-07-11 22:11:58 +00:00
Ged Murphy
31735fc29d - Fix the syssetup resource files
- This fixes the issue of the device manager and service manager not showing in admin tools due to LoadString failing.
- Translators required please

svn path=/trunk/; revision=27601
2007-07-11 22:09:36 +00:00
Colin Finck
e63dd20980 getfirefox has been removed long time ago, so don't create its shortcut anymore
Thanks to HeisSpiter for making me noticing this :-)

svn path=/trunk/; revision=27600
2007-07-11 19:52:10 +00:00
Thomas Bluemel
1c694b55bc Fix checking the file's existence
svn path=/trunk/; revision=27599
2007-07-11 19:43:57 +00:00
Thomas Bluemel
9dfc7b707b Set the executable's directory as working directory, not the link's...
svn path=/trunk/; revision=27598
2007-07-11 19:34:45 +00:00
Colin Finck
d9e6b3b8eb Hm, Tortoise seems to forgot this one as well... :-/
svn path=/trunk/; revision=27597
2007-07-11 19:06:54 +00:00
Colin Finck
90e76cef8e Forgot this one, sorry...
svn path=/trunk/; revision=27596
2007-07-11 19:05:11 +00:00
Thomas Bluemel
14c9f8917d Set a working directory for the start menu items
svn path=/trunk/; revision=27595
2007-07-11 18:49:01 +00:00
Colin Finck
ce4d81a117 - Brazilian Portuguese Translations by Wagner Leandro Bueno Angelo (wagner.snake AT gmail DOT com), fixes bug #2385
- Moved the localization stuff to "rsrc.rc" files in some more components
See issue #2385 for more details.

svn path=/trunk/; revision=27594
2007-07-11 18:35:42 +00:00
Aleksey Bragin
4742301dbe - Fix wrongly-applied translation.
svn path=/trunk/; revision=27591
2007-07-11 16:08:29 +00:00
Colin Finck
349224ee0f Updated XML file by Coviti (coviti AT gmail DOT com)
See issue #2358 for more details.

svn path=/trunk/; revision=27590
2007-07-11 14:34:33 +00:00
Hervé Poussineau
19e99b1930 Add a status window instead of a black screen at the start of the 2nd stage, when installing devices
Now, we should be able to diagnostic if a hang is caused by a bad driver or something else

svn path=/trunk/; revision=27589
2007-07-11 11:51:42 +00:00
Hervé Poussineau
092b297b59 Put common code in livecd and 2nd stage to a shared routine
Simplify creating of optional shortcuts
Create an install log
LiveCD: start userinit.exe instead of directly starting the shell

svn path=/trunk/; revision=27588
2007-07-11 09:55:53 +00:00
Hervé Poussineau
01e4b9b9ac Write source file and line in the setup install log
svn path=/trunk/; revision=27587
2007-07-11 09:04:22 +00:00
Hervé Poussineau
3a9951f710 [FORMATTING]
Fix indentation (mixed tabs and spaces) by always using 4 spaces

svn path=/trunk/; revision=27586
2007-07-11 08:52:55 +00:00
Aleksey Bragin
13c22ddec4 - Russian translation fixes by Dmitry Chapyshev (lentin).
svn path=/trunk/; revision=27578
2007-07-10 20:45:56 +00:00
Timo Kreuzer
783668fa9a UTF8 -> ANSI encoding, so the file will not get messed up again with notepad
svn path=/trunk/; revision=27575
2007-07-10 20:18:58 +00:00
Timo Kreuzer
f34ad18bda - fix messed up file beginning. Do not use ms notepad to edit rc files!
svn path=/trunk/; revision=27574
2007-07-10 19:39:49 +00:00
Johannes Anderwald
0bc8628373 Lithuanian localization support.
Name: CMan
Mail: cman at cman dot us

See issue #2383 for more details.

svn path=/trunk/; revision=27573
2007-07-10 18:46:10 +00:00
Johannes Anderwald
8e5daa28f1 Lithuanian localization support.
Name: CMan
Mail: cman at cman dot us


See issue #2383 for more details.

svn path=/trunk/; revision=27572
2007-07-10 18:45:06 +00:00
Johannes Anderwald
1c17aab025 - forgot one file
svn path=/trunk/; revision=27570
2007-07-10 18:24:17 +00:00
Johannes Anderwald
c0caac9484 - major rewrite of sysreg
- refactor code to abstract os differences more cleaner
- code needs still be tested

svn path=/trunk/; revision=27569
2007-07-10 18:23:07 +00:00
Magnus Olsen
06641a82b7 patch from Yaroslav Ponomarenko yarryp at gmail dot com
NtGdiExtTextOut did try render no existed glyth in the glyth cache 



svn path=/trunk/; revision=27568
2007-07-10 17:44:23 +00:00
Ged Murphy
08344fca94 fix the SetServiceStatus idl definition
svn path=/trunk/; revision=27567
2007-07-10 14:55:14 +00:00
Ged Murphy
e9982e936f fix SetServiceStatus to now call ScmrSetServiceStatus to set the service data
svn path=/trunk/; revision=27566
2007-07-10 14:54:30 +00:00
Ged Murphy
f8ab7f007a implement ScmrSetServiceStatus, this goes some way to being able to manually control services
svn path=/trunk/; revision=27565
2007-07-10 14:49:51 +00:00
Colin Finck
31491cefa9 Update copyrights to 2007
svn path=/trunk/; revision=27564
2007-07-10 14:17:15 +00:00
Hervé Poussineau
9541d1c816 Prevent possible access out of bounds when calculating CPU speed
svn path=/trunk/; revision=27563
2007-07-10 13:30:43 +00:00
Colin Finck
aab51cffca Delete the unneeded and wrong SUBLANG_NEUTRAL line from the dialog definition
See issue #2381 for more details.

svn path=/trunk/; revision=27562
2007-07-10 13:29:27 +00:00
Colin Finck
de3cbdd76e Adding/updating french translations for WordPad and ImageSoft by Heis Spiter (heis_spiter AT hotmail DOT com)
This patch also removes the call to a wrong window in ImageSoft

I slightly modified the patch to match with our new SUBLANG rules.
See issue #2377 for more details.

svn path=/trunk/; revision=27561
2007-07-10 13:17:54 +00:00
Colin Finck
84b861da97 SUBLANG fixes for rosapps
svn path=/trunk/; revision=27558
2007-07-10 12:20:59 +00:00
Colin Finck
cabf9252e6 Change the sublanguage of "nl-NL.rc" to SUBLANG_NEUTRAL again, since LANG_DUTCH has two sublanguages (SUBLANG_DUTCH and SUBLANG_DUTCH_BELGIAN)
This reverts tkreuzer's change in r27541

svn path=/trunk/; revision=27557
2007-07-10 10:16:07 +00:00
Hervé Poussineau
8b12884393 [FORMATTING]
Fix formatting, to have an indentation of 4 spaces
No code change

svn path=/trunk/; revision=27553
2007-07-09 23:22:43 +00:00
Ged Murphy
4216adf631 - Rewrite the service handler and parts of the main control thread. The rest will be rewritten bit by bit.
- tcpsvcs now cleanly starts serves and stops in Windows.

svn path=/trunk/; revision=27552
2007-07-09 23:13:09 +00:00
James Tabor
2c13c59b51 Fix Linux build.
svn path=/trunk/; revision=27551
2007-07-09 20:39:05 +00:00
Daniel Reimer
79bbf63c2b Set eol:style native
svn path=/trunk/; revision=27547
2007-07-09 18:11:53 +00:00
Daniel Reimer
b5277127b7 - Commit Translations from Bug #2350 - Bug #2353 by Kairo (kario@szm.sk)
- Half Commit rc file fix of Bug #2355 (Other half was already fixed today ;-) )

svn path=/trunk/; revision=27546
2007-07-09 17:59:50 +00:00
Hervé Poussineau
b71a99a951 Add reason.h header
See issue #2378 for more details.

svn path=/trunk/; revision=27545
2007-07-09 17:43:38 +00:00
Daniel Reimer
1431bed8bb Add Slovak Translation made by Kario.
See issue #2349 for more details.

svn path=/trunk/; revision=27544
2007-07-09 17:34:26 +00:00
Daniel Reimer
86977cdc8c Set eol:style native. This should be the Final Commit.
svn path=/trunk/; revision=27543
2007-07-09 17:14:36 +00:00
Daniel Reimer
f2136dc264 DOZENS of SUBLANG Fixes.
svn path=/trunk/; revision=27542
2007-07-09 17:03:56 +00:00
Timo Kreuzer
c1a1384688 SUBLANG_NEUTRAL -> SUBLANG_DEFAULT to fix regedit resource compilation
svn path=/trunk/; revision=27541
2007-07-09 16:03:23 +00:00
Colin Finck
2e52161bb0 Part 2 of X of trying to end up with all this SUBLANG mess
Alphabetically, the last RC file I changed was "cdlg_No.rc"

svn path=/trunk/; revision=27540
2007-07-09 15:25:44 +00:00
Colin Finck
f86a818579 Part 1 of X of trying to end up with all this SUBLANG mess
The new rules for the SUBLANGs are here: http://www.reactos.org/wiki/index.php/Sublang

Reverts r27532 as this was a step in the wrong direction
Also corrects some of the wrong SUBLANGs

svn path=/trunk/; revision=27539
2007-07-09 14:45:32 +00:00
Christoph von Wittich
699bd03ad8 -fix a warning (part 2/2)
svn path=/trunk/; revision=27538
2007-07-09 12:59:00 +00:00
Christoph von Wittich
54c9e4033d -fix a warning
svn path=/trunk/; revision=27537
2007-07-09 12:58:38 +00:00
Colin Finck
ca6658fc5a SUBLANG_SPANISH_MODERN is missing in the table on MSDN, but it's needed by our NLS
Readded it

Maybe someone can check if we can replace this with SUBLANG_SPANISH or another spanish variant, since SUBLANG_SPANISH_MODERN seems to be outdated

svn path=/trunk/; revision=27536
2007-07-09 12:21:08 +00:00
Colin Finck
b518786f1b Revert EmuandCo's change in r27533 (should work now with the new defines in winnt.h)
svn path=/trunk/; revision=27535
2007-07-09 11:08:51 +00:00
Colin Finck
7bc3f0f289 Add some more LANG and SUBLANG defines
Source: http://msdn2.microsoft.com/en-us/library/ms776294.aspx

svn path=/trunk/; revision=27534
2007-07-09 11:05:06 +00:00
Daniel Reimer
7cfb369ca4 Fix Build
svn path=/trunk/; revision=27533
2007-07-09 10:44:29 +00:00
Daniel Reimer
a8077b66ae Part 1 of X.
Changing SUBLANGS to SUBLANG_(CoutryName)
If I touched a wine synched one, I'll revert later.

svn path=/trunk/; revision=27532
2007-07-09 10:22:26 +00:00
Magnus Olsen
b660147329 patch from Yaroslav Ponomarenko yarryp at gmail dot com
revert 27521, bugfix the regress in second boot with this patch
-----------------------------------------------------------------
I GreatLord hope it is no more regress, if any one found any werid
with this change, please let me known direcly.



svn path=/trunk/; revision=27531
2007-07-09 05:44:59 +00:00
Christoph von Wittich
2ee6ba87f9 -fix a memory leak
svn path=/trunk/; revision=27530
2007-07-09 02:02:30 +00:00
Christoph von Wittich
972c5d1754 -fix a memory leak
svn path=/trunk/; revision=27529
2007-07-09 01:52:35 +00:00
Hervé Poussineau
e392256c32 Do not complain on IRP_MN_FILTER_RESOURCE_REQUIREMENTS
svn path=/trunk/; revision=27526
2007-07-08 22:19:51 +00:00
Christoph von Wittich
0eb1866364 -add a newline to the end of the file to make gcc happy
svn path=/trunk/; revision=27524
2007-07-08 21:28:37 +00:00
Christoph von Wittich
5fc7647c8a -fix some more warnings
svn path=/trunk/; revision=27523
2007-07-08 21:27:33 +00:00
Hervé Poussineau
1d4ef813b6 Revive acpi.sys driver
svn path=/trunk/; revision=27522
2007-07-08 21:26:42 +00:00
Hervé Poussineau
4a614a2899 Revert half of revision 27465, as it breaks 2nd stage setup ("Failure rendering glyph")
svn path=/trunk/; revision=27521
2007-07-08 21:23:47 +00:00
Eric Kohl
a1c8d56925 Fix a typo.
svn path=/trunk/; revision=27519
2007-07-08 20:39:27 +00:00
Christoph von Wittich
9017e736ff -fix some warnings
svn path=/trunk/; revision=27518
2007-07-08 20:38:35 +00:00
Eric Kohl
65e920d5da InternalOpenDirW: Fix object attribute.
svn path=/trunk/; revision=27517
2007-07-08 20:21:42 +00:00
Daniel Reimer
e32148b1e4 - Set eol:style native
svn path=/trunk/; revision=27516
2007-07-08 20:19:35 +00:00
Hervé Poussineau
e394d5e78d Fix usage of KdComPortInUse
svn path=/trunk/; revision=27515
2007-07-08 20:13:20 +00:00
Eric Kohl
add1532e20 - Fix indentation.
- Replace tabs by spaces.
- Replace STDCALL by WINAPI.
- Replace Alex' unreadable single-line statements by readable ones.
- No code changes.

svn path=/trunk/; revision=27514
2007-07-08 20:09:22 +00:00
Christoph von Wittich
c57c69624e -fix some format strings
svn path=/trunk/; revision=27513
2007-07-08 19:44:11 +00:00
Christoph von Wittich
7b99b108be -fix some more compilation issues
svn path=/trunk/; revision=27511
2007-07-08 19:34:23 +00:00
James Tabor
d08a778fd1 Fix Linux build.
svn path=/trunk/; revision=27510
2007-07-08 19:26:23 +00:00
Daniel Reimer
c7fc846f80 - set all RC Files to eol:style native
- add German RC File to mmc and Matrix Screensaver
- Fix RC Headers in the hope that GreatLord is happy. It builds well in GCC.

svn path=/trunk/; revision=27509
2007-07-08 19:15:50 +00:00
Christoph von Wittich
addc92fc58 -fix some compilation errors
svn path=/trunk/; revision=27507
2007-07-08 18:54:07 +00:00
Daniel Reimer
03fb0c8a35 set eol:style native
svn path=/trunk/; revision=27506
2007-07-08 18:02:55 +00:00
Daniel Reimer
02934dc3c6 Reorganize winhelp the way all other apps are organized too.
svn path=/trunk/; revision=27505
2007-07-08 18:01:14 +00:00
Johannes Anderwald
fe8c39773c - part 2/2 of bulgarian translation update
See issue #2366 for more details.

svn path=/trunk/; revision=27504
2007-07-08 18:00:21 +00:00
Johannes Anderwald
3f0a181d72 - part 1/2 of bulgarian translation update
See issue #2366 for more details.

svn path=/trunk/; revision=27503
2007-07-08 17:58:30 +00:00
Andrew Greenwood
330b16d830 Restructured PORTCLS as requested by Christoph_vW (so PREfast can be
used.) Here is also a very bare-bones implementation of SysAudio 
(actually it just creates \Device\sysaudio and a symlink for now...)


svn path=/trunk/; revision=27494
2007-07-08 17:31:55 +00:00
Aleksey Bragin
8d3e4b4e77 - Fix a couple of places where tagged commands support was not implemented.
- Uncomment buslogic.sys since it now half-works (at least it doesn't hang, and it even recognizes the driver, however an attempt to setup reactos to scsi disk fails).

svn path=/trunk/; revision=27493
2007-07-08 17:14:19 +00:00
Daniel Reimer
34fdc401c5 Set eol:style native (I hope....)
svn path=/trunk/; revision=27492
2007-07-08 17:03:40 +00:00
Johannes Anderwald
402b14fa42 - French translation for fontview (based on en-US.rc) by Pierre Schweitzer (heis_spiter at hotmail com)
See issue #2370 for more details.

svn path=/trunk/; revision=27491
2007-07-08 16:51:03 +00:00
Johannes Anderwald
5fcc4be1d1 - lithuanian translation by Vytis Girdzijauskas (cman at cman dot us)
See issue #2376 for more details.

svn path=/trunk/; revision=27490
2007-07-08 16:43:53 +00:00
Hervé Poussineau
ec9f3068a6 Explicitly use Unicode version
svn path=/trunk/; revision=27489
2007-07-08 16:37:22 +00:00
Magnus Olsen
3f6528063c patch from Yaroslav Ponomarenko yarryp at gmail dot com
fixed last bug for swamp mouse button 


svn path=/trunk/; revision=27488
2007-07-08 16:24:29 +00:00
Andrew Greenwood
224af7cee9 Further tidying up of the multimedia components. Renamed MPU401_KS to
MPU401 and SB16_KS to SB16. Have updated the rbuild files so these 
should still build without issue.


svn path=/trunk/; revision=27487
2007-07-08 16:12:09 +00:00
Magnus Olsen
6c0a11007b use // as comment instead for ;
svn path=/trunk/; revision=27486
2007-07-08 16:09:29 +00:00
Andrew Greenwood
ec310c8989 Renamed legacy mpu401 driver to mpu401_nt4 and disabled the building of
all drivers in this directory (all are incomplete, none of them work and 
are superceded by the Kernel Streaming alternatives.) Leaving drivers in 
source tree for reference at present but they can eventually be removed.


svn path=/trunk/; revision=27485
2007-07-08 16:07:01 +00:00
Magnus Olsen
15355ab9a9 patch from Yaroslav Ponomarenko yarryp at gmail dot com
Implement so spi_ msg works now with swamp mouse buttun, but it seam our msg quare does not support it yet or must 
we send a msg from spi msg we change the mouse buttun to notify the program. either way it is now partly supported 
by his patch

svn path=/trunk/; revision=27484
2007-07-08 15:58:47 +00:00
Andrew Greenwood
3f14a21b6f Kernel-mode COM rough implementation for KS. Forgot to add to SVN on
last commit.


svn path=/trunk/; revision=27483
2007-07-08 15:54:12 +00:00
Magnus Olsen
aec8f7eff1 correct fix for log10.
svn path=/trunk/; revision=27482
2007-07-08 15:33:38 +00:00
Christoph von Wittich
a8ea3c335e -set eol-style:native
-fix line endings

svn path=/trunk/; revision=27477
2007-07-08 14:50:25 +00:00
Christoph von Wittich
5eea562870 -release spinlocks before calling IoCompleteRequest
-fix some format strings

svn path=/trunk/; revision=27476
2007-07-08 14:27:17 +00:00
Andrew Greenwood
ed12e0c8c9 Missed a file on last commit...
svn path=/trunk/; revision=27475
2007-07-08 13:58:51 +00:00
Andrew Greenwood
dff03c9e44 A few modifications necessary to get PortCls and KS to build. PortCls
needs restructuring but that will be done later.


svn path=/trunk/; revision=27474
2007-07-08 13:53:39 +00:00
Christoph von Wittich
9be5d6e114 -avoid dereferencing of NULL pointers
svn path=/trunk/; revision=27473
2007-07-08 13:38:08 +00:00
Christoph von Wittich
7a7bdde4ec -use ExAllocatePoolWithTag instead of ExAllocatePool
-IoMapTransfer should not called without an AdapterObject

svn path=/trunk/; revision=27472
2007-07-08 13:24:53 +00:00
Aleksey Bragin
540155a12a - Delete unneeded fields from DeviceExtension.
- Reformat ScsiPortGetVirtualAddress(), and make it using SrbExtensionBuffer pointer instead of a removed VirtualAddress.

svn path=/trunk/; revision=27471
2007-07-08 12:32:02 +00:00
Aleksey Bragin
ad9fd2687e - Enable DMA support, this time properly.
- Fix ScsiPortGetPhysicalAddress() function to use scatter-gather list, if needed.
- Now BusLogic initializes succesfully, but BSODs later.

svn path=/trunk/; revision=27470
2007-07-08 12:21:18 +00:00
Aleksey Bragin
081ca81b64 Reverting last commit, sorry it makes scsiport hanging.
svn path=/trunk/; revision=27469
2007-07-08 11:47:28 +00:00
Aleksey Bragin
6a56fe39cc - Start adding DMA support (still not finished, so BusLogic fails).
svn path=/trunk/; revision=27468
2007-07-08 11:44:42 +00:00
Magnus Olsen
b35a8f64a1 patch from Daniel Reimer reimer.daniel at freenet dot de
fixed some sublang mess


svn path=/trunk/; revision=27467
2007-07-08 11:33:54 +00:00
Eric Kohl
9699821101 Fix bug in log10 function. Patch by Carlo Bramix.
This fixes bug #2357.

svn path=/trunk/; revision=27466
2007-07-08 11:22:39 +00:00
Magnus Olsen
aba2e5a942 patch from Yaroslav Ponomarenko yarryp at gmail dot com
adding almost all spi msg can be resive/send to win32k and 
some are stub and will not work yet, but win32k will accpect them 

svn path=/trunk/; revision=27465
2007-07-08 11:16:42 +00:00
Daniel Reimer
30764d14ac - Add German RC FIle for intl_new
- Fix Hungarian and Ukrainian RC File. (I hope..)

svn path=/trunk/; revision=27464
2007-07-08 11:06:25 +00:00
Colin Finck
2767e008a0 Fix the "intl_new" build (add an "rsrc.rc" file)
svn path=/trunk/; revision=27463
2007-07-08 10:55:58 +00:00
Magnus Olsen
6c6e093fbd adding rsrc.rc
svn path=/trunk/; revision=27462
2007-07-08 10:41:31 +00:00
Magnus Olsen
f905e2a4fd Fixing some of the wrong sublang problem
svn path=/trunk/; revision=27461
2007-07-08 10:37:00 +00:00
Colin Finck
a0530e5dd5 - Brazilian Portuguese Translations by Snake (wagner.snake AT gmail DOT com)
- Also adds an "rsrc.rc" file to "ntvdm"
See issue #2373 for more details.

svn path=/trunk/; revision=27460
2007-07-08 10:19:12 +00:00
Magnus Olsen
ba38a037b5 fixing right sub id
please check with vs if the rc got right sub id before a commit.
I do not whant file on other langues like fi in english lang and so on

svn path=/trunk/; revision=27459
2007-07-08 01:11:17 +00:00
Magnus Olsen
972b4279de patch from Yaroslav Ponomarenko yarryp at gmail dot com
adding missing #define of a spi_ into winuser.h

svn path=/trunk/; revision=27458
2007-07-08 00:34:43 +00:00
Magnus Olsen
3c5e9fd0c0 move some value to right place into the text FIXME load from register
svn path=/trunk/; revision=27457
2007-07-07 21:09:15 +00:00
Thomas Bluemel
016296a635 When calling ShellExecuteEx for the selected objects in a shell view, set the current directory to the view's directory.
svn path=/trunk/; revision=27456
2007-07-07 19:11:49 +00:00
Magnus Olsen
3207aad442 TrackMouseEvent
remove some hard code value, thuse value are now in win32k, it is either full implement, or partly implement 

TrackMouseEventProc
remove some hard code value, thuse value are now in win32k, it is either full implement, or partly implement 

svn path=/trunk/; revision=27455
2007-07-07 18:23:09 +00:00
Magnus Olsen
52dc4e8d79 patch from Yaroslav Ponomarenko yarryp at gmail dot com
implement pointers 
MouseSpeed, CursorAccelerationInfo.FirstThreshold , 
CursorAccelerationInfo.SecondThreshold, CursorAccelerationInfo.Acceleration, 
MouseHoverTime, MouseHoverWidth, MouseHoverHeight
for SPI_SETMOUSEHOVERTIME, SPI_SETMOUSEHOVERWIDTH, SPI_SETMOUSEHOVERHEIGHT, SPI_SETMOUSE, SPI_SETMOUSESPEED.
WARING : 
Some of them are not 100% support in win32k for they are need be fill in from the mouse drv and 
send them to the mouse drv as well, this part are not done yet.


svn path=/trunk/; revision=27454
2007-07-07 18:17:03 +00:00
Aleksey Bragin
c7b28e24dd - Temporarily remove buslogic.sys from 1st stage too. It'll be reincluded once scsiport.sys is fixed.
svn path=/trunk/; revision=27453
2007-07-07 18:00:11 +00:00
Colin Finck
257520e113 Partly commit the patch from bug #2358
svn path=/trunk/; revision=27452
2007-07-07 14:50:10 +00:00
Ged Murphy
9a6cc3dc06 set the address bar font to the default GUI font
svn path=/trunk/; revision=27450
2007-07-07 10:28:53 +00:00
Christoph von Wittich
32212ecff8 -check for already defined NDEBUG to be able to build the driver with PREfast
svn path=/trunk/; revision=27449
2007-07-07 10:23:09 +00:00
Aleksey Bragin
315b516aea - Disable BusLogic driver until scsiport fully supports it.
- Do NOT keep VMWare Tools CD mounted after 2nd stage, or you'll get vmscsi.sys installed, which is not supported yet either!

svn path=/trunk/; revision=27448
2007-07-07 10:13:04 +00:00
Ged Murphy
de5865bcd6 - fixes / improvements to regedit, see bug 2356 for details
- patch by carlo bramix  (carlo.bramix at libero it)
- it should be noted that import_registry_file needs more work to support unicode files

svn path=/trunk/; revision=27447
2007-07-07 10:09:24 +00:00
Aleksey Bragin
f9fbc836c8 - Separate common buffer allocation routine from ScsiPortGetUncachedExtension() into SpiAllocateCommonBuffer(), along with a code reformat.
- Use this function in ScsiPortInitialize() and in ScsiPortGetUncachedExtension().

svn path=/trunk/; revision=27446
2007-07-07 09:56:55 +00:00
Aleksey Bragin
0d4033d95d - Zero initialize a variable (I have no idea how PREfast missed this important flaw).
- Fix PCI bus enumeration, so that finding SCSI controllers on PCI bus works now.

svn path=/trunk/; revision=27445
2007-07-07 08:52:35 +00:00
Art Yerkes
adb11df303 Resolve imports at boot time by loading the appropriate modules. We still need
to fix the same stuff in ntoskrnl for pnp loading.
Thanks to hpoussin for fixing pnp so this works.

svn path=/trunk/; revision=27444
2007-07-07 04:43:08 +00:00
Christoph von Wittich
320491c5f1 -fix a memory leak
-don't use uninitialized memory

svn path=/trunk/; revision=27443
2007-07-07 01:39:19 +00:00
Christoph von Wittich
733237f1ad -use ExAllocatePoolWithTag instead of ExAllocatePool
svn path=/trunk/; revision=27442
2007-07-07 01:16:58 +00:00
Christoph von Wittich
8d94a7336b -some changes to be able to build the driver with PREfast
svn path=/trunk/; revision=27441
2007-07-07 01:09:55 +00:00
Christoph von Wittich
891171aebf -added msbuild target to rbuild to be able to test drivers with PREfast
svn path=/trunk/; revision=27440
2007-07-07 00:38:59 +00:00
Hervé Poussineau
9c9992b6a5 Fix traces
Do an unicode build

svn path=/trunk/; revision=27439
2007-07-06 22:47:39 +00:00
Christoph von Wittich
f974855d7e fix some PREfast warnings
svn path=/trunk/; revision=27438
2007-07-06 21:50:48 +00:00
Christoph von Wittich
676da8d7b8 fix gcc build
svn path=/trunk/; revision=27437
2007-07-06 21:36:43 +00:00
Christoph von Wittich
a9c2017b33 fix some PREfast issues
svn path=/trunk/; revision=27436
2007-07-06 21:33:51 +00:00
Hervé Poussineau
e3d5443c9a Simplify IoSynchronousInvalidateDeviceRelations/IoInvalidateDeviceRelations
IoInvalidateDeviceRelations now creates a workitem, which will call IoSynchronousInvalidateDeviceRelations()

svn path=/trunk/; revision=27435
2007-07-06 21:12:44 +00:00
Christoph von Wittich
8b8021bbb9 -some minor changes to be able to build the driver with PREfast
-use ExAllocatePoolWithTag instead of ExAllocatePool

svn path=/trunk/; revision=27434
2007-07-06 20:25:40 +00:00
Christoph von Wittich
01b3f0d7cf -some minor changes to be able to build the driver with PREfast
-use ExAllocatePoolWithTag instead of ExAllocatePool

svn path=/trunk/; revision=27433
2007-07-06 20:25:30 +00:00
Aleksey Bragin
03c866e842 [AUDIT]
- There are plenty of information about PCI, about bus drivers in Windows, and where there is too small information, the testing helps.
- Code is logical, authors are known.

svn path=/trunk/; revision=27432
2007-07-06 20:24:15 +00:00
Aleksey Bragin
8d27e7eff0 [AUDIT]
- isapnp is based on a linux driver, and mainly had only fixes after importing that code. Clean.

svn path=/trunk/; revision=27431
2007-07-06 20:18:43 +00:00
Christoph von Wittich
ea6b02f501 -some minor changes to be able to build the driver with PREfast
-declare I8042InterruptService* routines as KSERVICE_ROUTINE

svn path=/trunk/; revision=27430
2007-07-06 18:14:23 +00:00
Christoph von Wittich
9f79a749af Never call IoCompleteRequest while holding a spin lock. Attempting to complete an IRP while holding a spin lock can cause deadlocks.
svn path=/trunk/; revision=27429
2007-07-06 17:14:24 +00:00
Ged Murphy
f0124e6d34 0 -> FALSE for clarity
svn path=/trunk/; revision=27424
2007-07-06 14:02:37 +00:00
Ged Murphy
843b40c7ad - ensure SetLastError is called when EnumServicesStatusEx is returning required buffer sizes
- servman.exe now lists all ReactOS services

svn path=/trunk/; revision=27423
2007-07-06 13:53:29 +00:00
Aleksey Bragin
771911b3ab Dmitry Chapyshev:
- More russian translations, this time in rosapps.

svn path=/trunk/; revision=27422
2007-07-06 11:59:52 +00:00
Aleksey Bragin
8a99fa15c5 Dmitry Chapyshev:
- Change strange icon in mmc to a better one.
- Fix russian translation of newdev.dll and serialui.dll (I, Aleksey, partially changed the translation to my personal preference).

svn path=/trunk/; revision=27421
2007-07-06 10:42:22 +00:00
Aleksey Bragin
6d53c91bed - Start turning KDBG into a KD wrapper (and thus removing where possible KDBG-specific hacks in various places of the kernel).
- KdbSymInit() became a general initialization routine.
- KdpEnterDebuggerException() is modified to:
  * Call KDBG's symbol-loading hook when BREAKPOINT_LOAD_SYMBOLS is hit.
  * If KDBG is turned on, and it's a breakpoint, the Eip is incremented (thus fixing the inability to "cont" after breaking into the KDBG debugger).

svn path=/trunk/; revision=27419
2007-07-06 09:02:16 +00:00
Magnus Olsen
7df63f2bb1 add a missuing DPRINT1 in a unpimplement function
svn path=/trunk/; revision=27416
2007-07-06 08:24:55 +00:00
Magnus Olsen
aeccd973cc write out the bus name we say is not pnp, instead using number
svn path=/trunk/; revision=27415
2007-07-06 08:19:09 +00:00
Christoph von Wittich
92128ef797 fix some typos in the comments
svn path=/trunk/; revision=27414
2007-07-05 23:29:54 +00:00
Magnus Olsen
5ecbbb6ebb Do not hack video driver, VBE driver works in windows xp
----------------------------------------------------------------
Fixed to detect few legazy bus types, fill the list for no
PnP bus type in videprt/videoprt.c functions VideoPortInitialize

svn path=/trunk/; revision=27413
2007-07-05 22:06:47 +00:00
Hervé Poussineau
a6fa0638e6 Never call driver AddDevice routine with a NULL PDO
svn path=/trunk/; revision=27412
2007-07-05 20:08:28 +00:00
Hervé Poussineau
a10da52c02 Do not rely on a call to AddDevice with a NULL PDO to start to use a legacy video miniport
svn path=/trunk/; revision=27411
2007-07-05 20:03:22 +00:00
Hervé Poussineau
478a0d960b ReactOS now supports ACLs... (fix SeAccessCheck to sometimes deny access)
svn path=/trunk/; revision=27409
2007-07-05 17:01:02 +00:00
Hervé Poussineau
fa6d39f0e0 Let admins modify the token
svn path=/trunk/; revision=27408
2007-07-05 16:59:27 +00:00
Hervé Poussineau
e8c10e466d Better support of GUID_DEVICE_SYS_BUTTON interface.
Now, the kernel can receive power events from the keyboard, but only reacts by displaying a message

svn path=/trunk/; revision=27407
2007-07-05 14:23:16 +00:00
Magnus Olsen
802891c598 smaller cleanup remove empty folders
svn path=/trunk/; revision=27406
2007-07-05 12:31:09 +00:00
Magnus Olsen
8183f17038 adding usp10.dll to bootcd some program need it
svn path=/trunk/; revision=27405
2007-07-05 11:24:46 +00:00
Christoph von Wittich
28e26ae6bc don't zero an OEM_STRING with sizeof(UNICODE_STRING)
svn path=/trunk/; revision=27404
2007-07-05 11:10:08 +00:00
Magnus Olsen
e2651a0dbc Fixing a smaller bug was intrudes in rev 27394
----------------------------------------------
1. vmware driver child windows was not show right no button or text, in second boot
this change take care of that regress and does not intrudes any new regress what I can 
see. 

svn path=/trunk/; revision=27403
2007-07-05 09:46:57 +00:00
Magnus Olsen
1abc4ee915 Bugfix TrackMouseEvent
patch from Yaroslav Ponomarenko yarryp at gmail dot com
1. make it thread safe
2. fixing so ToolBar  works


/* greatlord */
1. I did smaller change to the patch
2. I also fixed if with missing { } alredy in ros code
See issue #2359 for more details.

svn path=/trunk/; revision=27402
2007-07-05 09:28:11 +00:00
Hervé Poussineau
05fa42912f Fix MSVC project files if version is not 8.00
svn path=/trunk/; revision=27399
2007-07-05 08:02:57 +00:00
Hervé Poussineau
1cf915a077 ZeroMemory the correct amount of bytes
svn path=/trunk/; revision=27398
2007-07-05 07:05:05 +00:00
Christoph von Wittich
7f02b7b93c ZeroMemory the correct amount of bytes
svn path=/trunk/; revision=27397
2007-07-05 01:24:57 +00:00
Christoph von Wittich
9699e0506c ZeroMemory the correct amount of bytes
svn path=/trunk/; revision=27396
2007-07-05 01:22:40 +00:00
Timo Kreuzer
f1a7f30887 co_WinPosSetWindowPos: fix the redrawing (instead of simply removing some code, like my last commit, sorry). Now it works more like on windows and both the problem of a blank control panel and ugly wizard pages are gone. Fixes bug 735, see also bug 902, may fix bug 2141.
See issue #735 for more details.

svn path=/trunk/; revision=27394
2007-07-04 22:22:30 +00:00
Andrew Greenwood
9dc5649fa5 Including <debug.h> in order to use DPRINT rather than my own homebrew
equivalent (using printf!) - this should prevent the un-necessary 
verbose output when starting cmd.exe now ;)


svn path=/trunk/; revision=27393
2007-07-04 18:55:23 +00:00
Aleksey Bragin
1070114e85 - IntCallWindowsProc(): DPRINT1 -> DPRINT, it seems it's allright if it's called with WndProc == NULL.
svn path=/trunk/; revision=27392
2007-07-04 17:20:06 +00:00
Christoph von Wittich
6fccf28376 fixed IopLockFileObject
svn path=/trunk/; revision=27391
2007-07-04 17:05:31 +00:00
Ged Murphy
be2228c407 change the name of the VS config from * - Wine headers to * - ReactOS headers
svn path=/trunk/; revision=27389
2007-07-04 15:28:56 +00:00
Thomas Bluemel
2e3fcb5dd9 Don't silently accept entrypoint=""
svn path=/trunk/; revision=27388
2007-07-04 15:27:32 +00:00
Christoph von Wittich
c0ed3a362f fix loading of comcat.dll
svn path=/trunk/; revision=27387
2007-07-04 15:25:21 +00:00
Hervé Poussineau
9c03ef676e Add a message in case of error when loading/initializing driver
svn path=/trunk/; revision=27386
2007-07-04 14:13:30 +00:00
Aleksey Bragin
122331f605 - Correctly set DN_DRIVER_LOADED flag.
- This fixes "i8042prt/kbdclass.sys get installed one more time at each boot".
See issue #2330 for more details.

svn path=/trunk/; revision=27385
2007-07-04 13:58:30 +00:00
Andrew Greenwood
4d91599bd6 Removing WDMAUD until I figure out how it can be implemented properly
(this will not have any adverse effects as it doesn't actually work 
yet.) Also replacing MMDRV with a rewritten version as it appears to
contain big chunks copied directly from NT4 DDK examples!


svn path=/trunk/; revision=27384
2007-07-04 10:17:48 +00:00
Christoph von Wittich
a941582fa2 fixed vmware video driver installation in vmware 6
svn path=/trunk/; revision=27383
2007-07-04 10:17:28 +00:00
Ged Murphy
d090403690 - Add some UNIMPLEMENTED macros to highlight API's being called
- Reformat the code, no other changes

svn path=/trunk/; revision=27382
2007-07-04 08:26:47 +00:00
Andrew Munger
8db103104e Remove stdole2.tlb from the bootcd also.
svn path=/trunk/; revision=27381
2007-07-03 22:04:42 +00:00
Christoph von Wittich
8201eb491c remove stdole2.tlb from build until there is a solution to build it properly with our buildsystem - wrc can't handle files from other directories than the source dir
svn path=/trunk/; revision=27379
2007-07-03 21:17:51 +00:00
Aleksey Bragin
daf2928882 - Uncomment PCNet driver's installation, since it's support has been fixed in 27377.
- Fix a typo.

svn path=/trunk/; revision=27378
2007-07-03 20:46:43 +00:00
Aleksey Bragin
c2af381a89 - Fix a multiplication error, which lead to a garbage DueTime being passed to KeSetTimerEx().
svn path=/trunk/; revision=27377
2007-07-03 20:38:09 +00:00
Christoph von Wittich
efb16b636b add stdole2.tlb to bootcd
svn path=/trunk/; revision=27376
2007-07-03 19:12:19 +00:00
Christoph von Wittich
114fb8a243 add stdole2.tlb to build
svn path=/trunk/; revision=27375
2007-07-03 19:11:35 +00:00
Christoph von Wittich
ccf9439e1e renamed TypeLib target to EmbeddedTypeLib
svn path=/trunk/; revision=27374
2007-07-03 19:10:33 +00:00
Christoph von Wittich
c9c06660a0 Copied remotely
svn path=/trunk/; revision=27373
2007-07-03 19:09:50 +00:00
Aleksey Bragin
d2ec09ba38 - Add debug prints.
svn path=/trunk/; revision=27369
2007-07-03 17:59:35 +00:00
Christoph von Wittich
42b7fb0c0e -added support for TypeLibs
svn path=/trunk/; revision=27368
2007-07-03 15:27:43 +00:00
Aleksey Bragin
2d419df2e3 - Revert changes to CRT which were not supposed to happen at all (26820, 27200:27204), and were incorrect.
- Remove artifacts from strtoul/strtoull source code (excessive line breaks).

svn path=/trunk/; revision=27367
2007-07-03 15:24:59 +00:00
Hervé Poussineau
55f2798900 Replace tabs by spaces. No code change
svn path=/trunk/; revision=27366
2007-07-02 22:39:11 +00:00
Hervé Poussineau
bffd171f09 Fix indentation (no code change)
svn path=/trunk/; revision=27365
2007-07-02 22:31:30 +00:00
Hervé Poussineau
e3d5a1d218 Clean up options between files
svn path=/trunk/; revision=27363
2007-07-02 18:24:43 +00:00
Hervé Poussineau
989dc0e975 Fix paths to some files
svn path=/trunk/; revision=27362
2007-07-02 18:24:01 +00:00
Hervé Poussineau
668dd86fe9 Fix some prototypes
svn path=/trunk/; revision=27360
2007-07-02 13:40:06 +00:00
The Wine Synchronizer
317ea83284 Autosyncing with Wine HEAD
svn path=/trunk/; revision=27359
2007-07-02 12:07:09 +00:00
Hervé Poussineau
052f7faeee Update README file about Wine shared DLLs
svn path=/trunk/; revision=27358
2007-07-02 12:06:25 +00:00
Christoph von Wittich
2c3f812b5c add comcat.dll to build
svn path=/trunk/; revision=27357
2007-07-02 01:47:50 +00:00
Christoph von Wittich
3ca18547fe Copied remotely
svn path=/trunk/; revision=27356
2007-07-02 01:36:28 +00:00
Christoph von Wittich
549e05c149 Removed file/folder
svn path=/trunk/; revision=27355
2007-07-02 01:35:53 +00:00
Christoph von Wittich
d6f775854f Added a folder remotely
svn path=/trunk/; revision=27354
2007-07-02 01:32:15 +00:00
Christoph von Wittich
853b33abbf -deleted comcat.h
-added comcat.idl to build
-added the baseaddress for comcat.dll
-added comcat related error values to winerror.h

svn path=/trunk/; revision=27351
2007-07-01 22:13:20 +00:00
Magnus Olsen
b79355c407 update dejavu font from 2.15 to 2.17
------------------------------------
What new Extend latin C support 
two more langues are complete
over 600 new glypt have been add
reencoing thing to unicode that was not inu uncode format. 
bug fix ae special char and other bugfix as well
this is last update of dejavu until they come to version 2.3.0 or to version 3.0.0

svn path=/trunk/; revision=27350
2007-07-01 18:34:40 +00:00
Franz Lehner
d32320fa56 Added Repair and update function to installer
svn path=/trunk/; revision=27349
2007-06-30 19:37:43 +00:00
Aleksey Bragin
ffce5f4f66 - Commit a fix for KDBG's attach to process problem.
See issue #1263 for more details.

svn path=/trunk/; revision=27348
2007-06-30 18:58:09 +00:00
Magnus Olsen
57f28d6036 forget adding this file sprry I broken the build
thx HeisSpiter
See issue #2314 for more details.

svn path=/trunk/; revision=27347
2007-06-30 17:47:14 +00:00
Aleksey Bragin
1d25003483 - Revert accidentally committed ASSERT by Magnus in revision 27342.
svn path=/trunk/; revision=27346
2007-06-30 16:03:34 +00:00
Aleksey Bragin
28244e5ffa - Clean up the mess Magnus introduced (remove allowwarnings="true").
- RpcTryFinall set of macros was mapped to PSEH incorrectly, which lead to a "finally" block being treated as an "except" block (thus ending up in a memory leak). Reverting this part for now until a better solution is found.

svn path=/trunk/; revision=27345
2007-06-30 16:01:03 +00:00
Magnus Olsen
3c6d190150 accpect pacth in bug 2314, with one smaller change
the msvcrt20.def change was not accpect, it need more time for review.
and we do not support __set_error in libcntpr.  
the patch are base on current strtoul, the strtoull are the long long version 
of strtoul. so he took current stroul and adpate it to long long. and also add
missing error code. patch are done by Pierre Schweitzer email heis_spiter at hotmail.com

See issue #2314 for more details.

svn path=/trunk/; revision=27344
2007-06-30 14:12:10 +00:00
Magnus Olsen
149ffee96d part 7 of 7
at last removing wine hack, that disable seh in rpc.h 
we have now seh activate in rpcrt4 and some other idl stuff as well, 
they where complete hacked to be offline, in wine header, I reworte the 
header and move some prototype to right header. 



svn path=/trunk/; revision=27342
2007-06-30 00:33:38 +00:00
Magnus Olsen
69a5d63fb0 part 6 of xx
removing wine hack, that disable seh in rpc.h 
1. adding  allowwarnings ="true"

svn path=/trunk/; revision=27337
2007-06-29 19:58:33 +00:00
Magnus Olsen
0f28005f96 part 5 of xx
removing wine hack, that disable seh in rpc.h 
cleanup work fireball ask about it

svn path=/trunk/; revision=27336
2007-06-29 19:15:12 +00:00
Magnus Olsen
73ebe1fb97 part 4 of xx
removing wine hack, that disable seh in rpc.h 
1. adding pseh lib to eventlog

svn path=/trunk/; revision=27335
2007-06-29 19:04:20 +00:00
Magnus Olsen
3ca8fa0d70 part 3 of xx
removing wine hack, that disable seh in rpc.h 
1. adding pseh lib to eventlog

svn path=/trunk/; revision=27334
2007-06-29 18:54:48 +00:00
Magnus Olsen
1fee243552 part 2 of xx
removing wine hack, that disable seh in rpc.h 
1. adding pseh lib to eventlog

svn path=/trunk/; revision=27333
2007-06-29 18:36:18 +00:00
Magnus Olsen
a077242b10 part 1 of xx
removing wine hack, that disable seh in rpc.h 
1. adding pseh lib to eventlog

svn path=/trunk/; revision=27332
2007-06-29 18:35:34 +00:00
Magnus Olsen
420c60d889 part 1 of xx
removing wine hack, that disable seh in rpc.h 
1. adding pseh lib to eventlog

svn path=/trunk/; revision=27331
2007-06-29 17:47:07 +00:00
Aleksey Bragin
017976049f - Reimplement HalpAssignPCISlotResources() (based on the old implementation, just changing to the new way of reading/writing PCI config space, formatting and other misc changes).
svn path=/trunk/; revision=27330
2007-06-29 17:20:26 +00:00
Timo Kreuzer
129a800f3f co_WinPosSetWindowPos:
- use IntInvalidateWindows() instead of co_UserRedrawWindows()

svn path=/trunk/; revision=27318
2007-06-28 20:23:46 +00:00
Aleksey Bragin
e706d4ba84 - Always use PsLoadedModuleList as a list of modules.
- Load kernel and hal symbols during BootPhase 1 initialization of this KD wrapper.

svn path=/trunk/; revision=27317
2007-06-28 20:19:16 +00:00
Timo Kreuzer
0a3292ae0a co_UserRedrawWindow(): Don't use region after it was deleted -> hRgn = NULL
svn path=/trunk/; revision=27315
2007-06-28 19:23:59 +00:00
Timo Kreuzer
8ec3b717ee - remove hack from co_WinPosSetWindowPos()
fixes bug 902
it doesn't reintroduce bug 735, wich seems to be fixed.
See issue #902,735 for more details.

svn path=/trunk/; revision=27313
2007-06-28 18:57:24 +00:00
Aleksey Bragin
a0e07982e6 - Rewrite KdbSymProcessBootSymbols() with respect to recent kernel changes.
- Change KdbSymInit() to match standard kd-wrapper init function.
- They are not called from anywhere, so don't expect something to either improve or break.

svn path=/trunk/; revision=27312
2007-06-28 17:49:02 +00:00
Aleksey Bragin
f290d37f66 - Fix incorrect usage of sprintf.
svn path=/trunk/; revision=27311
2007-06-28 16:19:35 +00:00
Johannes Anderwald
e129100556 - add option to macro to specify for which backend this macro is intended
If the macro is for all backends, then you dont need to set this option
However, if this macro is for gcc only then put an option, i.e.:
<define name="__USE_W32API" backend="mingw" />

for msvc backend set backend="msvc"
-Currently filtering is only implemented for msvc backend

svn path=/trunk/; revision=27303
2007-06-28 10:03:54 +00:00
Aleksey Bragin
13e2fd4bc6 - Fix symbols loading (PE sections are mapped now, not just read 1:1 from the disk, thus a need to use SectionHeader->VirtualAddress instead of SectionHeader->PointerToRawData).
svn path=/trunk/; revision=27301
2007-06-28 09:26:05 +00:00
Andrew Munger
1289745bf8 Fix realloc behavior when size == 0 and ptr != NULL.
Patch by DrV, bug 2347.

svn path=/trunk/; revision=27299
2007-06-28 07:05:24 +00:00
Aleksey Bragin
57e548bec4 - Fix incompatibility: In Windows IoGetDeviceProperty(DevicePropertyAddress) returns information as 0xDDDDFFFF (D=Device, F=Function) and not as a PCI_SLOT_NUMBER structure. This is confirmed by tests in Windows XP and 2003, and also found via Google.
- Fix incorrect usage of DevicePropertyAddress in videoprt and ndis (thus ndis.sys+pcnet.sys load [again] in Windows XP).

svn path=/trunk/; revision=27290
2007-06-27 18:05:04 +00:00
Dmitry Gorbachev
2beeeef110 The last commit.
Bulgarian translations by CCTAHEB (sstpr [at] narod [dot] ru). Bug #2344.

svn path=/trunk/; revision=27285
2007-06-26 23:31:01 +00:00
Ged Murphy
cf9d30ec8d - change the new explorer rbuild files to stop the IRC users from going insane.
- just remove the comment in shell.rbuild to build (just don't expect a fully working shell)

svn path=/trunk/; revision=27282
2007-06-26 13:30:53 +00:00
Daniel Reimer
533ca516f7 - Translate the Strings in the German Solitaire RC File, which were added a while ago.
- Add a German RC File to th new Explorer.

Its my first commit in Trunk, if I broke something, kill me ;-)

svn path=/trunk/; revision=27280
2007-06-26 07:55:08 +00:00
Thomas Bluemel
875b16dac6 Fix the build system, accidently broke it with r27269
svn path=/trunk/; revision=27276
2007-06-25 17:56:54 +00:00
Aleksey Bragin
43fb21136e - Ignore incorrect responses to ACK and just retry sending data until either ACK is read, or max number of iterations is reached. This fixes the keyboard/mouse detection problems when running ReactOS inside VMWare.
svn path=/trunk/; revision=27274
2007-06-25 11:55:51 +00:00
Magnus Olsen
67f892011c Fixing allot of werid bugs + cleanup debug nsg that we do not need any longer.
svn path=/trunk/; revision=27271
2007-06-24 17:29:03 +00:00
Magnus Olsen
e3d3cf7171 fixing more value that are not beig fill in, now we getting back the freq
svn path=/trunk/; revision=27270
2007-06-24 13:20:44 +00:00
Thomas Bluemel
a5b5d59762 Place .h files generated from .idl definitions in the intermediate directory
svn path=/trunk/; revision=27269
2007-06-24 12:54:54 +00:00
Magnus Olsen
caa55436f4 Fixing some value that are not being set
svn path=/trunk/; revision=27268
2007-06-24 11:47:00 +00:00
Magnus Olsen
f26b273557 simplefly Main_DirectDraw_QueryInterface code
svn path=/trunk/; revision=27266
2007-06-23 09:57:34 +00:00
Magnus Olsen
2d2cf54cc3 small redesgin do not type cast DirectDraw COM to LPDDRAWI_DIRECTDRAW_INT, use LPDDRAWI_DIRECTDRAW_INT as prototype in all directdraw functions.
svn path=/trunk/; revision=27265
2007-06-22 20:03:04 +00:00
Magnus Olsen
bd57936267 Fixing comping waring, also diamble our debug macro (it does not work for full screen for some reason
svn path=/trunk/; revision=27264
2007-06-22 19:34:06 +00:00
Magnus Olsen
1d08d6b833 fixing a member that are not being set
svn path=/trunk/; revision=27263
2007-06-22 16:50:36 +00:00
Magnus Olsen
e46a5994cf Fixing smaller bugs, like save the internal surface list, document up some members what they do
svn path=/trunk/; revision=27262
2007-06-22 15:11:59 +00:00
Magnus Olsen
a06823792a revert 27246 it is a hack a proper fix should be done in gdi32 or win32k
thx ged for review the old code with me, and talking what can be wrong 
this hack also solv dispare buttom in some case. 

svn path=/trunk/; revision=27253
2007-06-21 16:16:23 +00:00
Colin Finck
9c62047e36 Re-add the "lake.bmp" wallpaper inclusion (partly imported from the deleted 0.3.1 branch, r26044)
The wallpaper is now also added to the %SystemRoot% directory instead of %SystemRoot%\system32

The only thing I did not import is the setting of the default wallpaper in "hivedef.inf". For 0.3.1, we hardcoded the full path to the wallpaper in the "hivedef.inf" file.
For 0.3.3, we should either do this only in the branch or better implement a proper solution like setting the path in 2nd stage setup.

svn path=/trunk/; revision=27250
2007-06-21 15:23:49 +00:00
Colin Finck
f214c4f31e Finally fix the left/right confusion in all translations
svn path=/trunk/; revision=27249
2007-06-21 13:06:28 +00:00
Colin Finck
5f6ee9af28 Change the "ReactOS (R) Version 5.2 ..." boot message to "ReactOS (R) Kernel Version 5.2 ...", so people don't get confused by the different version numbers of the Kernel and ReactOS itself
svn path=/trunk/; revision=27248
2007-06-21 12:27:36 +00:00
Magnus Olsen
87c9cac62c fixing regress of icon drawing copyimage are complete mess and have allot of bugs.
I fixed tempary the icon drawing bug until I or some else got time rewriting copyimage image_load case
here is known bugs 
1. alpha icon does not working. 
2. wrong background getting selected 
3. and allot other thing. 

svn path=/trunk/; revision=27246
2007-06-20 19:54:22 +00:00
Magnus Olsen
ec6a3bd4ea do not cause a crash in lock, some how lock and unlock does not work as they should
svn path=/trunk/; revision=27244
2007-06-20 05:23:09 +00:00
Magnus Olsen
73ca69bb50 actavite debuger trace again
svn path=/trunk/; revision=27243
2007-06-20 05:14:45 +00:00
Christoph von Wittich
9eaf219355 return FALSE instead of 0
svn path=/trunk/; revision=27241
2007-06-19 20:38:49 +00:00
Aleksey Bragin
a2c98932c0 - Russian language translation by Dmitry Chapyshev.
svn path=/trunk/; revision=27236
2007-06-19 08:40:36 +00:00
Aleksey Bragin
556cfbf54a - Russian language translation and fixes to existing translation by Dmitry Chapyshev.
svn path=/trunk/; revision=27235
2007-06-19 08:37:36 +00:00
Aleksey Bragin
04c89b07a5 - Russian language translation fixes by Dmitry Chapyshev.
svn path=/trunk/; revision=27234
2007-06-19 08:27:45 +00:00
Magnus Olsen
74d47c7244 Check the sub_lang before a commit I do not want other langues that english,
like getting ukrain instead for english when the os are set to english

svn path=/trunk/; revision=27232
2007-06-18 21:57:11 +00:00
Magnus Olsen
d6273d8a62 Fixed some smaller bugs
svn path=/trunk/; revision=27226
2007-06-18 18:11:39 +00:00
Maarten Bosma
0e95f8362e - Some formatting fixes
- Some checks and fixed return values

svn path=/trunk/; revision=27224
2007-06-18 14:58:44 +00:00
Colin Finck
93e0ad758f Fix bug #2312 and add a check to show only the relevant information for Windows/Unix users
See issue #2312 for more details.

svn path=/trunk/; revision=27223
2007-06-18 11:58:35 +00:00
Christoph von Wittich
5fb6fb2312 added explorer-like addressbar
svn path=/trunk/; revision=27222
2007-06-18 00:09:37 +00:00
Magnus Olsen
4f5153dd3a Time to cellbrate we got bltblt hal working again
1. Createsurface can only create one surface at moment 
2. crash can occured if wrong param are being putin to createsurface for no error check are done. 
3. createsurface are still under havy devloping 

svn path=/trunk/; revision=27221
2007-06-17 23:43:21 +00:00
Magnus Olsen
7ae32c6424 last commit for today
fixing some compile warings for ddraw. 

svn path=/trunk/; revision=27220
2007-06-17 22:11:08 +00:00
Magnus Olsen
2f7fc5300c 1. fixed typo in DD->GetCaps
2. Started implement Createsurface for real this time. 
   thanks to all old try and error the new desgin make more sent 
   and are more clean. still Createsruface does not working yet. 

3. Fixed some comment tags for some whant start writing doc for thuse api 
   you are wellcome

svn path=/trunk/; revision=27218
2007-06-17 21:49:35 +00:00
Magnus Olsen
f8757ee824 GetCaps are complete, not tested in all case but almost all
svn path=/trunk/; revision=27216
2007-06-17 15:19:59 +00:00
Dmitry Gorbachev
d3a9230c70 Activate debug message about misbehaving "userinit.exe"
svn path=/trunk/; revision=27215
2007-06-17 15:18:06 +00:00
Magnus Olsen
487f93e2d7 DD->GetCaps for hal are so complete we can do with current
startup process we are missing setting This->lpLcl->lpGbl->lpddNLVCaps

fixed a smaller bugs in caps data

svn path=/trunk/; revision=27214
2007-06-17 14:46:04 +00:00
Magnus Olsen
d68da75a83 50% are implmene in DD->GetCaps now
svn path=/trunk/; revision=27213
2007-06-17 14:14:42 +00:00
Magnus Olsen
b51c13f0a3 GetCpas filling in how much memory we got now from HAL
svn path=/trunk/; revision=27212
2007-06-17 12:30:58 +00:00
Magnus Olsen
157883db74 start implement of DirectDraw_GetCaps
svn path=/trunk/; revision=27211
2007-06-17 11:22:23 +00:00
Magnus Olsen
588314ccad fixing one more bugs in QueryInterface
svn path=/trunk/; revision=27210
2007-06-16 22:05:16 +00:00
Magnus Olsen
4d6cc7d9a6 forget using addref in DirectDraw_QueryInterface, more werid bugs in ref
svn path=/trunk/; revision=27209
2007-06-16 20:04:01 +00:00
Magnus Olsen
4f6e4650de fixing couple of bugs in Main_DirectDraw_QueryInterface
1. adding create linking when u req a new directdraw interface from old one. 
   This Type of linking is exacly same lcl pointer as the linked interface,
   it mean we shall not create new lcl but use the current we got.
 
waring still bugs in DirectDraw_QueryInterface

svn path=/trunk/; revision=27208
2007-06-16 19:38:20 +00:00
Magnus Olsen
6eae3cd5e1 rewrite lite of Create_DirectDraw and add reenble options.
svn path=/trunk/; revision=27206
2007-06-16 18:18:04 +00:00
Magnus Olsen
e0e7446ed1 adding allot of fix and partly implement
1. Adding table lockup for directdraw 1-6 but they are not complete
2. remove out GetDevicreIdentifer to own file it is a large functions
3. Fixed DirectDrawCreate works now
4. found out bit more how DirectDraw_QueryInterface works and comment the new found 
5. add the new table to QueryInterface they are partly support now, the new IID is IID_IDirectDraw4, IID_IDirectDraw2 and IID_IDirectDraw it partly support now. 

svn path=/trunk/; revision=27205
2007-06-16 16:42:50 +00:00
Aleksey Bragin
9fea2af376 - Fix a typo.
svn path=/trunk/; revision=27204
2007-06-16 12:48:04 +00:00
Sylvain Petreolle
9120964800 revert previous r27194
ntoskrnl already exports InterlockedDe/Increment
spotted by hpoussin

still fails to link,
thans to heisspiter for win32 test

svn path=/trunk/; revision=27203
2007-06-16 12:45:02 +00:00
Aleksey Bragin
a49bd59734 - Finally, removing frame pointer was a bad idea (think of exceptions / etc).
svn path=/trunk/; revision=27202
2007-06-16 12:28:56 +00:00
Aleksey Bragin
f1c06f9d0b - Uhh.. Doing it properly now.
- Also gathered trigonometric function into one file.

svn path=/trunk/; revision=27201
2007-06-16 11:55:21 +00:00
Magnus Olsen
7c9d0792cb rewrite atan, cos, fabs, sin, sqrt, tan, it will give us better speed as well the old version was slow
svn path=/trunk/; revision=27200
2007-06-16 11:19:30 +00:00
Dmitry Gorbachev
b1afaa85ca Unable to reproduce that bug (#2047). Apply r27177 patch again.
svn path=/trunk/; revision=27199
2007-06-16 08:27:02 +00:00
Magnus Olsen
21dfa5bf59 adding one missing stub
svn path=/trunk/; revision=27198
2007-06-16 01:32:59 +00:00
Magnus Olsen
9c81f9ad19 prepare vbe driver for two thing
1. a framebuf for VBE 1.2 this will be pretty hard to implement, 
   I got some idea, this mean our vbe drv will work on vbe 1.2 
   without doing a bankswitch

2. prepare for some dx api for vbe by adding support for special mode 0x81FF
   meaing we getting full access to the video driver memory in vbe. Thx aleasky
   you remmid and long talk in some month how we can do it. 


 

svn path=/trunk/; revision=27197
2007-06-15 23:58:10 +00:00
Dmitry Gorbachev
a3897f253f Fix bug #2151. Thanks to Alex Ionescu.
svn path=/trunk/; revision=27196
2007-06-15 21:46:42 +00:00
Dmitry Gorbachev
7bba5bf9ba I'm sorry, but r27177 does not work for me. I just tested LiveCD on real
hardware, something goes wrong. So I'm reverting it for now. Please test it 
more carefully.

svn path=/trunk/; revision=27195
2007-06-15 21:39:28 +00:00
Sylvain Petreolle
e6e9d500a4 add missing library to portcls
svn path=/trunk/; revision=27194
2007-06-15 19:52:26 +00:00
Dmitry Gorbachev
20560b2ef4 Do not break away from the loop on every error. It can cause situation when
many threads die after one client death.

svn path=/trunk/; revision=27193
2007-06-15 19:14:15 +00:00
Magnus Olsen
a02534e0fe Fixing right behvoir for setcooperlevel with normal flag set in windows mode
Fixing gpl.dwflag being set right. 


svn path=/trunk/; revision=27192
2007-06-15 17:02:17 +00:00
Magnus Olsen
7ac1277f52 Fixing smaller bugs in startup.c it does not set windows handler or use windows handler hdc it create own hdc
svn path=/trunk/; revision=27191
2007-06-15 16:44:15 +00:00
Magnus Olsen
33ce8924d2 Fix so our demo apps can be compile with vs, this mean we can now using our demo apps debug our ddraw.dll internal struct data or ms ddraw.dll internal struct data allot easy.
svn path=/trunk/; revision=27190
2007-06-15 14:46:18 +00:00
Maarten Bosma
0dfb900085 Add lots of test cases for the CreateSurface API. See caps_tests.h for more info.
svn path=/trunk/; revision=27189
2007-06-15 14:46:03 +00:00
Dmitry Gorbachev
355f43c264 Improve FIXME comment. For future generations of developers. :)
svn path=/trunk/; revision=27187
2007-06-15 12:11:48 +00:00
Magnus Olsen
4f5eb73a1f make ddraw.dll lite more msvs frendly
svn path=/trunk/; revision=27184
2007-06-15 10:21:54 +00:00
Magnus Olsen
4db57afdf1 Fixing some bugs in startup.c
1. check for DDHALINFO_GETDRIVERINFOSET before using of 
   DdGetDriverInfo, it exists two diffent version of 
   DdGetDriverInfo2

2. Adding a fixme for fixing CreateSurfaceEx, GetDriverState 
   and DestroyDDLocal callbacks for HAL, and adding partly 
   code in the fixme.

   

svn path=/trunk/; revision=27183
2007-06-15 09:54:52 +00:00
Magnus Olsen
4bac086c86 more rewriting of setcooperlevel, it start working simluare as windows ddraw. and it start setup same value as well in the private struct.
svn path=/trunk/; revision=27181
2007-06-14 22:04:32 +00:00
Magnus Olsen
52c6c5e833 commit more test for setcooperlevel, not all test are in that we need.
svn path=/trunk/; revision=27180
2007-06-14 22:01:22 +00:00
Magnus Olsen
4a4c71ea2b fixing ddrawi is compatible with vs
svn path=/trunk/; revision=27178
2007-06-14 20:02:51 +00:00
Johannes Anderwald
c4f39da5a8 - release lock on error
svn path=/trunk/; revision=27177
2007-06-14 19:51:19 +00:00
Dmitry Gorbachev
e2299b4583 - Do not leak ports.
- Use threads. This should allow shutdown.
- Fix indentation.

svn path=/trunk/; revision=27176
2007-06-14 19:09:32 +00:00
Dmitry Gorbachev
076ca93553 - Do not create process data twice.
- Check message type.

svn path=/trunk/; revision=27175
2007-06-14 16:47:24 +00:00
Dmitry Gorbachev
0743fc87cf - Hackish solution of issue #2062.
- Turn off title change, as it can cause a deadlock.

svn path=/trunk/; revision=27174
2007-06-14 16:41:55 +00:00
Magnus Olsen
88bc96e3df start rewrite SetCooperativeLevel
we pass some more test for setcooper but not all, the wine code are allot mess and wrong. 
the wine code will be remove complete. 

svn path=/trunk/; revision=27173
2007-06-14 13:41:48 +00:00
Ged Murphy
05105d3d12 these files should have headers
svn path=/trunk/; revision=27166
2007-06-12 20:56:01 +00:00
Aleksey Bragin
59cf409608 - Translation to Russian language by Dmitry Chapyshev.
svn path=/trunk/; revision=27164
2007-06-12 20:41:34 +00:00
Aleksey Bragin
66a9ac9e88 - Translation to Russian language by Dmitry Chapyshev.
svn path=/trunk/; revision=27163
2007-06-12 20:35:04 +00:00
Aleksey Bragin
adcf0f69c7 - Translation to Russian language by Dmitry Chapyshev.
svn path=/trunk/; revision=27162
2007-06-12 20:31:45 +00:00
Johannes Anderwald
77e68c3d5a - was not meant to be commited
svn path=/trunk/; revision=27161
2007-06-12 19:35:15 +00:00
Johannes Anderwald
4d8d218004 - dont double free memory
svn path=/trunk/; revision=27160
2007-06-12 19:33:44 +00:00
Johannes Anderwald
13eda403d7 - remove MenuItem from MenuItemList on request
svn path=/trunk/; revision=27158
2007-06-12 18:18:32 +00:00
Magnus Olsen
bbbe421396 making portcls can be compile now
svn path=/trunk/; revision=27157
2007-06-12 15:37:30 +00:00
Dmitry Gorbachev
d37dc1d14e Dutch translation by Joost de Meij (bug report #2300).
svn path=/trunk/; revision=27156
2007-06-12 15:35:03 +00:00
Magnus Olsen
425ddbf45a fixing some header problem for portcls
svn path=/trunk/; revision=27155
2007-06-12 15:23:28 +00:00
Magnus Olsen
36f388cc37 adding include windows.h it take care for some macro was not declare and COM macro are only in psdk what I known, still create compiling issue
svn path=/trunk/; revision=27154
2007-06-12 10:26:47 +00:00
Hervé Poussineau
ad0d69c348 Do not create a new device node if we already know the PDO
svn path=/trunk/; revision=27153
2007-06-12 08:38:32 +00:00
Aleksey Bragin
5b7bb95ec1 Massive changes to the driver loading / device creation logic (as a result of collaborative work with Herve):
- Really reuse the driver's object, instead of always failing in "IopGetDriverObject()". Fix driver's object creation accordingly in NtLoadDriver() and IopActionInitChildServices().
- Move InvalidateRelations to a later stage, when it really should happen (previously it just delayed the boot process but couldn't load any driver since boot device was inaccessible and reusing drivers loaded by the bootloader was not possible).
- Minor bugfixes in various places related to these changes.
- Add DPRINTs for easier debugging and failure tracking (silent failure is the worst enemy of a developer).

Results:
- VMWare video driver regression is gone.
- "New device found" wizard appears in the 3rd stage like in "old good times".
- Network drivers hang somewhere, so a hack is added to temporarily disable installation of pcnet.sys.


svn path=/trunk/; revision=27151
2007-06-11 22:02:55 +00:00
Hervé Poussineau
8bb5ea4208 Always complete the IRP_MJ_PNP irp, even if we don't recognize the minor function
svn path=/trunk/; revision=27150
2007-06-11 21:26:51 +00:00
Aleksey Bragin
0a8b633b06 - hpoussin: If minor function is not recognized, you must not change the Irp->IoStatus.Status field.
svn path=/trunk/; revision=27149
2007-06-11 21:20:25 +00:00
Timo Kreuzer
1b70c2f495 - use LOGFONTW structure from GetFontResourceInfo for face name
- use LF_FULLFACESIZE
- some cleanup

svn path=/trunk/; revision=27148
2007-06-11 20:38:55 +00:00
Thomas Bluemel
07e6389f6c Fix syntax error
svn path=/trunk/; revision=27147
2007-06-11 18:14:14 +00:00
Aleksey Bragin
c8492ec043 - Remove a call to TREEVIEW_Update() which causes an infinite loop on ReactOS. Now it should be possible to use treeview controls (such as regedit's left pane) without major problems.
svn path=/trunk/; revision=27146
2007-06-11 17:57:07 +00:00
Dmitry Gorbachev
6284ebf8b2 Update Polish translation. Bug #2298.
svn path=/trunk/; revision=27145
2007-06-11 15:57:16 +00:00
Dmitry Gorbachev
272fa75e9d Translations:
- Dutch  by Joost de Meij (dreamsmsn *at* gmail *dot* com). Bug #2296.
- French by Pierre Schweitzer. Bug #2297.
- Polish by Olaf Siejka. Bug #2298.

svn path=/trunk/; revision=27144
2007-06-11 15:56:42 +00:00
Dmitry Gorbachev
12130e71ab - Remove root device hack.
- Add event dereferencing hack (bug report #2240).

svn path=/trunk/; revision=27141
2007-06-11 15:02:23 +00:00
Ged Murphy
ca4a88afa0 fix build
svn path=/trunk/; revision=27140
2007-06-11 14:48:39 +00:00
Ged Murphy
b0b8a08702 delete todo.h the definitions
svn path=/trunk/; revision=27139
2007-06-11 14:24:50 +00:00
Ged Murphy
72c2c80949 move a couple more definitions into the public sdk
svn path=/trunk/; revision=27138
2007-06-11 14:23:49 +00:00
Aleksey Bragin
80f6386261 - Fix a bug with querying registry values (a typo, spotted/fixed by Herve).
- Fix a problem when a device, which was already in the list is freed and memory corruption is introduced.

svn path=/trunk/; revision=27137
2007-06-11 13:35:42 +00:00
Dmitry Gorbachev
9b0d081e49 Add Belgian French variant, resolve political / cultural conflict.
svn path=/trunk/; revision=27135
2007-06-11 11:43:39 +00:00
Ged Murphy
6cd0c03313 remove corresponding definitions out of todo.h
svn path=/trunk/; revision=27134
2007-06-11 09:52:31 +00:00
Ged Murphy
d772596da8 start to move some definitions into the public sdk
svn path=/trunk/; revision=27133
2007-06-11 09:51:44 +00:00
Dmitry Gorbachev
fe667853fa Fix LPC port referencing.
svn path=/trunk/; revision=27132
2007-06-11 01:24:41 +00:00
Maarten Bosma
1bc331c11f Blt-API Tests
svn path=/trunk/; revision=27129
2007-06-10 20:47:17 +00:00
Maarten Bosma
d1d6598616 Tests BltBatch and GetBltStatus
svn path=/trunk/; revision=27124
2007-06-10 18:19:46 +00:00
Hervé Poussineau
db153659fe Fill HardwareDatabase, DriverStart and DriverSize fields before calling init routine
svn path=/trunk/; revision=27120
2007-06-10 16:15:16 +00:00
Maarten Bosma
65c877d142 Some clean up
svn path=/trunk/; revision=27118
2007-06-10 14:43:48 +00:00
Maarten Bosma
b7a21ac467 Add tests for IDirectDrawSurface methods:
- GetCaps
- GetDC / ReleaseDC
- ChangeUniquenessValue / GetUniquenessValue
- GetPixelFormat
- GetSurfaceDesc
- GetDDInterface 

svn path=/trunk/; revision=27117
2007-06-10 14:32:19 +00:00
Maarten Bosma
c80a21e102 added wrong file
svn path=/trunk/; revision=27115
2007-06-10 12:03:01 +00:00
Maarten Bosma
919058559b Some more movement.
svn path=/trunk/; revision=27112
2007-06-10 11:50:56 +00:00
Thomas Bluemel
b966dbe7ee convert a switch statement with a range to an if statement (msvc compatibility)
svn path=/trunk/; revision=27111
2007-06-10 11:50:48 +00:00
Maarten Bosma
2fe952c999 - some rearrangement
- tests for GetPrivateData, SetPrivateData, FreePrivateData of IDirectDrawSurface

svn path=/trunk/; revision=27110
2007-06-10 11:42:58 +00:00
Thomas Bluemel
c3bd31ab5a Fix accidentally introduced thread and memory leak when the cache should be run down
svn path=/trunk/; revision=27109
2007-06-10 11:24:34 +00:00
Thomas Bluemel
f7d3dc0bd6 Display nice images taken (and modified) from http://www.lullabot.com/articles/free_gpl_icons_lullacons_pack_1, which are licensed under the GPL.
svn path=/trunk/; revision=27108
2007-06-10 11:17:38 +00:00
Dmitry Gorbachev
6ccaee160f Fix issue #2151.
svn path=/trunk/; revision=27107
2007-06-10 11:11:05 +00:00
Thomas Bluemel
9705ebf7f4 Display the owner of the security descriptor
svn path=/trunk/; revision=27106
2007-06-10 10:45:38 +00:00
Thomas Bluemel
8b79ad2052 Add GUIDs for IID_IBandSite, CLSID_RebarBandSite and IID_IDeskBand
svn path=/trunk/; revision=27105
2007-06-10 09:32:11 +00:00
Thomas Bluemel
880c4059fe Add a very experimental explorer that heavily relies on the shell. It's still very buggy, not very functional and will not work on ReactOS due to the lack of support in shell32.dll and friends. It will not be built by default.
- todo.h is a header that contains definitions and GUIDs that we miss in the public sdk headers.
- undoc.h contains functions that are not publicly documented. It also contains internal (not yet complete) COM interfaces used with the start menu and SHCreateDesktop.

svn path=/trunk/; revision=27104
2007-06-10 08:09:42 +00:00
Thomas Bluemel
fe0d133fdf Add a base address for usrmgr.dll
svn path=/trunk/; revision=27103
2007-06-10 07:39:21 +00:00
Magnus Olsen
53c602d78e simplefly the math for calc out the guiddeviceidentify
svn path=/trunk/; revision=27102
2007-06-10 04:36:19 +00:00
Magnus Olsen
2d86b0c8ad update some comment
DD COM object
now we got 7 of 30 done and 7 of 30 are under developing / testing 
total we got 14 of 30 that is working 

svn path=/trunk/; revision=27101
2007-06-10 03:54:37 +00:00
Magnus Olsen
048061505b adding real testcase to GetDeviceIdentifier, we can not test everything, I leave small code comment out for easy debuging
svn path=/trunk/; revision=27100
2007-06-10 03:41:49 +00:00
Magnus Olsen
62c5149fce Only dwWHQLLevel are left todo in GetDeviceIdentifier
svn path=/trunk/; revision=27099
2007-06-10 03:33:17 +00:00
Magnus Olsen
f8a6e087fd Building part of guidDeviceIdentifier in GetDeviceIdentifier
left to coding in is REV_ SUBSYS_ liDriverVersion

svn path=/trunk/; revision=27098
2007-06-10 03:10:20 +00:00
Eric Kohl
f2d0f12dc0 Add a user manager control panel application since the 0.3.2 release has been canceled.
svn path=/trunk/; revision=27097
2007-06-09 23:17:33 +00:00
Eric Kohl
472b0cb7f3 Add NetLocalGroupEnum stub.
svn path=/trunk/; revision=27096
2007-06-09 23:14:07 +00:00
Magnus Olsen
b0186e348f almost finish GetDeviceIdentifier implementions,
leftdo fill in guidDeviceIdentifier and dwWHQLLevel

svn path=/trunk/; revision=27095
2007-06-09 22:49:38 +00:00
Hervé Poussineau
bd0786560f Support IRP_MN_FILTER_RESOURCE_REQUIREMENTS
svn path=/trunk/; revision=27094
2007-06-09 20:39:34 +00:00
Magnus Olsen
e19e754ce3 start implement of GetDeviceIdentifier we are filling one more member right. this time we getting the driver name
svn path=/trunk/; revision=27093
2007-06-09 20:22:09 +00:00
Hervé Poussineau
c5cf277736 Simplify method to call to DriverEntry of a driver
svn path=/trunk/; revision=27092
2007-06-09 20:16:29 +00:00
Hervé Poussineau
05b27afd12 Zero the full structure. Thanks Fireball
svn path=/trunk/; revision=27090
2007-06-09 19:37:41 +00:00
Magnus Olsen
0dabf31e76 start implement of GetDeviceIdentifier we are filling one member right.
svn path=/trunk/; revision=27088
2007-06-09 17:24:32 +00:00
Magnus Olsen
2e1e1e0140 prepare testkit for GetDeviceIdentifier
svn path=/trunk/; revision=27087
2007-06-09 13:23:18 +00:00
Aleksey Bragin
db99cff20e - If the module failed to load (e.g. fixup couldn't be done), then don't include it in the list of loaded modules.
svn path=/trunk/; revision=27086
2007-06-09 13:10:02 +00:00
Johannes Anderwald
62c077140e - disable building avtest for now
svn path=/trunk/; revision=27085
2007-06-09 10:15:00 +00:00
Magnus Olsen
535019cbf6 commit GetDeviceIdentifier and GetDeviceIdentifier7 both are under devloping, I hope I finish this implement today
svn path=/trunk/; revision=27084
2007-06-09 10:05:41 +00:00
Aleksey Bragin
8ef4afc835 - Don't load a module with the same name more than once.
svn path=/trunk/; revision=27083
2007-06-09 10:03:33 +00:00
Magnus Olsen
e619b8cca2 commit which api are under developing and hard tested.
mark which one have been completed and acts like ms ddraw does. 

svn path=/trunk/; revision=27082
2007-06-08 23:32:13 +00:00
Magnus Olsen
22c7e66366 rename Main_DirectDraw_GetAvailableVidMem to Main_DirectDraw_GetAvailableVidMem4
Fixing smaller bugs in Main_DirectDraw_GetAvailableVidMem4, complete works simluare now to ms version of this api
Implement Main_DirectDraw_GetAvailableVidMem for directdraw2 and directdraw3

svn path=/trunk/; revision=27081
2007-06-08 20:55:48 +00:00
Magnus Olsen
8c9302e2aa last testcase for getavailmemory
svn path=/trunk/; revision=27080
2007-06-08 20:30:07 +00:00
Johannes Anderwald
4102c22bc1 - include ddk
svn path=/trunk/; revision=27079
2007-06-08 20:03:56 +00:00
Magnus Olsen
7380e3282a Fixing smaller bugs in Main_DirectDraw_GetAvailableVidMem, it is still buggi
svn path=/trunk/; revision=27078
2007-06-08 19:25:39 +00:00
Magnus Olsen
779fdc743f small code cleanup
svn path=/trunk/; revision=27077
2007-06-08 19:18:45 +00:00
Magnus Olsen
3aa5478e6d adding allot more testcase for Test_GetAvailableVidMem it is not complete but we testing allot more now
svn path=/trunk/; revision=27076
2007-06-08 19:17:46 +00:00
Magnus Olsen
edddb00510 Fixing allot bugs in Main_DirectDraw_GetAvailableVidMem, it is still buggi
svn path=/trunk/; revision=27075
2007-06-08 17:12:05 +00:00
Magnus Olsen
032150f031 adding allot more testcase for Test_GetAvailableVidMem it is not complete but we testing allot more now
svn path=/trunk/; revision=27074
2007-06-08 16:46:50 +00:00
Dmitry Gorbachev
f77f4a810a Fix failed assertion in MM code.
svn path=/trunk/; revision=27072
2007-06-08 14:42:36 +00:00
Magnus Olsen
e248b95f9d fixing a smaller bug extream hard to find,
if we got two or more directdraw object we choice always the lates hDD not the object own hDD
use This->lpLcl->lpGbl->hDD = This->lpLcl->hDD; to set the object own hDD before call any dxhal api

svn path=/trunk/; revision=27070
2007-06-08 12:57:00 +00:00
Johannes Anderwald
869f31838e - check if window was created successfully...
svn path=/trunk/; revision=27069
2007-06-08 11:58:04 +00:00
Magnus Olsen
6a1c6e4790 my last commit was wrong, more testing show me diffen
svn path=/trunk/; revision=27068
2007-06-08 11:43:16 +00:00
Magnus Olsen
5e019b656f update with some new info
svn path=/trunk/; revision=27067
2007-06-08 11:36:38 +00:00
Magnus Olsen
3d128d4bc5 remove VideoPortPutDmaAdapter implement sorry breaking the build it is fix 2 / 2 next commit fixing the build again
svn path=/trunk/; revision=27066
2007-06-07 22:12:10 +00:00
Magnus Olsen
01148285c7 revert my commit to this filem sorry breaking the build it is fix 1 / 2 next commit fixing the build again
svn path=/trunk/; revision=27065
2007-06-07 22:09:47 +00:00
Magnus Olsen
7eedda6459 patch from Pierre Schweitzer <heis_spiter at hotmail dot com>
comment from Pierre Schweitzer
In rev 27054, ekohl reduced access right when creating partition list (when
opening "disk"). To work, usetup needs more rights (like reading contents). So
this patch adds the missing right
See issue #2293 for more details.

svn path=/trunk/; revision=27064
2007-06-07 21:33:17 +00:00
Dmitry Gorbachev
fb92e1fc3d Improve debug message.
svn path=/trunk/; revision=27063
2007-06-07 21:19:57 +00:00
Magnus Olsen
48d33901ec implement VideoPortFreeCommonBuffer,
implement VideoPortPutDmaAdapter use halPutDmaAdapter for this

we already have all code for it, it was simple write a warper for both so they works, both api need be tested hard.

svn path=/trunk/; revision=27062
2007-06-07 21:13:06 +00:00
Magnus Olsen
69be2950f9 export HalPutDmaAdapter so we can use it for VideoPortPutDmaAdapter
svn path=/trunk/; revision=27061
2007-06-07 21:11:58 +00:00
Magnus Olsen
23a0686be6 fixing bug in reactos GetFreq code for dx
svn path=/trunk/; revision=27060
2007-06-07 19:05:28 +00:00
Magnus Olsen
a5b4c11371 adding a big freq test
svn path=/trunk/; revision=27059
2007-06-07 19:03:11 +00:00
Eric Kohl
e86c5c5ce0 - Fix indentation and coding style.
- Fix the Unicode-only code.
- No code changes.

svn path=/trunk/; revision=27055
2007-06-07 16:18:38 +00:00
Eric Kohl
f807c0daab Fix access rights.
svn path=/trunk/; revision=27054
2007-06-07 16:08:08 +00:00
Eric Kohl
7f2ba4663b Fix object attributes
svn path=/trunk/; revision=27053
2007-06-07 16:05:12 +00:00
Magnus Olsen
94e835008d comment out line 2028 it seam bit wrong and it crash the win32k.
svn path=/trunk/; revision=27052
2007-06-07 14:03:10 +00:00
Maarten Bosma
06ea7c3758 sorry. fix it for real now.
svn path=/trunk/; revision=27051
2007-06-07 13:23:44 +00:00
Maarten Bosma
3db527c9d9 Fix little mistake
svn path=/trunk/; revision=27050
2007-06-07 13:19:56 +00:00
Magnus Olsen
eafaa0751c adding get FourCC working now
svn path=/trunk/; revision=27049
2007-06-07 13:12:55 +00:00
Magnus Olsen
a4e1dbf9bd cleanup Create_DirectDraw after all debuging and thx w3seek thuse advice. I was getting insaine why malloc fail.
svn path=/trunk/; revision=27048
2007-06-07 13:02:10 +00:00
Magnus Olsen
bfccdbeac1 wrong size of memory was alloc in startup.c
svn path=/trunk/; revision=27047
2007-06-07 12:56:13 +00:00
Magnus Olsen
01309cc881 no crash in ddraw what I known about for moment
svn path=/trunk/; revision=27046
2007-06-07 12:50:11 +00:00
Magnus Olsen
79583495ee fixing another crash for -O3
svn path=/trunk/; revision=27045
2007-06-07 12:39:42 +00:00
Magnus Olsen
259286f6fc Fixed one weird crash, please type make draw_clean 3 times so it gurated be clean in u tree, now build the ddraw,
tested compile with -O and no crash have been show 

svn path=/trunk/; revision=27044
2007-06-07 12:20:13 +00:00
Maarten Bosma
d4c1add2a8 Some Clipper Code.
svn path=/trunk/; revision=27043
2007-06-07 11:49:43 +00:00
Magnus Olsen
6a3725e689 commit SFV_CREATE at w3seek requet
svn path=/trunk/; revision=27042
2007-06-07 11:46:33 +00:00
Magnus Olsen
3246f9583b Cleanup debug msg allot
svn path=/trunk/; revision=27041
2007-06-07 11:28:23 +00:00
Dmitry Gorbachev
6ed41fe051 Do not free memory twice.
svn path=/trunk/; revision=27039
2007-06-07 11:15:22 +00:00
Magnus Olsen
fdf97aa483 remove seh on malloc
svn path=/trunk/; revision=27038
2007-06-07 10:33:04 +00:00
Magnus Olsen
a0230af6f5 fixing a stuoied bug, when malloc fail, gcc genrated code will crash.
This fix will provent ddraw alloc crash.   

svn path=/trunk/; revision=27037
2007-06-07 09:43:50 +00:00
Magnus Olsen
8d0428bfbd adding more seh protection to the code
svn path=/trunk/; revision=27036
2007-06-07 08:46:33 +00:00
Magnus Olsen
958b55cf2c fixing smaller bugs in cleanup so it remove memory that we alloc, adding more seh around some ore api
svn path=/trunk/; revision=27035
2007-06-07 02:23:54 +00:00
Magnus Olsen
201a7b042d more seh fixed
svn path=/trunk/; revision=27034
2007-06-07 01:53:44 +00:00
Dmitry Gorbachev
32740d717d Fix my previous "fix", which is even worse then original.
svn path=/trunk/; revision=27033
2007-06-07 01:34:35 +00:00
Magnus Olsen
8c5a2928ed adding more seh, everthing need warp around seh in ddraw.
svn path=/trunk/; revision=27032
2007-06-07 01:27:38 +00:00
Magnus Olsen
9ad6d62b37 Fixing another bugm, leaking memory, it will when we trying alloc memory for FourCC, this bug fix it and I manger come bit futher with my werid crash
svn path=/trunk/; revision=27031
2007-06-07 01:12:42 +00:00
Magnus Olsen
0c0bb0a0f4 Fixing some bugs
svn path=/trunk/; revision=27030
2007-06-07 01:00:52 +00:00
Dmitry Gorbachev
73f5eae1ad Fix stack corruption bug.
svn path=/trunk/; revision=27029
2007-06-06 22:44:33 +00:00
Dmitry Gorbachev
822527aaa7 Check for ERROR_PIPE_CONNECTED.
svn path=/trunk/; revision=27024
2007-06-06 11:44:20 +00:00
Timo Kreuzer
cf7825f156 - partly implement GetFontResourceInfoW
- Remove GetFontResourceInfo stub

svn path=/trunk/; revision=27023
2007-06-06 11:15:27 +00:00
Timo Kreuzer
c77aba633c - IntGdiAddFontResource: Add the filename to the font entry
- implement NtGdiGetFontResourceInfoInternalW and add it to the syscall table

svn path=/trunk/; revision=27022
2007-06-06 11:00:53 +00:00
Magnus Olsen
1ac461d40d implement VideoPortAllocateContiguousMemory after msdn documations (need be tested) see msdn http://msdn2.microsoft.com/en-us/library/aa479107.aspx
remove assert on VideoPortReleaseDeviceLock and VideoPortAcquireDeviceLock
it should not be a assernt if any of thuse api  success

svn path=/trunk/; revision=27021
2007-06-05 22:51:44 +00:00
Dmitry Gorbachev
ffb658d9bb Fix keyboard layout name. See www.reactos.org/forum/viewtopic.php?t=4004
svn path=/trunk/; revision=27019
2007-06-05 21:59:46 +00:00
Dmitry Gorbachev
684273bc12 Fix issue #2284.
svn path=/trunk/; revision=27016
2007-06-05 21:26:38 +00:00
Dmitry Gorbachev
0d8c6fe483 Update Polish translation. Add French translation by Pierre Schweitzer.
Reorganize resource files. (Bugs 2283 & 2284).

svn path=/trunk/; revision=27012
2007-06-05 19:18:12 +00:00
Magnus Olsen
785873953b delete a unuse rc file
thx irc:HeisSpiter notice this 

svn path=/trunk/; revision=27010
2007-06-05 17:29:30 +00:00
Dmitry Gorbachev
319d53aa6b French translations. Bug #2282.
svn path=/trunk/; revision=27009
2007-06-05 16:01:58 +00:00
Hervé Poussineau
f5d19e8198 It doesn't seem required to be called once with a NULL PDO.
Force this call, as it is where we initialize the keyboard/mouse

svn path=/trunk/; revision=27001
2007-06-04 20:22:07 +00:00
Hervé Poussineau
5f83cc2f85 Don't assume that a device without driver doesn't need any driver. It can simply not be installed
Better debugging messages

svn path=/trunk/; revision=27000
2007-06-04 19:32:28 +00:00
Hervé Poussineau
5423d567cc i8042prt is not a pnp driver yet
svn path=/trunk/; revision=26999
2007-06-04 19:32:19 +00:00
Hervé Poussineau
f859d4a99a Add missing registry value
svn path=/trunk/; revision=26998
2007-06-04 19:32:10 +00:00
Dmitry Gorbachev
8c1718142f Update Polish translation. Bug #2280.
svn path=/trunk/; revision=26997
2007-06-04 19:04:03 +00:00
Aleksey Bragin
cd085ee581 - Revert 26995 since it breaks booting.
svn path=/trunk/; revision=26996
2007-06-04 18:59:08 +00:00
Sylvain Petreolle
f7efcc22cc Install ISA PNP bus driver
svn path=/trunk/; revision=26995
2007-06-04 16:34:19 +00:00
Aleksey Bragin
fc0bcf57b3 - Correctly fill FullDllName for modules loaded by the bootloader. This prevents loading them again later by MmLoadSystemImage().
svn path=/trunk/; revision=26994
2007-06-04 15:32:35 +00:00
Hervé Poussineau
cc07f4e2d7 Reapply r18676/r18677 (dispatch.S part) on w3seek advice.
Fixes vmwinst.exe crash on 2nd stage in qemu

svn path=/trunk/; revision=26993
2007-06-04 14:49:28 +00:00
Hervé Poussineau
2a9396bf7f Add a bus number to the PCI resource descriptor
svn path=/trunk/; revision=26992
2007-06-04 10:01:29 +00:00
Hervé Poussineau
1c8c62aa42 Copy usetup and welcome apps to the right cdrom directory
svn path=/trunk/; revision=26991
2007-06-04 09:44:46 +00:00
Hervé Poussineau
6b63d35926 Use a tag when allocating/freeing some memory
svn path=/trunk/; revision=26990
2007-06-04 09:25:04 +00:00
Hervé Poussineau
e4d5c105d9 Install ISA PNP bus driver
Add NO_DRV.HW section, as it is needed by some 3rd party drivers

svn path=/trunk/; revision=26989
2007-06-04 09:17:06 +00:00
Hervé Poussineau
5c102f92f4 Rewrite pnproot:
- Don't create multiple devices with the same pnp id (Root\UNKNOWN\0000)
- Use RtlQueryRegistryValues to read multiple registry values
- Keep devices list in memory instead of always reading the registry
- Support IRP_MN_QUERY_DEVICE_TEXT/IRP_MN_QUERY_ID/IRP_MN_QUERY_BUS_INFORMATION/IRP_MN_FILTER_RESOURCE_REQUIREMENTS
- Better error handling
- ...

svn path=/trunk/; revision=26988
2007-06-04 09:15:04 +00:00
Hervé Poussineau
67c8317973 Commit a patch I have in my tree since 1 year. This may be related to bug 2238.
svn path=/trunk/; revision=26987
2007-06-04 09:02:12 +00:00
Hervé Poussineau
01d55fc116 Do not force user to enter an admin password
This decision needs to be reconsidered once ReactOS has a better security (lsass...)

svn path=/trunk/; revision=26986
2007-06-04 08:23:45 +00:00
Magnus Olsen
ef546be459 irc : Myrria (from linux xbox project) desc a bug in KiUserExceptionDispatcher and how to fix it.
See issue #2279 for more details.

svn path=/trunk/; revision=26985
2007-06-04 05:50:39 +00:00
Dmitry Gorbachev
eb63aa49cc - Remove corresponding kernel hack.
svn path=/trunk/; revision=26984
2007-06-03 22:12:28 +00:00
Dmitry Gorbachev
caa2fdd5fa - Fix r26980 hack.
svn path=/trunk/; revision=26983
2007-06-03 22:12:14 +00:00
Magnus Olsen
1d38ecfc6a small bugfix from alex ion*, he postet on irc channel and Haos posted the fix into bugzila.
"NullString.Length = sizeof(WCHAR); otherwise SMSS's environment strings are all messed"


See issue #2277 for more details.

svn path=/trunk/; revision=26981
2007-06-03 19:57:41 +00:00
Eric Kohl
d9314287a7 Redirect registry keys from 'CurrentControlSet' to 'ControlSet001' without using registry links.
svn path=/trunk/; revision=26980
2007-06-03 19:01:58 +00:00
Magnus Olsen
d6f3effcff audit vga driver, it is clean, writen by varius reactos devlopers from scartch it still contain tons with bugs and unfinish code.
svn path=/trunk/; revision=26978
2007-06-03 16:45:34 +00:00
Dmitry Gorbachev
6fb64d3bfc Commit patch #1504 from Paolo Devoti (bug #2276).
svn path=/trunk/; revision=26975
2007-06-03 14:35:08 +00:00
Ged Murphy
5f7db15852 - Don't return directly from PSEH. Same error, same dev, different day.
- Thanks to pigglesworth for noticing

svn path=/trunk/; revision=26973
2007-06-03 13:06:32 +00:00
Eric Kohl
f1aa2269d5 - Removed unused dialog resource and MSVC rubbish.
- Use a more descriptive id for the icon.

svn path=/trunk/; revision=26972
2007-06-03 11:58:45 +00:00
Dmitry Gorbachev
244e1cd74b Solitaire patch by Pierre Schweitzer (bug #2275).
svn path=/trunk/; revision=26971
2007-06-02 21:47:06 +00:00
Dmitry Gorbachev
d6d5cf7f99 - Fix LiveCD boot error.
- Remove MPW thread hack.

svn path=/trunk/; revision=26970
2007-06-02 21:20:12 +00:00
Eric Kohl
337e46a378 Add options dialog.
svn path=/trunk/; revision=26969
2007-06-02 16:32:19 +00:00
Magnus Olsen
ac282bf4e4 commited bugfix if we got if (my) dxallocfree and so on, also fixed the alloc macro it always zero the memory buffer
svn path=/trunk/; revision=26968
2007-06-02 15:09:52 +00:00
Magnus Olsen
ef4d675d1e sorry startup.c are bit messy but I change heapalloc to malloc and guess what all our weird problem are gone.
svn path=/trunk/; revision=26967
2007-06-02 14:42:43 +00:00
Magnus Olsen
8c5febf184 Fixing Getavil memory
svn path=/trunk/; revision=26966
2007-06-02 14:01:43 +00:00
Magnus Olsen
c5832b0f71 protect DirectDrawCreateEx with seh no more crash
svn path=/trunk/; revision=26965
2007-06-02 13:26:33 +00:00
Dmitry Gorbachev
576e0fdc97 Update Italian translation (Bug #2273).
svn path=/trunk/; revision=26959
2007-06-01 16:18:37 +00:00
Dmitry Gorbachev
2d9779cd5f Use DbgPrint() to print confusing debug message. (Bug #2224).
svn path=/trunk/; revision=26958
2007-06-01 16:09:23 +00:00
Magnus Olsen
4fc04f9002 fixed hardcode string in syssetup by Pierre Schweitzer (email : heis_spiter at hotmail dot com)
See issue #2247 for more details.

svn path=/trunk/; revision=26954
2007-05-31 20:52:44 +00:00
Aleksey Bragin
977e1bb11b Revert last commit, asked by Magnus Olsen.
svn path=/trunk/; revision=26953
2007-05-31 18:42:28 +00:00
Magnus Olsen
26e9b0e0e7 fixing LONG be typdef as int32_t
fixing ULONG be typdef as uint32_t

svn path=/trunk/; revision=26952
2007-05-31 18:10:14 +00:00
Dmitry Gorbachev
fde1a5a7fd - Add Finnish keyboard layout to CD.
svn path=/trunk/; revision=26950
2007-05-31 10:29:24 +00:00
Dmitry Gorbachev
26e9956f86 - Finnish keyboard layout by Kaj Kaloinen (kkaloine /at/ gmail /dot/ com).
With certain modifications. Bugzilla bug #2270.

svn path=/trunk/; revision=26949
2007-05-31 10:28:55 +00:00
Magnus Olsen
7b5da8f737 add seh around Main_DirectDraw_AddRef this prevent any crash it can cause
svn path=/trunk/; revision=26946
2007-05-30 18:46:59 +00:00
Magnus Olsen
07306934a8 implement Main_DirectDraw_Compact with same behvoir as ms DirectDraw_Compact does
in msdn it say it is unimplement and always return DD_OK, but the true is it can 
return DDERR_NOEXCLUSIVEMODE when we have a exlusive mode set. 

svn path=/trunk/; revision=26945
2007-05-30 18:26:56 +00:00
Ged Murphy
e8318db301 fix typo
svn path=/trunk/; revision=26944
2007-05-30 13:53:35 +00:00
Dmitry Gorbachev
5eb9a85a9d Burmese keyboard layout (2/2)
svn path=/trunk/; revision=26943
2007-05-30 12:21:10 +00:00
Dmitry Gorbachev
43b953c995 Burmese keyboard layout (1/2)
svn path=/trunk/; revision=26942
2007-05-30 12:20:44 +00:00
Dmitry Gorbachev
eb8e07f1a2 - Do not look outside VkToWcharTable[].
- Check for WCH_NONE.

svn path=/trunk/; revision=26940
2007-05-30 09:35:41 +00:00
Ged Murphy
90342114af - knock loop back to 0 as it's a shared function. Thanks to Colin for noticing this.
- fix a prototype and call it correctly

svn path=/trunk/; revision=26939
2007-05-30 07:11:22 +00:00
Hervé Poussineau
9c24c8e35e Add a first network adapter at index 0000, as real ones start at index 0001
See issue #2034 for more details.

svn path=/trunk/; revision=26938
2007-05-29 16:45:43 +00:00
Dmitry Gorbachev
d36da2336c Fix bug #2267.
svn path=/trunk/; revision=26937
2007-05-29 13:36:03 +00:00
Johannes Anderwald
3804dd3952 - clean up GuiHandleSysMenuCommand a bit
svn path=/trunk/; revision=26935
2007-05-29 11:23:31 +00:00
Aleksey Bragin
671ab7b5b1 - Give "RAW" filesystem driver a name which it deserves.
svn path=/trunk/; revision=26934
2007-05-28 21:34:49 +00:00
Magnus Olsen
d5cee88414 finish Main_DirectDraw_CreateSurface4 and Main_DirectDraw_CreateSurface
left todo is Internal_CreateSurface

svn path=/trunk/; revision=26933
2007-05-28 17:53:02 +00:00
Dmitry Gorbachev
6a80de90e0 - Use new resource file names.
- Uncomment NLS settings for Korean.

svn path=/trunk/; revision=26932
2007-05-28 15:55:38 +00:00
Dmitry Gorbachev
7543840918 - Fix ISO 639-1 language code.
svn path=/trunk/; revision=26931
2007-05-28 15:55:13 +00:00
Dmitry Gorbachev
98eb0fb639 - Add NLS file for Korean (from WINE).
svn path=/trunk/; revision=26930
2007-05-28 15:54:14 +00:00
Timo Kreuzer
cf5b4c7e99 undocumented behavior of LoadStringW: If nBufferMax is 0, LoadStringW will copy a pointer to the in-memory image of the string to the specified buffer and return the length of the string in WCHARs.
svn path=/trunk/; revision=26929
2007-05-28 00:35:55 +00:00
Timo Kreuzer
a009b642f6 - remove unused DrawPreview function
- small code reformat

svn path=/trunk/; revision=26928
2007-05-27 22:34:20 +00:00
James Tabor
d8af591e49 Fix NtUserLoadKeyboardLayoutEx prototype:
- Current prototype breaks compatibility.
- This prototype was researched in clean room techniques.
- Any questions, please email me, I will write a book to explain these techniques.

svn path=/trunk/; revision=26927
2007-05-27 20:47:12 +00:00
Dmitry Gorbachev
eaf620126f - Add Hebrew keyboard layout to CD.
- Fix font substitutes: DejaVu Vera -> DejaVu.

svn path=/trunk/; revision=26926
2007-05-27 18:59:00 +00:00
Eric Kohl
461dca557f Move language-specific files to the lang folder.
svn path=/trunk/; revision=26925
2007-05-27 15:37:33 +00:00
Eric Kohl
77286996f0 - Add "Clear display" command.
- Change menu item prefix to IDM.

svn path=/trunk/; revision=26924
2007-05-27 15:27:40 +00:00
Eric Kohl
a9a7a6ef22 Remove outdated email address.
svn path=/trunk/; revision=26923
2007-05-27 14:50:12 +00:00
Magnus Olsen
31942c7ebe adding Vmrender.idl compatible with ms dxsdk 2004 dec
svn path=/trunk/; revision=26922
2007-05-27 13:27:51 +00:00
Timo Kreuzer
e4925bf539 - fix a region leak
- unlock bitmap

svn path=/trunk/; revision=26921
2007-05-27 13:21:44 +00:00
Timo Kreuzer
6e719efbe9 fix region leak
svn path=/trunk/; revision=26920
2007-05-27 12:48:45 +00:00
Magnus Olsen
b476f82321 adding ddyngraph.idl compatible with ms dxsdk 2004 dec
svn path=/trunk/; revision=26919
2007-05-27 12:40:26 +00:00
Magnus Olsen
b0bc996f70 adding dmodshow.idl compatible with ms dxsdk 2004 dec
svn path=/trunk/; revision=26918
2007-05-27 11:38:03 +00:00
Magnus Olsen
f2bbc0c14a adding tvratings.idl compatible with ms dxsdk 2004 dec
svn path=/trunk/; revision=26917
2007-05-27 11:31:37 +00:00
Magnus Olsen
9ad0275820 adding regbag.idl compatible with ms dxsdk 2004 dec
svn path=/trunk/; revision=26914
2007-05-27 11:04:46 +00:00
Magnus Olsen
ca9b163cdb adding bdatypes.h compatible with ms dxsdk 2004 dec
svn path=/trunk/; revision=26913
2007-05-27 10:56:05 +00:00
Christoph von Wittich
a94fcd5985 64-Bit Fixes for cabman (patch from Colin Finck)
See issue #2236 for more details.

svn path=/trunk/; revision=26912
2007-05-27 10:26:43 +00:00
Christoph von Wittich
cdda19fd20 added an empty intrin_x86_64.h
svn path=/trunk/; revision=26911
2007-05-27 10:12:19 +00:00
Magnus Olsen
cd9120322a add correct mediaoobj.idl compatible with ms dxsdk 2004 dec
add medoaram.idl compatible with ms dxsdk 2004 dec

svn path=/trunk/; revision=26908
2007-05-27 09:34:59 +00:00
Eric Kohl
c6c58b7697 Calculate L2 cache size for AMD CPUs.
svn path=/trunk/; revision=26907
2007-05-26 16:37:11 +00:00
Magnus Olsen
15e6e8404d adding mixerocx.idl, vidcap.idl, videoacc.idl compatible with ms dxsdk 2004 dec
svn path=/trunk/; revision=26906
2007-05-26 16:16:01 +00:00
Magnus Olsen
d9221af45a adding correct amstream.idl , compatible with ms dxsdk 2004 dec
remove amvideo.idl this idl does not exists as idl in ms dxsdk only as amvideo.h 

svn path=/trunk/; revision=26905
2007-05-26 15:41:51 +00:00
Johannes Anderwald
c714ded2a4 - set svn:eol-style native
svn path=/trunk/; revision=26904
2007-05-26 15:14:07 +00:00
Magnus Olsen
670e9db84e adding austream.idl and ddstream.idl comptaible with ms dxsdk 2004 dec
svn path=/trunk/; revision=26903
2007-05-26 11:51:45 +00:00
Magnus Olsen
13f9ebd354 forget adding a header hack, for widl
svn path=/trunk/; revision=26902
2007-05-26 11:26:23 +00:00
Magnus Olsen
42b522ea77 adding correct mmstream.idl
svn path=/trunk/; revision=26901
2007-05-26 11:22:58 +00:00
Magnus Olsen
a74a1a7af1 adding dshowasf.idl did miss this file is a idl compatible wih ms dxsdk 2004 dec
svn path=/trunk/; revision=26900
2007-05-26 09:48:35 +00:00
Magnus Olsen
ea4a1dfdd0 adding two idl file 100% compatible with ms dxsdk 2004 dec
This two idl can not yet be auto genrated in reactos for varius reason. 

svn path=/trunk/; revision=26899
2007-05-26 09:28:26 +00:00
Magnus Olsen
780533a258 Created folder remotely
This folder will contain dxsdk idl files

svn path=/trunk/; revision=26898
2007-05-26 08:36:56 +00:00
Magnus Olsen
4a0055bc36 Wrote two new header this morning compatible with dxsdk 2004 dec release.
svn path=/trunk/; revision=26897
2007-05-26 07:03:52 +00:00
Magnus Olsen
2f6b952a84 Wrote one new header this night compatible with dxsdk 2004 dec release.
svn path=/trunk/; revision=26896
2007-05-25 21:51:35 +00:00
Dmitry Gorbachev
997f872497 Uncomment Japanese, as it is supported already.
svn path=/trunk/; revision=26895
2007-05-25 18:25:06 +00:00
Dmitry Gorbachev
b73dbd37d5 Borrow Japanese NLS file from WINE project.
svn path=/trunk/; revision=26894
2007-05-25 18:24:55 +00:00
Dmitry Gorbachev
0f337a24cb Do not free the string twice.
svn path=/trunk/; revision=26893
2007-05-25 17:10:11 +00:00
Aleksey Bragin
5f53b128c9 - Remove a hack from IopCreateDriver(), no boot hang happens in VMWare without it anymore.
- Uncomment a ExFreePool() in a Delete routine for Driver object type, should prevent a possible memory leak (was commented due to the previous hack).
- Added a small piece of a new logic into IopCreateDriver(). In ReactOS it's being called two times almost immediately, which results in a non-unique driver object name, since KeTickCount is the same. In order to prevent this situation a loop is added, having 100 iterations as max.

svn path=/trunk/; revision=26891
2007-05-25 13:52:58 +00:00
Magnus Olsen
e0d8bd0a65 switch to dxsdk 2 of 2 step
This commit fix the build again

svn path=/trunk/; revision=26889
2007-05-25 11:19:11 +00:00
Magnus Olsen
5fcac65ce9 switch to dxsdk 1 of 2 step
This commit break the build

svn path=/trunk/; revision=26888
2007-05-25 11:18:13 +00:00
Magnus Olsen
d7e4c52534 fixing two typo
svn path=/trunk/; revision=26887
2007-05-25 10:51:26 +00:00
Magnus Olsen
ec5f57ddaf remove a dprint that is not lonnger need it
svn path=/trunk/; revision=26886
2007-05-25 10:07:18 +00:00
Magnus Olsen
45333a49c3 Wrote one new header this morning compatible with dxsdk 2004 dec release.
svn path=/trunk/; revision=26885
2007-05-25 10:02:08 +00:00
Magnus Olsen
e7b2733b20 Wrote one new header this morning compatible with dxsdk 2004 dec release.
svn path=/trunk/; revision=26884
2007-05-25 09:32:37 +00:00
Timo Kreuzer
2b0336eaf8 - initialize display class with "Ms Shell Dlg"
- don't show display window until font is set
- use negative value for font size (patch by roytam1)

See issue #2260 for more details.

svn path=/trunk/; revision=26883
2007-05-25 07:48:17 +00:00
Aleksey Bragin
86ca0a4eba - ACPI was intentionally disabled. Reverting 26870, thus unregressing VMWare video driver installation (since PCI bus is now again being enumerated).
svn path=/trunk/; revision=26882
2007-05-25 07:46:48 +00:00
Aleksey Bragin
03356a723c - Fix wrong access-rights when referencing the object (fixes NtEnumerateKey() API).
- Add DPRINTs for problems with objects referencing.

svn path=/trunk/; revision=26880
2007-05-24 13:23:33 +00:00
Aleksey Bragin
2691c6bc92 - Add tracing DPRINTs to all public APIs.
svn path=/trunk/; revision=26878
2007-05-24 08:59:34 +00:00
James Tabor
9f2630ccce - Fixed arithmetic semantics. Making it more Windows compatible.
- This example work now.
double F2F(PFLOATOBJ f)
{
 if(SIGN(f->ul1)) // negate mant
   return (double) -(-f->ul1 * pow(2,(double)f->ul2-32));
 else return (double) f->ul1 * pow(2,(double)f->ul2-32);
}

svn path=/trunk/; revision=26877
2007-05-24 01:39:31 +00:00
Hervé Poussineau
8b7099f2cd Specify W suffix when possible
Don't allocate unneeded memory in SetupDiCreateDeviceInfoListExW
Replace strings by array of WCHARs

svn path=/trunk/; revision=26876
2007-05-23 21:40:46 +00:00
Magnus Olsen
f1a1a96940 Fixing CreateDirectDraw crash
svn path=/trunk/; revision=26873
2007-05-23 19:48:54 +00:00
Magnus Olsen
e9753c14a8 comment out GetDOURCC data from DDHALINFO for it seam some strang crash.
svn path=/trunk/; revision=26872
2007-05-23 19:27:29 +00:00
Timo Kreuzer
96b50f2d59 - make fontview look closer to MS fontview, patch by roytam1, modified by me.
- Create fonts only once
- Remove possibility to get page height without drawing


See issue #2260 for more details.

svn path=/trunk/; revision=26871
2007-05-23 00:25:31 +00:00
Ged Murphy
5cecf17b6f re-enable ACPI
svn path=/trunk/; revision=26870
2007-05-22 19:33:20 +00:00
Maarten Bosma
a898075895 Fix two oversights in GetDisplayMode.
svn path=/trunk/; revision=26869
2007-05-22 19:30:25 +00:00
Maarten Bosma
f31403fe80 Change EnumDisplayModes to use EnumDisplaySettingsEx because Nvidia does not set lpModeInfo in DDHALINFO.
svn path=/trunk/; revision=26868
2007-05-22 12:39:59 +00:00
Ged Murphy
6545618504 remove unnecessary NDEBUG definitions. freeldr has it's own debugging system.
svn path=/trunk/; revision=26867
2007-05-22 11:00:00 +00:00
Maarten Bosma
5dd4476d06 Fix another typo.
svn path=/trunk/; revision=26866
2007-05-22 10:58:27 +00:00
Maarten Bosma
fb06e53fc5 Fix a typo and improve a test.
svn path=/trunk/; revision=26865
2007-05-22 10:57:53 +00:00
Magnus Olsen
3355adf732 Fixing another memory crash bug this time for GetFourCCCodes
svn path=/trunk/; revision=26864
2007-05-22 10:46:17 +00:00
Hervé Poussineau
2a62b56fd9 Add installation path for VMware 6.0
svn path=/trunk/; revision=26863
2007-05-22 10:40:57 +00:00
Ged Murphy
f18c692bc2 turn debugging off
svn path=/trunk/; revision=26862
2007-05-22 10:17:07 +00:00
Ged Murphy
41624f4f99 - fix the release build for Colin.
- clean up formatting of a file I was playing with.

svn path=/trunk/; revision=26861
2007-05-21 23:12:16 +00:00
Magnus Olsen
d746c66d94 Fixing another memory crash bug this time for GetFourCCCodes
svn path=/trunk/; revision=26860
2007-05-21 20:51:55 +00:00
Magnus Olsen
3893f07116 hacking so we manger only create one directdraw interface, the linked code for create one is offline.
svn path=/trunk/; revision=26859
2007-05-21 20:25:23 +00:00
Ged Murphy
fe490d6ce0 revert 26844 to fall back in line with widl
svn path=/trunk/; revision=26858
2007-05-21 19:48:47 +00:00
Magnus Olsen
298cd5e094 Thx DrFred notice I did take wrong struct at alloc, I also comment up the code bit.
svn path=/trunk/; revision=26857
2007-05-21 18:49:28 +00:00
Eric Kohl
30740cbe3d Revert latest update due to unexpected bug in compiled files.
svn path=/trunk/; revision=26856
2007-05-21 18:28:00 +00:00
Maarten Bosma
6891a17fe5 MIN => min
svn path=/trunk/; revision=26855
2007-05-21 18:25:17 +00:00
Maarten Bosma
813da313d4 - Also leave critical section if lpNumCodes is 0
- make sure we do not copy too much - thanks to Hervé
- check if window is valid 

svn path=/trunk/; revision=26854
2007-05-21 17:18:41 +00:00
Magnus Olsen
327cd7852d fixing thread safe in GetFourCCCodes
svn path=/trunk/; revision=26853
2007-05-21 16:23:43 +00:00
Maarten Bosma
1c247edcf4 Implement IDirectDraw7::GetFourCCCodes
svn path=/trunk/; revision=26852
2007-05-21 15:47:39 +00:00
Magnus Olsen
0dd6b57e78 Fixing minors bugs
1. The linking interface was use when we req no linking interface.
2. The no linking was use when we req linking interface
3. cleanup the linking interface code so it getting simplire, like reuse same dx  handler and other stuff. (have not check if ms ddraw resue it or not)

svn path=/trunk/; revision=26851
2007-05-21 15:44:27 +00:00
Maarten Bosma
16abbb4536 Test for IDirectDraw7::GetFourCCCodes
svn path=/trunk/; revision=26850
2007-05-21 15:24:57 +00:00
Maarten Bosma
ded6f889ce Implement IDirectDraw7::EnumDisplayModes and IDirectDraw7::RestoreDisplayMode
svn path=/trunk/; revision=26849
2007-05-21 12:01:07 +00:00
Maarten Bosma
8bbbeb08ba - Implement IDirectDraw7::GetMonitorFrequency, GetDisplayMode
- Outsource display mode related APIs into own file
- Some formatting and spelling fixes

svn path=/trunk/; revision=26848
2007-05-21 10:11:10 +00:00
Aleksey Bragin
f52f59db1d - Make 2 disk read error messages different, so it's possible to see what fails more exactly.
svn path=/trunk/; revision=26847
2007-05-21 08:46:18 +00:00
Maarten Bosma
6a11c13aa1 Sorry, I forgot this one.
svn path=/trunk/; revision=26846
2007-05-20 22:56:32 +00:00
Maarten Bosma
d49bca10c2 Implement IDirectDraw7::GetAvailableVidMem.
svn path=/trunk/; revision=26845
2007-05-20 22:48:19 +00:00
Aleksey Bragin
cc557fcbd2 - Fix WebBrowser struct declaration to conform with a new WIDL.
svn path=/trunk/; revision=26844
2007-05-20 11:29:22 +00:00
Eric Kohl
486714fd5a Update WIDL to rev 20070519.
svn path=/trunk/; revision=26843
2007-05-19 23:02:35 +00:00
Hervé Poussineau
5cb63e5d4a Another try to fix release builds to please Colin_Finck...
svn path=/trunk/; revision=26842
2007-05-19 20:45:17 +00:00
Dmitry Gorbachev
413eb57968 Do not use paged pool at page fault time; see bug report #2252.
svn path=/trunk/; revision=26841
2007-05-19 15:13:37 +00:00
Timo Kreuzer
87c5734a34 fix drawing on resize
svn path=/trunk/; revision=26840
2007-05-19 14:23:00 +00:00
Sebastian Gasiorek
d6c16357c0 - add support for ETO_GLYPH_INDEX in NtGdiExtTextOut.
(fixes character shift problem in QT apps) see bug #975

svn path=/trunk/; revision=26839
2007-05-19 13:55:23 +00:00
Eric Kohl
9341afafbf Unicode.nls contains the Unicode case conversion tables. It does _not_ contain codepage tables.
svn path=/trunk/; revision=26838
2007-05-19 10:40:59 +00:00
Dmitry Gorbachev
f13108e171 - Add Chinese (PRC) and Armenian NLS settings.
svn path=/trunk/; revision=26837
2007-05-19 10:11:59 +00:00
Dmitry Gorbachev
667c44e8f0 - Handle DBCS codepages.
- Add Armenian locale definitions from Wine.

svn path=/trunk/; revision=26836
2007-05-19 10:11:48 +00:00
Dmitry Gorbachev
43b368ee01 - Add some code to deal with multibyte code pages.
svn path=/trunk/; revision=26835
2007-05-19 10:11:22 +00:00
Timo Kreuzer
61d291959e implement a basic fontview.exe. It doesn't work on ROS atm due to missing implementation of GetFontResourceInfoW(), but works on XP.
svn path=/trunk/; revision=26834
2007-05-19 01:33:27 +00:00
Dmitry Gorbachev
921f00b600 Fix German translation. Bug #2258.
svn path=/trunk/; revision=26833
2007-05-18 22:01:13 +00:00
Hervé Poussineau
d2eb919808 Check that we retrieved a value data before marking it as dirty
This is related to bug 1998

svn path=/trunk/; revision=26830
2007-05-18 12:41:16 +00:00
Magnus Olsen
1be0ddc3d5 fix a comment in it for swedish langues
svn path=/trunk/; revision=26829
2007-05-17 20:14:21 +00:00
Magnus Olsen
6b761fbc8e Audlt locale_rc.rc clean it is from wine see the comment in the file
svn path=/trunk/; revision=26828
2007-05-17 20:13:30 +00:00
Magnus Olsen
3e37ffb5a4 Fixing a small bug in sve.nls
svn path=/trunk/; revision=26827
2007-05-17 20:10:16 +00:00
Magnus Olsen
c6ae22c636 Fixing right sublang on SE and PL rc files, some have change the sublang to wrong one.
svn path=/trunk/; revision=26826
2007-05-17 20:01:02 +00:00
Sylvain Petreolle
860ff42e86 freebsd/linux/other unixes build fixes
svn path=/trunk/; revision=26824
2007-05-17 18:46:31 +00:00
Eric Kohl
15242938e7 - Update WPP and fix the resulting bugs because wpp_find_include has changed.
- Add notes to wpp.mak about how to build lex.yy.c, ppy.tab.c and ppy.tab.h manually.

svn path=/trunk/; revision=26822
2007-05-17 14:47:37 +00:00
Magnus Olsen
0935620f31 optimizing atan and log10, do not use frame pointer, use the stack pointer direcly
svn path=/trunk/; revision=26820
2007-05-17 10:48:00 +00:00
Alex Ionescu
70e2b462a5 - Implement NtDeleteKey as a simpler wrapper around CmDeleteKey.
- Add cmkeydel.c to handle key deletion. Will proably move to cmkcbncb.c later. Implemented CmpMarkKeyDirty, CmpFreeKeyBody, CmpFreeKeyByCell.
- Implement CmpMarkIndexDirty, CmpRemoveSubKey in cmindex.c.
- Implement CmDeleteKey (which uses CmpFreeKeyByCell for all the work).
- Remove CmiRemoveKeyFromList, CmiRemoveSubKey, CmiRemoveKeyFromHashTable, CmiSaveTempHive.

svn path=/trunk/; revision=26817
2007-05-17 00:27:14 +00:00
Magnus Olsen
b527796afa fixing some smaller bugs found by the regress test
svn path=/trunk/; revision=26816
2007-05-16 22:58:25 +00:00
Maarten Bosma
1ddfd23075 GetAvailableVidMem-Test
svn path=/trunk/; revision=26815
2007-05-16 22:19:07 +00:00
Magnus Olsen
ea1eae3dd9 Fixing a msvc7 comping issue
svn path=/trunk/; revision=26814
2007-05-16 21:03:02 +00:00
Maarten Bosma
316f38cf0f fix typo.
svn path=/trunk/; revision=26813
2007-05-16 20:59:01 +00:00
Maarten Bosma
2522ca071a - Comment out tests which works does not work for me under xp.
- Release returns ref count and no HRESULT (my bad).
 

svn path=/trunk/; revision=26812
2007-05-16 20:54:20 +00:00
Maarten Bosma
2c56fc8f36 Forgot to commit this one.
svn path=/trunk/; revision=26811
2007-05-16 20:47:02 +00:00
Maarten Bosma
3fa5e74711 - Tests for Compact, TestCooperativeLevel, Initialize, GetDisplayMode, RestoreDisplayMode
- Merge GetMonitorFrequency Test with other Display Mode Tests

svn path=/trunk/; revision=26810
2007-05-16 20:42:33 +00:00
Maarten Bosma
d64da71c44 - Enable display mode tests but do not tests all of them, but only the first five onces.
- Add tests for AddRef, QueryInterface, Release

svn path=/trunk/; revision=26809
2007-05-16 18:57:21 +00:00
Maarten Bosma
e2ad78e62d Add downloader.xml again.
svn path=/trunk/; revision=26808
2007-05-16 18:11:25 +00:00
Maarten Bosma
be864d9d6e Revert r25952 for now.
svn path=/trunk/; revision=26807
2007-05-16 18:05:03 +00:00
Dmitry Gorbachev
8559c5a684 Fix WinSock mapping data.
svn path=/trunk/; revision=26806
2007-05-16 15:52:50 +00:00
Dmitry Gorbachev
bf6eed30bc Do not divide by zero.
svn path=/trunk/; revision=26805
2007-05-16 15:52:27 +00:00
Dmitry Gorbachev
d9e562832a Polish translation update by Olaf Siejka. BugZilla report #2254.
svn path=/trunk/; revision=26804
2007-05-16 09:55:37 +00:00
Ged Murphy
332eec647d a better winmine icon
svn path=/trunk/; revision=26803
2007-05-15 22:27:34 +00:00
Ged Murphy
7d6e95e227 add a regedit icon, made for ReactOS by Taliesin Penfound (tpenfound at gmail!com)
svn path=/trunk/; revision=26802
2007-05-15 22:20:35 +00:00
Eric Kohl
722745be27 Implement sound acessibility settings.
svn path=/trunk/; revision=26801
2007-05-15 21:59:14 +00:00
James Tabor
12ccaa3207 Finish up float.c, hopfully the div and sub math is right.
svn path=/trunk/; revision=26799
2007-05-15 20:48:58 +00:00
Dmitry Gorbachev
0a44b61c7f Fix Italian rc file. Bug report #2253. From Paolo Devoti.
svn path=/trunk/; revision=26798
2007-05-15 20:16:08 +00:00
Maarten Bosma
e381e0f4df Fix types in startup.c.
svn path=/trunk/; revision=26795
2007-05-15 17:52:00 +00:00
Maarten Bosma
f6773f20a3 Fix compiler warning.
svn path=/trunk/; revision=26794
2007-05-15 17:41:27 +00:00
Maarten Bosma
ada941267c Some formatting and implement SetDisplayMode.
svn path=/trunk/; revision=26793
2007-05-15 16:18:30 +00:00
Aleksey Bragin
149c5b1cae - Revert rpcrt4 update, too buggy for now. My apologizes.
svn path=/trunk/; revision=26792
2007-05-15 12:12:42 +00:00
Aleksey Bragin
3d1bf7d14e - Make advapi32 compilable without CUNITs.
svn path=/trunk/; revision=26790
2007-05-15 11:21:09 +00:00
Aleksey Bragin
c08df38aaa - Sync RPCRT4.dll to Wine-20070507 (recent release Wine 0.9.36).
- Fix a couple of headers.
- NOTE: I tested this rpcrt4 under ReactOS 0.3.1 and it boots normally. However, for future work, a wrapper library around winsock should be built, and a rpcrt4_ros.diff should be developer. Right now it's manually synced, and contains a few modifications (marked as #ifdef FIX_LATER in most cases).
Also, I'm not going to do a proper vendor import of this library, because next sync will most probably be autosync.
In case of problems, it could be reverted.

svn path=/trunk/; revision=26789
2007-05-15 11:19:12 +00:00
Christoph von Wittich
00495fbe26 changed some german translations
svn path=/trunk/; revision=26787
2007-05-15 01:49:17 +00:00
Hervé Poussineau
a3bda9f0e6 One more fix for release build
svn path=/trunk/; revision=26786
2007-05-14 21:09:52 +00:00
Hervé Poussineau
94e0b70c25 Try to fix release build
svn path=/trunk/; revision=26785
2007-05-14 20:28:26 +00:00
Alex Ionescu
753ad4922b - Re-organize regobj.c so that new APIs are at the bottom.
- Make NtDeleteKey delete the key in-line instead of waiting for the Ob callback.

svn path=/trunk/; revision=26784
2007-05-14 20:24:12 +00:00
Hervé Poussineau
5f71c28029 Also define the DPRINT_ constants in release mode
svn path=/trunk/; revision=26783
2007-05-14 20:07:16 +00:00
Aleksey Bragin
368e2849a5 - Fix debug print macros (by hpoussin).
svn path=/trunk/; revision=26782
2007-05-14 20:01:05 +00:00
Alex Ionescu
475bf24b50 - Implement CmpFindSubKeyByNumber and CmpDoFindSubKeyByNumber.
- Make NtEnumerateKey a simpler wrapper around CmEnumerateKey.
- Implement CmEnumerateKey by using the same API as previously, CmpQueryKeyData instead of duplicating code like the previous version did. Use CmpFindSubKeyByNumber to convert from index to key node.
- Remove CmiGetValueFromKeyByIndex, CmiGetKeyFromHashByIndex, CmiCopyPackedName: deprecated.

svn path=/trunk/; revision=26781
2007-05-14 19:35:58 +00:00
Alex Ionescu
64f4f03b95 - Make CmiGetMaxClassLength, CmiGetMaxNameLength, CmiGetMaxValueDataLength, CmiGetMaxValueNameLength use PHHIVE and PCM_KEY_NODE instead of PKEY_OBJECT or PERGSITRY_HIVE/PCM_KEY_NDOE so they're consistent.
- Implement NtQueryKey as a simple wrapper around CmQueryKey.
- Implement CmQueryKey based on previous code, and handle only the classes that the previous code handled, through CmpQueryKeyData.
- The CmiGetMax* routines will be depreated soon since they're a perf hit and we should be reading the key node's values instead.

svn path=/trunk/; revision=26780
2007-05-14 18:12:57 +00:00
Alex Ionescu
934cae8069 - Implement NtEnumerateValueKey as a simpler wrapper.
- Implement CmEnumerateValueKey. Simply calls already-existing Value Cache routines (CmpGetValueListFromCache, CmpGetValueKeyFromCache and CmpQueryKeyValueData) to do all the work.

svn path=/trunk/; revision=26778
2007-05-14 06:40:40 +00:00
Alex Ionescu
3ecce0a306 - Delete CmiGetPackedNameLength, CmiComparePackedNames, CmiCompareHash, CmiCompareHashI, CmiCompareKeyNames, CmiCompareKeyNamesI; dead code.
svn path=/trunk/; revision=26775
2007-05-14 05:43:27 +00:00
Alex Ionescu
c045c30908 - Implement NtQueryValueKey as a simple wrapper around CmQueryValueKey (same idea as always).
- Add cmvalche.c to deal with Value Caches. Cm implements these to quickly look up either the value list and/or the value index and/or the value data itself.  The routines fallback on non-cached access, which is what we currently do, since we don't have value caches yet.
- Implement CmQueryValueKey and CmpQueryKeyValueData based on previous code, but update to use value caches and new routines.

svn path=/trunk/; revision=26774
2007-05-14 05:36:25 +00:00
James Tabor
6f9af1cef6 Implement FLOATOBJ_GetFloat and Long, SetFloat and Long, and Neg.
svn path=/trunk/; revision=26773
2007-05-14 03:55:28 +00:00
James Tabor
5bca352f7d Update painting.c with new storage method for floating point operations.
svn path=/trunk/; revision=26772
2007-05-14 03:18:42 +00:00
Christoph von Wittich
ac6836eee1 asome extra space for the german text
svn path=/trunk/; revision=26771
2007-05-14 01:09:50 +00:00
Christoph von Wittich
0a26c894c2 some extra space for the text (to be displayed completely)
svn path=/trunk/; revision=26770
2007-05-14 01:05:57 +00:00
James Tabor
bea034c7dc Commit union for float conversion.
svn path=/trunk/; revision=26769
2007-05-14 00:47:29 +00:00
Alex Ionescu
4752c4b4c7 - Implement NtDeleteValueKey as a simple wrapper around CmDeleteValueKey so that handles, callbacks and SEH is abstracted away.
- Implement CmpRemoveValueFromList.
- Implement CmDeleteValueKey based on the old code, make it use CmpRemoveValueFromList.
- Remove CmiDeleteValueFromKey, CmiDestroyValueCell.

svn path=/trunk/; revision=26768
2007-05-14 00:44:26 +00:00
Dmitry Gorbachev
e834db9305 Fix r26764.
svn path=/trunk/; revision=26766
2007-05-13 22:44:36 +00:00
Maarten Bosma
ec669d109c Lots of additional cases by EmuandCo.
svn path=/trunk/; revision=26765
2007-05-13 20:31:38 +00:00
Alex Ionescu
03466c9be1 - Properly remove trailing \r\n depending on system configuration. Previous code assumed our wmc tool used target-newlines instead of host-newlines, causing Linux builds to display incorrect boot messages. New code scans the string.
svn path=/trunk/; revision=26764
2007-05-13 20:26:08 +00:00
Alex Ionescu
b7c77071ec - Remove confusion.
svn path=/trunk/; revision=26763
2007-05-13 19:57:35 +00:00
Alex Ionescu
0e7bfb3fd3 - Fix crash at end of text-mode setup (by hacking cmlib not to write a log file anymore -- logs aren't critical and I'll see why exactly it couldn't write the log anymore later, and apply a proper fix).
svn path=/trunk/; revision=26762
2007-05-13 19:11:13 +00:00
Alex Ionescu
41abdae9ca - Remove more old/dead code.
svn path=/trunk/; revision=26761
2007-05-13 19:10:23 +00:00
Alex Ionescu
cfb706a690 - HvGetCellSize should return the correct positive length instead of the raw negative length. Update code and callers to match.
- Add cmapi.c file containing internal Cm* APIs for the Nt counterparts and to make it easier to seperate the handle->object code, SEH and callback parts.
- Remove CmiAddValueToKey, CmiAllocateValueCell since we have new routines for this.
- Make NtSetValueKey a simple wrapper around CmSetValueKey.
- Implement CmSetValueKey based on previous code, but use newer Cm APIs instead (this also fixes some cell allocation bugs regarding Stable/Volatile storage).
- New code is more conservative with HvMakeCellDirty calls when they're not needed, and is more scalable to support big cells in the future.

svn path=/trunk/; revision=26760
2007-05-13 18:39:35 +00:00
Maarten Bosma
39932ced34 Some more CreateSurface Tests (for invaild flags)
svn path=/trunk/; revision=26759
2007-05-13 17:58:05 +00:00
Maarten Bosma
35b29a1d0a - Release Ddraw Object Test_CreateDDraw
- First Surface Test of many to follow
- GetMonitorFrequency and whitespace changes by EmuandCo

svn path=/trunk/; revision=26758
2007-05-13 17:31:35 +00:00
Alex Ionescu
779a784f15 - Fix critical bug in CmpCopyName, it wasn't compressing names at all.
- Implement new cmlib routines: HvIsCellAllocated, Doesn't really work fully since we don't support mapped-file hives, but works for the kinds of hives we currently use. HvIsCellDirty, should work as expected.
- Implement new cm routines: CmpMarkValueDataDirty, CmpFreeValueData, CmpFreeValue. There are generic so they can deal with Big, Small or Normal keys.
- Implement CmpAddValueToList, CmpSetValueDataNew.
- Add RtlCheckBit to winddk.h, it's inlined instead of being an actual function call.

svn path=/trunk/; revision=26757
2007-05-13 16:58:54 +00:00
Magnus Olsen
75685e5dd4 adding more check for createsurface
svn path=/trunk/; revision=26756
2007-05-13 16:51:15 +00:00
Maarten Bosma
e37697709f Beginning of CreateSurface test.
svn path=/trunk/; revision=26755
2007-05-13 16:37:58 +00:00
Hervé Poussineau
f9560fb69d Move itss.idl to the place it belongs
svn path=/trunk/; revision=26754
2007-05-13 14:38:27 +00:00
Magnus Olsen
85c06f6f40 adding more check
svn path=/trunk/; revision=26753
2007-05-13 13:14:54 +00:00
Magnus Olsen
393d729ca1 fixing two return code thx Ventron for the info for one of the return code
svn path=/trunk/; revision=26752
2007-05-13 12:43:51 +00:00
Magnus Olsen
336c7c37c4 adding smore check for createsurface, (still does not create a surface)
svn path=/trunk/; revision=26751
2007-05-13 12:11:41 +00:00
Maarten Bosma
57f86bb38b Add debugging macro to get error code and test for display modes (commented out because it checks every single display mode and thus takes fairly long).
svn path=/trunk/; revision=26750
2007-05-13 12:09:44 +00:00
Maarten Bosma
ba36cacf56 SetCooperativeLevel Test
svn path=/trunk/; revision=26749
2007-05-13 09:58:47 +00:00
Magnus Olsen
b955734dc0 fixing more linux build issue
svn path=/trunk/; revision=26748
2007-05-13 08:47:35 +00:00
Dmitry Gorbachev
7622d26ba5 Update Polish translation. Patch by Caemyr. Bug report #2249.
svn path=/trunk/; revision=26747
2007-05-13 08:46:14 +00:00
Magnus Olsen
968fb23c3b fixing a path issue so it is compatible with linux
svn path=/trunk/; revision=26746
2007-05-13 08:38:22 +00:00
Timo Kreuzer
c21f54bb23 handle FW_DONTCARE in GetFontScore. Fixes gray/thin display of dialogbox elements' text.
svn path=/trunk/; revision=26743
2007-05-13 02:31:00 +00:00
Timo Kreuzer
8e23820aa6 On win XP the gdi handle index can be > 0x3fff, so change GDI_HANDLE_INDEX_MASK to 0x0000ffff to not fail on win XP on higher handle index.
svn path=/trunk/; revision=26742
2007-05-13 00:57:09 +00:00
Dmitry Gorbachev
7bef6e865e Check result of ANSI -> Unicode conversion, which can fail in the case of
memory shortage.

svn path=/trunk/; revision=26741
2007-05-12 22:54:58 +00:00
Maarten Bosma
a6e430f084 Add it to build.
svn path=/trunk/; revision=26740
2007-05-12 19:43:23 +00:00
Maarten Bosma
1c0a28e0fa Start of ddraw test case.
svn path=/trunk/; revision=26739
2007-05-12 19:43:01 +00:00
Magnus Olsen
053c08fc8e commit some bugfix for ddraw createsurface, fixing comping as well
svn path=/trunk/; revision=26738
2007-05-12 19:20:54 +00:00
Magnus Olsen
e535eb641e fixing smaller bugs
svn path=/trunk/; revision=26737
2007-05-12 18:33:28 +00:00
Maarten Bosma
bf51ef9a82 Create Internal_CreateSurface stub.
svn path=/trunk/; revision=26736
2007-05-12 17:50:09 +00:00
Magnus Olsen
9dbe363154 implement internal api CopyDDSurfDescToDDSurfDesc2
svn path=/trunk/; revision=26735
2007-05-12 17:48:27 +00:00
Maarten Bosma
a54fcea595 - outsourced DirectDraw_SetCooperativeLevel
- adjusted .c file headers

svn path=/trunk/; revision=26734
2007-05-12 17:30:37 +00:00
Magnus Olsen
9fb321d933 start implement Main_DirectDraw_CreateSurface
we need now finish  internal_CreateSurface and  CopyDDSurfDescToDDSurfDesc2

svn path=/trunk/; revision=26733
2007-05-12 17:23:48 +00:00
Maarten Bosma
1846501455 Reformating
svn path=/trunk/; revision=26732
2007-05-12 16:37:17 +00:00
Maarten Bosma
80e4e04c0c Sorry, just noticed that I forgot to commit this one.
svn path=/trunk/; revision=26731
2007-05-12 16:29:58 +00:00
Maarten Bosma
8658735640 Formating
svn path=/trunk/; revision=26730
2007-05-12 16:28:54 +00:00
Maarten Bosma
4a65ec1dcc splitted rosdraw.h; outsourced big comment into text file.
svn path=/trunk/; revision=26729
2007-05-12 16:21:50 +00:00
Magnus Olsen
216cb06c21 forget this change, did think it still was in svn.
svn path=/trunk/; revision=26728
2007-05-12 15:52:09 +00:00
Magnus Olsen
a05a002084 start reimplement createsurface
svn path=/trunk/; revision=26727
2007-05-12 15:50:26 +00:00
Maarten Bosma
499e453d66 Fix warning.
svn path=/trunk/; revision=26726
2007-05-12 15:45:54 +00:00
Maarten Bosma
b4e08acebe Forgot to include surface_main.c in ddraw.rbuild.
svn path=/trunk/; revision=26725
2007-05-12 15:24:54 +00:00
Maarten Bosma
c0c39ccc77 DirectDraw rearrangement. (part 2/2)
svn path=/trunk/; revision=26724
2007-05-12 14:58:26 +00:00
Maarten Bosma
b2247432db DirectDraw rearrangement. (part 1/2)
svn path=/trunk/; revision=26723
2007-05-12 14:20:12 +00:00
Magnus Olsen
afe388c584 sorry did use some private headers that are not commited yet, here is win32kdxtest comping fix.
svn path=/trunk/; revision=26722
2007-05-12 13:58:27 +00:00
Maarten Bosma
52e0d50e08 Deactivate a check.
svn path=/trunk/; revision=26721
2007-05-12 13:17:01 +00:00
Eric Kohl
7e499053cd - Attach clock specific data to the window instead of storing them in global variables.
- Stop the clock and show the system time when the user changes the system time.

See issue #2241 for more details.

svn path=/trunk/; revision=26720
2007-05-12 12:37:23 +00:00
Ged Murphy
d5d68cf53f - Add winhelp based on Wine.
- Not fully complete and has some bugs.
- go to help -> help on help for a preview

svn path=/trunk/; revision=26719
2007-05-12 10:14:45 +00:00
Magnus Olsen
62ae8a3919 update dxhaltest with some new test, Thuse test are not 100% correct in all case. some error should be supress when it been run in vmware with windows or reactos
svn path=/trunk/; revision=26718
2007-05-12 10:14:22 +00:00
Aleksey Bragin
a3d6e8f3e9 Undo last change, since it's an index in an array of TCHARs, so "1" is correct.
svn path=/trunk/; revision=26717
2007-05-12 08:44:49 +00:00
Alex Ionescu
8202615b33 - Rename CmiInitNonVolatileRegistryHive to CmiInitHiveFromFile.
- Remove CmiCreateNewRegFile and the way new hives were created, saved, then re-reloded. Instead initialize a new hive only once.
- Add support for calling either HINIT_FILE or HINIT_CREATE with a hive, and support log file hives now.
- Make hacks/oldcm differences smoother, and copy routine to cmsysini.c, since it's now compatible with the rewrite. This is probably the last function that was easily convertible/modifiable.

svn path=/trunk/; revision=26716
2007-05-12 08:27:28 +00:00
Magnus Olsen
66d03d55cd did see a small mistake use sizeof(TCHAR) for adding NULL termeting of string for u do not known if we switch compile regedit as unicode-16 or ANSI.
svn path=/trunk/; revision=26715
2007-05-12 08:27:00 +00:00
Alex Ionescu
ff7c618dd0 - Change CmiInitNonVolatileRegistry hive to use CmpOpenHiveFiles and CmpInitializeHive. Required a lot of hacking to get to work right, but at least it does, and uses our new code paths.
- Update CmpInitializeHive with the HINIT_FILE hack required for current cmlib functionality.

svn path=/trunk/; revision=26714
2007-05-12 06:47:39 +00:00
James Tabor
7ae94663c6 Moving FLOATOBJ code in preparations of implementation of basic float storage emulation and float code processing.
svn path=/trunk/; revision=26713
2007-05-12 04:48:40 +00:00
Alex Ionescu
ef1f549526 - Get rid of CmiCopyKey since it was dead code. Make CmiScanKeyForValue and CmiScanForSubKey simple wrappers around the newer CmpFindSubKeyByName and CmpFindValueByName routines.
- Allow cmlib to support HINIT_FILE flag for HvInitializeHive. This means the kernel doesn't need to create a section for the hive, then call HvInitializeHive with HINIT_MEMORY anymore, and can simply send the file handle. I wrote a sneaky little hack in cmlib which actually ends up doing the same idea, albeit not by using a section, making it portable.
- Fix a serious bug in CmpFindSubKeyInLeaf affected by our lack of alphabetically-sorted cells; the linear search I hacked was slightly broken.
- Remove the need to hold a LogFileName in the hive structure, since we generate it dynamically now.

svn path=/trunk/; revision=26712
2007-05-12 03:28:04 +00:00
Alex Ionescu
6ef9f575cb - Move CmInitSystem1 to cmsysini.c and merge in existing code from Cm rewrite branch.
- Merge code into cmkcbncb.c related to KCB/Cache initialization (This is "Dead" code for now, since it's not used, just initailized.)
- Rename CmiRegistryLock to CmpRegistryLock.
- The new /config registry code is now totally isolated from the old /cm code, although some of the old structures are still used until the actual rewrite is fully merged/finished.

svn path=/trunk/; revision=26710
2007-05-11 23:35:19 +00:00
Dmitry Gorbachev
10f84bdddc Do not write beyond the buffer.
svn path=/trunk/; revision=26709
2007-05-11 23:17:44 +00:00
Dmitry Gorbachev
acd6160248 Do not write beyond the buffer.
svn path=/trunk/; revision=26708
2007-05-11 23:15:53 +00:00
Dmitry Gorbachev
14f97db8a4 Do not fail with less then two arguments.
svn path=/trunk/; revision=26707
2007-05-11 23:12:49 +00:00
Timo Kreuzer
c04165689d make caption font bold again
svn path=/trunk/; revision=26706
2007-05-11 22:57:21 +00:00
Alex Ionescu
47687d1136 - Copy CmOpenHiveFiles to cminit.c and rename to CmpOpenHiveFiles. Extend the functionality of the routine:
- Allow caller to have full power over handles and filenames being used instead of hard-coding a pointer to the registry hive.
  - Setup proper I/O flags to disable compression and open for random access, backup-intent and allow disabling buffering.
  - Allow proper access mask/share mode when booting off read-only media.
  - Call the FS driver with FSCTL_MARK_AS_SYSTEM_HIVE if instructed.
  - Call with FSCTL_SET_COMPRESSION to make sure compression is off.
  - Allow creating the hive if it doesn't exist already.
  - Consider 0-byte opened hives as new hives.
  - Allow caller to request volume sector size and validate with hive cluster size.
  - Make .log hives hidden.
- Implemement CmpCreateEvent to allowed for overlapped I/O registry operations.
- Move more globals to cmdata.c.

svn path=/trunk/; revision=26705
2007-05-11 22:51:11 +00:00
Alex Ionescu
57ddb7b014 - Move Cmlib wrapper functions to cmwraprs.c and add the file -- no code change.
- Move CmCheckRegistry stub to cmcheck.c and add the file.
- Move CmpInitializeHive to cminit.c and add the file. Modify it to add Cm-rewrite compatible code (but #ifed out).
- Change the HiveList lock to a pushlock instead of an ERESOURCE. Rename CmiHiveListHead to CmpHiveListHead.
- Get rid of Cm security functions and stub the CmpSecurityMethod in cmse.c to always return success. Key security was never really working anyway, this just removes more code.

svn path=/trunk/; revision=26704
2007-05-11 21:35:56 +00:00
Alex Ionescu
e433606342 - Move CmpCreateRootNode and CmpCreateRegistryRoot to cmsysini.c as well, and add some fixes to CmpCreateRegistryRoot to make it compatible with the Cm Rewrite when it's done.
- Initialize some stuff that wasn't being initialized in CmpCreateRootNode.
- Use CmpHiveRootSecurityDescriptor in CmpCreateRegistryRoot to protect the key.
- Save the root handle globally so we can close it during shutdown.
- Add cmkcbncb.c with an empty stub for CmpCreateKeyControlBlock. Will copy from Cm rewrite branch later.
- Properly name fields of CM_KEY_NODE in the headers of the /config tree.

svn path=/trunk/; revision=26703
2007-05-11 19:34:11 +00:00
Alex Ionescu
703c503a4f - Move CmpInitializeSystemHive and CmpCreateObjectTypes to cmsysini.c since they're almost identical to the Cm rewrite and compatible, so they're considered "new" code (although they still use EREGISTRY_HIVE).
- Add code missing in CmpInitializeSystemHive from Cm Rewrite (mainly detecting boot type and self-healing settings).
- Free a memory leak.
- Enable security for key objects.
- Rename CmiKeyType to CmpKeyObjectType.

svn path=/trunk/; revision=26702
2007-05-11 18:58:34 +00:00
Alex Ionescu
010910bc34 - Add missing ACE structures to ntifs.h.
- Add missing SeLengthSid to ntifs.h.
- Implement CmpHiveRootSecurityDescriptor and use it in CmpInitializeSystemHive and CmInitSystem1 to properly secure system-created hives.
- Implement CmpInitializeHardwareConfiguration and call it. Its job is to populate the hardware hive, but FreeLDR already does this, so it doesn't do much at the moment.

svn path=/trunk/; revision=26701
2007-05-11 18:15:13 +00:00
Dmitry Gorbachev
852a223ab9 - Terminate the string. NtUserMenuItemInfo() sometimes returns no string.
- Check if NtUserBuildMenuItemList() returns negative result.

svn path=/trunk/; revision=26700
2007-05-11 14:12:57 +00:00
Dmitry Gorbachev
5b30343d53 Check result of DRIVER_FindFromHDrvr().
svn path=/trunk/; revision=26699
2007-05-11 14:12:40 +00:00
Dmitry Gorbachev
915201e112 Fix (partially) bug #2243.
svn path=/trunk/; revision=26698
2007-05-11 14:12:21 +00:00
Aleksey Bragin
5e9f050616 Fix for linux build (#include "..\ -> #include "../).
svn path=/trunk/; revision=26696
2007-05-11 13:07:54 +00:00
Alex Ionescu
384af65d69 - More simplification: Get rid of CmImportBinaryHive, CmpImportSystemHive, CmpImportHardwareHive and all of import.c!
- Fix CmpInitializeHive to set any flags that are passed, not assume HIVE_NO_FILE by default.
- "Import" the system and hardware hives using CmpInitializeHive instead of the cmimport.c routines which are gone.
- Get rid of old/unused cmdata.c in /cm.

svn path=/trunk/; revision=26693
2007-05-11 06:24:00 +00:00
Alex Ionescu
59a8c8c5dc - Remove unusued, complex hive checking code from regfile.c.
- Implement CmpInitializeHive based on Cm Rewrite but keep code compatible with the current EREGISTRY_HIVE structure in the current Cm.
- Remove CmiCreateVolatileHive and CmiCreateTemp since they're unused.
- Implement CmpCreateRootNode based on CmRewrite and CmCreateRootNode in cmlib, CmpCopyName and CmpNameSize from Cm Rewrite and use them.
- Use CmpInitializeHive + CmpCreateRootNode for the master volatile hive.

svn path=/trunk/; revision=26692
2007-05-11 04:59:38 +00:00
Alex Ionescu
107f14ad9f - CmpInitializeMachineDependentConfiguration: Finish up by using the same code as for System BIOS Version detection for the Video BIOS Detection. This routine should be pretty much finished now since all required hardware keys are created.
svn path=/trunk/; revision=26686
2007-05-10 21:40:39 +00:00
Alex Ionescu
65a66f73b8 - Add code to detect and save the BIOS Version string to the registry. We use the same detection patterns as Windows for now (Ver, Rev, Rel, v0-9).
- All BIOS Version strings are scanned and saved in a REG_MULTI_SZ key, as on Windows. QEMU BIOS Version String is correctly detected as the CVS/SVN $ID tag, which is good enough.

svn path=/trunk/; revision=26685
2007-05-10 21:36:24 +00:00
Alex Ionescu
0efeac48a8 - Remove CPU Detection code from FreeLDR (hwcpu.c) since our kernel properly does the same job now (and better).
- Remove ReactOS hacks from recent code due to FreeLDR, since it doesn't conflict with us anymore.

svn path=/trunk/; revision=26684
2007-05-10 20:51:50 +00:00
Alex Ionescu
3fcfcbce89 - CmpInitializeMachineDependentConfiguration: Use the same strategy as for the BIOS to get the Video ROM BIOS Date as well and save it into VideoBiosDate.
svn path=/trunk/; revision=26683
2007-05-10 20:43:40 +00:00
Alex Ionescu
3511920f89 - Create \Device\PhysicalMemory in Phase 1 instead of Phase 2, since CmInit needs it.
- CmpInitializeMachineDependentConfiguration: Map the IVT to detect the Video ROM Area and save it (corretly detected on QEMU at 0xC000). Then map the BIOS at 0xF0000 and scan it for the newest BIOS Date.
- Save detected BIOS date in the System Node's SystemBiosVersion, and save BIOS-default date (11 bytes before the ROM end) in Control\BIOSINFO.

svn path=/trunk/; revision=26682
2007-05-10 20:36:15 +00:00
Alex Ionescu
b5dc8db0ee - CmpInitializeMachineDependentConfiguration: Add Processor Name and Vendor ID as well (the former doesnt' work on QEMU because QEMU desn't support CPUID-EX, but on VMWare, I get: Dual Core AMD Opteron(tm) Processor 185.
svn path=/trunk/; revision=26681
2007-05-10 19:06:52 +00:00
Alex Ionescu
82bcb975e4 - CmpInitializeMachineDependentConfiguration: Write FeatureSet, MHZ and Update Signature to registry CentralProcessor node.
svn path=/trunk/; revision=26680
2007-05-10 18:11:11 +00:00
Alex Ionescu
bd87454d22 - Make CmpInitializeMachineDependentConfiguration create the FloatingPointProcessor hardware key/ARC node.
svn path=/trunk/; revision=26678
2007-05-10 18:04:41 +00:00
Alex Ionescu
0d78fd8f3d - Add more code to CmpInitializeMachineDependentConfiguration to create the BIOSINFO key and to start working on the CentralProcessor key (which, in ReactOS, FreeLDR creates when it shouldn't). Creates the basic CentralProcessor nodes for now.
- Add cmconfig.c and implement a helper routine that converts from ARC CONFIGURATION_COMPONENT_DATA to a Hardware Description entry and resource descriptor.
- Fix outdated _CONFIGURATION_TYPE definition in our DDK.

svn path=/trunk/; revision=26677
2007-05-10 17:52:09 +00:00
Alex Ionescu
78b58e34df - Add i386/cmhardwr.c and start implementing CmpInitializeMachineDependentConfiguration. Currently it only detects and writes the key for PAE.
- Call the API from CmInitSystem1.

svn path=/trunk/; revision=26675
2007-05-10 16:42:24 +00:00
Dmitry Gorbachev
5b30480967 Fix a bug in ScServiceMainStub(), add more checks.
svn path=/trunk/; revision=26672
2007-05-10 10:13:01 +00:00
Alex Ionescu
107cb5719e - Remove/deprecate some certain chunks of Cm which are not critical to booting and not even to applications (such as NtSaveKey, which didn't even have NtRestoreKey) and mark them as unimplemented functions.
- This doesn't do much but clean up some of our code to make it easier to see what the critical parts are and reduce bug surface exposure.
- Move and slightly reformat (without touching any of the actual code) registry callback/notification code to cmhook.c.

svn path=/trunk/; revision=26671
2007-05-10 09:14:15 +00:00
Alex Ionescu
e72d90dbc8 - Move CmpSetSystemValues to cmsysini.c
- Remove all NTLDR-style profile code from cmsysini.c, since ReactOS doesn't support it, and there's no use lugging that code around.
- Rename CmpCreateCurrentControlSetLink to CmpCreateControlSet.
- Get rid of CmiCreateCuttenControlSetLink and use the new version instead, which also supports setting the right current Hardware Profile ID.

svn path=/trunk/; revision=26670
2007-05-10 01:48:54 +00:00
Alex Ionescu
0285323c9d - Refactor the registry initialization code to be somewhat closer to the Cm rewrite branch.
- No actual code/implementation changes per-se, simply moved code into new routines, deleted old routines, renamed some routines and added more error-checking.
- Also performed registry initialization in an order more analogous to Windows.
- Added cmsysini.c from the branch, but it's not used at the moment.

svn path=/trunk/; revision=26669
2007-05-10 00:02:04 +00:00
Alex Ionescu
83bd3b5fc0 - Fix crash in Install CD introduced in 26666, with a ludicrious hack for FreeLDR
svn path=/trunk/; revision=26668
2007-05-09 21:15:52 +00:00
Aleksey Bragin
959a4b6f1e - Add error messages to prevent silent failing, no functionality change.
svn path=/trunk/; revision=26667
2007-05-09 20:52:08 +00:00
Alex Ionescu
33ea79c7fe - Implement CmGetSystemControlValues and all related low-level Cm functionality required to select the proper control set and read all the kernel variables during Phase 0 initialization. We can now read time-zone data, version, suite, language IDs and other important kernel variables in the lowest-level boot phase.
- New code uses cmlib from Filip Navara without any modification, and is fully compatible with reading Windows hives as well except XP's "Big value cells" (cells with > 2GB data) which aren't supported.
- Create /config directory where the new Configuration Manager code lies.

svn path=/trunk/; revision=26666
2007-05-09 18:30:21 +00:00
Alex Ionescu
5aaa1671e7 1) Update KiPcToFileHeader to work in early-boot stage by looking through the KeLoaderBlock instead.
2) Make KeRosDumpStrackFrames use KiPcToFileHeader instead of KiRosPrintAddress. The end result is the same but we don't recursively bugcheck anymore during Phase 0 bugchecks :)

svn path=/trunk/; revision=26665
2007-05-09 16:15:22 +00:00
Aleksey Bragin
d80647e124 - Add km regtests to build.
- Add a very simple memory monitor (to be improved later).

svn path=/trunk/; revision=26664
2007-05-09 11:55:19 +00:00
Aleksey Bragin
7ba021c0ca - Move tests from trunk.
svn path=/trunk/; revision=26663
2007-05-09 11:18:34 +00:00
Aleksey Bragin
93510b1a0f - Delete /drivers dir (it's gonna be created by svn copy commit)
svn path=/trunk/; revision=26662
2007-05-09 11:17:46 +00:00
Aleksey Bragin
8088e369f7 - Create a place for kernel-mode regression testing drivers.
svn path=/trunk/; revision=26661
2007-05-09 11:13:20 +00:00
Alex Ionescu
2f0daf6186 - Fix line endings.
svn path=/trunk/; revision=26660
2007-05-09 04:55:24 +00:00
Alex Ionescu
b4e9b56b39 - Added more improvements/fixes to the Executive Initialization code:
- We now print out error messages at each SESSIONX_INITIALIZATION_FAILURE directly on the screen.
  - Build CmNtCSDVersion to include SP1 and our SVN Revision number.
  - Build CmNtSpBuildNumber with the actual SP1 build number.
  - Detect Headless Terminal usage.
  - Build and create the CmVersionString.
  - Display a startup banner similar to Windows based on the CmVersionString, also indicating the SVN revision.
  - Fix some bugs in the timezone code.
  - Display a second startup banner like Windows's, displaying memory and CPU counts.
  - Add calls to initialize RANGE_LISTs, the Prefetecher, XIP Support and Phase 2 Executive Initialization.
  - Parse the command line to detect /SAFEBOOT: switch and which type of safe mode boot this is.
  - Display an optional third startup banner showing which safemode boot type this is.
  - Detect /BOOTLOG switch and display a fourth startup banner if it's enabled, but don't initialize boot logging yet.
  - Don't allow driver loading to push the progress bar beyond 75%.
  - Write safe-boot type to registry, detect AlternateShell mode and validate that one is configured.
  - Write MININT key to registry if booting in WinPE (LiveCD) mode.
  - Don't leak smss environment and parameters anymore.
  - Cleanup and reformat some code, use VER_ constants instead of magic numbers.

svn path=/trunk/; revision=26659
2007-05-09 00:44:45 +00:00
Alex Ionescu
0724e3d18e - Add CcPf (Cache Manager PreFetcher) structures and add a stub function to initailize the global settings for the pre-fetcher (only a lock and list for now).
- Add hdlsterm.c for Headless Terminal Support and a stub function to detect if anyone is trying to do this.
- Add xipdisp.c for eXecute-In-Place Support and add a stub function to detect if anyone is trying this, as well as get various supported command line settings.
- Try to find XIP Memory Descriptor if one was given.
- Get Power Event callback from Win32k in PsEstablishWin32Callouts.
- Notifiy System Time Change callback with PoNotifySystemTimeSet.
- Add safemode and bootlog Message IDs.

svn path=/trunk/; revision=26658
2007-05-09 00:29:38 +00:00
Alex Ionescu
da6c47f5f8 - Stripped down ntstrafe.h routines required for a future patch, and for basic functionality. Do not support any flags yet (and will ASSERT if attempt is made): RtlStringCbCopyA, RtlStringCbCatExA, RtlStringCbCopyExA, RtlStringCbPrintfExA, RtlStringCbPrintfA.
svn path=/trunk/; revision=26657
2007-05-09 00:06:18 +00:00
Alex Ionescu
f0b1b0e858 - Buildno now generates a KERNEL_VERSION_BUILD_HEX ULONG containing the SVN revision.
svn path=/trunk/; revision=26656
2007-05-08 23:00:35 +00:00
Eric Kohl
0ab223d167 Save user cursor schemes using the environment variables SystemRoot, USERPROFILE or ProgramFiles in the cursor paths instead of absolute paths.
svn path=/trunk/; revision=26655
2007-05-08 22:13:18 +00:00
Alex Ionescu
651efa4a73 - Fix broken definition of IsBoostAllowed which would cause ERESOURCE boosts to be applied backwards.
- Use cleaner, inlined definitions for ExAcquire/ReleaseResourceLock.
- Convert ERESOURCE code to use a Queued In-Stack Spinlock instead of a regular spinlock.
- Force usage of the spinlock instead of cli/sti for DBG builds, and enable strict sanity checks.
- Fix incorrect check in ExpCheckForApcsDisabled.
- Properly handle memory starvation in the contended path.
- Make sure to allocate a semaphore if needed during ExAcquireSharedStarveExclusive.
- Fix multiple bugs in ExIsResourceAcquiredSharedLite.
- ExReleaseResourceForThreadLite didn't always properly set the ResourceOwnedExclusive flag, and didn't validate ownership.
- ExSetResourceOwnerPointer wouldn't set the owner if there wasn't one already.

svn path=/trunk/; revision=26654
2007-05-08 21:35:10 +00:00
Aleksey Bragin
b5d4ee9e39 - Fix unshielded "return"s inside PSEH blocks, in the kernel.
- Fix formatting of a couple of lines.

svn path=/trunk/; revision=26653
2007-05-08 10:32:16 +00:00
Aleksey Bragin
182dd09c91 - Fix an unshielded "return" inside a PSEH block.
svn path=/trunk/; revision=26652
2007-05-08 09:01:39 +00:00
Timo Kreuzer
64b29c8149 - fix resources
svn path=/trunk/; revision=26651
2007-05-07 09:27:43 +00:00
Hervé Poussineau
deb7fbe415 Fix memory corruption in freeldr
svn path=/trunk/; revision=26650
2007-05-06 07:35:57 +00:00
Eric Kohl
6786d8e6a9 The current cursor scheme will now be loaded correctly and the scheme list will display the correct name of the cursor scheme.
svn path=/trunk/; revision=26649
2007-05-06 02:06:30 +00:00
Eric Kohl
e0364c78da Remove outdated email addresses.
svn path=/trunk/; revision=26648
2007-05-05 11:32:25 +00:00
Dmitry Gorbachev
5cfa655cbc Update Polish translation (bug #2233).
svn path=/trunk/; revision=26647
2007-05-05 08:16:59 +00:00
Martin Fuchs
231dcbf43a update to XMLStorage version 1.2
svn path=/trunk/; revision=26646
2007-05-05 07:30:20 +00:00
Dmitry Gorbachev
841a6e2567 Fix a bug in stub generation code. There are some other lesser bugs.
svn path=/trunk/; revision=26645
2007-05-05 03:48:20 +00:00
Dmitry Gorbachev
2210b29b99 Chinese translation (bug report #2221).
svn path=/trunk/; revision=26644
2007-05-04 23:31:08 +00:00
Dmitry Gorbachev
4559868d74 Chinese translation by Zhangbing (bug #2222).
svn path=/trunk/; revision=26643
2007-05-04 23:30:48 +00:00
Dmitry Gorbachev
231b59a486 Fix a typo in translation. Bug report #2233.
svn path=/trunk/; revision=26642
2007-05-04 23:27:54 +00:00
Dmitry Gorbachev
a11eecdb83 Update Polish translation. Patch by Lech Groblewicz
<xrogers'at'gmail'dot'com> and Olaf Siejka. Bug #2233.

svn path=/trunk/; revision=26641
2007-05-04 23:27:28 +00:00
Dmitry Gorbachev
2408771fff Patch for reformatting the cabman code, Colin Finck, see bug report #2234.
svn path=/trunk/; revision=26640
2007-05-04 22:21:55 +00:00
Eric Kohl
0a981d42cf Removed my name because these files no longer contain any code written by me.
svn path=/trunk/; revision=26639
2007-05-04 22:15:13 +00:00
Eric Kohl
21cced5dc3 Removed my name because I did not write this file!
svn path=/trunk/; revision=26638
2007-05-04 21:59:25 +00:00
Sylvain Petreolle
103b32e6e4 slash is alive !
-#include "..\gditest.h"
+#include "../gditest.h"


svn path=/trunk/; revision=26637
2007-05-04 21:23:42 +00:00
Aleksey Bragin
34aac7b904 - Add fundamental VCB structure, and function to initialize it.
- Add common headers to all xCB structures.
- All development is being done according to Rajeev Nagar's book and some parts are inspired by its accompanying FSD sample.

svn path=/trunk/; revision=26636
2007-05-04 18:34:48 +00:00
Aleksey Bragin
e45d903111 - Fixes and changes to NPFS debug printing system, so it actually works now.
svn path=/trunk/; revision=26635
2007-05-04 13:40:14 +00:00
Aleksey Bragin
57ba31d95a - Add function stubs
- Add simple dbgprinting mechanism for easier debugging.

svn path=/trunk/; revision=26634
2007-05-04 11:50:41 +00:00
Hervé Poussineau
86d213a22d Set a valid (but unknown) last write time to registry keys, instead of a random one
svn path=/trunk/; revision=26633
2007-05-04 11:00:14 +00:00
Hervé Poussineau
965eebb584 Don't ignore results of IRP_MN_FILTER_RESOURCE_REQUIREMENTS
svn path=/trunk/; revision=26632
2007-05-04 10:49:53 +00:00
Aleksey Bragin
1e04962f7e - Prepare a playground for a new NPFS driver implementation.
svn path=/trunk/; revision=26631
2007-05-04 10:15:00 +00:00
Hervé Poussineau
defa5fee07 Joliet supports directory names with extension.
svn path=/trunk/; revision=26630
2007-05-03 20:41:46 +00:00
Dmitry Gorbachev
9269358c6f Do not call DefFrameProc() for not yet created MDI client window.
svn path=/trunk/; revision=26629
2007-05-03 19:06:55 +00:00
Christoph von Wittich
d229077222 "fix" my email address :P
svn path=/trunk/; revision=26628
2007-05-03 18:43:15 +00:00
Magnus Olsen
0acfc6fc7b Clean, writen by casper in frist place in C++ and are not complete and full with unimplement stuff, see the text file.
svn path=/trunk/; revision=26627
2007-05-03 18:32:54 +00:00
Dmitry Gorbachev
761de0042d - Fix a bug in "close all log files" code.
- Replace custom list functions by RTL ones.
- Fix indentation.

svn path=/trunk/; revision=26626
2007-05-03 07:47:12 +00:00
Aleksey Bragin
80b680b6ae - Delete cromwell-based usb drivers since they don't work with modern reactos kernel.
- Remove usbhub from the build.

svn path=/trunk/; revision=26625
2007-05-02 11:37:29 +00:00
Dmitry Gorbachev
cff3ed531e Use _SEH_YIELD().
svn path=/trunk/; revision=26624
2007-05-02 08:21:57 +00:00
Dmitry Gorbachev
12a24bb9e3 Do not crash on broken pipe.
svn path=/trunk/; revision=26623
2007-05-02 03:06:18 +00:00
Timo Kreuzer
45986f803a sorry another one creeped in ;-)
svn path=/trunk/; revision=26622
2007-05-01 22:28:25 +00:00
Timo Kreuzer
cef53d8369 sorry accidentally committed this file
svn path=/trunk/; revision=26621
2007-05-01 22:20:15 +00:00
Timo Kreuzer
a2a4bb1e51 update gdi32_test
- fix #line ...
- add more tests

svn path=/trunk/; revision=26620
2007-05-01 22:08:34 +00:00
Timo Kreuzer
85be5ff46c Extpen implementation:
- give GDI_OBJECT_TYPE_EXTPEN a sizeof(GDIBRUSHOBJ) and EXTPEN_Cleanup function in GDI_OBJ_INFO table
- define PENOBJ_AllocExtPen, PENOBJ_FreeExtPen, PENOBJ_LockExtPen needed by IntGdiExtCreatePen
- create A Tag for extpen for tagged pool that holds style dwords
- implement IntGdiExtCreatePen
- implement EXTPEN_Cleanup, freeing the stylebuffer
- implement NtGdiExtCreatePen
- make CreateStockObjects, NtGdiCreatePen(Indirect) call IntGdiExtCreatePen
- remove IntGdiCreatePenIndirect

svn path=/trunk/; revision=26619
2007-05-01 22:04:47 +00:00
Dmitry Gorbachev
5dfe58e2d0 Update Italian keyboard layout (bug #1963).
svn path=/trunk/; revision=26618
2007-05-01 21:35:14 +00:00
Dmitry Gorbachev
3d4456f568 Use _SEH_YIELD() to return from PSEH block. Thanks to Alex Ionescu.
svn path=/trunk/; revision=26617
2007-05-01 19:07:11 +00:00
Ged Murphy
983ad60182 quick hack to make sysdm.cpl open our standalone device manager
it's a democracy : http://www.reactos.org/forum/viewtopic.php?t=3835

svn path=/trunk/; revision=26616
2007-05-01 16:25:26 +00:00
Eric Kohl
219c4c8eb7 Fix indentation, no code changes.
svn path=/trunk/; revision=26615
2007-05-01 13:55:11 +00:00
Alex Ionescu
4e78c81b3c - OMG I wanna be awesome too!
svn path=/trunk/; revision=26614
2007-05-01 13:54:29 +00:00
Ged Murphy
eb0ae252ec FireBall, trend setter
svn path=/trunk/; revision=26613
2007-05-01 13:49:10 +00:00
Aleksey Bragin
48cc5fcfe7 Fix my email address.
svn path=/trunk/; revision=26612
2007-05-01 13:44:55 +00:00
Timo Kreuzer
acf05c5f44 remove from build, won't compile
svn path=/trunk/; revision=26611
2007-05-01 13:01:10 +00:00
Sebastian Gasiorek
adba938cb6 change default font to DeJavu Sans (patch by preston)
fixes bug #2183

svn path=/trunk/; revision=26610
2007-05-01 10:07:52 +00:00
Sebastian Gasiorek
e86b6ad881 implement polish keyboard layout
svn path=/trunk/; revision=26609
2007-05-01 09:39:57 +00:00
Dmitry Gorbachev
0a0395bfc8 - Fix infinite loop.
- Add debug msg.

svn path=/trunk/; revision=26608
2007-05-01 08:52:59 +00:00
Ged Murphy
583ae73f0f add hh to the build
svn path=/trunk/; revision=26603
2007-04-30 22:41:09 +00:00
Ged Murphy
171d1fe1a6 a couple of small fixes to the marlett font
svn path=/trunk/; revision=26602
2007-04-30 22:39:32 +00:00
Ged Murphy
2d954aec2f fix timezone cities
svn path=/trunk/; revision=26601
2007-04-30 22:25:56 +00:00
Ged Murphy
639abb18c5 don't risk a leak. precompify header
svn path=/trunk/; revision=26600
2007-04-30 22:25:26 +00:00
James Tabor
66e137da1f Fix build. Sdk reports something about; needed for win95 functionality
svn path=/trunk/; revision=26599
2007-04-30 19:24:46 +00:00
Ged Murphy
69bd4cc6a6 - correctly get local NTP server info
- fix some bugs in the socket code

svn path=/trunk/; revision=26598
2007-04-30 19:05:04 +00:00
James Tabor
710ef6922b Moved NtGdiGetTextCharset to NtGdiGetCharSet.
svn path=/trunk/; revision=26597
2007-04-30 18:58:22 +00:00
James Tabor
ab9029ca76 Fix build.
svn path=/trunk/; revision=26596
2007-04-30 17:31:55 +00:00
James Tabor
c0289e7d9d Fix name for GdiFlush.
svn path=/trunk/; revision=26595
2007-04-30 17:20:56 +00:00
James Tabor
817d5ed49b Plug in locale GetStockObject.
svn path=/trunk/; revision=26594
2007-04-30 16:15:13 +00:00
James Tabor
4bb33d9f46 Win32k/Gdi32
- Remove NtGdiCreateFont/Indirect, and NtGdiGetOutlineTextMetrics.

svn path=/trunk/; revision=26593
2007-04-30 15:33:35 +00:00
Hervé Poussineau
6e7167b022 Rename msacm directory to msacm32
svn path=/trunk/; revision=26592
2007-04-30 15:25:51 +00:00
James Tabor
7a81790bac Win32k/Gdi32
- Remove NtGdiCreateD/IC, it served us well.
- Add a note to NtGdiCreateEnhMetaFile.

svn path=/trunk/; revision=26591
2007-04-30 14:33:10 +00:00
Christoph von Wittich
aeb5637da4 add a FORCE_CPP condition to the C::B backend - sometimes the g++ compiler finds some errors in the C code which cc doesn't
svn path=/trunk/; revision=26590
2007-04-30 12:01:14 +00:00
Eric Kohl
9497aaca2a Remove "Properties for" from caption.
svn path=/trunk/; revision=26589
2007-04-30 11:22:07 +00:00
Timo Kreuzer
6f233933c1 - Add Alex' test for GetObject (word alignment check)
- change TEST macro a little for better output

svn path=/trunk/; revision=26588
2007-04-30 10:44:18 +00:00
Timo Kreuzer
1b553a5e55 Sorry Alex, my fault. NtGdiExtGetObjectW *does* need a WORD alignment.
svn path=/trunk/; revision=26587
2007-04-30 09:33:11 +00:00
Ged Murphy
4e7353cb79 move rbuild project back to 7.1
svn path=/trunk/; revision=26586
2007-04-30 08:58:53 +00:00
Dmitry Gorbachev
5072c761aa Add a stub for TraceMessage.
svn path=/trunk/; revision=26585
2007-04-30 08:42:04 +00:00
Dmitry Gorbachev
9b13eaa0c0 Add RtlDllShutdownInProgress().
svn path=/trunk/; revision=26584
2007-04-30 08:41:42 +00:00
Sylvain Petreolle
8486880a27 forgot this file
svn path=/trunk/; revision=26583
2007-04-29 21:32:27 +00:00
Sylvain Petreolle
ccc433f9a2 translate start menu & desktop links
display 2nd stage install in system language
original patch by Pierre Schweitzer

svn path=/trunk/; revision=26582
2007-04-29 21:29:41 +00:00
Eric Kohl
b290654c00 - Replace CHECKBOXes by AUTOCHECKBOXes.
- Add a sticky keys configuration dialog (not finished yet).
- Remove "Properties for" from the title.
- Remove the property sheet callback function.

svn path=/trunk/; revision=26581
2007-04-29 14:53:57 +00:00
Eric Kohl
84ab282bdf - Remove "Properties for" from title.
- Fix page order.
- Disable first year edittext control on the "Date" page.
- Add missing (english) dialogs to the polish resource file.
- Fix coding style.

svn path=/trunk/; revision=26580
2007-04-29 13:45:10 +00:00
Thomas Bluemel
0c3487a948 Fix typo. Thanks to PeterK
See issue #2208 for more details.

svn path=/trunk/; revision=26577
2007-04-29 08:43:49 +00:00
Dmitry Gorbachev
fbdc420d95 Terminate hWnd list.
svn path=/trunk/; revision=26576
2007-04-29 08:20:39 +00:00
James Tabor
26e3f1e305 ReactOS is now using NtGdiOpenDCW for CreateD*IC. Tested with Qemu and real hardware.
svn path=/trunk/; revision=26575
2007-04-29 06:50:36 +00:00
James Tabor
d05f5dec2f Implement NtGdiOpenDCW.
svn path=/trunk/; revision=26570
2007-04-29 02:02:17 +00:00
Timo Kreuzer
a0d7f57718 gdi32_test:
a lot of testcases especially for GetObject

svn path=/trunk/; revision=26569
2007-04-29 01:43:41 +00:00
James Tabor
ec3552fddf Now we can turn on GdiReleaseDC.
svn path=/trunk/; revision=26568
2007-04-28 23:46:30 +00:00
James Tabor
0ad5a2118e Fix compile.
svn path=/trunk/; revision=26567
2007-04-28 23:42:38 +00:00
James Tabor
d51049e8a2 Allow for the deallocation of the local DC structure once the new create I and DC are ready.
svn path=/trunk/; revision=26566
2007-04-28 23:40:51 +00:00
Timo Kreuzer
9d118cb21a BRUSH_GetObject:
- return sizeof(LOBRUSH) not BRUSHOBJ
- don't return 0 on too small usermode buffer
NtGdiExtGetObjectW:
- remove unnecessary hacks
- no need to align usermode buffer to words
- add ENUMLOGFONTEXDVW, wich should be the biggest structure needed
more fixes for fonts and extpens needed in the corresponding subfunctions, but all of my other tests pass now.

svn path=/trunk/; revision=26565
2007-04-28 21:53:06 +00:00
Timo Kreuzer
8d57329f09 GetNonFontObject:
- OBJECTTYPE_META_DC does not SetLastError()
- beautify the code a little

svn path=/trunk/; revision=26564
2007-04-28 21:45:18 +00:00
Dmitry Gorbachev
2dd2c5e5b5 Undo r26555 change as suggested by Aleksey & Thomas.
svn path=/trunk/; revision=26563
2007-04-28 21:23:44 +00:00
Ged Murphy
50ff73801f update wine doc with hhctrl info
svn path=/trunk/; revision=26562
2007-04-28 11:50:21 +00:00
Ged Murphy
5d395b8ba1 add sensapi.dll to bootcd
svn path=/trunk/; revision=26561
2007-04-28 11:47:48 +00:00
Timo Kreuzer
9c609558ab wintests build fix:
- comment out type redefinitions

svn path=/trunk/; revision=26560
2007-04-28 09:02:15 +00:00
Timo Kreuzer
bccf77e454 winetsts build fix
- add needed #includes to test.h
- add windef.h including psdk/windef.h

svn path=/trunk/; revision=26559
2007-04-28 08:58:18 +00:00
James Tabor
495edaf0e6 Fix build.
svn path=/trunk/; revision=26558
2007-04-28 07:05:13 +00:00
James Tabor
57b3bc520a Fix indexing mistake, added new LDC structure items. New defines for LDC and Xfroms. Now the Dc_Attr works. Read and write to it in user space.
svn path=/trunk/; revision=26557
2007-04-28 06:43:44 +00:00
Dmitry Gorbachev
eaa232fee7 Chinese translation by Zhangbing (bug #2219).
svn path=/trunk/; revision=26556
2007-04-28 06:02:39 +00:00
Dmitry Gorbachev
2d98eea8ca Patch by Sbs (sbarthes [at] gmail [dot] com). Bugzilla report #2137.
svn path=/trunk/; revision=26555
2007-04-28 06:02:22 +00:00
Dmitry Gorbachev
d36cd41e29 - Use hack to prevent Explorer crash.
svn path=/trunk/; revision=26554
2007-04-28 04:10:33 +00:00
Dmitry Gorbachev
4b61211e6d - Do not write beyond the buffer.
svn path=/trunk/; revision=26553
2007-04-28 04:10:19 +00:00
Dmitry Gorbachev
a29c27d211 - Enlarge window name buffer.
- Do not free Menu Item Info many times.
- Remove r26508 hack.

svn path=/trunk/; revision=26552
2007-04-28 04:09:56 +00:00
Dmitry Gorbachev
8373c171aa - Do not free statically allocated structure.
svn path=/trunk/; revision=26551
2007-04-28 04:09:31 +00:00
Eric Kohl
7289c6023a - Enable and disable the "Long" and "Short" labels along with the mouse trails trackbar.
- Use BS_MULILINE and BS_TOP button styles for checkboxes that display long texts.
- Indent the edittext control on the wheel page.

svn path=/trunk/; revision=26550
2007-04-28 00:20:41 +00:00
Ged Murphy
73b74596f8 add hhctrl.ocx to bootcd
svn path=/trunk/; revision=26549
2007-04-27 23:06:43 +00:00
Ged Murphy
2292629085 - fix hhctrl.ocx and add to the build
- remove autogenerated itss.h, it was committed accidentally

svn path=/trunk/; revision=26548
2007-04-27 22:27:46 +00:00
Sylvain Petreolle
2d4262cf8c fix msi winetest
svn path=/trunk/; revision=26547
2007-04-27 21:31:07 +00:00
Magnus Olsen
039e4a7b2e patch by hto.
Fixing the crash in win32k after user-mode callback
 Some forget use seh. all user mode param shall always be using seh. 
See issue #2212 for more details.

svn path=/trunk/; revision=26546
2007-04-27 19:11:22 +00:00
Hervé Poussineau
253fa4b7a0 Fix mkdir command, if compiled in UNICODE. Patch by Pierre Schweitzer (heis_spiter at hotmail dot com)
See issue #2216 for more details.

svn path=/trunk/; revision=26545
2007-04-27 17:40:50 +00:00
James Tabor
07a4c5d550 Fix build, Error conflict.
svn path=/trunk/; revision=26544
2007-04-27 16:31:55 +00:00
Ged Murphy
d74b0da468 add hhctrl.ocx from Wine.
unfinished at the moment, so not included in the build yet.

svn path=/trunk/; revision=26543
2007-04-27 16:07:21 +00:00
James Tabor
622eab9dfa Move CreateFontIndirectEx from stubs to font.c.
svn path=/trunk/; revision=26542
2007-04-27 15:26:21 +00:00
Ged Murphy
66c85e2957 - add support for .ocx files to rbuild
- update project to VS2005

svn path=/trunk/; revision=26541
2007-04-27 15:18:34 +00:00
Eric Kohl
d7d69d0175 Add code that applies the currently selected cursor scheme.
svn path=/trunk/; revision=26540
2007-04-27 13:54:19 +00:00
Eric Kohl
aa12c0e3e3 Define missing SPI_SETCURSORS.
svn path=/trunk/; revision=26539
2007-04-27 12:56:29 +00:00
The Wine Synchronizer
8348169a15 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26538
2007-04-27 12:00:08 +00:00
The Wine Synchronizer
4d550168bb Autosyncing with Wine HEAD
svn path=/trunk/; revision=26537
2007-04-27 11:59:52 +00:00
Ged Murphy
d0ec5bba5d export stubbed LsaEnumerateTrustedDomains to get dameware loading
svn path=/trunk/; revision=26536
2007-04-27 11:54:12 +00:00
Hervé Poussineau
691d28d40a Add missing WINAPI in function prototypes
svn path=/trunk/; revision=26535
2007-04-27 11:51:50 +00:00
Ged Murphy
453ad10eac forgot to svn add the rbuild file
svn path=/trunk/; revision=26534
2007-04-27 09:39:00 +00:00
Ged Murphy
1324d35870 add wtsapi32.dll from Wine
svn path=/trunk/; revision=26533
2007-04-27 09:32:47 +00:00
Ged Murphy
dbcf03ede1 - add cryptnet.dll from wine (stub)
- relocate a few dlls

svn path=/trunk/; revision=26532
2007-04-27 09:05:43 +00:00
James Tabor
3b4b572193 Win32/Gdi32:
- Implement NtGdiHfontCreate, removed NtGdiCreateFont and NtGdiCreateFontIndirect from service. Changed name to NtGdiGetOutlineTextMetricsInternalW.
- Updated TEXTOBJ structure changing LOGFONTW to ENUMLOGFONTEXDVW.
- Update FontGetObject plus the rest of text.c in win32k.
- Added CreateFontIndirectExA/W to psdk/wingdi.h, it was missing.
Tested with Qemu.

svn path=/trunk/; revision=26530
2007-04-27 05:42:25 +00:00
Dmitry Gorbachev
9e76cf5867 Update French translation of Desk.cpl (bug #2209).
svn path=/trunk/; revision=26529
2007-04-27 02:45:39 +00:00
Dmitry Gorbachev
9438750f06 - Update French translation of Explorer (bug #2209).
- Fix minor bug in USetup.

svn path=/trunk/; revision=26528
2007-04-27 02:45:12 +00:00
Eric Kohl
0cb9c0bdde Remove quotation marks from the scheme data string to make main.cpl work on WinXP.
svn path=/trunk/; revision=26527
2007-04-26 23:34:48 +00:00
James Tabor
67e078d353 Tooling up for big changes. GetOutlineTextMetricsW, minnor update.
svn path=/trunk/; revision=26526
2007-04-26 17:58:57 +00:00
James Tabor
db6a940431 Dc allocation of DC_ATTR. If'ed out for now.
svn path=/trunk/; revision=26525
2007-04-26 16:28:50 +00:00
Eric Kohl
f2e37886f7 Add a new cursor scheme to the scheme list and select it after it has been saved.
svn path=/trunk/; revision=26524
2007-04-26 15:42:12 +00:00
James Tabor
66b0c897a2 Pluggin NtGdiArcInternal and NtGdiPolyPolyDraw
svn path=/trunk/; revision=26523
2007-04-26 14:53:36 +00:00
James Tabor
78d8963001 Start NtGdiPolyPolyDraw stub.
svn path=/trunk/; revision=26522
2007-04-26 14:42:22 +00:00
Hervé Poussineau
89546243af Add some missing const
svn path=/trunk/; revision=26521
2007-04-26 14:02:59 +00:00
The Wine Synchronizer
9cea416d3b Autosyncing with Wine HEAD
svn path=/trunk/; revision=26520
2007-04-26 13:38:13 +00:00
The Wine Synchronizer
c6e78e42c8 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26519
2007-04-26 13:37:57 +00:00
Hervé Poussineau
68e79fb538 Update some headers
svn path=/trunk/; revision=26518
2007-04-26 13:37:38 +00:00
The Wine Synchronizer
a841c3b409 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26517
2007-04-26 11:37:49 +00:00
Hervé Poussineau
14c4779a12 Add clusapi.dll to bootcd, and set it as autosynced in README.WINE
svn path=/trunk/; revision=26516
2007-04-26 11:36:30 +00:00
Ged Murphy
a1d727df3c add clusapi base address
svn path=/trunk/; revision=26515
2007-04-26 11:32:51 +00:00
Ged Murphy
cdd37d19ea - add a minimal clusapi.h. part 2 of clusapi
- this header will need a lot more work.

svn path=/trunk/; revision=26514
2007-04-26 11:32:13 +00:00
Ged Murphy
93d1dcecc4 add stubed out clusapi.dll from Wine. part 1 of 3
svn path=/trunk/; revision=26513
2007-04-26 11:28:30 +00:00
Eric Kohl
638bc65d33 - Ensure that cursor schemes can be loaded from an unmodified Windows XP. The users "Schemes" key does not exist in this case.
- Also use the KEY_QUERY_VALUE access right to open registry keys.

svn path=/trunk/; revision=26512
2007-04-26 08:28:23 +00:00
James Tabor
25e902187c Update FontGetObject, point out required modifications to support ENUMLOGFONTEXDVW for font objects.
svn path=/trunk/; revision=26511
2007-04-26 04:34:46 +00:00
James Tabor
cd5a11a313 Apply Alex patch to dc.c NtGdiExtGetObject.
svn path=/trunk/; revision=26510
2007-04-26 03:25:42 +00:00
James Tabor
5610a60b73 GetObject:
Don't mix Apples and Oranges!
- Reorder A/W structure handling for ColorSpace. 
- Pointed out the default size to be sent to NtGdiExtGetObjectW.

svn path=/trunk/; revision=26509
2007-04-26 00:37:09 +00:00
Dmitry Gorbachev
42f1c2363d "Fix" explorer crash.
svn path=/trunk/; revision=26508
2007-04-25 23:54:45 +00:00
Timo Kreuzer
96d2b5521b - Fix calculation of handle
- Add Type column

svn path=/trunk/; revision=26507
2007-04-25 22:09:23 +00:00
Johannes Anderwald
b0c5d40269 - add missing rosapps targets
svn path=/trunk/; revision=26506
2007-04-25 21:48:56 +00:00
Eric Kohl
d11c32fcc8 - Implement the mouse speed and acceleration settings.
- Update mouse option settings only if they have changed.

svn path=/trunk/; revision=26505
2007-04-25 15:22:44 +00:00
Sylvain Petreolle
a887f1c7fa winver now lives in rosapps,
add it as optional

svn path=/trunk/; revision=26504
2007-04-25 11:03:10 +00:00
Hervé Poussineau
8232bcdfd7 Do not try to copy winver.exe on the bootcd, it was deleted in r26486
svn path=/trunk/; revision=26503
2007-04-25 08:38:23 +00:00
The Wine Synchronizer
1ef7375549 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26502
2007-04-25 08:22:35 +00:00
The Wine Synchronizer
dee6701b2c Autosyncing with Wine HEAD
svn path=/trunk/; revision=26501
2007-04-25 08:22:24 +00:00
The Wine Synchronizer
a8e8588392 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26500
2007-04-25 08:22:13 +00:00
The Wine Synchronizer
b0d8e30526 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26499
2007-04-25 08:21:59 +00:00
The Wine Synchronizer
9e6fba7c97 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26498
2007-04-25 08:21:43 +00:00
The Wine Synchronizer
dbf733fa0d Autosyncing with Wine HEAD
svn path=/trunk/; revision=26497
2007-04-25 08:21:30 +00:00
The Wine Synchronizer
2815d57683 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26496
2007-04-25 08:21:11 +00:00
The Wine Synchronizer
239c488ad1 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26495
2007-04-25 08:20:45 +00:00
The Wine Synchronizer
66c1fabe11 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26494
2007-04-25 08:20:24 +00:00
The Wine Synchronizer
a601165253 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26493
2007-04-25 08:20:01 +00:00
The Wine Synchronizer
200bde0d76 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26492
2007-04-25 08:19:27 +00:00
Hervé Poussineau
85ecb99534 Fix some prototypes, prepare Wine sync of msvfw32
svn path=/trunk/; revision=26491
2007-04-25 08:18:48 +00:00
Hervé Poussineau
f330a8a5db Oops, typo
svn path=/trunk/; revision=26490
2007-04-25 07:57:40 +00:00
Hervé Poussineau
4b1d44da29 Rename msvideo to msvfw32, part 2/2
svn path=/trunk/; revision=26489
2007-04-25 07:51:26 +00:00
Hervé Poussineau
0ec9407980 Rename msvideo to msvfw32, part 1/2
svn path=/trunk/; revision=26488
2007-04-25 07:49:34 +00:00
Johannes Anderwald
abf638636b - remove reference
svn path=/trunk/; revision=26487
2007-04-24 22:53:40 +00:00
Johannes Anderwald
3c9168b478 - this module should only live in rosapps
svn path=/trunk/; revision=26486
2007-04-24 22:53:01 +00:00
Timo Kreuzer
adf530ab36 - Fix BITMAP_GetObject()
- NtGdiExtGetObjectW: return 0 if IntGdiGetObject returns 0

svn path=/trunk/; revision=26485
2007-04-24 19:01:52 +00:00
Dmitry Gorbachev
8ce4938620 Simplified Chinese resources from Zhangbing (bug #2202).
svn path=/trunk/; revision=26484
2007-04-24 12:58:14 +00:00
Dmitry Gorbachev
f0f64567fa Undo r26482 change, waste more stack space.
svn path=/trunk/; revision=26483
2007-04-24 05:05:49 +00:00
Dmitry Gorbachev
1abb769823 Use allocation function instead of hack, save 12 bytes.
svn path=/trunk/; revision=26482
2007-04-23 22:06:34 +00:00
Johannes Anderwald
4684a592f2 - fix rbuild file for modules
- avtest
- downloader
- gettype
- green
- imagesoft
- ramdrv
- roshttpd
- screenshot
- winefile
- winver

svn path=/trunk/; revision=26481
2007-04-23 18:54:51 +00:00
Johannes Anderwald
65af5cdee8 - add a few spanish translations by Javier Remacha, remialdo@gmail.com
See issue #2110,2111 for more details.

svn path=/trunk/; revision=26480
2007-04-23 18:30:35 +00:00
Johannes Anderwald
59165de8b8 - fix sublang ids
svn path=/trunk/; revision=26479
2007-04-23 18:13:03 +00:00
Eric Kohl
4759ac6aa7 Use the IDs of the default cursors to load the default cursor scheme.
svn path=/trunk/; revision=26478
2007-04-23 18:10:14 +00:00
Johannes Anderwald
4ddb4966b9 - add a few spanish translations by Javier Remacha, remialdo@gmail.com (bug 2113) (bug 2114) (bug 2115) (bug 2116) (bug 2117)
svn path=/trunk/; revision=26477
2007-04-23 17:58:43 +00:00
Eric Kohl
e1363274d9 Add default cursors using IDs 100 to 116 because these IDs are used by Windows and the Mouse Control Panel Applet will use these IDs to show the default cursor scheme. The old cursor resources will be removed as soon as cursor schemes are properly loaded by user32.dll and win32k.sys.
svn path=/trunk/; revision=26476
2007-04-23 17:07:46 +00:00
Timo Kreuzer
1fb9668017 - fix indentation, no code change
svn path=/trunk/; revision=26475
2007-04-23 15:48:37 +00:00
Timo Kreuzer
a21f8262bf GetObject rewrite part 2 (NtGdiExtGetObjectW, ...)
- hanlde GDI_OBJECT_TYPE_EXTPEN
- PALETTEOBJ* -> PPALGDI
- fix return value of BITMAP_GetObject & BRUSH_GetObject
- implement PALETTE_GetObject
- handle cases where the buffer gets filled partly

svn path=/trunk/; revision=26474
2007-04-23 15:32:04 +00:00
Johannes Anderwald
a3c8ac67d5 - update polish translation by Groblewicz (xxrogers@users.sourceforge.net)
See issue #2194 for more details.

svn path=/trunk/; revision=26473
2007-04-23 15:22:38 +00:00
Timo Kreuzer
67962f297e GetObject rewrite part one (gdi32)
- use switch/case instead of if
- SetLastError() only in the correct cases
- add additional object types
- restructure the code
- change to @implemented
Before someone reverts everything: I have testcases. 129/132 tests pass now (this is without EXTLOGPEN tests)

svn path=/trunk/; revision=26472
2007-04-23 14:31:08 +00:00
Eric Kohl
99183c7f49 - Enable the "Apply" button when a change to the current cursor scheme has been made.
- Support any cursor size.

svn path=/trunk/; revision=26471
2007-04-23 09:21:13 +00:00
Dmitry Gorbachev
b6ec0ae75f Do not wait so long for drive reset.
svn path=/trunk/; revision=26470
2007-04-23 04:54:13 +00:00
Eric Kohl
b25aaa3d59 Use WS_EX_CLIENTEDGE to make the main windows look a little nicer.
svn path=/trunk/; revision=26469
2007-04-22 23:09:45 +00:00
Magnus Olsen
eb55201ce5 Fixing a crash, fixed so Setcoparative pass the test, still some werid bugs after I delete all code in ddraw.
anyone whant debuging this u are wellcome

svn path=/trunk/; revision=26468
2007-04-22 19:59:44 +00:00
Magnus Olsen
2189a28c87 adpabte wine SetCooperativeLevel to reactis ddraw. allot test need be done, I also took DDRAWI_DIRECTDRAW_LCL->dwObsolete1 as device windows.
memory leak can exists and some value I forget free as well. 

svn path=/trunk/; revision=26467
2007-04-22 18:15:31 +00:00
Eric Kohl
84234a9add Add message boxes to confirm the removal of user cursor schemes and the replacement of existing cursor schemes.
svn path=/trunk/; revision=26466
2007-04-22 17:55:11 +00:00
Eric Kohl
14dabcb80d Add missing strings.
svn path=/trunk/; revision=26465
2007-04-22 15:16:36 +00:00
Eric Kohl
d9543390bb - Add the ability to save cursor schemes.
- Open the browse dialog upon double-click on a cursor in the cursor list.
- Localize the filter string and the title string of the browse dialog.

svn path=/trunk/; revision=26464
2007-04-22 15:11:04 +00:00
Dmitry Gorbachev
9ff0fd619e Fix Polish translation (bug #2194).
svn path=/trunk/; revision=26463
2007-04-22 14:35:02 +00:00
Magnus Olsen
8c548667ca fixing a small bug in startup.c
svn path=/trunk/; revision=26462
2007-04-22 14:02:37 +00:00
Magnus Olsen
6a8616e1f8 This commit break ddraw.dll it does not working any longer can not execlute a program. it is part of cleanup of the startup process of dx interface.
svn path=/trunk/; revision=26461
2007-04-22 13:54:34 +00:00
James Tabor
e808f1ee16 Implement Wine port EnumLogFontExW2A.
svn path=/trunk/; revision=26460
2007-04-22 12:46:26 +00:00
Dmitry Gorbachev
8c39ab1ac8 Fix bug #2188.
svn path=/trunk/; revision=26458
2007-04-22 00:25:32 +00:00
James Tabor
6a08b2af85 Removed NtGdiGetObjectType, use GDI_HANDLE_GET_TYPE.
svn path=/trunk/; revision=26457
2007-04-21 22:23:19 +00:00
James Tabor
09a93d1379 GetObjectA/W:
- During testing of font objects, I passed ENUM/EXT/LOGFONT/EX/W to NtGdiExtGetObjectW.
   I think it likes EXTLOGFONTW. More resesrch is required.
 - Added a helper subroutine GetNonFontObject.


svn path=/trunk/; revision=26456
2007-04-21 21:56:29 +00:00
Thomas Bluemel
8bafbd4cdb link against powrprof
svn path=/trunk/; revision=26455
2007-04-21 20:16:11 +00:00
Thomas Bluemel
447e15240e Display current CPU speed
svn path=/trunk/; revision=26454
2007-04-21 19:37:11 +00:00
Eric Kohl
ab2d232623 - The initially selected cursor scheme was always treated as a system scheme. Fixed!
- Clean-up the "browse cursor" and "delete cursor scheme" code.
- Remove string buffers from the PointerProc function.

svn path=/trunk/; revision=26453
2007-04-21 14:56:23 +00:00
Christoph von Wittich
82e7994a44 removed unneeded dependencies
svn path=/trunk/; revision=26452
2007-04-21 14:24:15 +00:00
Hervé Poussineau
d91187e69e Try to fix build by including a POSTAUTO target, executed after the creation of makefile.auto
Remove a hack in Makefile
WARNING: You need to delete makefile.auto after updating to this revision!

svn path=/trunk/; revision=26451
2007-04-21 13:19:59 +00:00
Christoph von Wittich
02af37bdf4 add ks back to build
svn path=/trunk/; revision=26450
2007-04-21 12:47:04 +00:00
Christoph von Wittich
d7e104f635 set svn:eol-style native
svn path=/trunk/; revision=26449
2007-04-21 11:23:41 +00:00
James Tabor
bdc91e1345 Initialize stock_object cache.
svn path=/trunk/; revision=26447
2007-04-21 01:56:47 +00:00
James Tabor
28d7cf70fc Fix my code so it can compile.
svn path=/trunk/; revision=26445
2007-04-20 23:53:04 +00:00
James Tabor
a7c2ad7021 Implement CreatePolygonRgn and partial implementation of CreatePolyPolygonRgn. Need to implement NtGdiPolyPolyDraw. It is stubbed in my tree.
svn path=/trunk/; revision=26444
2007-04-20 23:50:44 +00:00
James Tabor
eff89f2d9a Implement GetAndSetDCDWord. Clearing out my code base. This has set here for six months now.
svn path=/trunk/; revision=26443
2007-04-20 23:31:51 +00:00
James Tabor
7b205923df Reimplement GetStockObject, based on Wine. It is bypassed in the def file. Init support code is not added yet.
svn path=/trunk/; revision=26442
2007-04-20 22:44:37 +00:00
Christoph von Wittich
cf933b1f2b implement NtGdiGetSystemPaletteEntries (patch by w3seek)
svn path=/trunk/; revision=26441
2007-04-20 22:36:57 +00:00
James Tabor
789cd80e65 Forgot stubs.c update.
svn path=/trunk/; revision=26440
2007-04-20 21:30:49 +00:00
James Tabor
02492896d1 Implement GdiFixUpHandle, fix handle masking and entry indexing.
svn path=/trunk/; revision=26439
2007-04-20 21:21:15 +00:00
Christoph von Wittich
e97e061bad fix compilation of ks
and fix some issues with portcls (not all)

svn path=/trunk/; revision=26438
2007-04-20 16:45:18 +00:00
Hervé Poussineau
006c35bd43 Add missing dependancy
svn path=/trunk/; revision=26437
2007-04-20 12:37:53 +00:00
The Wine Synchronizer
f662eaa548 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26436
2007-04-20 12:23:52 +00:00
Hervé Poussineau
c3111bb5ce Process .idl files before source files
svn path=/trunk/; revision=26435
2007-04-20 12:18:10 +00:00
Hervé Poussineau
0186ef646d Autosyncing with Wine HEAD
svn path=/trunk/; revision=26434
2007-04-20 11:44:43 +00:00
The Wine Synchronizer
c1a0a2b00c Autosyncing with Wine HEAD
svn path=/trunk/; revision=26433
2007-04-20 11:26:32 +00:00
Eric Kohl
ac9fa62a28 - Fix the "Use default" and "Browse" functions on the pointer page.
- Remove useless code.

svn path=/trunk/; revision=26432
2007-04-20 11:02:35 +00:00
The Wine Synchronizer
24ed99d8d9 Revert changes done to ole32, oleaut32 and riched20 in r26428.
You need to *exclusively* use wineimport.cmd tool when updating these libraries

svn path=/trunk/; revision=26431
2007-04-20 10:28:01 +00:00
Christoph von Wittich
d0cdae3bdc forgot to set a dependency
svn path=/trunk/; revision=26430
2007-04-20 02:43:06 +00:00
Christoph von Wittich
c89ee63d25 move ks.h to psdk
svn path=/trunk/; revision=26429
2007-04-20 02:33:02 +00:00
Christoph von Wittich
1f121135ab update riched20,ole32,oleaut32 to latest wine versions
disable ks,portcls,wdm because of broken ks.h
updated psdk,ddk headers
updated uuid and wine libs
implement IdlHeader handling in rbuild
added new idl files and removed the old header files
TODO: get rid of the WINELIB_NAME_AW macros, fix ks.h

svn path=/trunk/; revision=26428
2007-04-20 02:30:53 +00:00
Christoph von Wittich
dfb2099f2c rename internal CreateToolBar function to avoid naming conflicts
svn path=/trunk/; revision=26427
2007-04-19 22:55:37 +00:00
Christoph von Wittich
0ed01d58fd added some more defines (taken from wine)
svn path=/trunk/; revision=26426
2007-04-19 21:04:40 +00:00
James Tabor
b242b46662 Move name NtGdiGetObject to NtGdiExtGetObjectW, no code change.
svn path=/trunk/; revision=26425
2007-04-19 20:30:28 +00:00
Magnus Olsen
bd137f7767 put back right code for in NtGdiGetObject after all people have been mess around in it. please ask how it works before u thuch this code.
svn path=/trunk/; revision=26424
2007-04-19 18:55:25 +00:00
Dmitry Gorbachev
8961a9e5d5 Zhangbing's Solitaire translation (bug #2186).
svn path=/trunk/; revision=26423
2007-04-19 15:25:54 +00:00
Eric Kohl
1cefaa15f9 - Fix a bug in EnumerateCursorSchemes that caused the selection of the wrong cursor scheme upon page initialization.
- Remove obsolete global variables.

svn path=/trunk/; revision=26422
2007-04-19 15:00:56 +00:00
Ged Murphy
38945890be revert base changes. The original test case was wrong
svn path=/trunk/; revision=26421
2007-04-19 09:33:53 +00:00
Eric Kohl
8d7099f9ac Fix the tab order on the wheel page and replace generic CONTROL statements by RADIOBUTTON statements.
svn path=/trunk/; revision=26420
2007-04-19 08:37:27 +00:00
Eric Kohl
b7e4d48a47 Update indentation, no code changes.
svn path=/trunk/; revision=26419
2007-04-19 07:10:37 +00:00
The Wine Synchronizer
627d3f8c10 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26418
2007-04-19 07:10:09 +00:00
Hervé Poussineau
df36abec77 Prepare autosync of Wine wldap32 dll
svn path=/trunk/; revision=26417
2007-04-19 07:09:34 +00:00
Magnus Olsen
df581d7e3c Wrote one new header this morning compatible with dxsdk 2004 dec release.
svn path=/trunk/; revision=26416
2007-04-19 06:42:57 +00:00
Dmitry Gorbachev
cfccfd2a06 Fix Ukrainian translation.
svn path=/trunk/; revision=26414
2007-04-19 00:31:15 +00:00
Dmitry Gorbachev
08cc46e1f1 Use separate directory for language-specific files.
svn path=/trunk/; revision=26413
2007-04-19 00:31:01 +00:00
Christoph von Wittich
e005356583 add wldap32.rbuild
svn path=/trunk/; revision=26412
2007-04-18 23:57:15 +00:00
Christoph von Wittich
b67e2c97a8 Copied remotely
svn path=/trunk/; revision=26411
2007-04-18 23:49:02 +00:00
Christoph von Wittich
196301c5c4 Removed file/folder
svn path=/trunk/; revision=26410
2007-04-18 23:48:22 +00:00
Christoph von Wittich
67f8b0225f Removed file/folder
svn path=/trunk/; revision=26409
2007-04-18 23:45:10 +00:00
Christoph von Wittich
814fee4797 add rbuild files for wldap32 and add it to bootcd
svn path=/trunk/; revision=26408
2007-04-18 23:42:27 +00:00
Christoph von Wittich
96e23d17f6 Copied remotely
svn path=/trunk/; revision=26407
2007-04-18 23:41:42 +00:00
James Tabor
2317af487c Correct pointer in LDC.
svn path=/trunk/; revision=26405
2007-04-18 19:52:40 +00:00
James Tabor
7eca5e510f Correct statment for NtGdiGetObject.
svn path=/trunk/; revision=26404
2007-04-18 19:51:33 +00:00
Christoph von Wittich
dd05afbec1 fix a bug and some warnings in ddraw
svn path=/trunk/; revision=26403
2007-04-18 19:51:21 +00:00
Christoph von Wittich
f90ddf0d29 disable IntEngGradientFillTriangle because of an endless loop and add a FIXME
svn path=/trunk/; revision=26402
2007-04-18 19:07:11 +00:00
Christoph von Wittich
fb3ba4445f fix build of d3d8.dll and add it to bootcd (needed by Trillian)
svn path=/trunk/; revision=26401
2007-04-18 18:19:26 +00:00
Christoph von Wittich
9b77e5185f implemented SPI_GETKEYBOARDCUES (hardcoded to TRUE)
svn path=/trunk/; revision=26400
2007-04-18 16:45:09 +00:00
Eric Kohl
68e9e8da8f - Show the current cursor scheme upon page initialization.
- Update the cursor list and the cursor preview when a new cursor scheme is selected.
- Update the cursor preview when another cursor is selected.

svn path=/trunk/; revision=26399
2007-04-18 15:42:13 +00:00
Christoph von Wittich
8288717157 revert the translation patches for wine-autosynced modules
svn path=/trunk/; revision=26398
2007-04-18 15:30:04 +00:00
Christoph von Wittich
6029bc5beb polish translation from the polish translation team
See issue #2181 for more details.

svn path=/trunk/; revision=26397
2007-04-18 15:21:29 +00:00
Timo Kreuzer
81e62c37bf NtGdiGetObject:
- return 0 if buffer != 0 and count == 0
- don't write beyond umode buffer size (max count bytes!)
- use SEH only once
- No need for Ret & RetCount, use only RetCount
- document the function

svn path=/trunk/; revision=26396
2007-04-18 13:46:11 +00:00
Christoph von Wittich
c52d16c759 use the correct index in Module32Next
svn path=/trunk/; revision=26395
2007-04-18 13:39:26 +00:00
Christoph von Wittich
1b8f5cd0bb fix formatting
svn path=/trunk/; revision=26394
2007-04-18 12:50:21 +00:00
Christoph von Wittich
99163e450a fix some bugs in CreateActCtxA
svn path=/trunk/; revision=26393
2007-04-18 12:31:39 +00:00
Dmitry Gorbachev
285ed6ed7e Chinese translations by Zhangbing (bugs 2179, 2180).
svn path=/trunk/; revision=26392
2007-04-18 08:53:15 +00:00
Christoph von Wittich
3a413e53d1 forgot to commit this file
svn path=/trunk/; revision=26390
2007-04-18 02:50:29 +00:00
Christoph von Wittich
951839f487 fix build of d3d9.dll and add it to bootcd
svn path=/trunk/; revision=26389
2007-04-18 02:40:09 +00:00
Christoph von Wittich
a8e41c3f8f include npfs.h before debug.h - this fixes compilation with MSVC
svn path=/trunk/; revision=26388
2007-04-18 01:51:27 +00:00
Christoph von Wittich
90441d106e fix formatting (no code changes)
svn path=/trunk/; revision=26387
2007-04-18 01:25:28 +00:00
Christoph von Wittich
4f58b4d38e don't cast HBITMAP to HICON in when type is IMAGE_BITMAP
svn path=/trunk/; revision=26386
2007-04-18 00:55:04 +00:00
Christoph von Wittich
1f00c50b85 take care of DIB_PAL_COLORS in NtGdiStretchDIBits
svn path=/trunk/; revision=26385
2007-04-18 00:38:36 +00:00
Christoph von Wittich
d2796783e0 fix console font
svn path=/trunk/; revision=26384
2007-04-17 23:38:39 +00:00
Ged Murphy
96b61f6b0b - fix GetObject call for bitmaps
- Windows returns the number of bytes copied, not the size of the struct.
- fix NtGdiGetObject, 'count' is now irrelevant
- this breaks CopyImage, but it's broken anyway so it can wait until tomorrow.

svn path=/trunk/; revision=26383
2007-04-17 22:58:34 +00:00
Dmitry Gorbachev
d5d519547c Simplified Chinese translation by zhangbing (bug #2175).
svn path=/trunk/; revision=26382
2007-04-17 20:38:03 +00:00
Christoph von Wittich
2ac5f48e47 change the condition in NtGdiGetObject to if ((RetCount) && (count)) (patch by GreatLord)
svn path=/trunk/; revision=26381
2007-04-17 20:26:49 +00:00
Christoph von Wittich
0751108eaf add cryptui.dll to bootcd
svn path=/trunk/; revision=26380
2007-04-17 20:06:00 +00:00
Christoph von Wittich
c35151ce3d fix crash in VerQueryValueA/W
svn path=/trunk/; revision=26379
2007-04-17 18:58:58 +00:00
Christoph von Wittich
da377e0f0b implemented NtUserDrawCaptionTemp (doesn't support all flags yet but enough to get the desk.cpl working)
svn path=/trunk/; revision=26378
2007-04-17 17:15:33 +00:00
Dmitry Gorbachev
ee9ffb6236 Finnish translation (see bug #1781).
svn path=/trunk/; revision=26377
2007-04-17 17:00:20 +00:00
Thomas Bluemel
0cfc87c00c Revert r26375 partly, being able to select multiple applications *does* make sense (e.g. to minimize/restore them)!
svn path=/trunk/; revision=26376
2007-04-17 16:48:32 +00:00
Dmitry Gorbachev
aec5ef496c Taskmgr patch from Heis Spiter (bug #2085).
svn path=/trunk/; revision=26375
2007-04-17 15:53:59 +00:00
Dmitry Gorbachev
c47c4021ba Update French translations (bug #2120).
svn path=/trunk/; revision=26374
2007-04-17 15:45:00 +00:00
Dmitry Gorbachev
dbaad8acc7 Update Norwegian translation (bug #1756).
svn path=/trunk/; revision=26373
2007-04-17 15:13:46 +00:00
Christoph von Wittich
aa3af33258 fix "FIXME"-text
svn path=/trunk/; revision=26372
2007-04-17 13:59:54 +00:00
Christoph von Wittich
2a7a36c6bf add cryptui.dll (stubbed) needed by SmartFTP
svn path=/trunk/; revision=26371
2007-04-17 13:02:53 +00:00
Christoph von Wittich
0c39bba15b implemented DrawCaptionTempA/W
(NtUserDrawCaptionTemp is still missing)

svn path=/trunk/; revision=26370
2007-04-17 11:27:42 +00:00
Eric Kohl
64a7ff0759 - Replace the listview control on the pointer page by an ownerdrawn listbox and add necessary code changes.
- Add missing "Horizontal Resize" string resource.
- Make the cursor preview work for the system cursors.

svn path=/trunk/; revision=26368
2007-04-17 10:41:07 +00:00
Christoph von Wittich
5012d502e3 display the icons again - but something is still wrong
svn path=/trunk/; revision=26367
2007-04-17 01:15:24 +00:00
Dmitry Gorbachev
6784ecd342 Detect i8042 IRQs by edge. This should fix endless loop in i8042 driver on
machines with VIA and ALI chipsets. (See bug report #2159.) Thanks Peter K. 
and other testers for help.

svn path=/trunk/; revision=26366
2007-04-16 23:03:41 +00:00
Dmitry Gorbachev
cd86e748b8 Do not change reserved ELCR bits.
svn path=/trunk/; revision=26365
2007-04-16 23:02:54 +00:00
Magnus Olsen
0606c5e1f9 Wrote two new header this morning compatible with dxsdk 2004 dec release.
svn path=/trunk/; revision=26363
2007-04-16 06:46:25 +00:00
Magnus Olsen
dba1a7a382 Find some older works, dxsdk header compatible with dxsdk 2004 dec release. I will clean up sdk so dx thuse dx header belong to dxsdk will be here. later.
In this folder will contain all header that is compatible with dxsdk 2004 dec. later I will upgrade this folder file to more resent dxsdk headers. 

svn path=/trunk/; revision=26362
2007-04-15 17:29:40 +00:00
Magnus Olsen
db1bac44f0 Find some older works, dxsdk header compatible with dxsdk 2004 dec release. I will clean up sdk so dx thuse dx header belong to dxsdk will be here. later.
In this folder will contain all header that is compatible with dxsdk 2004 dec. later I will upgrade this folder file to more resent dxsdk headers. 

svn path=/trunk/; revision=26361
2007-04-15 15:28:57 +00:00
Magnus Olsen
ca8c6fb877 Find some older works, dxsdk header compatible with dxsdk 2004 dec release. I will clean up sdk so dx thuse dx header belong to dxsdk will be here. later.
In this folder will contain all header that is compatible with dxsdk 2004 dec. later I will upgrade this folder file to more resent dxsdk headers. 

svn path=/trunk/; revision=26360
2007-04-15 14:39:23 +00:00
Magnus Olsen
b3bd2cb8be Find some older works, dxsdk header compatible with dxsdk 2004 dec release. I will clean up sdk so dx thuse dx header belong to dxsdk will be here. later.
In this folder will contain all header that is compatible with dxsdk 2004 dec. later I will upgrade this folder file to more resent dxsdk headers. 

svn path=/trunk/; revision=26359
2007-04-15 14:08:04 +00:00
Magnus Olsen
ab23b32e3d Find some older works, dxsdk header compatible with dxsdk 2004 dec release. I will clean up sdk so dx thuse dx header belong to dxsdk will be here. later.
In this folder will contain all header that is compatible with dxsdk 2004 dec. later I will upgrade this folder file to more resent dxsdk headers. 

svn path=/trunk/; revision=26358
2007-04-15 13:49:34 +00:00
Magnus Olsen
cbbad16d0f Find some older works, dxsdk header compatible with dxsdk 2004 dec release. I will clean up sdk so dx thuse dx header belong to dxsdk will be here. later.
In this folder will contain all header that is compatible with dxsdk 2004 dec. later I will upgrade this folder file to more resent dxsdk headers. 

svn path=/trunk/; revision=26357
2007-04-15 13:14:42 +00:00
Magnus Olsen
b665d86cf0 Find some older works, dxsdk header compatible with dxsdk 2004 dec release. I will clean up sdk so dx thuse dx header belong to dxsdk will be here. later.
In this folder will contain all header that is compatible with dxsdk 2004 dec. later I will upgrade this folder file to more resent dxsdk headers. 

svn path=/trunk/; revision=26356
2007-04-15 12:37:11 +00:00
Eric Kohl
f9dd8597e1 Change pointer shadow setting on-the-fly.
svn path=/trunk/; revision=26355
2007-04-15 10:56:51 +00:00
Magnus Olsen
82fec2b2ca Find some older works, dxsdk header compatible with dxsdk 2004 dec release. I will clean up sdk so dx thuse dx header belong to dxsdk will be here. later.
In this folder will contain all header that is compatible with dxsdk 2004 dec. later I will upgrade this folder file to more resent dxsdk headers. 

svn path=/trunk/; revision=26354
2007-04-15 10:17:27 +00:00
Magnus Olsen
00da39c2a7 Find some older works, dxsdk header compatible with dxsdk 2004 dec release. I will clean up sdk so dx thuse dx header belong to dxsdk will be here. later.
In this folder will contain all header that is compatible with dxsdk 2004 dec. later I will upgrade this folder file to more resent dxsdk headers. 

svn path=/trunk/; revision=26353
2007-04-15 09:31:28 +00:00
Magnus Olsen
cccfc14618 Find some older works, dxsdk header compatible with dxsdk 2004 dec release. I will clean up sdk so dx thuse dx header belong to dxsdk will be here. later.
In this folder will contain all header that is compatible with dxsdk 2004 dec. later I will upgrade this folder file to more resent dxsdk headers. 

svn path=/trunk/; revision=26352
2007-04-15 09:08:13 +00:00
Magnus Olsen
66f57054d0 Copied remotely, this header is compatible with ms dxsdk 2004 dec
svn path=/trunk/; revision=26351
2007-04-14 22:32:01 +00:00
Magnus Olsen
809f75e1e2 Copied remotely, compatible with dxsdk 2004 dec
svn path=/trunk/; revision=26350
2007-04-14 21:45:40 +00:00
Magnus Olsen
828716e496 Find some older works, dxsdk header compatible with dxsdk 2004 dec release. I will clean up sdk so dx thuse dx header belong to dxsdk will be here. later.
In this folder will contain all header that is compatible with dxsdk 2004 dec. later I will upgrade this folder file to more resent dxsdk headers. 

svn path=/trunk/; revision=26349
2007-04-14 21:36:02 +00:00
Magnus Olsen
6204e0ae00 Find some older works, dxsdk header compatible with dxsdk 2004 dec release. I will clean up sdk so dx thuse dx header belong to dxsdk will be here. later.
In this folder will contain all header that is compatible with dxsdk 2004 dec. later I will upgrade this folder file to more resent dxsdk headers. 

svn path=/trunk/; revision=26348
2007-04-14 20:36:46 +00:00
Magnus Olsen
0a8246f280 Find some older works, dxsdk header compatible with dxsdk 2004 dec release. I will clean up sdk so dx thuse dx header belong to dxsdk will be here. later.
In this folder will contain all header that is compatible with dxsdk 2004 dec. later I will upgrade this folder file to more resent dxsdk headers. 

svn path=/trunk/; revision=26347
2007-04-14 20:07:28 +00:00
Eric Kohl
7984ff409c - Set mouse speed an mouse trail on-the-fly.
- Get rid of more global variables.

svn path=/trunk/; revision=26346
2007-04-14 20:07:16 +00:00
Magnus Olsen
c037b35615 Find some older works, dxsdk header compatible with dxsdk 2004 dec release. I will clean up sdk so dx thuse dx header belong to dxsdk will be here. later.
In this folder will contain all header that is compatible with dxsdk 2004 dec. later I will upgrade this folder file to more resent dxsdk headers. 

svn path=/trunk/; revision=26345
2007-04-14 19:08:13 +00:00
Magnus Olsen
83bf07aef3 Find some older works, dxsdk header compatible with dxsdk 2004 dec release. I will clean up sdk so dx thuse dx header belong to dxsdk will be here. later.
In this folder will contain all header that is compatible with dxsdk 2004 dec. later I will upgrade this folder file to more resent dxsdk headers. 

svn path=/trunk/; revision=26344
2007-04-14 18:54:57 +00:00
Magnus Olsen
d5f02da15d Find some older works, dxsdk header compatible with dxsdk 2004 dec release. I will clean up sdk so dx thuse dx header belong to dxsdk will be here. later.
In this folder will contain all header that is compatible with dxsdk 2004 dec. later I will upgrade this folder file to more resent dxsdk headers. 

svn path=/trunk/; revision=26343
2007-04-14 18:18:31 +00:00
Dmitry Gorbachev
5f8f828416 Fix a bug.
svn path=/trunk/; revision=26342
2007-04-14 18:07:08 +00:00
Eric Kohl
82bb46d16d - Fix the mouse wheel page.
- Get rid of global variables.

svn path=/trunk/; revision=26341
2007-04-14 16:12:26 +00:00
Sylvain Petreolle
f4a15a31a1 fix swap file caption size
svn path=/trunk/; revision=26340
2007-04-14 15:12:22 +00:00
Eric Kohl
267358185b Ooops! Forgot to add the icons!
svn path=/trunk/; revision=26339
2007-04-14 14:37:27 +00:00
Eric Kohl
8b3e3dd6c0 - Swap mouse buttons on-the-fly.
- Add mouse button preview icons.
- Change double click speed on-the-fly.
- Add double click test icons.
- Fix double click speed calculation.
- Get rid of rsrc.rc.

svn path=/trunk/; revision=26338
2007-04-14 14:26:46 +00:00
Ged Murphy
d9f8bb326a - don't put items to the start menu if they aren't in the OS. this applies to the apps we moved out for trunk builds
- remove ibrowser and winefile completely
- add devmgmt

svn path=/trunk/; revision=26337
2007-04-14 01:09:38 +00:00
Timo Kreuzer
2693be107f NtUserBuildHwndList:
- non-recursive implementation, which saves stack space and should be about twice as fast.
- use SEH instead of MmCopyToCaller

svn path=/trunk/; revision=26336
2007-04-14 00:06:21 +00:00
Ged Murphy
595f645cca delete cplsample, we have no reason to have a cpl applet shell in our tree
svn path=/trunk/; revision=26335
2007-04-13 23:44:07 +00:00
Ged Murphy
c81e33705b delete vc6 files
svn path=/trunk/; revision=26334
2007-04-13 23:43:53 +00:00
Dmitry Gorbachev
1a4bfcb4ce Allow installation to / booting from a disk with several partitions (hack).
svn path=/trunk/; revision=26333
2007-04-13 22:04:39 +00:00
Sylvain Petreolle
58d132c3c6 translate other parts of desk into french
svn path=/trunk/; revision=26332
2007-04-13 20:50:37 +00:00
Ged Murphy
9eb397f1d9 update French resource file.
Thanks to HeisSpiter

svn path=/trunk/; revision=26331
2007-04-13 18:27:12 +00:00
Dmitry Gorbachev
c6079e7909 Fix previous fix.
svn path=/trunk/; revision=26330
2007-04-13 14:57:36 +00:00
Dmitry Gorbachev
abe25cf75b Fix a bug. (Thanks to Ged).
svn path=/trunk/; revision=26329
2007-04-13 14:47:55 +00:00
Dmitry Gorbachev
7f235d3886 Thai translation by Sumath Aowsakulsutthi.
svn path=/trunk/; revision=26328
2007-04-13 14:29:01 +00:00
Dmitry Gorbachev
533c3d2c65 Thai translation by Sumath Aowsakulsutthi
svn path=/trunk/; revision=26327
2007-04-13 14:28:22 +00:00
Dmitry Gorbachev
f940277069 Fix Italian translation (Carlo Bramini).
svn path=/trunk/; revision=26326
2007-04-13 11:00:38 +00:00
Ged Murphy
acba6c80ef Rewrite screensaver cpl applet, key changes are:
- redesigned to look like XP's
- Add the screensaver preview on the dialog
- implement saving of screensaver settings
- preview and config buttons now work
Translators required.

svn path=/trunk/; revision=26325
2007-04-13 04:23:35 +00:00
Alex Ionescu
4337531281 - Send IRP_MN_FILTER_RESOURCE_REQUIREMENTS to devices before IRP_MN_START_DEVICE. Allows the Windows Input Stack to load better, but we still have a load order bug. Patch by hpoussin.
svn path=/trunk/; revision=26324
2007-04-12 23:48:31 +00:00
James Tabor
8eb6d672a1 Fix signedness error.
svn path=/trunk/; revision=26323
2007-04-12 05:14:24 +00:00
Alex Ionescu
cde8c95d91 - Fix several pushlock bugs (thanks in part to hto). Should fix bug 2063.
svn path=/trunk/; revision=26322
2007-04-11 20:00:53 +00:00
Dmitry Gorbachev
2a83478e2a Fix some bugs.
svn path=/trunk/; revision=26321
2007-04-11 08:43:34 +00:00
Magnus Olsen
51c632e281 DO not waring if no keyboard layout does not exists or loading, I change the msg from DPRINT1 to DRPINT
svn path=/trunk/; revision=26320
2007-04-11 07:01:44 +00:00
Dmitry Gorbachev
7d0a0bacc0 Norvegian translation by LMH1 (bug reports 1737 and 1738).
svn path=/trunk/; revision=26317
2007-04-10 23:06:01 +00:00
Christoph von Wittich
75361b6928 get GreatLord's hack at least to work
svn path=/trunk/; revision=26316
2007-04-10 22:57:57 +00:00
Magnus Olsen
e43e673325 1. small hack to getting a new checked treed being build.
2. This bug does not show if you doing make clean and Build only affect a new frech tree
3. please fix the makefile more right this is a small hack until some fix it. 


svn path=/trunk/; revision=26315
2007-04-10 22:47:12 +00:00
Timo Kreuzer
3f379161d6 NtGdiMoveToEx: copy old cursor pos back to caller instead of copying from caller.
svn path=/trunk/; revision=26314
2007-04-10 21:58:15 +00:00
Magnus Olsen
92c14d1f5f update the copyright year in the rc file
svn path=/trunk/; revision=26312
2007-04-10 20:49:41 +00:00
Magnus Olsen
8206f926b7 update freetype to 2.3.4
svn path=/trunk/; revision=26311
2007-04-10 20:41:41 +00:00
Magnus Olsen
361475b0a6 This fix the hiniting issue we have seen crop ypqg before u did not see it was drawing.
This commit cause a smaller glitch in cmd. Please some help me figout how to fix this glitch in cmd
other wise I will be force revert this commit. 

svn path=/trunk/; revision=26306
2007-04-10 18:52:24 +00:00
Magnus Olsen
c1e9fc6f75 darn rember me close all file before a commit, I did by mistake break the build fixed with this commit
svn path=/trunk/; revision=26305
2007-04-10 17:06:59 +00:00
Magnus Olsen
c9fb4f777b Long live Dejavu font, Long live Dejavu font
This commit fixed the charwidth calculation that was wrong for unicode font. That mean we can last using dejavu font in cmd. 
Now anyone whant we can delete the bitstream font from reactos please test see if it any apps still using bitstream font. 
I can not found any apps in reactos using it anylonger. I give the pleasuer delete the bitstream font for anyone whant 
doing that. 


svn path=/trunk/; revision=26304
2007-04-10 17:05:23 +00:00
Dmitry Gorbachev
7848c88917 Fix debug message.
svn path=/trunk/; revision=26303
2007-04-10 10:07:15 +00:00
Hervé Poussineau
4e939dcc2c Replace freeldr DEBUG define, by the global DBG define
svn path=/trunk/; revision=26302
2007-04-10 09:31:51 +00:00
Timo Kreuzer
39b3562b65 tabs->spaces reformat, no code change.
svn path=/trunk/; revision=26301
2007-04-09 19:52:32 +00:00
Aleksey Bragin
6b2c34484c - Reverting 26299: Please fix an actual bug (wherever it is), and don't commit your temporary personal workarounds.
svn path=/trunk/; revision=26300
2007-04-09 18:05:27 +00:00
Magnus Olsen
f410bbe117 comment out vga drv, we only need one of thuse two driver start on livecd. and that is vbe driver not both driver.
svn path=/trunk/; revision=26299
2007-04-09 16:09:22 +00:00
Sylvain Petreolle
406ee892b1 make french accents display correctly,
patch by Pierre Schweitzer
see issue #1919

svn path=/trunk/; revision=26298
2007-04-09 14:32:53 +00:00
Eric Kohl
655f34cb87 Change keyboard settings on-the-fly to make the preview work properly.
svn path=/trunk/; revision=26295
2007-04-09 13:26:55 +00:00
Alex Ionescu
52041c5b65 - Call IRP_MN_START_DEVICE in a critical region, since NT drivers depend on this implementation detail (on NT, an ERESOURCE+CriticalRegion is always held when parsing a new device node, so all related IRP_MNs are actually received under a critical region. For now, I only made IRP_MN_START_DEVICE behave as such. i8042prt from the DDK depends on this behavior.
- Cleaned up Fast Mutex Implementation.
- Disabled a hard-coded bugcheck and instead disabled soem code.

svn path=/trunk/; revision=26294
2007-04-09 13:00:38 +00:00
Magnus Olsen
aa7e29c22e NtGdiDdCanCreateSurface
1. fixed the input of DDSURFACEDESC2 so it been convert to DDSURFACEDESC.
2. fixed varius bsod in ros 0.3.1 
3. fixed some return code. 

svn path=/trunk/; revision=26293
2007-04-09 11:45:25 +00:00
Sylvain Petreolle
2c7409ef06 fix netid fr-FR.rc codepage
svn path=/trunk/; revision=26292
2007-04-09 11:23:10 +00:00
Sylvain Petreolle
c35a93cdf1 add french translation,
sublang fixes

svn path=/trunk/; revision=26291
2007-04-09 10:06:38 +00:00
Sylvain Petreolle
6f8ab055b0 update appwiz.cpl french translation
svn path=/trunk/; revision=26290
2007-04-09 09:40:07 +00:00
Dmitry Gorbachev
f57e0717e2 Use separate directory for language-specific files.
svn path=/trunk/; revision=26289
2007-04-08 21:55:16 +00:00
Dmitry Gorbachev
871e05ab78 Use separate directory for language-specific files.
svn path=/trunk/; revision=26288
2007-04-08 21:54:46 +00:00
Dmitry Gorbachev
b594d9eacb Use new naming convention.
svn path=/trunk/; revision=26287
2007-04-08 21:53:24 +00:00
Dmitry Gorbachev
319fb9f4a4 Use new naming convention.
svn path=/trunk/; revision=26286
2007-04-08 19:04:00 +00:00
Magnus Olsen
fc7ad40506 revert 21677 this change are not need, I comfrim vmware own graphice driver do not release the dx interface in windows xp/2003 or higher.
I remove so vmware drv getting dx interfae, this enabler windows xp graphice drv again. sorry no dx hardware acclations from vmware any longer. 

svn path=/trunk/; revision=26285
2007-04-08 17:43:51 +00:00
Eric Kohl
c74fbaf787 Add cursor blink time preview and change blink time on the fly.
svn path=/trunk/; revision=26284
2007-04-08 16:46:35 +00:00
Dmitry Gorbachev
29cb375d5a Fix "registry error" bug (see bugzilla report #1998).
svn path=/trunk/; revision=26283
2007-04-08 14:57:34 +00:00
Magnus Olsen
ce8c107dbc fixing smaller bugs in NtGdiDdWaitForVerticalBlank now it is compatible with windows 2000 in all my test case.
svn path=/trunk/; revision=26282
2007-04-08 12:05:22 +00:00
Eric Kohl
923523688f Add caret blink time setting.
svn path=/trunk/; revision=26281
2007-04-08 10:18:24 +00:00
Eric Kohl
a580611fe7 - Add missing keyboard speed dialog resources.
- Implement keyboard repeat delay and repeat rate settings.

svn path=/trunk/; revision=26280
2007-04-07 23:10:58 +00:00
Ged Murphy
d3bc04a87c - add hh.exe
- not added to build as it useless until we get hhctrl.ocx done.

svn path=/trunk/; revision=26279
2007-04-07 15:24:45 +00:00
Magnus Olsen
9da28b4efd tested NtGdiDdGetScanLine not suppored by vmware drv did use another 3d party driver for the test.
fixed some werid loop of pseh, all code are tested in 0.3.1 for I do not have a working vmware drv 
for the driver. NtGdiDdGetScanLine is working same as windows 2000 now. 


svn path=/trunk/; revision=26278
2007-04-07 15:10:01 +00:00
Ged Murphy
2ee0f4dca0 start to redo tracert
svn path=/trunk/; revision=26277
2007-04-07 15:09:57 +00:00
Aleksey Bragin
78117fc10d Please use TABs inside .rbuild files, not spaces.
svn path=/trunk/; revision=26276
2007-04-07 15:09:48 +00:00
Magnus Olsen
734706acab clean up NtGdiDdQueryDirectDrawObject and NtGdiDdCreateDirectDrawObject They are now working to 100% simulare to windows 2000 in all case. if you do not count the undoc bevhoir of NtGdiDdCreateDirectDrawObject when pvmlist and heapnum got a vaild pointer and heapnum=0
svn path=/trunk/; revision=26275
2007-04-07 09:30:52 +00:00
Alex Ionescu
2d88738681 - NDK updates and compatibility fixes for Vista/WDK/User-Mode/Individual per-file NDK Usage.
- Update targets to pentium to take advantage of cmpxhg8b when possible. (ROS won't run on 386/486 anyway).
- Fix some compiler problems when building with -O3.

svn path=/trunk/; revision=26274
2007-04-07 05:33:30 +00:00
Timo Kreuzer
dd4ede8870 load metrics fonts and colors from registry on userinit.
svn path=/trunk/; revision=26273
2007-04-07 00:32:34 +00:00
Timo Kreuzer
69ef89a5e9 IntSetSysColors: update SysColorBrushes and Pens and broadcast WM_SYCOLORCHANGE message. Now you can change colors with desk.cpl
svn path=/trunk/; revision=26272
2007-04-06 22:50:19 +00:00
Magnus Olsen
937e866fb2 remove a wrong behvoir in DdQueryDirectDrawObject aka GdiEntry2
svn path=/trunk/; revision=26271
2007-04-06 20:54:21 +00:00
Magnus Olsen
a6bda507b9 Remove a windwos 95/98/Me behvoir in NtGdiDdQueryDirectDrawObject, also tested in windows 2000 see if this bevhoir really exitsed or not.
puvmList and puNumHeaps should be ignore by Windows NT when they are pass down, it is not true if both getting a vaild pointer I am getting back data in windows it is not a vmList, what I get back I do not known. Add a comment I did forget setup the copy of puD3dTextureFormats from kmode to umode pointer will be fixed later. After I fix the last part this api is 99.9% compatible with Windows 2000 and higher.

svn path=/trunk/; revision=26270
2007-04-06 20:43:11 +00:00
Timo Kreuzer
5f5b06dc4b fix warnings on gcc 4.1.2
svn path=/trunk/; revision=26269
2007-04-06 14:24:59 +00:00
Aleksey Bragin
96924455c4 - Make class2 and disk completely warning-free.
svn path=/trunk/; revision=26268
2007-04-05 17:36:39 +00:00
Magnus Olsen
43b354a3d4 Update Dejavu from 2.14 to 2.16
It add allot of new charaters to all dejavu font.

svn path=/trunk/; revision=26267
2007-04-05 12:20:19 +00:00
Alex Ionescu
dd73f432c2 - Refactored some parts of the FS Recognizer Driver.
- Added support for some more advanced storage stack support.
- Added locking and states.
- Added the ability for a file system to span across different device types (such as UDFS which is both for disks and optical media)
- Updated NTFS, UDFS validation to use new functions. CDFS validation was removed (NT doesn't do it).
- Improved some parts of FAT validation and relaxed others to match NT's.

svn path=/trunk/; revision=26266
2007-04-05 00:11:35 +00:00
Dmitry Gorbachev
fe6c48c65b - Fix the damn thing.
svn path=/trunk/; revision=26265
2007-04-04 20:12:23 +00:00
Johannes Anderwald
965b2d9d39 - allow backspace in edit / hex mode
- patch by Kamil Hornicek (tykef@atlas.cz)

See issue #2129 for more details.

svn path=/trunk/; revision=26264
2007-04-04 19:43:27 +00:00
Johannes Anderwald
9d6dcfb24e - move implementation of dialogs to appropiate file (odbccp32.dll)
- odbccp32.cpl is therefore complete YUHU
- rbuild needs to be hacked that odbccp32.cpl is outputed in the right destination folder (currently it writes into destination of odbccp32.dll)

svn path=/trunk/; revision=26263
2007-04-04 18:43:24 +00:00
Johannes Anderwald
c3ebb7990e - beginning of ODBC control panel applet
svn path=/trunk/; revision=26262
2007-04-04 16:26:16 +00:00
Aleksey Bragin
260dc41818 - Fix freeing of an unallocated memory bug (RtlInitUnicodeString() never allocates anything, it just initializes necessary fields, and noone asks us to free the string the function gets as a parameter).
svn path=/trunk/; revision=26261
2007-04-04 16:04:41 +00:00
Aleksey Bragin
ed06eba9e3 ... and pciide/pciidex.
svn path=/trunk/; revision=26260
2007-04-04 15:22:03 +00:00
Aleksey Bragin
2682573ee6 - Fix up npfs/msfs drivers paths.
svn path=/trunk/; revision=26259
2007-04-04 15:15:43 +00:00
Alex Ionescu
f623df7b11 - Refactor device attachment into a private routine.
- We shouldn't allow attaching to a device that's still initlizaing, but ROS currently does because of some device that tries to do this, in the PnP manager or early boot-phase drivers (it has an auto-generated name). Please fix this!

svn path=/trunk/; revision=26258
2007-04-04 03:19:27 +00:00
Alex Ionescu
6a5123b065 - Implement IopAttachDeviceToDeviceStackSafe for future use.
- Use OBJ_KERNEL_HANDLE for various internal Device Object handles.
- Fix bug in IopStartNextPacketByKeyEx which didn't actually read the flags to see if the I/O was cancelleable or not.
- Fail DO creation if the VPB couldn't be created.
- Fix completely wrong implementation of IoGetDeviceAttachmentBaseRef. It was getting the attached device instead of the base device, and wasn't even referencing it!.
- 

svn path=/trunk/; revision=26257
2007-04-04 02:49:41 +00:00
Alex Ionescu
0c5f9a2ec6 - Remove "zero-stream" from null, NT doesn't support this.
- Implement Fast I/O Dispatch entrypoints for null.
- Support query file information and lock IRPs, just like NT.
- Remove query volume information IRP, not supported by NT.
- Page the entire driver.

svn path=/trunk/; revision=26256
2007-04-03 16:22:44 +00:00
Alex Ionescu
ca95775748 - Don't load NT4 audio drivers by default anymore.
- Don't load beep.sys in non-setup mode.
- Improve beep driver by making it use device queues instead of instantly completing beep requests, and make it cancel-safe, unloadable, and thread-safe in regards to timers. Also reduce memory footprint by making the entire driver pageable and dynamically locking/unlocking the image section by keeping a reference count of opens.

svn path=/trunk/; revision=26254
2007-04-03 16:01:58 +00:00
Aleksey Bragin
295322ab9b - Remove unneeded DPRINT1().
svn path=/trunk/; revision=26253
2007-04-03 15:18:05 +00:00
Alex Ionescu
4b795a9e2d - Add "fs" to npfs and msfs.
- Put blue in drivers\setup.
- Re-organize Audio stack in /wdm and /ksfilter directories.

svn path=/trunk/; revision=26252
2007-04-03 14:55:54 +00:00
Alex Ionescu
baf845546d - Add missing .rbuild files from last commit.
- Move serial stack to /serial.
- Move parallel stack to /parallel and make room for parport/parclass (NT5+ Parallel stack).

svn path=/trunk/; revision=26251
2007-04-03 14:22:00 +00:00
Alex Ionescu
d03eaaa66d - Cleanup /storage directory and prepare for NT5+ Storage Stack and Floppy Port/Class drop.
svn path=/trunk/; revision=26250
2007-04-03 14:14:25 +00:00
Aleksey Bragin
3340addefa - Remove old unused code for sending sense requests.
- Bugfix new sense request code (it was saving a pointer to the wrong SRB).
- Implement requests, which bypass frozen queue. CdRom should now work properly.
- Some very small code reformating.

svn path=/trunk/; revision=26249
2007-04-02 20:24:54 +00:00
Alex Ionescu
05d2982786 - Revert 26244, 26245, 26246, 26247.
- Stop committing on crack.
- Read IRC logs and use your head.
- GCC 3.4.5 is buggy, don't use. Don't break good code to hide compiler bugs.

svn path=/trunk/; revision=26248
2007-04-02 15:08:54 +00:00
Magnus Olsen
3fd4c41408 some gcc 3.4.5 fixed; but not all we need
svn path=/trunk/; revision=26247
2007-04-02 10:32:21 +00:00
Magnus Olsen
ceac8e2667 fixing the build for gcc 3.4.5
svn path=/trunk/; revision=26246
2007-04-02 09:48:51 +00:00
Magnus Olsen
fbfe1712be fixing the build for gcc 3.4.5
svn path=/trunk/; revision=26245
2007-04-02 09:01:15 +00:00
Magnus Olsen
550b42f6d2 fixing the build for gcc 3.4.5
svn path=/trunk/; revision=26244
2007-04-02 08:58:34 +00:00
Aleksey Bragin
cfb33d951a - Revert double spinlock releasing introduced by 26242 (but thanks for fixing DPRINT :) ).
svn path=/trunk/; revision=26243
2007-04-02 08:00:31 +00:00
Dmitry Gorbachev
982ab11661 Do not assume ReleaseSpinLock == LowerIrql.
svn path=/trunk/; revision=26242
2007-04-01 22:04:26 +00:00
Hervé Poussineau
4b824a0114 Take care of ROS_AUTOMAKE variable in rbuild
svn path=/trunk/; revision=26241
2007-04-01 20:47:00 +00:00
Aleksey Bragin
f32c6a7cd9 - Add more compile-time checks for KPRCB C vs. asm fields match.
svn path=/trunk/; revision=26240
2007-04-01 19:35:05 +00:00
Aleksey Bragin
d860e7b5eb - Rename scsiport-new to scsiport (couldn't do that in the previous commit).
svn path=/trunk/; revision=26239
2007-04-01 19:27:59 +00:00
Aleksey Bragin
4e7b22b216 - Commit "new" storage stack drivers support based on NT4 DDK's sample drivers (with some modifications and a couple of hacks - they are marked with "HACK" keyword in the source code).
- ReactOS boots/works (faster/stabler), VMWare bug is gone.
- Delete the old scsiport, switching to the new scsiport instead.
NOTE(!): Before commenting this commit read license.txt files. If you still want to comment, read license.txt again, it should help.
- Warnings fixes, improvements, etc to the code will come later.

svn path=/trunk/; revision=26238
2007-04-01 19:25:38 +00:00
Magnus Olsen
934ee21b1f this file is auotgenreate sorry, thx alex
svn path=/trunk/; revision=26237
2007-04-01 19:00:29 +00:00
Magnus Olsen
1c0e162f29 some have delete the napi.h I do not known how did that. it break the win32k complete it is a private header file
svn path=/trunk/; revision=26236
2007-04-01 18:48:25 +00:00
Saveliy Tretiakov
f18384ae4f Implement UserUnloadKeyboardLayout()
svn path=/trunk/; revision=26234
2007-04-01 17:34:00 +00:00
Saveliy Tretiakov
9e8d69fa5d Implement NtUserUnloadKeyboardLayout()
svn path=/trunk/; revision=26233
2007-04-01 17:30:44 +00:00
Saveliy Tretiakov
36af38d7dd Add missing check
svn path=/trunk/; revision=26232
2007-04-01 17:27:59 +00:00
Saveliy Tretiakov
9a92415ba4 Implement EngUnloadImage
svn path=/trunk/; revision=26231
2007-04-01 17:20:50 +00:00
Saveliy Tretiakov
d1004e8c13 Implement EngUnloadImage()
svn path=/trunk/; revision=26230
2007-04-01 17:15:58 +00:00
Saveliy Tretiakov
eecef5a1de Implement SystemUnloadGdiDriverInformation
svn path=/trunk/; revision=26229
2007-04-01 17:15:08 +00:00
Saveliy Tretiakov
0048eddd14 Fix build
svn path=/trunk/; revision=26228
2007-04-01 17:14:24 +00:00
Aleksey Bragin
b684c23b8e - Remove audit brake / svn:needs-lock property, since these drivers are going to become svn history soon.
svn path=/trunk/; revision=26227
2007-04-01 16:29:16 +00:00
Aleksey Bragin
1d3fb59485 - Move handlers of SRB_FUNCTION_ATTACH and RELEASE to a standalone function, and don't do reference/dereference of the DeviceObject
- Implement RELEASE_QUEUE and FLUSH_QUEUE srb functions
- Turn off DPRINTs, since scsiport seems to finally work (without advanced features, but enough to install and boot using ATAPI and DISK drivers)!

svn path=/trunk/; revision=26226
2007-04-01 12:13:55 +00:00
Aleksey Bragin
01da330bc2 - More DPRINTs added to ease debugging
- Bugfixes: IOCTL_SCSI_GET_CAPABILITIES fixed, setting inquiry operation in CDB fixed, storing information about bus scanning fixed

svn path=/trunk/; revision=26225
2007-04-01 11:17:48 +00:00
KJK::Hyperion
643b171651 !!! ATTENTION EVERYONE - do a make clean after getting this revision !!!
!!! ATTENTION PSEH USERS - new features & a change in rules !!!

modified   include/reactos/libs/pseh/framebased.h
modified   include/reactos/libs/pseh/framebased/internal.h
deleted    include/reactos/libs/pseh/setjmp.h
modified   lib/pseh/framebased.c
deleted    lib/pseh/i386/setjmp.asm
modified   lib/pseh/pseh.rbuild
   Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
   !!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
   !!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
   !!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
   Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
   On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
   Use inline code to enter/leave trylevels; yields much better binary code
   Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
   Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
   Removed bitrotten old syntax, because it wasn't being used nor maintained

modified   dll/3rdparty/freetype/freetype.rbuild
modified   dll/win32/kernel32/kernel32.rbuild
modified   drivers/network/tcpip/tcpip.rbuild
modified   lib/drivers/ip/ip.rbuild
modified   lib/rtl/rtl.rbuild
modified   ntoskrnl/ntoskrnl.rbuild
modified   subsystems/win32/win32k/win32k.rbuild
   Removed obsolete _SEH_NO_NATIVE_NLG define

modified   drivers/network/afd/afd/lock.c
modified   drivers/network/afd/afd/tdi.c
modified   subsystems/csr/csrsrv/api.c
modified   subsystems/win32/win32k/ntuser/clipboard.c
modified   subsystems/win32/win32k/ntuser/window.c
   Use the new _SEH_YIELD macro to return/goto from SEH blocks

modified   tools/rbuild/backend/mingw/modulehandler.cpp
modified   tools/rbuild/backend/mingw/modulehandler.h
modified   tools/rbuild/module.cpp
modified   tools/rbuild/project.dtd
modified   tools/rbuild/rbuild.h
   Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
   Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing

modified   lib/3rdparty/mingw/mingw.rbuild
   Build with underscoresymbols="true"

svn path=/trunk/; revision=26224
2007-04-01 00:07:25 +00:00
Dmitry Gorbachev
9ce1b28fc1 Fix the bug introduced in r26219.
svn path=/trunk/; revision=26223
2007-03-31 22:18:16 +00:00
Aleksey Bragin
ebf23937a3 - Fix a few obvious bugs (incorrect DeviceExtension pointer arithmetic, non-initialized field usage).
- Packets are sequentially numbered.

Now all devices are perfectly enumerated (SpBuildDeviceMap() may still need work, but later), and problem occurs later when servicing IOCTLs.

svn path=/trunk/; revision=26222
2007-03-31 20:47:42 +00:00
Aleksey Bragin
fd27183f35 - Implement timeouts / retrying after timeout.
svn path=/trunk/; revision=26221
2007-03-31 20:03:07 +00:00
Aleksey Bragin
fc3d38d1cb - Finish ScsiPortInitialize() refactoring / improving. Only DMA stuff and 2-interrupts case are missing now.
svn path=/trunk/; revision=26220
2007-03-31 18:37:07 +00:00
Dmitry Gorbachev
c08f45390a Do not wait for explorer startup. Hack.
svn path=/trunk/; revision=26219
2007-03-31 11:52:24 +00:00
Magnus Olsen
151cc9133b more compatible fix betwin reactos ddk and ms DDK version 3790.1830
svn path=/trunk/; revision=26218
2007-03-30 22:58:02 +00:00
Magnus Olsen
898210e00d more compatible fix betwin reactos ddk and ms DDK version 3790.1830
svn path=/trunk/; revision=26217
2007-03-30 21:17:33 +00:00
Dmitry Gorbachev
fda50948f1 Fix a bug.
svn path=/trunk/; revision=26216
2007-03-30 21:08:23 +00:00
Magnus Olsen
1ca4f18dc7 more compatible fix betwin reactos ddk and ms DDK version 3790.1830
svn path=/trunk/; revision=26215
2007-03-30 21:08:09 +00:00
Magnus Olsen
043a16c1dc more compatible fix betwin reactos ddk and ms DDK version 3790.1830
svn path=/trunk/; revision=26214
2007-03-30 20:49:26 +00:00
Magnus Olsen
a6246fbb17 more compatible fix betwin reactos ddk and ms DDK version 3790.1830
svn path=/trunk/; revision=26213
2007-03-30 20:04:05 +00:00
Aleksey Bragin
7ea1266acd - Fix ScsiPortGetDeviceBase() / ScsiPortSetDeviceBase().
svn path=/trunk/; revision=26212
2007-03-30 19:24:11 +00:00
Aleksey Bragin
c891e7315a - Further work on ScsiPortInitialize(): old PortConfig section is deleted.
- SpiGetPciData() code improved, part of the code is transferred into a new function.

Right now a crash is introduced in ScsiPortFreeDeviceBase(), because of the changes in ScsiPortInitialize(): will be fixed by the next commit.

svn path=/trunk/; revision=26211
2007-03-30 19:10:29 +00:00
Aleksey Bragin
1f9a18b920 - Revert useless commit:
* No need to copy stuff from DDK, it's prohibited (#define _INC_NEWDEV)
 * #pragma was put there especially, and no reason to remove it was said
 * pushpack / poppack does not do anything if there are no structs definitions

svn path=/trunk/; revision=26210
2007-03-30 15:39:27 +00:00
Magnus Olsen
dedbc24d60 more compatible fix betwin reactos ddk and ms DDK version 3790.1830
svn path=/trunk/; revision=26209
2007-03-30 15:32:34 +00:00
Magnus Olsen
7b9e24ee13 moref compatible fix betwin reactos ddk and ms DDK version 3790.1830
svn path=/trunk/; revision=26208
2007-03-30 15:24:03 +00:00
Magnus Olsen
07ec644063 moref compatible fix betwin reactos ddk and ms DDK version 3790.1830
svn path=/trunk/; revision=26207
2007-03-30 15:13:14 +00:00
Magnus Olsen
d255db35bf fixing usb.h compatible with DDK version 3790.1830
adding usb200.h compatible with DDK version 3790.1830

svn path=/trunk/; revision=26206
2007-03-30 14:50:01 +00:00
Aleksey Bragin
b33dcd50d9 - Start ScsiPortInitialize() refactoring: moving code to separate functions, adding support for various registry-defined options / tweaks (like DisableTaggedQueuing).
- Fixed a bug with using wrong spinlock (IrpLock instead of SpinLock).
- Doesn't fix anything yet, just makes work with the ScsiPortInitialize() more comfortable and initializing needed fields correctly. Also the "PortConfig" filling inside ScsiPortInitialize() will go away once it works fine in the standalone function.

svn path=/trunk/; revision=26205
2007-03-30 13:17:06 +00:00
Magnus Olsen
e3701e4987 remove VidMemFree and HeapVidMemAllocAligned
they are protoypes belong to dmemmgr.h

ddrawi.h need be rewiten it is from wine so I add some hacks for now getting it works simluare to ms ddk version. 
This fix gdi32.dll break in the build

svn path=/trunk/; revision=26204
2007-03-30 09:53:34 +00:00
Magnus Olsen
b18be77063 fixing newdev.h compatible with DDK version 3790.1830
it did not have #include <pshpack1.h>  and #include <poppack.h>

svn path=/trunk/; revision=26203
2007-03-30 08:47:54 +00:00
Magnus Olsen
0772fa79b5 adding ieverp.h compatible with DDK version 3790.1830
svn path=/trunk/; revision=26202
2007-03-30 08:41:21 +00:00
Magnus Olsen
94bc12cc65 fixing ddrawint.h compatible with DDK version 3790.1830
adding polarity.h compatible with DDK version 3790.1830

svn path=/trunk/; revision=26201
2007-03-30 08:34:20 +00:00
Aleksey Bragin
fe868c7d45 - Implement a simple error handling branch, however it gets hit due to an error somewhere else.
svn path=/trunk/; revision=26200
2007-03-29 21:18:28 +00:00
Aleksey Bragin
3ff7da19ca - Massive changes due to a rewrite of the core logic related to ISR, DPC, IRP completion and commands delivery. Fixes a lot of race conditions which existed in hbirr-scsiport.
- Add some helper functions, and fields inside device extension structures.
- Reorganize flags a little, dividing them into flags for scsi port device extension and logical unit device extension. (however some of the flags are still messed up)
- This gets us further, but still not enough / bugs may exist.

svn path=/trunk/; revision=26199
2007-03-29 21:05:41 +00:00
Aleksey Bragin
3d4fc31db6 - Change unclear flag name to a better one.
- Set needed flags in a few places (which I forgot to set) - this fixes the hang introduced by the previous commit.
- Further code prettification.

svn path=/trunk/; revision=26198
2007-03-28 19:26:41 +00:00
Hervé Poussineau
e2ab9cb060 Don't use ntoskrnl.RtlDuplicateUnicodeString, as it is not exported on MS Windows
svn path=/trunk/; revision=26197
2007-03-28 18:47:35 +00:00
Aleksey Bragin
d8175ef0a6 - Rearrange code inside ScsiPortStartIo() routine (some code for dma-support added, but currently disabled), also change time when spinlock is being held.
- Respective changes in ScsiPortStartPacket(), also some code is missing for rare kind of requests.
- Add flags check into ScsiPortIsr(), so that we skip unwanted interrupts (and change to usage of the new interrupt flags structure instead of a strange and unclear "IrpFlags" field).

svn path=/trunk/; revision=26196
2007-03-28 18:29:15 +00:00
Johannes Anderwald
d7f6674119 - fix memory leak
svn path=/trunk/; revision=26195
2007-03-28 17:43:44 +00:00
Hervé Poussineau
71bef156c4 Fix interrupt resources (related to r21188 fix)
svn path=/trunk/; revision=26194
2007-03-28 17:40:57 +00:00
Aleksey Bragin
93f480d223 Fix HalGetInterruptVector() calls. Should enable input devices after 26188 fix.
svn path=/trunk/; revision=26193
2007-03-28 17:14:16 +00:00
Aleksey Bragin
ce0e0958b4 - Start putting all data, needed for ISR into a dedicated structure.
- Use DEVICE_QUEUEs.
- Add a function to retrieve SRB information help structure (is a shared code between Notify(), and in future - ScsiPortGetSrb()).
- Rework RequestComplete part of ScsiPortNotification().
- Rework ScsiPortDispatchScsi() a bit - shutdown/flush can share the same code as execute_scsi/ioctl requests, also added a few more DPRINTs in error conditions to help debugging.

svn path=/trunk/; revision=26192
2007-03-28 10:41:03 +00:00
Aleksey Bragin
24387402f3 - Fix a few simple mistakes / typos.
- Enumerating buses almost works.

svn path=/trunk/; revision=26191
2007-03-28 09:44:37 +00:00
Magnus Olsen
95c38a9cf1 change ObpDosDevicesShortName match the ob.h header prototype
svn path=/trunk/; revision=26190
2007-03-27 21:21:32 +00:00
Aleksey Bragin
dfd6a60128 - Rewrite bus scanning / inquiry handling (was BSODing).
- Change a way LUN extensions are stored inside DeviceExtension.

svn path=/trunk/; revision=26189
2007-03-27 21:15:09 +00:00
Aleksey Bragin
f5af63ddda - Fix HalGetInterruptVector()'s usage of level vs. vector. At least Windows seems to use Level parameter.
- No need in special hacks (e.g. in scsiport), as a result.

svn path=/trunk/; revision=26188
2007-03-27 12:55:57 +00:00
Aleksey Bragin
379a566aa8 Change code, fix warnings, so it finally builds.
svn path=/trunk/; revision=26187
2007-03-27 11:07:12 +00:00
Aleksey Bragin
285adfefbe - Remove old crap files
- Put new .def, add .rbuild

svn path=/trunk/; revision=26186
2007-03-27 10:12:59 +00:00
Aleksey Bragin
86476d7a1b Branch scsiport from the "before hbirr rewrite" state (rev. 8950).
svn path=/trunk/; revision=26185
2007-03-27 10:07:57 +00:00
Timo Kreuzer
9c00af1b5f fix a tiny mem leak
svn path=/trunk/; revision=26184
2007-03-27 02:52:42 +00:00
Hervé Poussineau
76f7f2d03a Include nci.mak later, as it needs $(ARCH) variable
Fix a typo in ncitool

svn path=/trunk/; revision=26183
2007-03-26 23:43:07 +00:00
Hervé Poussineau
cd21248e88 Add missing file
svn path=/trunk/; revision=26182
2007-03-26 23:00:58 +00:00
Hervé Poussineau
0e5cca2a4e - Move NCI generated files to arch-specific directories
- Replace ncitool by the one from powerpc branch, which supports code generation for multiple architectures

svn path=/trunk/; revision=26181
2007-03-26 22:56:22 +00:00
Hervé Poussineau
acad1159c3 Cleanup code for easier porting to other architectures
svn path=/trunk/; revision=26180
2007-03-26 20:28:13 +00:00
Aleksey Bragin
87d76d8d95 Commit to test SVN 1.4.3 upgrade...
svn path=/trunk/; revision=26179
2007-03-26 18:56:35 +00:00
Magnus Olsen
24f90dc0c9 we now resive DrvGetDirectDrawInfo DD_HALINFO from the driver to win32k from win32k to gdi32.dll or d3dthk.dll or direcly syscall. it take care of allot bugs in my test case. tested with vmware driver
svn path=/trunk/; revision=26178
2007-03-26 07:49:05 +00:00
Magnus Olsen
8362925634 ReactOS win32k are using windows 2000 driver and it seam if we want using ms dx interface for graphics driver we must report it is plan NT5 driver we want not higher or lower, this show from vmware own display driver, now we get req for pvmList before we doing second call to DrvGetDirectDrawInfo, it show good sign we got that request from vmware driver.
svn path=/trunk/; revision=26177
2007-03-26 03:46:11 +00:00
Hervé Poussineau
e9f5948d58 Allocate enough memory to copy string
See issue #2107 for more details.

svn path=/trunk/; revision=26176
2007-03-25 22:42:37 +00:00
Hervé Poussineau
b58b255ebf Fix warnings by Pierre Schweitzer
Add svn:eol-style property
See issue #2096 for more details.

svn path=/trunk/; revision=26175
2007-03-25 21:25:11 +00:00
Hervé Poussineau
06c88018fb Updated French translation by Pierre Schweitzer
See issue #2001 for more details.

svn path=/trunk/; revision=26174
2007-03-25 21:20:32 +00:00
Hervé Poussineau
50e595a2db Add French translation by Stéphane BARTHES
Update German translation by Colin Finck
See issue #2101 for more details.

svn path=/trunk/; revision=26173
2007-03-25 20:59:55 +00:00
Hervé Poussineau
d94852e52a French translation by Stéphane BARTHES
See issue #2101 for more details.

svn path=/trunk/; revision=26172
2007-03-25 20:55:06 +00:00
Hervé Poussineau
54ddef051a French translation by Stéphane BARTHES
See issue #2109 for more details.

svn path=/trunk/; revision=26171
2007-03-25 20:49:00 +00:00
Aleksey Bragin
fff4893bbc - Change ScsiPort prototype to match DDK.
svn path=/trunk/; revision=26170
2007-03-25 18:21:12 +00:00
Aleksey Bragin
87967349f8 - Add a few more IOCTLs needed for storage stack
- Add a couple of structs from DDK
- Change ScsiPort prototype to match DDK

svn path=/trunk/; revision=26169
2007-03-25 18:18:51 +00:00
Aleksey Bragin
e0fff4a12f rbuild uses TABs for indentation.
svn path=/trunk/; revision=26168
2007-03-25 17:24:52 +00:00
Alex Ionescu
c28da2e61a - Fixup some kernel module debugging flags/settings from leftovers.
- Enable debugging during text-mode setup.
- Optimize KeSynhronizeExecution into assembly so we can avoid using EBP and have the fastest possible routine, since it is performance critical.
- 

svn path=/trunk/; revision=26167
2007-03-25 14:33:54 +00:00
Aleksey Bragin
ea6edc618d More 26160-style fixes (mandatory addressing of PCR via FS register).
Alex & Dmitry - please check this, just in case.

svn path=/trunk/; revision=26166
2007-03-25 14:31:03 +00:00
Aleksey Bragin
51147f6c84 - Fix (and optimize) KeRemoveByKeyDeviceQueue() routine.
- Add DPRINTs for easier testing/debugging.

svn path=/trunk/; revision=26165
2007-03-25 13:23:30 +00:00
Magnus Olsen
34713168d4 Fixing smaller bugs in dx after some analyzing how vmware drv works.
1. vmware drv do not implement DrvGetDirectDrawInfo
   that show windows 2000/XP/2003 that mean u are not force to implement this api in the drv, only INDEX_DrvEnableDirectDraw and INDEX_DrvDisableDirectDraw are req to be implement in the driver. 

svn path=/trunk/; revision=26164
2007-03-25 10:53:05 +00:00
Ged Murphy
3907b65ae1 rearrange servman language files before sbs goes crazy ...
svn path=/trunk/; revision=26163
2007-03-24 14:55:57 +00:00
Ged Murphy
aee5aaff2e ensure correct linkage. fixes build
svn path=/trunk/; revision=26162
2007-03-24 11:36:36 +00:00
Ged Murphy
00b0578558 make entry points unicode compliant
thanks to Colin Finck for noticing

svn path=/trunk/; revision=26161
2007-03-24 10:38:15 +00:00
Dmitry Gorbachev
6afc128ac7 Fix a bug.
svn path=/trunk/; revision=26160
2007-03-24 08:31:23 +00:00
Magnus Olsen
8d9781fe92 rewrite old NtGdiDdBlt I wrote so it match with the new caching of Dx pointers. Fixing varius problem in NtGdiDdCreateSurface. But some who the color are not being draw right with DdBlt work in Progress to figout why. But it works now partly yes dx start working. at kmode or syscall for real apps. or if they are using gdi32.dll or d3d8thk.dll
svn path=/trunk/; revision=26159
2007-03-23 17:07:49 +00:00
Thomas Bluemel
2ac1a08519 Fix bugs in GetBinaryType reported by songlei@qihoo.net
svn path=/trunk/; revision=26158
2007-03-23 15:34:34 +00:00
Magnus Olsen
b54c8f6b9b Thank CodeMercenary (CodeMercenary at hotmail dot com) that provide ms ddk example driver code is wrong for how to write a graphice driver with dx support. he gave me input and provide the ddk example code is wrong.
Now I change the desgin after correct infomations
so it lead to even less overhead of code. 
 
 

svn path=/trunk/; revision=26157
2007-03-23 12:47:19 +00:00
Timo Kreuzer
b7763201df fix build
svn path=/trunk/; revision=26156
2007-03-23 01:52:24 +00:00
Aleksey Bragin
eebea09420 When initial setup is running it asks to press enter to format the drive, then
it displays the exact same message again before finally formatting the drive.

Thanks Colin_Finck.

See issue #1964 for more details.

svn path=/trunk/; revision=26155
2007-03-22 18:38:48 +00:00
Ged Murphy
f279772add fix icon
svn path=/trunk/; revision=26154
2007-03-22 18:37:23 +00:00
Hervé Poussineau
cc526db47b Send service name to pnproot driver (not used yet)
svn path=/trunk/; revision=26153
2007-03-22 17:13:14 +00:00
Aleksey Bragin
fed3766e68 - Clear DPC request when delivering DPCs from the idle loop
(by Alex Ionescu).

svn path=/trunk/; revision=26152
2007-03-21 21:28:58 +00:00
Hervé Poussineau
b3f670a641 Add svn:eol-style property
svn path=/trunk/; revision=26151
2007-03-21 20:32:38 +00:00
Hervé Poussineau
3b3c9641e4 Clear DO_DEVICE_INITIALIZING flag when device is initialized.
See issue #1790 for more details.

svn path=/trunk/; revision=26150
2007-03-21 18:13:32 +00:00
Johannes Anderwald
f8cf12b484 - revert 26147
svn path=/trunk/; revision=26149
2007-03-21 17:16:26 +00:00
Aleksey Bragin
6276a365f6 - KiRosFrldrLpbToNtLpb(): Round up to the correct size in pages (I don't see a reason to provide a "cropped" size of modules).
- Change "FreeLDR BIAS hack" to a better one: measure sizes of all 3 codepages, and place them contiguously. Is this still required at all? On my system I didn't see a case when these tables are placed not contiguously by freeldr.
- This fixes early bugcheck in ExpInitNls().

svn path=/trunk/; revision=26148
2007-03-21 14:31:57 +00:00
Johannes Anderwald
f24347940e - fix makefiles to depend on TOOLS_OUT_ value than directly hardcoding it to $(OUTPUT)
svn path=/trunk/; revision=26147
2007-03-20 20:12:10 +00:00
Aleksey Bragin
1f06d767be Fix MSVC compilation with NT4 ddk.
svn path=/trunk/; revision=26146
2007-03-20 19:09:55 +00:00
Dmitry Gorbachev
1f7253af8d Italian translation by Paolo Devoti.
svn path=/trunk/; revision=26145
2007-03-20 16:03:32 +00:00
Dmitry Gorbachev
7c4c2ff00b Italian translation by Paolo Devoti.
svn path=/trunk/; revision=26144
2007-03-20 16:02:01 +00:00
Dmitry Gorbachev
bb0f048c4c Italian translation by Paolo Devoti (see bug #2027)
svn path=/trunk/; revision=26143
2007-03-20 16:01:19 +00:00
Alex Ionescu
6de9ae607d - Fix an important bug which was causing us to incorrectly set the DPC Stack in the Processor Region Control Block.
- Enable usage of the DPC Stack during DPCs.
- Enable usage of the DPC Stack during Fast System Calls and put back the correct push/pop code in FASTCALL_PROLOG.

svn path=/trunk/; revision=26142
2007-03-19 21:53:38 +00:00
Alex Ionescu
5037bca4df - Don't use the stack in FASTCALL_PROLOG. It messes up NPX checks (this is a bug, it shouldn't happen... related to DPC stack bug.)
- Zero out the trap/npx frame for new user-mode threads.
- Use KeI386FxsrPresent and not KEI386XMMIPresent when setting up the context for a new thread.

svn path=/trunk/; revision=26141
2007-03-19 19:43:50 +00:00
Alex Ionescu
71e781df12 - Fix NPX check in context switcher.
- Fix ObLogSecurityDescriptor.
- Fix some missing features in SeAccessCheck.

svn path=/trunk/; revision=26140
2007-03-19 19:05:39 +00:00
Alex Ionescu
1d2fd8ac1f - Change FASTCALL_PROLOG to use the stack to update FS, since we run in the DPC stack.
- Implement KeDisableInterrupts to disable interrupts and return whether or not they were enabled.
- Implement KiCheckTimerTable, in DBG mode, to validate the timer tables.
- Implement DPC Timeout detection, in DBG mode.
- Fix a bug in KiQuantumEnd which would've affected real-time threads.
- Fix some bugs in KiRetireDpcList to avoid issues should the DPC Queue Depth drop below 0, and solve some possible races.
- Fix KeRemoveQueueDpc only to enable interrupts if it was called with interrupts enabled.

svn path=/trunk/; revision=26139
2007-03-19 17:55:38 +00:00
Alex Ionescu
755994a386 - Change the way DR_TRAP_FIXUP and V86_TRAP_FIXUP work so that they can be combined into TRAP_FIXUPS, which will also handle ABIOS Fixups later.
- Modified the way TRAP_FIXUPS and XXX_PROLOGS work, so that the fixup code doesn't depend on numerical values anymore, but instead on unique labels for each function (kitd thus becomes kitd_a and kitd_t, for entry and exit).
- Now we can put the TRAP_FIXUPS for the Interrupt Template as part of the code, and at the end.
- Enable Dr Save/Restore in lots of places where it was previously disable.
- Implement Dr Save/Restore in V86 traps.

svn path=/trunk/; revision=26138
2007-03-19 05:56:27 +00:00
Alex Ionescu
32ca724933 - New ISR Timeout detection code.
- New Interrupt Storm detection code.
- Use PCR everywhere instead of fs:[ or [fs:. Significant improvements on UP builds because we use ds:[KPCRADDRESSS] for them.
- Ongoing work.

svn path=/trunk/; revision=26137
2007-03-19 03:29:29 +00:00
Eric Kohl
42c0ac532c Fix some dialog issues:
- Use AUTOCHECKBOXes instead of CHECKBOXes.
- Set the height of CHECKBOXes and PUSHBUTTONs to 14.
- Get rid of overlapping controls.
- Remove DS_FIXEDSYS dialog style.
- Move language-independent resources to the main .rc file.

svn path=/trunk/; revision=26136
2007-03-18 21:56:25 +00:00
Aleksey Bragin
0b926dc709 It's better to zero-initialize these variables before calling RtlQueryRegistryValues().
svn path=/trunk/; revision=26135
2007-03-18 21:55:21 +00:00
Sylvain Petreolle
1d40e5858d add KsInitializeDriver
svn path=/trunk/; revision=26134
2007-03-18 17:12:18 +00:00
Sylvain Petreolle
08dcc6be8a reenable mpu401_ks,
it builds since andrew added the needed includes

svn path=/trunk/; revision=26133
2007-03-18 15:51:37 +00:00
Sylvain Petreolle
8c680affb1 various fixes
sb16_ks now builds, but cannot be built

svn path=/trunk/; revision=26132
2007-03-18 15:38:04 +00:00
Hervé Poussineau
87bde6d032 Add a variable to change the name of the ReactOS directory on bootcd.
If a non default name is chosen, the cdrom is created, but it is unusable as freeldr doesn't find txtsetup.inf

svn path=/trunk/; revision=26131
2007-03-18 14:33:17 +00:00
Hervé Poussineau
b0385e2a41 Fix SeAccessCheck to perform correct checks.
When returning STATUS_ACCESS_DENIED when required (currently disabled), ReactOS boots up to login screen on 3rd boot.
Now, we just need to fix callers.

svn path=/trunk/; revision=26130
2007-03-18 12:47:27 +00:00
Sylvain Petreolle
567f8a2469 add missing parenthesis
svn path=/trunk/; revision=26129
2007-03-18 11:39:27 +00:00
Hervé Poussineau
0423e310b2 Fix warnings
svn path=/trunk/; revision=26128
2007-03-18 00:27:02 +00:00
Hervé Poussineau
2d8e002457 Fix some warnings
svn path=/trunk/; revision=26127
2007-03-17 23:21:23 +00:00
Hervé Poussineau
889d81aa97 Disable PS/2 auxiliary port detection, which is too unreliable.
svn path=/trunk/; revision=26126
2007-03-17 21:25:00 +00:00
Hervé Poussineau
958ed9973b Add some missing definitions
svn path=/trunk/; revision=26125
2007-03-17 21:14:11 +00:00
Hervé Poussineau
4670093f37 Fix default data sent to RtlQueryRegistryValues
svn path=/trunk/; revision=26124
2007-03-17 20:53:05 +00:00
Magnus Olsen
f06ffd93b8 fixing a gcc4 warring. why does gcc4 warning a uninsiated value but the value are being iniste in seh
svn path=/trunk/; revision=26123
2007-03-17 18:32:32 +00:00
Magnus Olsen
287d86906b Now we can call to the driver createsurface, but we fail create a surface. maybe I miss fill in some value ??
svn path=/trunk/; revision=26122
2007-03-17 15:15:27 +00:00
Andrew Greenwood
d157ccaa15 Should compile now...
svn path=/trunk/; revision=26121
2007-03-17 13:27:50 +00:00
Andrew Greenwood
f8ed50f1f4 A few header files I forgot to commit last time. Sorry!
svn path=/trunk/; revision=26120
2007-03-17 13:21:33 +00:00
Dmitry Gorbachev
f4f6d1b7e2 Fix my bad fix.
svn path=/trunk/; revision=26119
2007-03-17 08:30:26 +00:00
Magnus Olsen
566a0ec7e9 small typo in DdCreateSurface
svn path=/trunk/; revision=26118
2007-03-16 17:04:53 +00:00
Dmitry Gorbachev
93a03949bf Fix bugs #2049 and #2084 (thanks to Peter Krawies)
svn path=/trunk/; revision=26117
2007-03-16 16:54:34 +00:00
Dmitry Gorbachev
6f562dec4a Fix a bug (#2054, translation by Heis Spiter)
svn path=/trunk/; revision=26116
2007-03-16 16:53:01 +00:00
Dmitry Gorbachev
6c337b4d51 Commit a patch (attachment #1135)
svn path=/trunk/; revision=26115
2007-03-16 16:52:36 +00:00
Magnus Olsen
3c950f2259 start fixing NtGdiDdCreateSurface, This code are not complete and does not work for NtGdiDdCreateSurface yet. But I do not whant start 10 time write it again.
svn path=/trunk/; revision=26114
2007-03-16 15:28:48 +00:00
Aleksey Bragin
83ba5bc979 - Fix a few simple errors in ks/portcls.h
- Exclude it from the build process since important header files are missing (Hint to Andrew: commit stdunk.h & co)

svn path=/trunk/; revision=26113
2007-03-16 12:49:47 +00:00
Aleksey Bragin
a647cfde4b Put ntdll dependency back.
svn path=/trunk/; revision=26112
2007-03-16 11:45:52 +00:00
Magnus Olsen
c837850451 fixing smaller bugs in NtGdiDdQueryDirectDrawObject,
like some return value are right

svn path=/trunk/; revision=26111
2007-03-16 09:01:40 +00:00
Art Yerkes
2a58de26de Stragglers plus warning fixen.
svn path=/branches/powerpc/; revision=26110
2007-03-16 07:16:45 +00:00
Hervé Poussineau
df2510eefd Fix compilation of drivers ks, mpu401_ks and sb16_nt4
svn path=/trunk/; revision=26109
2007-03-15 19:00:34 +00:00
Hervé Poussineau
294005ab57 Add missing #endif
svn path=/trunk/; revision=26108
2007-03-15 16:32:56 +00:00
Hervé Poussineau
0d0de63b1b Split intrin.h file into architecture specific files
svn path=/trunk/; revision=26107
2007-03-15 15:42:11 +00:00
Hervé Poussineau
17dd2f5904 Add some missing files. Trunk is still not buildable
svn path=/trunk/; revision=26106
2007-03-15 10:58:19 +00:00
Aleksey Bragin
b51c90e8d2 - "Fix" RtlQueryRegistryValues() usage (inspired by 26072)
- Typo fix
- DPRINT added for showing RegistryPath

svn path=/trunk/; revision=26105
2007-03-15 10:37:58 +00:00
Hervé Poussineau
a1d5a61f87 Fix crt compilation
svn path=/trunk/; revision=26104
2007-03-15 09:14:59 +00:00
Andrew Greenwood
30bfd875a8 Yet more files I've been meaning to commit...
(and again they're mostly incomplete)


svn path=/trunk/; revision=26103
2007-03-14 21:31:31 +00:00
Andrew Greenwood
b4da8c5ab8 Basic beginnings of an MPU401 driver (forgot to commit with last files)
svn path=/trunk/; revision=26102
2007-03-14 20:50:42 +00:00
Alex Ionescu
6092d2b4b8 - Move libcntpr to /sdk. Couldn't do rename+move atomically.
svn path=/trunk/; revision=26101
2007-03-14 20:34:10 +00:00
Alex Ionescu
c46a354547 - Rename libcntptr->libcntpr. I don't know what the f*ck happened but it was named _correctly_ on my system, then got committed with the wrong name, while svn still matched it locally.
svn path=/trunk/; revision=26100
2007-03-14 20:33:22 +00:00
Alex Ionescu
7b13eab23c - Actually add libcntpr. Yup, I messed this up badly.
svn path=/trunk/; revision=26099
2007-03-14 20:30:32 +00:00
Alex Ionescu
1d6bb4a345 - Add missing file.
svn path=/trunk/; revision=26098
2007-03-14 20:30:00 +00:00
Alex Ionescu
5ba01b7bbb - Remove leftovers.
svn path=/trunk/; revision=26097
2007-03-14 20:29:24 +00:00
Alex Ionescu
f96362240e - Remove leftovers.
svn path=/trunk/; revision=26096
2007-03-14 20:28:28 +00:00
Alex Ionescu
85985d712e - Cleanup the /lib directory, by putting more 3rd-party libs in /3rdparty, and by creating a new directory called /sdk where libraries which emulate the ones in the WDK are present (Such as uuid, nt, crt, etc).
- Removed lib/interlck and lib/string.
- Removed math routines from lib/rtl.
- Created a new library called libcntpr which is what NT/WDK use when compiling the kernel/system libraries. This is an "NT-Private" version of the CRT which is supposed to contain what we had in lib/string and lib/rtl.

svn path=/trunk/; revision=26095
2007-03-14 20:24:57 +00:00
Andrew Greenwood
e4cfaf284e Mostly minor updates to the source tree for portcls.
Still much work to be done!


svn path=/trunk/; revision=26094
2007-03-14 19:50:47 +00:00
Magnus Olsen
3738b97003 Bug fix DdCreateSurface, it can now create one surface, the code are tested in windows, in my syscall demo for win32k. We do not support create more that one surface. mulit surface create will be add later. But code path to implement it, exist
svn path=/trunk/; revision=26093
2007-03-14 16:33:36 +00:00
The Wine Synchronizer
de50154dfe Autosyncing with Wine HEAD
svn path=/trunk/; revision=26092
2007-03-14 14:55:42 +00:00
The Wine Synchronizer
59ff37d40e Autosyncing with Wine HEAD
svn path=/trunk/; revision=26091
2007-03-14 14:54:22 +00:00
The Wine Synchronizer
15fc32b041 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26090
2007-03-14 14:52:10 +00:00
The Wine Synchronizer
7a7a27ca44 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26089
2007-03-14 14:50:28 +00:00
The Wine Synchronizer
f64ae53f31 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26088
2007-03-14 14:46:50 +00:00
The Wine Synchronizer
0b3750172e Autosyncing with Wine HEAD
svn path=/trunk/; revision=26087
2007-03-14 14:44:22 +00:00
The Wine Synchronizer
5962dcf2b9 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26086
2007-03-14 14:43:17 +00:00
The Wine Synchronizer
39708f92fe Autosyncing with Wine HEAD
svn path=/trunk/; revision=26085
2007-03-14 14:39:18 +00:00
The Wine Synchronizer
efbe7b0e2c Autosyncing with Wine HEAD
svn path=/trunk/; revision=26084
2007-03-14 14:38:17 +00:00
The Wine Synchronizer
aaf129ba9b Autosyncing with Wine HEAD
svn path=/trunk/; revision=26083
2007-03-14 14:34:47 +00:00
The Wine Synchronizer
958f8ca669 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26082
2007-03-14 14:33:33 +00:00
The Wine Synchronizer
9da480a6c6 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26081
2007-03-14 14:29:38 +00:00
The Wine Synchronizer
688da06757 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26080
2007-03-14 14:20:42 +00:00
The Wine Synchronizer
5988132317 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26079
2007-03-14 14:13:17 +00:00
Hervé Poussineau
25c32b4c9b Add missing file for autosync of cabinet.dll
svn path=/trunk/; revision=26078
2007-03-14 13:05:40 +00:00
The Wine Synchronizer
8392d2f122 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26077
2007-03-14 12:55:03 +00:00
The Wine Synchronizer
428fdc04d7 Autosyncing with Wine HEAD
svn path=/trunk/; revision=26076
2007-03-14 12:48:32 +00:00
Hervé Poussineau
217ef4cd9f Prepare import of Wine library odbccp32 (sorry, this revision won't build)
svn path=/trunk/; revision=26075
2007-03-14 12:44:54 +00:00
Hervé Poussineau
29f298cd86 Add stubs for SetupDiGetClassInstallParamsA/W
Support SetupDiSetClassInstallParams(DIF_ADDPROPERTYPAGE_ADVANCED)

svn path=/trunk/; revision=26074
2007-03-14 12:29:18 +00:00
Hervé Poussineau
62be77605d No need to ask for more rights than needed
svn path=/trunk/; revision=26073
2007-03-14 12:23:21 +00:00
Alex Ionescu
cd1198b3d6 - Rewrite RtlQueryRegistryValues and implement all the features it requires. This is one of the most important kernel-mode API for driver support.
- Fix code in the kernel which was incorrectly calling it.

svn path=/trunk/; revision=26072
2007-03-14 01:44:38 +00:00
Dmitry Gorbachev
1fbd004ffe Fix bug #1872
svn path=/trunk/; revision=26071
2007-03-13 16:08:49 +00:00
Hervé Poussineau
c306ff4785 Prevents a freeze when running the bootcd. Still needs to investigate to find the real reason.
svn path=/trunk/; revision=26070
2007-03-13 15:57:50 +00:00
Andrew Munger
4062336483 Typo fixes, patch by our friend Coviti.
svn path=/trunk/; revision=26068
2007-03-13 11:28:18 +00:00
Alex Ionescu
a97f262ed8 - Fix some bugs in the kernel related to driver loading, which were hindering FreeLDR 2.5 support.
- Make FreeLDR relocate and process the import tables of drivers as well. This is almost FreeLDR 2.5 but is still missing some minor functionality before being completely done.

svn path=/trunk/; revision=26067
2007-03-12 17:30:57 +00:00
Dmitry Gorbachev
8d8e5ea06e Fix BSS bugs (#2068, #2072)
svn path=/trunk/; revision=26066
2007-03-12 00:29:56 +00:00
Magnus Olsen
4485db1f76 NtGdiDdWaitForVerticalBlank
copy user mode pointer to kmode memory
and copy back some data to user mode pointer
using seh

NtGdiDdCanCreateSurface, NtGdiDdGetScanLine
fixing a stupied bug do not crash if look
fail of hDD handler. but this should never 
happen. either way

 

svn path=/trunk/; revision=26065
2007-03-11 16:28:22 +00:00
Magnus Olsen
4a26adf7ff fixing smaller bug in NtGdiDdCanCreateSurface
and NtGdiDdGetScanLine

svn path=/trunk/; revision=26064
2007-03-11 15:47:49 +00:00
Magnus Olsen
537190e037 fixing smaller bug in NtGdiDdCanCreateSurface
svn path=/trunk/; revision=26063
2007-03-11 15:18:12 +00:00
Magnus Olsen
b860835afa forget clear a value in gdientry2
svn path=/trunk/; revision=26062
2007-03-11 14:01:22 +00:00
Alex Ionescu
6b126a39a9 - Release dispatcher lock if gate is already signaled.
See issue #2083 for more details.

svn path=/trunk/; revision=26061
2007-03-11 00:42:18 +00:00
Eric Kohl
7ac91cf037 Show custom colors in the preview window.
svn path=/trunk/; revision=26060
2007-03-10 21:25:03 +00:00
Dmitry Gorbachev
d400691f1c Fix Bugzilla bug 2051 (French translation by Heis Spiter)
svn path=/trunk/; revision=26059
2007-03-10 19:07:20 +00:00
Dmitry Gorbachev
b2b8e513c8 Norwegian translation by LMH1 (bugs 1699, 1739, 1740)
svn path=/trunk/; revision=26058
2007-03-10 18:54:12 +00:00
Eric Kohl
a4135506bb Get rid of the ugly dialogs. User the current shell font instead.
svn path=/trunk/; revision=26057
2007-03-10 14:32:49 +00:00
Dmitry Gorbachev
d8304d7df3 Do not install them two times.
svn path=/trunk/; revision=26056
2007-03-10 12:47:04 +00:00
Dmitry Gorbachev
88c1378112 Disable incorrect optimization
svn path=/trunk/; revision=26055
2007-03-10 11:06:02 +00:00
Saveliy Tretiakov
136be81331 Disable debug (second attempt
svn path=/trunk/; revision=26054
2007-03-10 10:40:11 +00:00
Eric Kohl
47199f7b6b - Let the user close dialogs by clicking the close (X) button.
svn path=/trunk/; revision=26053
2007-03-10 09:29:50 +00:00
KJK::Hyperion
b788577769 Set _SEH_ENABLE_TRACE for debug builds
svn path=/trunk/; revision=26052
2007-03-10 06:42:05 +00:00
KJK::Hyperion
f5891f221e added lib/debugsup
added      lib/debugsup/debugsup-ntos.def
added      lib/debugsup/debugsup.rbuild
modified   lib/lib.rbuild
   New import-only library. Links modules that need low-level debugging functions (DbgBreakPoint, DbgBreakPointWithStatus, DbgPrint, DbgPrompt, DbgPrintEx, RtlAssert, RtlUnwind) to the correct low-level library (ntdll for user mode and ntoskrnl for kernel mode). This ensures debugging macros will always work, everywhere, and it doesn't force all modules with debugging information to link to ntdll/ntoskrnl. TODO: link RtlUnwind to kernel32 for Win32 modules

modified   tools/rbuild/backend/mingw/modulehandler.cpp
modified   tools/rbuild/backend/mingw/modulehandler.h
   Add debugsup_ntdll/debugsup_ntoskrnl as an implicit library for all executable modules (minus the kernel)


svn path=/trunk/; revision=26051
2007-03-10 03:51:27 +00:00
Dmitry Gorbachev
2ce0a2f2ed Update Russian translation.
svn path=/trunk/; revision=26050
2007-03-09 22:27:04 +00:00
Saveliy Tretiakov
c6f7e2ff23 Disable debug
svn path=/trunk/; revision=26049
2007-03-09 21:36:35 +00:00
Saveliy Tretiakov
a039eb5807 Fix bug 2080
svn path=/trunk/; revision=26048
2007-03-09 21:35:14 +00:00
Hervé Poussineau
2ce91bd022 Remove IopCreateDriverObject, which was buggy and duplicating IoCreateDriver functionality.
Add IopCreateDriver to contain common code, called by IoCreateDriver and ex-callers of IopCreateDriverObject.

svn path=/trunk/; revision=26047
2007-03-09 18:14:34 +00:00
Alex Ionescu
d2aecb2da4 - Fix building the BootCD.
svn path=/trunk/; revision=26046
2007-03-09 08:31:05 +00:00
Hervé Poussineau
d0b5dbfa63 Do not access to not initialized variable
svn path=/trunk/; revision=26045
2007-03-08 22:50:48 +00:00
Aleksey Bragin
90a1a6d858 Add bitmap version of the Lake wallpaper and directory.rbuild.
trunk/wallpaper is to be checked out into the "modules" directory! (so it can be optional)

svn path=/trunk/; revision=26043
2007-03-08 21:45:10 +00:00
Magnus Olsen
348c174ef2 wallpaper from harteex
svn path=/trunk/; revision=26042
2007-03-08 21:02:53 +00:00
Magnus Olsen
f41eda3c31 Created folder wallpaper remotely
for adding diffrent offical wallpaper

svn path=/trunk/; revision=26041
2007-03-08 20:27:14 +00:00
Saveliy Tretiakov
dd635fa115 ReEnable assert (as Alex suggested)
svn path=/trunk/; revision=26040
2007-03-08 20:09:50 +00:00
Saveliy Tretiakov
22b62d2461 Forget to enter critical region
svn path=/trunk/; revision=26039
2007-03-08 19:45:32 +00:00
Saveliy Tretiakov
d71c81868e Fix build:
- Add missing function protype.
- Move IntSetupClipboard to winsta.c


svn path=/trunk/; revision=26038
2007-03-08 19:44:36 +00:00
Magnus Olsen
619c975c6a fixing minior bugs in DdQueryDirectDrawObject
some data was not fill in

svn path=/trunk/; revision=26035
2007-03-08 19:18:06 +00:00
Aleksey Bragin
038309c488 Remove clipboard merge leftover.
YES encoded, yes.

svn path=/trunk/; revision=26034
2007-03-08 19:11:09 +00:00
Alex Ionescu
1e3d5d70e9 - Tree cleanups proposed on the mailing list. Move all non-Core OS modules to rosapps. Tests were already moved by Fireball to rostests.
svn path=/trunk/; revision=26033
2007-03-08 19:00:15 +00:00
Alex Ionescu
ad07a1e58f - Tree cleanups proposed on the mailing list. Move all non-Core OS modules to rosapps. Tests were already moved by Fireball to rostests.
svn path=/trunk/; revision=26032
2007-03-08 18:59:45 +00:00
Thomas Bluemel
a90321860f Add the very beginnings of a mmc.exe implementation (not yet included in the build)
svn path=/trunk/; revision=26031
2007-03-08 17:44:10 +00:00
Saveliy Tretiakov
59736af42b Merge clipboard branch to trunk
svn path=/trunk/; revision=26029
2007-03-08 13:31:33 +00:00
Saveliy Tretiakov
52913c361c change dprint1 to dprint
svn path=/trunk/; revision=26028
2007-03-08 12:57:19 +00:00
Saveliy Tretiakov
2d04abb37e Fix make livecd
svn path=/trunk/; revision=26027
2007-03-08 12:31:24 +00:00
Aleksey Bragin
3937a712b0 - Fix bootcd (taking in account rostests module too)
- Add mscutils to the build process

svn path=/trunk/; revision=26026
2007-03-07 22:10:37 +00:00
Aleksey Bragin
420b5b108e - Uncomment a couple of implemented Ob functions
svn path=/trunk/; revision=26025
2007-03-07 12:32:02 +00:00
Aleksey Bragin
1c0cf74086 - Fix a typo in the function header
svn path=/trunk/; revision=26024
2007-03-07 12:30:07 +00:00
Aleksey Bragin
5323c74126 Revert 25953.
"[14:22] <hackbunny> Fireball: FUCK
 [14:22] <hackbunny> he actually COMMITTED that code?"

svn path=/trunk/; revision=26022
2007-03-07 11:28:51 +00:00
Hervé Poussineau
9e66340100 Remove useless file
svn path=/trunk/; revision=26021
2007-03-07 09:33:53 +00:00
Aleksey Bragin
8bfa37adbe Move what's left in trunk here (2/2).
Now it should compile even without rostests module.

svn path=/trunk/; revision=26020
2007-03-06 21:48:14 +00:00
Aleksey Bragin
6761d24ea4 Move what's left in trunk here (1/2)
svn path=/trunk/; revision=26019
2007-03-06 21:44:58 +00:00
Aleksey Bragin
a6f9762e88 - Delete testsets
- Move dvmgmt and servman into mscutils directory (suggested by Alex Ionescu)

svn path=/trunk/; revision=26017
2007-03-06 12:43:19 +00:00
Aleksey Bragin
0a5bac4ba6 Remove regtests from /reactos since it's not needed anymore.
svn path=/trunk/; revision=26016
2007-03-06 12:14:33 +00:00
Aleksey Bragin
ac0a89b785 Move and reshuffle reactos/regtetsts into rostests. 2/2
svn path=/trunk/; revision=26015
2007-03-06 12:00:03 +00:00
Aleksey Bragin
33c6673cfb Move and reshuffle reactos/regtetsts into rostests. 1/2
svn path=/trunk/; revision=26014
2007-03-06 11:59:18 +00:00
Aleksey Bragin
d5b244c7cc Add proper header
svn path=/trunk/; revision=26013
2007-03-06 11:40:03 +00:00
Aleksey Bragin
1423048911 Move testsets from reactos to rostests (into a "win32" directory for now). 2/2
svn path=/trunk/; revision=26012
2007-03-06 11:34:03 +00:00
Aleksey Bragin
102ccaa64d Move testsets from reactos to rostests (into a "win32" directory for now). 1/2
svn path=/trunk/; revision=26011
2007-03-06 11:33:50 +00:00
Aleksey Bragin
2199ae9003 Move tests from rosapps to rostests
svn path=/trunk/; revision=26010
2007-03-06 11:10:43 +00:00
Aleksey Bragin
3e98dbd825 Adding rostests as part of the tree restructure
svn path=/trunk/; revision=26009
2007-03-06 11:01:08 +00:00
Alex Ionescu
2742ba22e8 - Implement KdpQueryMemory (KdQueryMemoryApi).
- Setting and clearing breakpoints now works! (At least the simple ones with F9/bp/bc). And they actually get hit properly.

svn path=/trunk/; revision=26007
2007-03-05 20:10:26 +00:00
Alex Ionescu
4b3c677fe7 - Fixed up KdComPortInUse so that we don't crash when using TinyKRNL/Windows kdcom.dll anymore (due to serial.sys). WinDBG should work a lot better now.
- Implemented hack so that NT-style sprintf can work.
- Implement MiCacheImageSymbols and upgrade MmLoadSystemImage to load symbols for drivers/images which have a debug section.
- Implemented a case in MiResolveImageReferences which was getting hit.
- Don't leak a section object reference each time we load a driver.
- Set the LoadedImports pointer in the loader entry, and set the proper flags after loading a driver.
- Do image notifications after loading a driver, if they're enabled.

svn path=/trunk/; revision=26006
2007-03-05 19:24:54 +00:00
James Tabor
47dae7de28 Fix RosBE build
svn path=/trunk/; revision=26005
2007-03-05 17:35:37 +00:00
Alex Ionescu
5e0491122d - Implement simple breakpoints (KdWriteBreakPointApi, KdpWriteBreakpoint, KdpAddBreakpoint).
- Stepping out with WinDBG now works, but not adding breakpoints (that's KdWriteBreakpointExApi, coming up soon).
- This was supposed to be 26000 but oh well, back porting features to a locked branch seems to have won out :)

svn path=/trunk/; revision=26004
2007-03-05 17:09:44 +00:00
Magnus Olsen
c8cf34eb84 fixed dprint1 to dprint
svn path=/trunk/; revision=26001
2007-03-05 15:17:53 +00:00
Magnus Olsen
dbd1166859 tempary fix for CreateDC("DISPLAY","DISPLAY",....) until I figout some thing better
svn path=/trunk/; revision=25998
2007-03-05 15:10:26 +00:00
Alex Ionescu
5e5311f4ae - Fix KdpSetCommonSTate to clear breakpoints.
- Allow KdpReadVirtualMemory to read SharedUserData since it's now readable.
- Allow it to read user-mode pointers as well, just not null-pointers.
- Fix KdpReportExceptionStateChange by implementing DumpTraceData. Now the crash in ndis.sys gets caught.
- Next up: implement breakpoints so that stepping out works.

svn path=/trunk/; revision=25997
2007-03-05 03:23:58 +00:00
Alex Ionescu
e707b70756 - Add proper bootcd/install freeldr.ini flags to allow KD debugging to work.
- Fix KdPollBreakIn.
- Add initial debug breakpoint code to ExpInitializeExecutive.
- WinDBG now breaks at the initial breakpoint and you can continue execution from there.
- There's still a lot of weird hangs when using WinDBG, it's far from usable.

svn path=/trunk/; revision=25996
2007-03-05 02:29:46 +00:00
Alex Ionescu
05f82784bd - Stub NtSystemDebugControl.
- Fully support _WINKD_. Change this to 1, and get kdcom.dll from Windows 2003 or TinyKRNL and you'll be able to connect to WinDBG if using the right debug settings. You can now boot to desktop with WinDBG connected and see debug messages, but not much else is supported.
- Fix bugs in KeGetBugMessageText.
- Implement KeEnterKernelDebugger.

svn path=/trunk/; revision=25994
2007-03-05 01:35:43 +00:00
Alex Ionescu
aafc3a967a - Detect if reparsing is being used during IRP completion and complain.
- Free MDLs in a safer way by not actually using the Irp->MdlAddress as we're looping through them.
- Don't leak an event for each Asynchronous API anymore.
- Handle IRP_OB_QUERY_NAME completion properly.
- handle IRP_CREATE_OPERATION with a file object present.
- Use deferred delete for File Object dereferences, to speed up I/O completion.
- Clear the I/O Stack Location when parsing completion stacks.
- Support SL_ERROR_RETURNED during completion routines.

svn path=/trunk/; revision=25993
2007-03-05 00:47:19 +00:00
Hervé Poussineau
030a4abe86 Convert text to multibyte before displaying it
svn path=/trunk/; revision=25992
2007-03-04 23:26:30 +00:00
Hervé Poussineau
abfa7fb417 Some reformatting, no code change
svn path=/trunk/; revision=25991
2007-03-04 23:18:28 +00:00
Aleksey Bragin
55a11ded1b Fix compiling in proper npfs mode.
svn path=/trunk/; revision=25989
2007-03-04 21:14:58 +00:00
Alex Ionescu
1e35f772f8 - Enable _WINKD_ in config.rbuild. Currently set to 0 and don't set it to 1 yet because it won't build yet.
- Support _WINKD_ in ntoskrnl.rbuild to build KD64 instead of KDBG/KD if it's enabled.
- Remove some incorrect kernel exports.

svn path=/trunk/; revision=25988
2007-03-04 20:52:54 +00:00
Alex Ionescu
be2645ad8a - Wrap some KDBG-specific initialization in _WINKD_ guard.
- Remove KdpDetectConflicts since our serial driver correctly uses KdComPortInUse for this (and kdcom fills it out).

svn path=/trunk/; revision=25987
2007-03-04 20:28:18 +00:00
Alex Ionescu
bf3d075381 - Add kd64.h header from branch and format it nicely.
- Add support for _WINKD_ definition to use kd64.h instead of kd.h, as well as disable usage of rossym.h
- Add KdSystemDebugControl, NtSet/QueryDebugFilterState to kdapi.c for the KD64 code.

svn path=/trunk/; revision=25986
2007-03-04 19:54:39 +00:00
Alex Ionescu
f7577eaeb7 - Enable stubs in kdcom to actually be exported (to simplfiy compatibility with KD Branch, which won't be needed soon thanks to a build flag).
- Enable call to KdDebuggerInitialize1 even in trunk, since it doesn't do anything.
- Make i8042prt stop using a reactos-only kernel export hack (KdpServiceDispatcher),and use KdSystemDebugControl instead, which is the NT version and fully-exported.
- Implement a stub KdSystemDebugControl and export it.

svn path=/trunk/; revision=25985
2007-03-04 19:20:03 +00:00
Alex Ionescu
12e7593f24 - Fix a bug in KeQueryPerformanceCounter which was reading the flags in ESI instead of ECX.
- Fix a bug in KeQueryPerformanceCounter which wasn't handling the possibility of an invalid counter value.
- Don't disable/enable interrupts in HalpInitializeClock and HalCalibratePerformanceCounter. Instead, save the flags, disable, and then restore flags, so that if interrupts were disabled initially, they'll remain that way.
- Make KeUpdateRunTime and KeUpdateSystemTime support KPRCB->SkipTick.
- Atomically check for DPC routine active by referencing fs. Also update Debug DPC time.
- Add support for detecting break-in during KeUpdateSystemTime.
- DPC Routine active is a BOOLEAN, not a ULONG. Fix the check in KeUpdateRunTime since this might've messed up a lot of things.
- Temporarily disable DbgBreakPoint during DbgPrint.
- Hang in KeQueryPerformanceCounter while WinDBG is connected is now fixed, as well as DbgPrint support. WinDBG can now remain connected and show all the DebugPrints! (But GUI doesn't boot -- yet).

svn path=/trunk/; revision=25984
2007-03-04 19:06:34 +00:00
Eric Kohl
3e6fa8fd31 Translate german resources.
svn path=/trunk/; revision=25983
2007-03-04 18:47:12 +00:00
Eric Kohl
2f8a2c2ac1 - Show disables and selected menu items.
- User the caption font to display the window text.

svn path=/trunk/; revision=25982
2007-03-04 18:41:47 +00:00
Magnus Olsen
78674981d1 split up all testcase to own file. the size are growning
svn path=/trunk/; revision=25981
2007-03-04 11:57:44 +00:00
Magnus Olsen
5b73c362ba adding so dump can decoding pCallBackFlags[0] so we do not need calc out what hardware acclations DD_CALLBACKS support.
svn path=/trunk/; revision=25980
2007-03-04 11:45:29 +00:00
Eric Kohl
9039b97b9f Users can now set bold or italic fonts.
svn path=/trunk/; revision=25978
2007-03-03 21:03:22 +00:00
Magnus Olsen
2c81a2df18 partly implement NtGdiDdReenableDirectDrawObject
this give us bit more closer getting hardware accalertions working. 

svn path=/trunk/; revision=25977
2007-03-03 20:19:56 +00:00
Alex Ionescu
c44e8d2c89 - Fix another typo in CommonDispatchException (with yet another critical flaw as a result). Sometimes, exceptions would incorrectly be detected as coming from user-mode even though CS was kernel mode. When creating the KTRAP_FRAME, the kernel would then add the Ring 3 RPL_MASK (3) (because it believed we're in usermode) to the kernel-mode CS, creating the invalid CS of 0xB, which would lead into a GPF during the iretd.
- Re-enable DebugPrint since this now works.

svn path=/trunk/; revision=25976
2007-03-03 19:49:36 +00:00
Alex Ionescu
a195100319 - Fix critical bugs in DR_TRAP_FIXUP, TRAP_PROLOG and TRAP_EPILOG which would either cause infinite loops during exceptions or corruption of the correct code path when dealing with debug registers.
- Fix a bug in KiRecordDr7 setting the new DR7 mask.
- Make KiEspToTrapFrame thread-safe by raising to APC_LEVEL to make sure a thread/set context doesn't corrupt the state.
- Fix thread-safe IRQL Code in KeContexToTrapFrame/KeTrapFrameToContext.
- Fix KiDispatchException to properly handle KI_EXCEPTION_ACCESS_VIOLATION and convert it back to STATUS_ACCESS_VIOLATION which is what the system expects.
- Also fix the way we do bugchecks so the the trapframe gets properly put as a parameter.
- Make KiDebugService call into KiTrap3 to share code (merge from kd-branch).
- Changes to the KdpEnterDebuggerException hack we have to handle this change.
- Temporarily disable DebugPrint functionality (sorry, I'm onto a big bug here!)

svn path=/trunk/; revision=25975
2007-03-03 17:24:58 +00:00
Magnus Olsen
037363f05d NtGdiDdQueryDirectDrawObject
1. fixed some return code it get right. 

svn path=/trunk/; revision=25973
2007-03-03 16:31:28 +00:00
Eric Kohl
7368a5b0d4 - Let the user edit the font size directly.
- Remove the useless "NOT CBS_SIMPLE" window style from the font size combobox.

svn path=/trunk/; revision=25970
2007-03-03 12:44:09 +00:00
Sylvain Petreolle
827a4b1699 downloader fixes:
remove downloader.xml from bootcd
fix paths in .rbuild

svn path=/trunk/; revision=25969
2007-03-03 11:41:28 +00:00
Alex Ionescu
27065dc629 - Remove DbgPrint committed in FreeLDR by accident.
- Fix a hack in DbgLoadImageSymbols.

svn path=/trunk/; revision=25967
2007-03-03 05:44:58 +00:00
Alex Ionescu
523822a169 - Copy the entire drivers in memory, not just their mappable sections, since WinDBG (and probably other things) use "SizeOfImage" in the header to figure out when the image ends, but we map considerably less, creating overlaps.
svn path=/trunk/; revision=25966
2007-03-03 05:41:14 +00:00
Alex Ionescu
af68f5e42d - Remove KD APIs from stub HAL, they've been in kdcom for a while (merge from kd-branch).
- DebugPrint/DebugPrompt should have an int3 after the int2d, and the int2d handler should ++ the trap frame's EIP to compensate (merge from kd-branch).
- Remove KDB symbol hooks (merge from kd-branch).
- Make PSEH compialble in MSVC again after Greatlord's break.
- Fix KiSaveProcessorControlState/KiRestoreProcessorControlState (merge from kd-branch).
- Disable GDB hook/hacks (merge from kd-branch).
- Add KD64 directory from kd-branch with SharedUserData access enabled (no other code changed). It's not currently compiled though, just putting it here.

svn path=/trunk/; revision=25965
2007-03-03 04:39:25 +00:00
Sylvain Petreolle
61ea6949b7 fix build
svn path=/trunk/; revision=25964
2007-03-02 22:04:21 +00:00
Aleksey Bragin
545cea09f9 Don't spam debug log with that message, it seems it's normal.
svn path=/trunk/; revision=25961
2007-03-02 21:11:16 +00:00
Christoph von Wittich
913d1938ee some configuration changes for debug builds
svn path=/trunk/; revision=25960
2007-03-02 21:04:41 +00:00
Christoph von Wittich
e3a80a5990 fix the msvc backend on linux hosts
svn path=/trunk/; revision=25959
2007-03-02 20:53:41 +00:00
Alex Ionescu
f5751896c4 -Fix build
svn path=/trunk/; revision=25958
2007-03-02 20:40:48 +00:00
Christoph von Wittich
46921a9a8f fix a crash in the msvc8 backend
svn path=/trunk/; revision=25957
2007-03-02 20:30:12 +00:00
Alex Ionescu
ae80dd6422 - Fix various ntoskrnl/wdk compilation issues in rossym, cmlib, kdcom, rtl.
- Rename one more duplicated file in the kernel which wasn't caught previously.
- pseh, rossym, cmlib, kdcom, bootvid, rtl compile & link, and ntoskrnl is now down to only 23 linker errors.

svn path=/trunk/; revision=25956
2007-03-02 19:52:29 +00:00
Alex Ionescu
7815967299 - Do massive renames in the ntoskrnl tree to make sure we don't have multiple files with the same name (this makes msvc very, very, sad).
- Add _IN_KERNEL_ define for WDK compatibility when using resstr.h
- The entire kernel can now be compiled with MSVC (read this sentence carefully before throwing out the champagne).

svn path=/trunk/; revision=25954
2007-03-02 18:25:23 +00:00
Magnus Olsen
e48040833f adding a small debugprint to detect if pseh going into a endless loop, if we see same msg from it repate it self whole time, we known then pseh have gone into endless loop.
svn path=/trunk/; revision=25953
2007-03-02 17:49:47 +00:00
Maarten Bosma
6a00d9d64a Lester Kortenhoeven (lester(at)kortenhoeven(dot)de): Implement scripting.
svn path=/trunk/; revision=25952
2007-03-02 17:27:39 +00:00
Alex Ionescu
794a97e498 - More MSVC fixes.
svn path=/trunk/; revision=25948
2007-03-02 16:28:34 +00:00
Alex Ionescu
9efff39376 - Fix multiple WDK compatibilities issues.
- Fix MSVC warnings and incompatibilities.

svn path=/trunk/; revision=25947
2007-03-02 16:26:45 +00:00
Christoph von Wittich
7270b49222 fix mkhive on x86_64 hosts
svn path=/trunk/; revision=25946
2007-03-02 15:57:34 +00:00
Alex Ionescu
b15fa5308e - Rewrite a dirty, reverse-engineered function written by dwelch (David Welch) 7.1 years ago in revision 965. We must agressively continue to hunt down such reversed code by previously tainted ReactOS developers who have thankfully left/been kicked out since then.
svn path=/trunk/; revision=25945
2007-03-02 07:37:45 +00:00
Alex Ionescu
5ba38d0494 - Don't depend on LD variables anymore for Mm.
- Update KrnlFun.c
- Make pushlock.c compile with msvc/wdk.
- Fix definition of HIGH_LEVEL_ENTRIES which was way too small (and thus always 0) which caused frees/allocates in the 3rd-level table not to work properly. MSVC statically detected this, it's unlikely we were hitting this in ROS at the moment but it would've been a bad bug to catch later, yay msvc.

svn path=/trunk/; revision=25944
2007-03-02 07:23:19 +00:00
Alex Ionescu
ba689f332a - Fix some rtl warnings on /W3.
svn path=/trunk/; revision=25943
2007-03-02 07:21:33 +00:00
Alex Ionescu
a0a19e46ae - Merge from KD-branch:
- Remove double implementation of DebugPrint with a single correct implementation which calls DebugService, and moved DebugPrint to rtl since it can now be shared properly.

svn path=/trunk/; revision=25942
2007-03-02 06:11:27 +00:00
Alex Ionescu
2e20ca1f14 - Create PDE/PTE entries for KUSER_SHARED_DATA in FreeLDR, so that MmInit1 isn't needed to access it.
- This allows us to access SharedUserData much earlier in the kernel, as well as in kdcom, which means the Windows/TinyKRNL version should now work without modification.

svn path=/trunk/; revision=25941
2007-03-02 06:01:07 +00:00
Alex Ionescu
d89145a431 - Fix a bug in HalEnableSystemInterrupt which was causing us to read invalid port data instead of the PCI edge/level registers.
- Fix an offset bug which was causing us to read/write to DR7 in a completely random location (somewhere in side the _CONTEXT record).
- Fix a bug in DR save/restore which was making us save dr0,1,2 isntead of dr3,6,7.
- All bugs reported by Aleksey Bragin.

svn path=/trunk/; revision=25938
2007-03-01 20:27:33 +00:00
Alex Ionescu
5928240766 - Fix KiDispatchException to unmask KI_EXCEPTION_INTERNAL when setting the exception code, so that usermode/SEH filters get proper exception codes again.
- Fixes and compatible merges from KD Branch:
 - Add stubs for KdSave, KdRestore, KdDebuggerInitialize0, KdSendPacket, KdReceivePacket to kdcom.dll
 - Implement and export KeTryToAcquireSpinLockAtDpcLevel.
 - Add EXCEPTION_RECORD64 and LIST_ENTRY64, KeTryToAcquireSpinLockAtDpcLevel, BREAKPOINT_COMMAND_STRING, Ke386SetCr2, Ke386SetDr3, Ke386SetDr6.
 - Remove non-kernel routines from kdfuncs.h and remove deprecated routines from ke.h.
 - Implement KiRestoreProcessorControlState, KeFreezeExecution, KeThawExecution, ExAcquireTimeRefreshLock, ExReleaseTimeRefreshLock.
 - Rename ModuleLoadList to PsLoadedModuleList. Add PsNtosImageBase and set value in it.
 - Add skeleton wdbgexts.h with what's needed until now, this is a PSDK header.
 - Add kddll.h for KDCOM/1394/USB2.DLL prototypes.
 - Add windbgkd.h with KD protocol definitions. Used to be an NT5 DDK header, but was removed, so this goes into include\reactos.
 - Fix KiDebugService to load EDX from KTRAP_FRAME_EDX, not KTRAP_FRAME_EAX!.
 - Fix CommonDispatchException to check for the argument count in ECX, not EAX. Previously we were ignoring parameter counts and never filling out exception records!
 - Add KdDebuggerInitialize1 and enable call to it.
 - Fix KD_SYMBOLS_INFO definition and DbgLoadImageSymbols prototype.
 - Implement DbgUnLoadImageSymbols.
 - Fix some small bugs in KeBugCheckWithTf and add various debugger calls/checks where needed.
 - Fix bugcheck recursion code which was incorrect.
 - Only save/restore CR4 if KeFeatureBits indicates CR4 support exists.
 - Export KdDebuggerNotPresent since KDCOM needs it.
 - Add KCONTINUE_STATUS.
 - Add DBGKD_ANY_CONTROL_SET and X86/IA64/AMD64 control sets.
 - Add DBGKD_MANIPULATE_STATE64 and all sub-structures (READ_MEMORY, WRITE_MEMORY, etc).
 - Create GCC_ULONG64 type to hack around a bug in GCC which is incapable of creating entries for externals at compile-time for 64-bit pointers.
 - Rename NameSpaceRoot to ObpRootDirectoryObject, IopLogListHead to IopErrorLogListHead, BugcheckCallbackListHead to KeBugcheckCallbackListHead, BugcheckReasonCallbackListHead to KeBugcheckReasonCallbackListHead, ObTypeObjectType to ObpTypeObjectType.
 - Create ntverp.h and common.ver files. These are the standard files used by the NT/DDK build systems and we should try to support them as well instead of re-defining everything our own way (especially if we want to build ddk-compatible drivers later on).
 - Made init.c use version data from ntverp.h instead of hard-coding.
 - Defined NT 5.2.3790.1830 as the version we report.
 - Fixed up .rc file to be correct and match DDK-sytnax/style.
 - For now only the kernel uses this new versionning scheme, but we should change the build system later to use this for every component.
 - Fix KiSaveProcessorControlState and KiRestoreProcessorControlSate. The latter doesn't freeze the CPU anymore so it's enabled, and the former doesn't cause WinDBG to panic anymore and display weird data.
 - KPROCESSOR_STATE is not 4-byte aligned.
 - Use DR_MASK and DR7_OVERRIDE_V in KiUpdateDr7, KiRecordDr7 instead of DR_ACTIVE_MASK.
 - Add ExceptionRecord32To64.
 - Fix generation of driver name for symbol load.

svn path=/trunk/; revision=25937
2007-03-01 19:51:20 +00:00
Magnus Olsen
94297234b4 NtGdiGetObject
1. fixed one BSD it does show bluescreen when the buffer are too small
2. fixed some bugs in calculation of different GdiObject sized

svn path=/trunk/; revision=25935
2007-03-01 19:13:29 +00:00
Ged Murphy
eb28b183e5 - call undocumented functions directly when building with MSVC and the MS PSDK
- fixes building with MSVC

note, this can be removed when bulding ROS with MSVC isn't reliant on the MS PSDK

svn path=/trunk/; revision=25932
2007-02-28 23:43:12 +00:00
Eric Kohl
c04b7173b2 Add code to support font size changes.
svn path=/trunk/; revision=25931
2007-02-28 22:49:34 +00:00
Eric Kohl
c296041163 Use wsprintf() to convert an integer to a string instead of abusing a hidden edit control.
svn path=/trunk/; revision=25930
2007-02-28 20:44:47 +00:00
Alex Ionescu
045e38927e - Make usetup ""work"" on systems with ~28MB+ RAM. Due to an unknown bug (in usetup or Mm, file copies during setup don't get flushed until memory reaches about 42-47% remaining. At this point, if enough memory is available, no more memory will be allocated, even though more files are being copied. On systems with < 48MB, the system will not usually flush pages fast enough to keep the memory at ~42-47%. We ""fix"" this by adding a delay to each file copy as long as free memory is below 40%.
- Also added 3 progress bars during memory transfers to show the status of the memory.

svn path=/trunk/; revision=25929
2007-02-28 20:43:13 +00:00
Alex Ionescu
a1ad43c2ee - More refactoring of FreeLDR/SetupLDR PE Loader Code to remove some hacks.
- Don't double-free some entries when failing to load a boot driver. This would cause a crash when pciide couldn't load (since we don't yet import drivers in FreeLDR, and pciide needs pciidex). Thanks to encoded for reporting it.
- We now free boot driver memory again since it's safe to do so again. This should reduce memory requirements even more.

svn path=/trunk/; revision=25928
2007-02-28 19:04:27 +00:00
Alex Ionescu
864da6c412 - Properly load drivers using new method describred previously (read from disk into temporary allocated buffer, then map into allocated memory, then free disk buffer).
- FreeLDR doesn't relocate nor map imports for drivers yet..still needs testing/fixes.

svn path=/trunk/; revision=25927
2007-02-28 17:48:44 +00:00
Sylvain Petreolle
257f23bf3b forget to add 2 files
svn path=/trunk/; revision=25926
2007-02-28 14:24:17 +00:00
Sylvain Petreolle
ec2c82b6d5 french translations updates
svn path=/trunk/; revision=25925
2007-02-28 14:15:31 +00:00
Saveliy Tretiakov
93f907207b Update testapp
svn path=/trunk/; revision=25924
2007-02-28 13:25:50 +00:00
Saveliy Tretiakov
9eea1f6b20 WM_INPUTLANGCHANGE is sent not posted.
svn path=/trunk/; revision=25923
2007-02-28 13:23:51 +00:00
Saveliy Tretiakov
05d4dee367 Make ntuser locks use eresource instead of mutex.
Fix corresponding FIXME in class.c


svn path=/trunk/; revision=25922
2007-02-28 13:21:48 +00:00
Timo Kreuzer
4481a26504 EnumChildWindows:
- if hWndParent == NULL: call EnumWindows
- else use bChildren = TRUE

svn path=/trunk/; revision=25921
2007-02-28 13:21:09 +00:00
Timo Kreuzer
9cb8365d3f NtUserBuildHwndList:
- handle bChildren
- remove some code duplication

svn path=/trunk/; revision=25920
2007-02-28 13:19:00 +00:00
Saveliy Tretiakov
a9d354b237 Andrey Janzen (virus126):
echo %date% on windows >=XP return '24.02.2007', not 'Sut 24.02.2007'
fix & implement dynamic buffer


svn path=/trunk/; revision=25919
2007-02-28 13:17:34 +00:00
Dominique Cote
4072d1c2a7 Added test functions for fsrtl lib
svn path=/trunk/; revision=25918
2007-02-28 04:09:16 +00:00
KJK::Hyperion
f007c58ba9 modified include/reactos/libs/pseh/framebased.h
modified   lib/pseh/framebased.c
 - _SEH_ENABLE_TRACE now obsolete; _SEH_ENABLE_TRACE_LIB renamed to _SEH_ENABLE_TRACE now that the name is available again. Yay open source development model and yay me

svn path=/trunk/; revision=25917
2007-02-28 00:22:08 +00:00
KJK::Hyperion
d04dfa5357 modified framebased.h
- don't enable a random tracing level when the library is built for tracing but an application is not. Fastest bugfix ever

svn path=/trunk/; revision=25916
2007-02-28 00:16:38 +00:00
KJK::Hyperion
53d575c73e modified include/reactos/libs/pseh/framebased.h
- final reformatting/cleanup fixes
 - fixed regression introduced in 25908

modified   include/reactos/libs/pseh/framebased.h
modified   include/reactos/libs/pseh/framebased/internal.h
modified   lib/pseh/framebased.c
 - per-frame tracing support for PSEH. Prints detailed debugging traces with DbgPrint when enabled. New defines _SEH_ENABLE_TRACE, _SEH_ENABLE_TRACE_LIB and _SEH_DO_DEFAULT_TRACING, new macros _SEH_EnableTracing() and _SEH_DisableTracing(), new constants _SEH_DO_TRACE_XXX. Please test it
See issue #2069 for more details.

svn path=/trunk/; revision=25915
2007-02-28 00:04:36 +00:00
Dmitry Gorbachev
86294c4aeb Undo 25911
svn path=/trunk/; revision=25913
2007-02-27 18:17:26 +00:00
Dmitry Gorbachev
2e29a8dbd8 Update Russian translations.
svn path=/trunk/; revision=25912
2007-02-27 16:51:19 +00:00
Dmitry Gorbachev
9713a955bb Indonesian translation by Zaenal Mutaqin
svn path=/trunk/; revision=25911
2007-02-27 00:04:43 +00:00
Dominique Cote
982855b6e3 Added:
FsRtlPrepareMdlWriteDev()
FsRtlMdlWriteCompleteDev()
FsRtlPrepareMdlWrite()
FsRtlMdlWriteComplete()

svn path=/trunk/; revision=25910
2007-02-26 20:22:55 +00:00
KJK::Hyperion
35f897c768 Reformatted, for real
svn path=/trunk/; revision=25909
2007-02-26 15:55:43 +00:00
KJK::Hyperion
97f61ad508 modified include/reactos/libs/pseh/framebased.h
Removed some bad optimization ideas that never worked anyway. If you want optimization, use the uglier _SEHX macros. If you enjoy several huge, non-optimizable nested loops in all of your functions, just keep using the _SEH form

deleted    include/reactos/libs/pseh/native.h
deleted    include/reactos/libs/pseh/prettybased.h
   Deleted some really bad ideas that nobody used or maintained anyway

All and all else
   Reformatted. Goodbye one-space indentation, hello tabs

svn path=/trunk/; revision=25908
2007-02-26 15:32:19 +00:00
Dmitry Gorbachev
65792010fe Indonesian translation (Zaenal Mutaqin)
svn path=/trunk/; revision=25907
2007-02-26 14:37:09 +00:00
Dmitry Gorbachev
5aa7f19d62 Indonesian translation (Zaenal Mutaqin)
svn path=/trunk/; revision=25906
2007-02-25 22:45:32 +00:00
Eric Kohl
9f48caa207 - Sort font names alphabetically.
- Enable the user to choose fonts.

svn path=/trunk/; revision=25905
2007-02-25 21:58:20 +00:00
Saveliy Tretiakov
3a94758ff5 Fix installname
svn path=/trunk/; revision=25902
2007-02-24 18:16:50 +00:00
Magnus Olsen
fbf5933eb6 adding -dump as param to dumping out all struct and data
svn path=/trunk/; revision=25901
2007-02-24 13:58:25 +00:00
Magnus Olsen
da00b2ed98 adding more testcase for NtGdiDdQueryDirectDrawObject
svn path=/trunk/; revision=25900
2007-02-24 13:32:09 +00:00
Magnus Olsen
a640e4e2d6 adding more testcase for NtGdiDdQueryDirectDrawObject
svn path=/trunk/; revision=25899
2007-02-24 12:24:31 +00:00
Saveliy Tretiakov
54c6bf6cfa kbdse.dll -> kbdsw.dll
svn path=/trunk/; revision=25898
2007-02-24 12:00:43 +00:00
Saveliy Tretiakov
54cf74f087 Andrey Janzen (virus126):
- Fix warning when using FEATURE_UNIX_FILENAME_COMPLETION.
- Make unix-style completion work correctly.
- Make %time% return milliseconds/10.


svn path=/trunk/; revision=25896
2007-02-23 20:05:39 +00:00
Saveliy Tretiakov
658c2a1911 Andrey Janzen (virus126):
Replace numbers by constants in all translations.
Fixes bug 2065.


svn path=/trunk/; revision=25895
2007-02-23 19:52:00 +00:00
Alex Ionescu
9969d07b68 - Update FreeLDR PE Loading to actually use its Mm routines to allocate a buffer to read an image file into, then to allocate the actual load base and use the same code as in sysldr.c right now to PE-load the image into memory, then free the original read buffer. Not yet enabled for drivers!
- This means that:
  - 1) FreeLDR now keeps memory accounting information for the image files it loads, instead of us randomly writing to memory.
  - 2) We now skip sections marked as NO_LOAD. The kernel already re-mapped drivers doing this, but it didn't remap the kernel/hal, plus we still had to map the drivers once in FreeLDR, so we're saving a meg+ of kernel memory.

svn path=/trunk/; revision=25894
2007-02-23 19:48:25 +00:00
Saveliy Tretiakov
8ccd7405b6 Update keyboard layout names. Add "Layout Id" key for Us-Dvorak. Rename kbdse.dll to kbdsw.dll
svn path=/trunk/; revision=25893
2007-02-23 18:41:48 +00:00
Alex Ionescu
7c1178da04 - Load the driver image file with OBJ_KERNEL_HANDLE, and don't use FILE_SYNCHRONOUSIO_NONALERT, since we can use async access since the data is now being mapped instead of read.
svn path=/trunk/; revision=25892
2007-02-23 15:35:14 +00:00
Alex Ionescu
4f9ab3b9a5 - Add a new member to MM_IMAGE_SECTION_OBJECT to hold the size of the mapped image file.
- Finally load driver images like human beings, as actual image section objects instead of random memory that we allocate and manually "load" using unsafe and crappy PE memory copies. We now use KJK's integer-safe and properly documented/implemented loader for image sections that is already used for processes and other user-mode images.
- Implement MiLoadImageSection for the task above and remove all the deprecated code that did the previous hackloading.

svn path=/trunk/; revision=25891
2007-02-23 15:31:45 +00:00
Saveliy Tretiakov
0446badad8 Move primary language selection from Input Locale page to General page.
svn path=/trunk/; revision=25890
2007-02-23 09:35:32 +00:00
Saveliy Tretiakov
82acba718f Update testapp
svn path=/trunk/; revision=25889
2007-02-23 08:56:32 +00:00
Saveliy Tretiakov
e67ae3715b Add KLF_SHIFTLOCK and KLF_RESET
svn path=/trunk/; revision=25888
2007-02-23 08:21:29 +00:00
Saveliy Tretiakov
8daaec74a8 Fix warnings.
svn path=/trunk/; revision=25887
2007-02-23 08:20:33 +00:00
Alex Ionescu
8648ea02e1 - Get rid of LdrGetModuleObject, since MmLoadSystemImage will now return the existing module object in case it has already been loaded, get rid of LdrGetProcedureAddress, it doesn't belong in the kernel. Move MmGetSystemRoutineAddress from mm.c to sysldr.c and rewrite it to use MiFindExportedRoutineByName instead.
- Remove /ldr ntoskrnl directory, since this module is finally gone.
- Make PsInit code search for ntdll lookups using LookupEntryPoint internal function, instead of LdrGetProcedureAddress. Same code but done with recursion instead, and internal to this module (remove ANSI_STRINGs since we don't need them anymore).

svn path=/trunk/; revision=25886
2007-02-23 07:56:01 +00:00
Alex Ionescu
86c4790af3 - Merge DbgUnLoadImageSymbols from KD branch.
- Rename LdrUnloadModule to MmUnloadSystemImage and:
  - Use MmSystemLoadLock.
  - Take into consideration the import list.
  - Honour load count.
  - Unload symbols if really unloading the image.
  - Dereference and clear imports.
  - Do proper LdrEntry cleanup.
- Stub MiDereferenceImports and MmCallDllInitialize.
- Implement MiLocateExportName and MiClearImports.
- We don't yet fully support reference counting imports...this is still TBD.

svn path=/trunk/; revision=25885
2007-02-23 07:13:19 +00:00
Alex Ionescu
bae0317c7c - Fix build.
svn path=/trunk/; revision=25884
2007-02-23 06:59:10 +00:00
Alex Ionescu
3111dda705 - Fix MmCreateImageSection to use previous mode instead of hardcoding UserMode.
- Implement MiProcessLoaderEntry for adding/removing entries on the PsLoadedModuleList.
- Move MmLoadSystemImage from loader.c to sysldr.c
- Update MmLoadSystemImage:
  - Use MmSystemLoadLock.
  - Support returning the entry for an already-loaded image, instead of loading it twice.
  - Use Section APIs to map the image... we're still doing a dirty ZwReadFile hack, but at least now we can depend on the PE code to validate the image (so removed the hardcoded validation).
  - Add more generic cleanup got so we can just jump to it.
  - Add more stub code and detection code for upcoming features.

svn path=/trunk/; revision=25883
2007-02-23 05:39:42 +00:00
Dmitry Gorbachev
736a4de31f Indonesian translation by Zaenal Mutaqin (ade999 at gmail dot com)
svn path=/trunk/; revision=25882
2007-02-23 01:42:52 +00:00
Alex Ionescu
e81f8006bb - Move some Mm routines from pe.c to sysldr.c where they belong.
- Create and initialize Mm Loader lock.
- Re-arrange some code in MmLoadSystemImage, no code changes yet.
- Add new LDRP_ flags for LDR_DATA_TABLE_ENTRY to the NDK.

svn path=/trunk/; revision=25881
2007-02-22 20:55:02 +00:00
Saveliy Tretiakov
50b11bc313 Handle WM_INPUTLANGCHANGE and WM_INPUTLANGCHANGEREQUEST in DefWindowProc.
svn path=/trunk/; revision=25880
2007-02-22 19:43:27 +00:00
Saveliy Tretiakov
da13fb5a41 NtUserLoadKeyboardLayoutEx: Support KLF_REORDER and KLF_ACTIVATE.
NtUserActivateKeyboardLayout: Support HKL_NEXT, HKL_PREV, KLF_REORDER.


svn path=/trunk/; revision=25879
2007-02-22 19:41:10 +00:00
Magnus Olsen
06b4e06c8a win32k dx test are now compatible with all Windows and ReactOS that got a d3d8thk.dll file
rember that file are diffent for Windows 2000 and Windows XP/2003 ReactOS d38thk.dll are Windows XP/2003 compatible. 

svn path=/trunk/; revision=25878
2007-02-22 19:21:10 +00:00
Magnus Olsen
92213f75ef Move d3d8thk.h for it being use for apps that need todo win32k syscall for directx graphice part
svn path=/trunk/; revision=25877
2007-02-22 19:10:40 +00:00
Sylvain Petreolle
717a91df43 fix build
svn path=/trunk/; revision=25876
2007-02-22 18:48:01 +00:00
Alex Ionescu
f141767094 - Rename LdrLoadModule to MmLoadSystemImage and change prototype. No code change except update callers and return ImageBaseAddress parameter when requested.
svn path=/trunk/; revision=25875
2007-02-22 18:30:50 +00:00
Alex Ionescu
31446c8a3b - Improve LdrGetModuleObject (in FreeLDR) to handle partial names too, so NTOSKRNL will still match NTOSKRNL.EXE. This is needed for forwarder support.
- Implement LdrPEFixupForward in FreeLDR and update LdrPEGetExportByName to use it, so that FreeLDR can now parse import tables with forwarders.
- Add call to MmInitSystem for Phase 0 in ExpInitializeExecutive.
- Completely redesign the way boot drivers are handled. They're now re-mapped during Phase 0 MmInit (part of the re-mapping is a hack until FreeLDR 2.5 is ready) and the IoMgr only does I/O stuff, not PE loading anymore (this is only half-true, we still process imports until FreeLDR 2.5 is done).
- Also re-design the way the module list head is initialized and used. LdrInit1 is now gone, Phase 0 MmInit now handles initializing it and copying boot loader data to it.
- Some code is still missing and functions still need to be improved.
- When FreeLDR 2.5 is ready some of the hacks will go away, they're #ifed for now to make it easy to switch.

svn path=/trunk/; revision=25874
2007-02-22 18:02:53 +00:00
Alex Ionescu
40e1082e3d - Rename ModuleListHead to PsLoadedModulesList.
- Start implementing some routines of the Mm SysLdr. Implemented MiSnapThunk and most of MiResolveImageReferences. The SysLdr has a lot of restrictions that the typical Ldr in user-mode doesn't, as well as manages imports and reference counts them, so the code can't be shared with ntdll's Ldr (this is also why real NT doesn't have an Ldr component, and this is in Mm).
- Fix some PE Header types that were wrong in our PSDK.

svn path=/trunk/; revision=25872
2007-02-22 00:01:52 +00:00
Magnus Olsen
6751f1721e adding a helper intEnableDriver it will be use for enable the dx driver for the graphice card.
rewrote NtGdiDdQueryDirectDrawObject so it only copy the cache data only. This will speed up allot. we only need call on NtGdiDdCreateDirectDrawObject yo setup the whole cache and enable the drv with the helper functions. the NtGdiDdQueryDirectDrawObject will be faster like this. using RtlCopyMemory insted for RtlMemMove  and allot other change in it. adding _SEH to NtGdiDdQueryDirectDrawObject so user can not crash it any longer. 

svn path=/trunk/; revision=25870
2007-02-21 22:19:31 +00:00
Timo Kreuzer
b43aa6554f Silence some warnings
svn path=/trunk/; revision=25869
2007-02-21 22:04:59 +00:00
Alex Ionescu
012009365d - Implement ExpQueryModuleInformation to handle SystemModuleInformation, instead of LdrpQueryModleInformation. This version properly fills out all the data required and also supports (but doesn't yet handle) user-mode modules.
- Start work on supporting NT-compatible System Loader that properly fills out LDR_DATA_TABLE_ENTRY and handles imports correctly. Modified LdpPEProcessModule to properly build the data table entry and create the base name and directory name.
- Add stub for MiResolveImageRefernces.

svn path=/trunk/; revision=25868
2007-02-21 18:43:57 +00:00
Dmitry Gorbachev
af1995f6f1 Thai translation (Sumath Aowsakulsutthi)
svn path=/trunk/; revision=25867
2007-02-21 18:23:59 +00:00
Dmitry Gorbachev
8f0b7ce68c Thai translation (Sumath Aowsakulsutthi)
svn path=/trunk/; revision=25866
2007-02-21 18:22:30 +00:00
Dmitry Gorbachev
4d0c6f3b50 Thai translation by Sumath Aowsakulsutthi (punth1 at gmail dot com)
svn path=/trunk/; revision=25865
2007-02-21 18:22:11 +00:00
Dmitry Gorbachev
d6122e01fa Fix Italian resource file
svn path=/trunk/; revision=25863
2007-02-21 11:41:17 +00:00
Alex Ionescu
828eda9888 - Properly implement SystemLoadGdiDriverInformation.
- Properly implement SystemExtendServiceTableInformation, except that the SE_LOAD_DRIVER_PRIVILEGE check is currently disabled since our smss doesn't acquire it (and we should therefore ban it from loading win32k.sys...).
- Delete LdrpLoadImage, LdrpUnlaodImage, LdrpLoadAndCallImage.

svn path=/trunk/; revision=25862
2007-02-21 02:46:30 +00:00
Alex Ionescu
effa3a52ef - Cleanup loader.c and comment some public routines (no code change).
- Temporarily remove routines to set per-page protection (this doesn't really break anything, just makes the OS less secure).

svn path=/trunk/; revision=25861
2007-02-21 01:57:02 +00:00
Alex Ionescu
226a94773d - Get rid of a bunch of multiboot crap FreeLDR was still doing for ReactOS.
- Remove some of the sixtuplicated routines to load a PE file. We're now down to a single function which takes an ImageType parameter for DLL/EXE/SYS, but even this is still temporary as the parameter will soon go away.
- We now load drivers in the same nice way that we load the kernel and DLLs, but we don't yet process their imports and relocate them in FreeLDR, because FreeLDR doesn't handle forwarders yet.
- We don't need a large hack in KiRosPrepareForSystemStartup anymore since the driver base addresses are now proper.
- Don't free boot-drivers anymore, since we'll load them in place soon.
- Don't load bootvid twice.
- Remove PAE stuff in FreeLDR since we don't support PAE anyway in the kernel and when we do, might as well implement it cleanly instead of relying on the broken FreeLDR stuff.

svn path=/trunk/; revision=25860
2007-02-20 20:02:52 +00:00
Ged Murphy
b4f7cf3523 add chars to the edit box when either double clicked or the select button is hit
svn path=/trunk/; revision=25848
2007-02-19 23:56:16 +00:00
Eric Kohl
d8e1e7bba4 Enable the user to set the size of captions, caption buttons, menu bars and croll bars.
svn path=/trunk/; revision=25844
2007-02-19 16:12:38 +00:00
Dmitry Gorbachev
f49c3528f3 Fix a bug
svn path=/trunk/; revision=25842
2007-02-19 13:20:09 +00:00
Thomas Bluemel
5c7f9d04ce Minor fixes, thanks Ged
svn path=/trunk/; revision=25841
2007-02-19 13:15:28 +00:00
Saveliy Tretiakov
148aa8601e Patch from Preston:
fix bug 1918 "Keyboard config unavailable".


svn path=/trunk/; revision=25834
2007-02-18 16:35:09 +00:00
Eric Kohl
b6dc9d8a3d Reenable the preview control notification. The user can now select the GUI item clicking it in the preview control.
svn path=/trunk/; revision=25832
2007-02-17 21:40:39 +00:00
Saveliy Tretiakov
abf9c6e638 Patch by Alexey Zavyalov (Generex).
Implement SetLocaleInfoA, SetLocaleInfoW.


svn path=/trunk/; revision=25831
2007-02-17 15:46:25 +00:00
Saveliy Tretiakov
4ea3e26092 Patch by Andrey Janzen (virus126).
Fix copy\paste bug in calc.


svn path=/trunk/; revision=25830
2007-02-17 15:33:57 +00:00
Magnus Olsen
e565b89550 adding file dump.c it contain printf stuff to dump some struct to the screen it can make debuging more easy. but if u build reactos with DBG=0 you will not see the dump of the stuct I mabe will add a option to it when u start this tools so it dump data when u use the options.
svn path=/trunk/; revision=25829
2007-02-17 15:01:01 +00:00
Thomas Bluemel
316942e612 - Move around definitions to make the code a bit more modular
- Use an about menu instead of an button

svn path=/trunk/; revision=25828
2007-02-17 09:32:33 +00:00
Ged Murphy
15b0d2660f add to bootcd to highlight the paint issue
svn path=/trunk/; revision=25827
2007-02-17 00:23:53 +00:00
Ged Murphy
aed1c8ece5 add to build
svn path=/trunk/; revision=25826
2007-02-17 00:22:21 +00:00
Ged Murphy
8cc6eff6ae - halfplement charmap.exe
- tested in ROS, by no means perfect but we cant least see the various glyphs within a font
- this app highlights an issue with our paint code (not yet investigated)

svn path=/trunk/; revision=25825
2007-02-17 00:13:35 +00:00
Magnus Olsen
77c7470539 adding more test case for test_NtGdiDdQueryDirectDrawObject not complete yet
svn path=/trunk/; revision=25824
2007-02-16 20:14:24 +00:00
Art Yerkes
66ccb79bbf Updated linker script.
svn path=/branches/powerpc/; revision=25465
2007-01-15 10:20:00 +00:00
Art Yerkes
c668a23039 Corresponding checkpoint for HAL.
Some hacks are still in here.
Not much is implemented yet.
Just getting the basics going.

svn path=/branches/powerpc/; revision=25464
2007-01-15 10:00:47 +00:00
Art Yerkes
674fbb117a Checkpoint. HalDisplayString is working and hooked up to DbgPrint.
We've now got reciprocal imports from hal working.
I've added a small hack, that being to relocate modules to 64k boundaries.  This works around ABI issues for
now.
Some warning suppression re: uninitialized values.
KdInit: make it possible to use a subset of the x86 debug targets.

svn path=/branches/powerpc/; revision=25463
2007-01-15 09:54:16 +00:00
Art Yerkes
e4aa183ac9 Remove some spam and add options to make ntoskrnl a bit smaller and easier to process.
svn path=/branches/powerpc/; revision=25462
2007-01-15 09:43:12 +00:00
Art Yerkes
ea981c38bb Some additions for relocatable ppc dlls.
svn path=/branches/powerpc/; revision=25446
2007-01-14 03:02:43 +00:00
Art Yerkes
58bde26065 Zero other BSS type sections where applicable.
svn path=/branches/powerpc/; revision=25424
2007-01-11 09:00:30 +00:00
Art Yerkes
483d900bfb Update address of hal before performing imports, add page.c
svn path=/branches/powerpc/; revision=25377
2007-01-08 10:12:22 +00:00
Art Yerkes
e9873af4fc HAL display implementation based on openfirmware framebuffer.
svn path=/branches/powerpc/; revision=25376
2007-01-08 09:30:17 +00:00
Art Yerkes
fbaf823a61 Start of an implementation of page.c
svn path=/branches/powerpc/; revision=25375
2007-01-08 09:28:39 +00:00
Art Yerkes
c6f96d6493 Add needed reloc types.
svn path=/branches/powerpc/; revision=25374
2007-01-08 09:27:30 +00:00
Art Yerkes
9e8cec3b58 Hal stubs. Build halppc.
svn path=/branches/powerpc/; revision=25335
2007-01-06 22:31:50 +00:00
Art Yerkes
40d233d877 Make this allow POWERPC as well.
svn path=/branches/powerpc/; revision=25333
2007-01-06 20:01:20 +00:00
Art Yerkes
0c8a94de76 Allow PowerPC too.
svn path=/branches/powerpc/; revision=25325
2007-01-06 02:44:40 +00:00
Art Yerkes
49cba5d4e3 Pre-transformed, modified headers suitable for use with -isystem when building
reactos-ppc code.

svn path=/branches/powerpc/; revision=25304
2007-01-05 06:02:56 +00:00
Art Yerkes
81a8d71a9d Compiler driver wrapper for building pe-powerpcle executables. Expects access
to a powerpc gcc and ld, as well as alink.  The scripts in here are transformed
by sed ala GNU configure.

fork_win32 and fork_unix provide a uniform way of calling an external program
and reading stderr.

dlltool.cpp is a minimalist what-if about replacing binutils' dlltool.  It's
not used by might be instructive.

svn path=/branches/powerpc/; revision=25303
2007-01-05 05:56:26 +00:00
Art Yerkes
fb9f4b89c9 A test to see if things are mostly working. You can build it and then load
them on a prep box.  You'll see output on the serial port if they linked
and bound properly.  I have a patch for gxemul that can load pecoff and bind
imports, that can be used for this purpose.

svn path=/branches/powerpc/; revision=25302
2007-01-05 05:50:55 +00:00
Art Yerkes
036f2c1f6c ldscript used to link reactos ppc executables.
svn path=/branches/powerpc/; revision=25301
2007-01-05 05:45:52 +00:00
Art Yerkes
3bae2c0ecd This is the modified version of alink used to produce pe-coff powerpc
executables.  I received permission from Anthony Williams to distribute
a modified version for use in ReactOS.

Thanks to him, we're able to use better-supported elf tools for most of
the things we do.

svn path=/branches/powerpc/; revision=25300
2007-01-05 05:42:00 +00:00
Art Yerkes
9c3817045b - Reserve and map a page for Pcr
- Some stubs (KeInitExceptions, KeInitInterrupts, ...)
- Normalize segments and bats

svn path=/branches/powerpc/; revision=25280
2007-01-03 09:31:26 +00:00
Art Yerkes
87541c1edb Removed tracking.
svn path=/branches/powerpc/; revision=25274
2007-01-02 08:32:52 +00:00
Art Yerkes
2d0a9e6ffa Removed now unneeded-tracing, added hal address. We can see hal from here.
svn path=/branches/powerpc/; revision=25273
2007-01-02 08:31:10 +00:00
Art Yerkes
aeea011c59 - most of the churn here is from code and headers imported from trunk.
- there are several improvements to freeldr for which ion and fireball are responsible.
- also here is filip's cmlib.
- my changes to freeldr mostly centered around managing the kernel slab and transitioning to the kernel memory
  map.  the new map is built in a new area and installed once we have every page set up.  this is a bit safer
  than the old method.
- the video planes are handed off to ntoskrnl, and some trace macros using the frame buffer are available.
- some hacks are removed.
- current status: LdrInitModuleManagement tries to get the header from hal.dll but fails for some reason.  i
  need to look into it.
- this is a checkpoint, since there's been some interest in seeing how things are progressing.
- you can put any pe-coff powerpc exe (based at 0x80000000) in place of ntoskrnl to test various aspects of 
  the boot handoff.  this will be useful for testing our trap handlers and such.
- the toolchain didn't produce correct executables in all cases before, and didn't differentiate rva32 and
  rel32, causing some things to be linked wrong.  so far, the current toolchain (20061231) links correctly,
  using R_PPC_UADDR32 as a surrogate for rva32, since it's never produced by gcc.
- some earlyboot video tracing is in ntoskrnl so i can peek around a bit.

svn path=/branches/powerpc/; revision=25259
2007-01-01 11:32:44 +00:00
Art Yerkes
8268d67594 Build an entirely new page table.
svn path=/branches/powerpc/; revision=24597
2006-10-22 07:24:21 +00:00
Art Yerkes
6dae10c682 Simplify this since we now have intrin.h
svn path=/branches/powerpc/; revision=24450
2006-10-08 10:50:50 +00:00
Art Yerkes
884712c2ba Also added for merge.
svn path=/branches/powerpc/; revision=24449
2006-10-08 10:31:52 +00:00
Art Yerkes
d56f62106c Move mmu.h to make it more generally accessible since we need translation
functions in windows subdir.

svn path=/branches/powerpc/; revision=24448
2006-10-08 10:27:42 +00:00
Art Yerkes
d908957c65 Really fix font.h
svn path=/branches/powerpc/; revision=24447
2006-10-08 10:18:28 +00:00
Art Yerkes
9c051d65f9 Fix silly error: missing digit.
svn path=/branches/powerpc/; revision=24446
2006-10-08 10:14:01 +00:00
Art Yerkes
4b55d29dd3 Straggler. Early boot video font.
svn path=/branches/powerpc/; revision=24445
2006-10-08 10:11:51 +00:00
Art Yerkes
6cbdc0d820 Partially fixed up tree after merge from HEAD. More to do.
Fixing ICE in gcc is no fun.

svn path=/branches/powerpc/; revision=24443
2006-10-08 10:01:27 +00:00
Art Yerkes
47e3cefe5b - Create a slab that contains the last vestage of our life as the boot program.
- Include a font containing some characters we can use with boot video.
- Copy in a description of the boot framebuffer.
- Add a small ad-hoc number writing function.
- Display our progress building the initial page table.
- We don't necessarily have space in the boot-time page table so just kill
  off boot-time paging.
- Pass ntoskrnl the address of the boot slab.  It contains the boot font, a
  description of the boot video device and all active page table entries.
- Next, well be able to use this in early ntoskrnl space to display our 
  progress etc.  Since we're using phyiscal addresses to write to the boot
  framebuffer, the page table needn't include it.  This simplifies things
  compared to linux, but it's expensive.

svn path=/branches/powerpc/; revision=24390
2006-10-04 08:10:01 +00:00
Art Yerkes
532db1da72 A 'boot logo' of sorts to show we're about to switch to kernel mode.
We'll pass the FB address into kernel land so we can continue writing on it.

svn path=/branches/powerpc/; revision=24357
2006-10-01 22:57:16 +00:00
Art Yerkes
042ade46e9 Working out boot video, fixed memory map completely.
svn path=/branches/powerpc/; revision=24332
2006-10-01 05:46:59 +00:00
Art Yerkes
6421038be3 Remove the need to relocate freeldr. We now use it in-place as stored in
ofwldr's .data.  Fix call_ofw for more modern macs.
Add more debugging type calls to calls.ofw.


svn path=/branches/powerpc/; revision=24327
2006-10-01 03:30:06 +00:00
Art Yerkes
77caf5c3c7 Checkpoint in here. More work needed.
svn path=/branches/powerpc/; revision=24275
2006-09-26 03:33:05 +00:00
Art Yerkes
1956e17bc7 Added some needed OFW calls.
svn path=/branches/powerpc/; revision=24274
2006-09-26 03:29:53 +00:00
Art Yerkes
5ece9e35c8 Add missing file from the branch. Preparing to move build hosts.
svn path=/branches/powerpc/; revision=24265
2006-09-25 01:43:46 +00:00
Art Yerkes
1226225c28 Add ppc version of bitops header (from linux)
Compile usbuhci, usbohci

svn path=/branches/powerpc/; revision=24163
2006-09-17 10:35:12 +00:00
Art Yerkes
99c1928bcb Fix b0rked macros
svn path=/branches/powerpc/; revision=24161
2006-09-17 10:19:34 +00:00
Art Yerkes
fd77489b59 Add disable, enable interrupts.
svn path=/branches/powerpc/; revision=24160
2006-09-17 10:00:59 +00:00
Art Yerkes
ee127f5c83 Add needed definition (scsiport).
KeGetCurrentIrql

svn path=/branches/powerpc/; revision=24159
2006-09-17 09:51:36 +00:00
Art Yerkes
b6e4be8a15 compile atapi.sys (add needed def for PAGE_SIZE)
svn path=/branches/powerpc/; revision=24158
2006-09-17 09:49:21 +00:00
Art Yerkes
6b21a858d1 Adapt pefixup for bytesex.h, rsym: add some debugging info that can be
turned on if needed.

svn path=/branches/powerpc/; revision=24157
2006-09-17 09:37:46 +00:00
Art Yerkes
32c139b3f3 rsym working right on ppc. Use a template (horror) to emulate an off-endian
field in a struct.  We'll reconcile this code later.
remove link-ntoskrnl.  I'm gonna split off the ppc ldscript.

svn path=/branches/powerpc/; revision=24077
2006-09-12 05:09:41 +00:00
Art Yerkes
5b6b2b681f Insert PTEs for 16 mb of kernel memory.
Added function to insert PTEs in mmu.c
mboot: complete the jump to kernel space.
mach: add some memory to our initial map.
 - We should allow freeldr's mm to request more memory before giving up
 - We'll do well to allocate big blocks directly from ofw and small blocks
   from this heap implementation
 - We can't return *all* memory like it wants because we still need ofw,
   which may need to do allocation itself

svn path=/branches/powerpc/; revision=24045
2006-09-10 20:43:26 +00:00
Art Yerkes
1cc1dd2ddd Cleaning: tweaks.
svn path=/branches/powerpc/; revision=24015
2006-09-10 06:07:08 +00:00
Art Yerkes
716a587e86 Add -fshort-wchar
svn path=/branches/powerpc/; revision=24014
2006-09-10 05:58:10 +00:00
Art Yerkes
d8e8330fd4 Merge fix to ppc branch.
svn path=/branches/powerpc/; revision=23991
2006-09-09 13:49:03 +00:00
Art Yerkes
4a7321f583 Removed workaround. Now know the cause.
svn path=/branches/powerpc/; revision=23989
2006-09-09 13:33:18 +00:00
Art Yerkes
8c90909c24 Link ntoskrnl.
svn path=/branches/powerpc/; revision=23909
2006-09-04 06:38:37 +00:00
Art Yerkes
8741dcaf30 Removed junk.
svn path=/branches/powerpc/; revision=23908
2006-09-04 06:27:18 +00:00
Art Yerkes
c31bb913e5 Big merge: thanks alex and greatlord. Not a complete merge but most
relevant things for ppc right now.
hal
ntoskrnl
include
lib/rtl
lib/cmlib
some freeldr components

svn path=/branches/powerpc/; revision=23907
2006-09-04 05:52:23 +00:00
Art Yerkes
3cc6a119fb Fixed, separated mmu related functions. We now get correct translations
in every case.

fat.c: workaround for now.  Need to figure out why the fs is b0rked.

svn path=/branches/powerpc/; revision=23893
2006-09-03 03:37:20 +00:00
Art Yerkes
62f408e7e6 Most of an implementation of page lookup for PPC. Written for
understanding and also to provide a way to inspect virtual to phyiscal 
translations.  We should and will do this with ofw most of the time, but 
we'll have to do it ourselves in the delicate time before jumping to 
ntoskrnl.

svn path=/branches/powerpc/; revision=23861
2006-09-01 09:46:44 +00:00
Art Yerkes
f5f3faa9f2 Adding methods to inquire about virtual memory setup.
svn path=/branches/powerpc/; revision=23858
2006-09-01 06:53:49 +00:00
Art Yerkes
f6811c33e7 Some intermediate work. We start loading the kernel now.
Working on early boot memory mapping.  We'll rely heavily on open 
firmware until we're on our own page table.

svn path=/branches/powerpc/; revision=23835
2006-08-31 08:01:30 +00:00
Thomas Bluemel
e0ee404d03 Make sure writes to video_mem are not optimized away
svn path=/branches/powerpc/; revision=23782
2006-08-29 15:50:53 +00:00
Art Yerkes
47acc19039 Menu displays.
Need stdin/hid objects.

svn path=/branches/powerpc/; revision=23765
2006-08-29 07:16:16 +00:00
Art Yerkes
746211fbde Fixed support for disk and filesystem. We're reading files normally.
Now working on display modes and character input.

svn path=/branches/powerpc/; revision=23764
2006-08-29 06:28:13 +00:00
Art Yerkes
f04af18b2a Added method call interface, mmu translation methods.
svn path=/branches/powerpc/; revision=22687
2006-06-29 11:07:46 +00:00
Art Yerkes
d763a47abc Claim a workspace using openfirmware.
svn path=/branches/powerpc/; revision=22681
2006-06-28 22:55:52 +00:00
Art Yerkes
6fa7ef7aec Fixed actual bug in freeldr printf. Probably used to depend on a bug in
_itoa, which was later made compliant.  I'm guessing that this went 
unnoticed because nobody used freeldr's printf very often.

svn path=/branches/powerpc/; revision=22680
2006-06-28 22:26:04 +00:00
Art Yerkes
87b0390e55 Woot. We're deep into freeldr. Printf is working, etc.
Forgot .bss.  TODO: retrieve .bss size in build step.

svn path=/branches/powerpc/; revision=22670
2006-06-28 01:14:23 +00:00
Art Yerkes
ada2c0684c Working up to it. We get the first banner.
svn path=/branches/powerpc/; revision=22669
2006-06-27 23:47:38 +00:00
Art Yerkes
df179d3111 - LE Stubs fully correct and we can move freely between freeldr and ofwboot.
- Small tweaking.
- Added build for ppc-le2be, cause it's needed to mangle freeldr into a
  correct ofwboot payload.
- Some cleaning in ofwboot.

svn path=/branches/powerpc/; revision=22666
2006-06-27 13:03:35 +00:00
Art Yerkes
d2af61537f Fix some sillyness. Remove some cruft.
svn path=/branches/powerpc/; revision=22661
2006-06-27 10:02:42 +00:00
Art Yerkes
5ac23d52a3 Utility functions separated, simple test (register dump)
svn path=/branches/powerpc/; revision=22659
2006-06-27 08:56:20 +00:00
Art Yerkes
0b3ce78bbe Forward functions verified working.
svn path=/branches/powerpc/; revision=22658
2006-06-27 08:51:04 +00:00
Art Yerkes
15c645139d Add ofw generated object file.
svn path=/branches/powerpc/; revision=22657
2006-06-27 08:15:06 +00:00
Art Yerkes
d91cff1ae8 Regularize with generated interfaces.
svn path=/branches/powerpc/; revision=22656
2006-06-27 08:01:08 +00:00
Art Yerkes
67f4a8ac0f Small tweaks.
svn path=/branches/powerpc/; revision=22655
2006-06-27 07:46:47 +00:00
Art Yerkes
511258568b Add ofw interface generator. It's a bit like mig is for mach. Just
does some convenience stuff, since we're an unusual OS, and we have 
special needs wrt OF.

svn path=/branches/powerpc/; revision=22654
2006-06-27 07:32:56 +00:00
Art Yerkes
9ae023f477 Get at least the basics working and make regdump output a little nicer.
svn path=/branches/powerpc/; revision=22612
2006-06-25 18:12:29 +00:00
Art Yerkes
3ea4c44cda Small update to WIP.
svn path=/branches/powerpc/; revision=22604
2006-06-24 23:53:21 +00:00
Art Yerkes
b0ae60eb7d Added link for freeldr.
svn path=/branches/powerpc/; revision=22598
2006-06-24 22:21:34 +00:00
Art Yerkes
61239b654c WIP Stragglers.
svn path=/branches/powerpc/; revision=22597
2006-06-24 22:10:40 +00:00
Art Yerkes
1ef3e5d464 Added simple main function for powerpc.
svn path=/branches/powerpc/; revision=22596
2006-06-24 22:07:06 +00:00
Art Yerkes
fc38707bc0 WIP straggler.
svn path=/branches/powerpc/; revision=22595
2006-06-24 22:03:20 +00:00
Art Yerkes
f55d60a183 PowerPC wip stragglers.
svn path=/branches/powerpc/; revision=22594
2006-06-24 21:56:05 +00:00
Art Yerkes
8d033e5f1b Add ARCH=powerpc, for initial build.
svn path=/branches/powerpc/; revision=22593
2006-06-24 21:52:03 +00:00
Art Yerkes
771a05678e ReactOS PowerPC WIP. This will be edited and merged, and likely shrunk.
Hacks will be removed and indeed your favorite assembly snippet will 
eventually not be just 'blr', so please *don't panic*.

svn path=/branches/powerpc/; revision=22592
2006-06-24 21:34:12 +00:00
Art Yerkes
e1850b5ee7 PowerPC WIP. Some of this is indeed hacky and will be changed.
svn path=/branches/powerpc/; revision=22591
2006-06-24 21:27:06 +00:00
9104 changed files with 1177719 additions and 365844 deletions

View File

@@ -0,0 +1,608 @@
// irc_test.cpp
#ifdef _MSC_VER
#pragma warning ( disable : 4786 )
#endif//_MSC_VER
#include <time.h>
#include <stdio.h>
#include "File.h"
#include "ssprintf.h"
#include "trim.h"
#include "IRCClient.h"
#include "config.h"
using std::string;
using std::vector;
//vector<string> tech, module, dev, stru, period, status, type, func, irql, curse, cursecop;
class List
{
public:
string name;
bool macro;
std::vector<std::string> list;
string tag;
int last;
List() { last = -1; }
List ( const char* _name, bool _macro ) : name(_name), macro(_macro)
{
tag = ssprintf("%%%s%%",_name);
last = -1;
}
};
vector<List> lists;
vector<string> ops;
void ImportList ( const char* listname, bool macro )
{
lists.push_back ( List ( listname, macro ) );
List& list = lists.back();
File f ( ssprintf("%s.txt",listname).c_str(), "r" );
string line;
while ( f.next_line ( line, true ) )
list.list.push_back ( line );
}
const char* ListRand ( List& list )
{
vector<string>& l = list.list;
if ( !l.size() )
{
static string nothing;
nothing = ssprintf ( "<list '%s' empty>", list.name.c_str() );
return nothing.c_str();
}
else if ( l.size() == 1 )
return l[0].c_str();
int sel = list.last;
while ( sel == list.last )
sel = rand()%l.size();
list.last = sel;
return l[sel].c_str();
}
const char* ListRand ( int i )
{
return ListRand ( lists[i] );
}
int GetListIndex ( const char* listname )
{
for ( int i = 0; i < lists.size(); i++ )
{
if ( !stricmp ( lists[i].name.c_str(), listname ) )
return i;
}
return -1;
}
List& GetList ( const char* listname )
{
return lists[GetListIndex(listname)];
}
const char* ListRand ( const char* list )
{
int i = GetListIndex ( list );
if ( i < 0 )
return NULL;
return ListRand(i);
}
string TaggedReply ( const char* listname )
{
string t = ListRand(listname);
string out;
const char* p = t.c_str();
while ( *p )
{
if ( *p == '%' )
{
bool found = false;
for ( int i = 0; i < lists.size() && !found; i++ )
{
if ( lists[i].macro && !strnicmp ( p, lists[i].tag.c_str(), lists[i].tag.size() ) )
{
out += ListRand(i);
p += lists[i].tag.size();
found = true;
}
}
if ( !found )
out += *p++;
}
const char* p2 = strchr ( p, '%' );
if ( !p2 )
p2 = p + strlen(p);
if ( p2 > p )
{
out += string ( p, p2-p );
p = p2;
}
}
return out;
}
string gobble ( string& s, const char* delim )
{
const char* p = s.c_str();
p += strspn ( p, delim );
const char* p2 = strpbrk ( p, delim );
if ( !p2 ) p2 = p + strlen(p);
string out ( p, p2-p );
p2 += strspn ( p2, delim );
s = string ( p2 );
return out;
}
bool isop ( const string& who )
{
for ( int i = 0; i < ops.size(); i++ )
{
if ( ops[i] == who )
return true;
}
return false;
}
// do custom stuff with the IRCClient from your subclass via the provided callbacks...
class MyIRCClient : public IRCClient
{
File flog;
clock_t brake_silence;
// wait another 30 mins to brake the silence
#define NOIDLE brake_silence = clock () + 30 * CLK_TCK * 60
void CheckIdle ( void )
{
while (true) // _inRun
{
while (clock() < brake_silence)
Sleep(10000);
string out = TaggedReply("idle");
if ( !strnicmp ( out.c_str(), "/me ", 4 ) )
Action ( CHANNEL, &out[4] );
else
PrivMsg ( CHANNEL, out );
NOIDLE;
}
}
static void THREADAPI CallMe ( MyIRCClient* irc )
{
irc->CheckIdle();
}
public:
MyIRCClient()
{
NOIDLE;
ThreadPool::Instance().Launch ( (ThreadPoolFunc*)MyIRCClient::CallMe, this );
flog.open ( "arch.log", "r+" );
}
// see IRCClient.h for documentation on these callbacks...
bool OnConnected()
{
return true;
}
bool OnJoin ( const string& user, const string& channel )
{
//printf ( "user '%s' joined channel '%s'\n", user.c_str(), channel.c_str() );
return true;
}
bool OnPart ( const std::string& user, const std::string& channel )
{
std::vector<std::string>::iterator it = ops.begin();
for ( ; it != ops.end(); it++ )
{
if ( *it == user )
{
printf ( "remove '%s' to ops list\n", user.c_str() );
ops.erase ( it );
}
}
return true;
}
bool OnNick ( const std::string& oldNick, const std::string& newNick )
{
for ( int i = 0; i < ops.size(); i++ )
{
if ( ops[i] == oldNick )
{
printf ( "op '%s' changed nick to '%s'\n", oldNick.c_str(), newNick.c_str() );
ops[i] = newNick;
return true;
}
}
return true;
}
bool OnEndChannelUsers ( const string& channel )
{
return true;
}
bool OnPrivMsg ( const string& from, const string& text )
{
//flog.flush();
printf ( "<%s> %s\n", from.c_str(), text.c_str() );
flog.printf ( "<%s> %s\n", from.c_str(), text.c_str() );
if ( !isop(from) )
return PrivMsg ( from, "hey, your tongue doesn't belong there!" );
else if ( strnicmp ( text.c_str(), "!say ", 5 ) )
return PrivMsg ( from, "Talk to me on normal Chanel" );
string say = trim(&text[5]);
if ( !strnicmp ( say.c_str(), "/me ", 4 ) )
return Action ( CHANNEL, trim(&say[4]) );
else
return PrivMsg ( CHANNEL, trim(say) );
}
bool OnChannelMsg ( const string& channel, const string& from, const string& text )
{
fflush ( flog );
printf ( "%s <%s> %s\n", channel.c_str(), from.c_str(), text.c_str() );
flog.printf ( "%s <%s> %s\n", channel.c_str(), from.c_str(), text.c_str() );
NOIDLE; // add 30 mins till idle
bool found_name = false;
string text2 ( text );
strlwr ( &text2[0] );
if ( !strnicmp ( text.c_str(), BOTNAME, strlen(BOTNAME) ) )
found_name = true;
string s ( text );
if ( found_name )
gobble ( s, " \t" ); // remove bot name
// command
if ( s[0] == '!' )
{
bool from_op = isop(from);
string cmd = gobble ( s, " \t" );
// from all
if ( false && cmd == "!svn" && from == "TechBot" ) // || cmd == "!help" && !TechBotOnline
{
PrivMsg ( channel, "For my help try !what." );
}
// from normel user
else if ( !from_op )
{
if ( cmd == "!grovel" )
{
string out = ssprintf(TaggedReply("nogrovel").c_str(),from.c_str());
if ( !strnicmp ( out.c_str(), "/me ", 4 ) )
return Action ( channel, &out[4] );
else
return PrivMsg ( channel, out );
}
else if ( cmd == "!what" )
{
return PrivMsg ( channel, ssprintf("For you, %s, I only support the \"!grovel\" command.", from.c_str()).c_str() );
}
else if ( cmd == "!grovel" || cmd == "!kiss" || cmd == "!hug"
|| cmd == "!give" || cmd == "!what" || cmd == "!add" || cmd == "!remove" )
{
PrivMsg ( channel, ssprintf("%s: I only take commands from ops",from.c_str()) );
}
}
// from op
else if ( cmd == "!grovel" )
{
string out = ssprintf(TaggedReply("grovel").c_str(),from.c_str());
if ( !strnicmp ( out.c_str(), "/me ", 4 ) )
return Action ( channel, &out[4] );
else
return PrivMsg ( channel, out );
}
else if ( cmd == "!kiss" )
{
if ( s.size() )
return Action ( channel, ssprintf("kisses %s",s.c_str()) );
else
return PrivMsg ( channel, ssprintf("%s: huh?",from.c_str()) );
}
else if ( cmd == "!hug" )
{
if ( s.size() )
return Action ( channel, ssprintf("hugs %s",s.c_str()) );
else
return PrivMsg ( channel, ssprintf("%s: huh?",from.c_str()) );
}
else if ( cmd == "!give" )
{
string who = gobble(s," \t");
if ( who.size() && s.size() )
return Action ( channel, ssprintf("gives %s a %s",who.c_str(),s.c_str()) );
else
return PrivMsg ( channel, ssprintf("%s: huh?",from.c_str()) );
}
else if ( cmd == "!what" )
{
PrivMsg ( channel, "For ops I support the following commands:" );
PrivMsg ( channel, "!grovel" );
PrivMsg ( channel, "!kiss" );
PrivMsg ( channel, "!hug" );
PrivMsg ( channel, "!give" );
PrivMsg ( channel, "!say (the input is a private message)" );
PrivMsg ( channel, "!add" );
PrivMsg ( channel, "!remove" );
PrivMsg ( channel, " - for more info see wiki" );
}
else if ( cmd == "!add" )
{
string listname = gobble ( s, " \t" );
int i = GetListIndex ( listname.c_str() );
if ( i == -1 )
return PrivMsg ( channel, ssprintf("%s: I don't have a list named '%s'",from.c_str(),listname.c_str()) );
List& list = lists[i];
if ( s[0] == '\"' || s[0] == '\'' )
{
char delim = s[0];
const char* p = &s[1];
const char* p2 = strchr ( p, delim );
if ( !p2 )
return PrivMsg ( channel, ssprintf("%s: Couldn't add, unmatched quotes",from.c_str()) );
s = string ( p, p2-p );
}
for ( i = 0; i < list.list.size(); i++ )
{
if ( list.list[i] == s )
return PrivMsg ( channel, ssprintf("%s: entry already exists in list '%s'",from.c_str(),listname.c_str()) );
}
if ( !stricmp ( listname.c_str(), "curse" ) )
strlwr ( &s[0] );
list.list.push_back ( s );
{
File f ( ssprintf("%s.txt",list.name.c_str()), "w" );
for ( i = 0; i < list.list.size(); i++ )
f.printf ( "%s\n", list.list[i].c_str() );
}
return PrivMsg ( channel, ssprintf("%s: entry added to list '%s'",from.c_str(),listname.c_str()) );
}
else if ( cmd == "!remove" )
{
string listname = gobble ( s, " \t" );
int i = GetListIndex ( listname.c_str() );
if ( i == -1 )
return PrivMsg ( channel, ssprintf("%s: I don't have a list named '%s'",from.c_str(),listname.c_str()) );
List& list = lists[i];
if ( s[0] == '\"' || s[0] == '\'' )
{
char delim = s[0];
const char* p = &s[1];
const char* p2 = strchr ( p, delim );
if ( !p2 )
return PrivMsg ( channel, ssprintf("%s: Couldn't add, unmatched quotes",from.c_str()) );
s = string ( p, p2-p );
}
std::vector<std::string>::iterator it = list.list.begin();
for ( ; it != list.list.end(); it++ )
{
if ( *it == s )
{
list.list.erase ( it );
{
File f ( ssprintf("%s.txt",list.name.c_str()), "w" );
it = list.list.begin();
for ( ; it < list.list.end(); it++ )
f.printf ( "%s\n", it->c_str() );
}
return PrivMsg ( channel, ssprintf("%s: entry removed from list '%s'",from.c_str(),listname.c_str()) );
}
}
return PrivMsg ( channel, ssprintf("%s: entry doesn't exist in list '%s'",from.c_str(),listname.c_str()) );
}
else
{
if (found_name)
return PrivMsg ( channel, ssprintf("%s: huh?",from.c_str()) );
}
} // if (command)
bool found_curse = false;
static vector<string>& curse = GetList("curse").list;
text2 = " " + text2 + " ";
for ( int i = 0; i < curse.size() && !found_curse; i++ )
{
if ( strstr ( text2.c_str(), curse[i].c_str() ) )
found_curse = true;
}
if ( found_curse )
{
static List& cursecop = GetList("cursecop");
return PrivMsg ( channel, ssprintf("%s: %s", from.c_str(), ListRand(cursecop)) );
}
string botname (BOTNAME);
strlwr ( &botname[0] );
//botname = " " + botname + " ";
if ( strstr(text2.c_str(), botname.c_str()) || strstr(text2.c_str(), " arch ") || found_name )
{
string out = ssprintf("%s: %s", from.c_str(), TaggedReply("tech").c_str());
flog.printf ( "TECH-REPLY: %s\n", out.c_str() );
if ( !strnicmp ( out.c_str(), "/me ", 4 ) )
return Action ( channel, &out[4] );
else
return PrivMsg ( channel, out );
}
return true;
} // On Chanel Message
bool OnChannelMode ( const string& channel, const string& mode )
{
//printf ( "OnChannelMode(%s,%s)\n", channel.c_str(), mode.c_str() );
return true;
}
bool OnUserModeInChannel ( const string& src, const string& channel, const string& mode, const string& target )
{
printf ( "OnUserModeInChannel(%s,%s,%s,%s)\n", src.c_str(), channel.c_str(), mode.c_str(), target.c_str() );
const char* p = mode.c_str();
if ( !p )
return true;
while ( *p )
{
switch ( *p++ )
{
case '+':
while ( *p != 0 && *p != ' ' )
{
if ( *p == 'o' )
{
printf ( "adding '%s' to ops list\n", target.c_str() );
ops.push_back ( target );
}
break;
}
break;
case '-':
while ( *p != 0 && *p != ' ' )
{
if ( *p == 'o' )
{
std::vector<std::string>::iterator it = ops.begin();
for ( ; it != ops.end(); it++ )
{
if ( *it == target )
{
printf ( "remove '%s' to ops list\n", target.c_str() );
ops.erase ( it );
}
}
break;
}
}
}
}
return true;
}
bool OnMode ( const string& user, const string& mode )
{
//printf ( "OnMode(%s,%s)\n", user.c_str(), mode.c_str() );
return true;
}
bool OnChannelUsers ( const string& channel, const vector<string>& users )
{
//printf ( "[%s has %i users]: ", channel.c_str(), users.size() );
for ( int i = 0; i < users.size(); i++ )
{
if ( users[i][0] == '@' )
ops.push_back ( &users[i][1] );
/*if ( i )
printf ( ", " );
printf ( "%s", users[i].c_str() );*/
}
//printf ( "\n" );
return true;
}
bool OnKick ( void )
{
Join(CHANNEL);
return true;
}
bool OnBanned ( const std::string& channel )
{
Sleep(10000);
return Join(CHANNEL);
}
};
int main ( int argc, char** argv )
{
srand ( time(NULL) );
ImportList ( "dev", true );
ImportList ( "func", true );
ImportList ( "dev", true );
ImportList ( "func", true );
ImportList ( "irql", true );
ImportList ( "module", true );
ImportList ( "period", true );
ImportList ( "status", true );
ImportList ( "stru", true );
ImportList ( "type", true );
ImportList ( "tech", false );
ImportList ( "curse", false );
ImportList ( "cursecop", false );
ImportList ( "grovel", false );
ImportList ( "nogrovel", false );
ImportList ( "idle", false );
#ifdef _DEBUG
printf ( "initializing IRCClient debugging\n" );
IRCClient::SetDebug ( true );
#endif//_DEBUG
while (true)
{
printf ( "calling suStartup()\n" );
suStartup();
printf ( "creating IRCClient object\n" );
MyIRCClient irc;
printf ( "connecting to freenode\n" );
if ( !irc.Connect ( SERVER ) ) // irc.freenode.net
{
printf ( "couldn't connect to server\n" );
Sleep(10000);
continue;
}
printf ( "sending user command\n" );
if ( !irc.User ( BOTNAME, "reactos.com", SERVER, "ArchBlackmann" ) )
{
printf ( "USER command failed, retying ...\n" );
Sleep(10000);
continue;
}
printf ( "sending nick\n" );
if ( !irc.Nick ( BOTNAME ) )
{
printf ( "NICK command failed, retying ...\n" );
Sleep(10000);
continue;
}
printf ( "setting mode\n" );
if ( !irc.Mode ( MODE ) )
{
printf ( "MODE command failed, retying ...\n" );
Sleep(10000);
continue;
}
printf ( "joining channel\n" );
if ( !irc.Join ( CHANNEL ) )
{
printf ( "JOIN command failed, retying ...\n" );
Sleep(10000);
continue;
}
printf ( "entering irc client processor\n" );
irc.Run ( false ); // do the processing in this thread...
}
return 0;
}

View File

@@ -0,0 +1,216 @@
# Microsoft Developer Studio Project File - Name="ArchBlackmann" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=ArchBlackmann - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "ArchBlackmann.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "ArchBlackmann.mak" CFG="ArchBlackmann - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "ArchBlackmann - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "ArchBlackmann - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "ArchBlackmann - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "ArchBlackmann - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "ArchBlackmann - Win32 Release"
# Name "ArchBlackmann - Win32 Debug"
# Begin Source File
SOURCE=.\ArchBlackmann.cpp
# End Source File
# Begin Source File
SOURCE=.\auto_ptr.h
# End Source File
# Begin Source File
SOURCE=.\auto_vector.h
# End Source File
# Begin Source File
SOURCE=.\base64.cpp
# End Source File
# Begin Source File
SOURCE=.\base64.h
# End Source File
# Begin Source File
SOURCE=.\chomp.cpp
# End Source File
# Begin Source File
SOURCE=.\chomp.h
# End Source File
# Begin Source File
SOURCE=.\config.h
# End Source File
# Begin Source File
SOURCE=.\cram_md5.cpp
# End Source File
# Begin Source File
SOURCE=.\cram_md5.h
# End Source File
# Begin Source File
SOURCE=.\File.cpp
# End Source File
# Begin Source File
SOURCE=.\File.h
# End Source File
# Begin Source File
SOURCE=.\IRCClient.cpp
# End Source File
# Begin Source File
SOURCE=.\IRCClient.h
# End Source File
# Begin Source File
SOURCE=.\MD5.cpp
# End Source File
# Begin Source File
SOURCE=.\MD5.h
# End Source File
# Begin Source File
SOURCE=.\panic.cpp
# End Source File
# Begin Source File
SOURCE=.\panic.h
# End Source File
# Begin Source File
SOURCE=.\QueueT.h
# End Source File
# Begin Source File
SOURCE=.\Reli.h
# End Source File
# Begin Source File
SOURCE=.\ReliMT.cpp
# End Source File
# Begin Source File
SOURCE=.\ReliMT.h
# End Source File
# Begin Source File
SOURCE=.\SockUtils.cpp
# End Source File
# Begin Source File
SOURCE=.\SockUtils.h
# End Source File
# Begin Source File
SOURCE=.\SplitJoin.cpp
# End Source File
# Begin Source File
SOURCE=.\SplitJoin.h
# End Source File
# Begin Source File
SOURCE=.\ssprintf.cpp
# End Source File
# Begin Source File
SOURCE=.\ssprintf.h
# End Source File
# Begin Source File
SOURCE=.\ThreadPool.cpp
# End Source File
# Begin Source File
SOURCE=.\ThreadPool.h
# End Source File
# Begin Source File
SOURCE=.\trim.cpp
# End Source File
# Begin Source File
SOURCE=.\trim.h
# End Source File
# Begin Source File
SOURCE=.\verify.h
# End Source File
# End Target
# End Project

View File

@@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "ArchBlackmann"=.\ArchBlackmann.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

265
irc/ArchBlackmann/File.cpp Normal file
View File

@@ -0,0 +1,265 @@
// File.cpp
// (C) 2002-2004 Royce Mitchell III
// Dually licensed under BSD & LGPL
#ifdef _MSC_VER
#pragma warning ( disable : 4786 )
#endif//_MSC_VER
#include <stdio.h>
#include <stdarg.h>
#include "File.h"
#ifndef nelem
#define nelem(x) ( sizeof(x) / sizeof(x[0]) )
#endif//nelem
typedef File::filesize_t filesize_t;
typedef File::fileoff_t fileoff_t;
fileoff_t File::seek ( fileoff_t offset )
{
#ifdef WIN32
if ( _f->_flag & _IOWRT ) // is there pending output?
fflush ( _f );
// reset "buffered input" variables
_f->_cnt = 0;
_f->_ptr = _f->_base;
// make sure we're going forward
if ( _f->_flag & _IORW )
_f->_flag &= ~(_IOREAD|_IOWRT);
return _lseeki64 ( _fileno(_f), offset, SEEK_SET );
#else//UNIX
return lseek64 ( fileno(_f), offset, SEEK_SET );
#endif
}
std::string File::getline ( bool strip_crlf /*= false*/ )
{
std::string s = "";
char buf[256];
for ( ;; )
{
*buf = 0;
fgets ( buf, nelem(buf)-1, _f );
if ( !*buf )
break;
s += buf;
if ( strchr ( "\r\n", buf[strlen(buf)-1] ) )
break;
}
if ( strip_crlf && s.size() )
{
char* p = strpbrk ( &s[0], "\r\n" );
if ( p )
{
*p = '\0';
s.resize ( p-&s[0] );
}
}
return s;
}
std::wstring File::wgetline ( bool strip_crlf /*= false*/ )
{
std::wstring s = L"";
wchar_t buf[256];
for ( ;; )
{
*buf = 0;
fgetws ( buf, nelem(buf)-1, _f );
if ( !*buf )
break;
s += buf;
if ( wcschr ( L"\r\n", buf[wcslen(buf)-1] ) )
break;
}
if ( strip_crlf && s.size() )
{
wchar_t* p = wcspbrk ( &s[0], L"\r\n" );
if ( p )
{
*p = L'\0';
s.resize ( (p-&s[0])/sizeof(wchar_t) );
}
}
return s;
}
// this function searches for the next end-of-line and puts all data it
// finds until then in the 'line' parameter.
//
// call continuously until the function returns false ( no more data )
bool File::next_line ( std::string& line, bool strip_crlf )
{
line = getline(strip_crlf);
// indicate that we're done *if*:
// 1) there's no more data, *and*
// 2) we're at the end of the file
return line.size()>0 || !eof();
}
bool File::next_line ( std::wstring& line, bool strip_crlf )
{
line = wgetline ( strip_crlf );
return line.size()>0 || !eof();
}
/*
example usage:
bool mycallback ( const std::string& line, int line_number, long lparam )
{
std::cout << line << std::endl;
return true; // continue enumeration
}
File f ( "file.txt", "rb" ); // open file for binary read-only ( i.e. "rb" )
f.enum_lines ( mycallback, 0, true );
*/
/*bool File::enum_lines ( bool (*callback)(const std::string& line, int line_number, long lparam), long lparam, bool strip_crlf )
{
int line_number = 0;
for ( ;; )
{
std::string s = getline(strip_crlf);
line_number++;
if ( !s.size() )
{
if ( eof() )
return true;
else
continue;
}
if ( !(*callback) ( s, line_number, lparam ) )
return false;
}
}*/
filesize_t File::length() const
{
#ifdef WIN32
return _filelengthi64 ( _fileno(_f) );
#elif defined(UNIX)
struct stat64 file_stat;
verify(fstat64(fileno(_f), &file_stat) == 0);
return file_stat.st_size;
#endif
}
void File::close()
{
if ( _f )
{
fclose(_f);
_f = 0;
}
}
void File::printf ( const char* fmt, ... )
{
va_list arg;
int done;
va_start(arg, fmt);
assert(_f);
done = vfprintf ( _f, fmt, arg );
va_end(arg);
}
/*static*/ bool File::LoadIntoString ( std::string& s, const std::string& filename )
{
File in ( filename, "rb" );
if ( !in.isopened() )
return false;
filesize_t flen = in.length();
size_t len = size_t(flen);
if ( len != flen )
return false; // file too big...
s.resize ( len + 1 );
if ( !in.read ( &s[0], len ) )
return false;
s[len] = '\0';
s.resize ( len );
return true;
}
/*static*/ bool File::LoadIntoString ( std::string& s, const std::wstring& filename )
{
File in ( filename, L"rb" );
if ( !in.isopened() )
return false;
filesize_t flen = in.length();
size_t len = size_t(flen);
if ( len != flen )
return false; // file too big...
s.resize ( len + 1 );
if ( !in.read ( &s[0], len ) )
return false;
s[len] = '\0';
s.resize ( len );
return true;
}
/*static*/ bool File::SaveFromString ( const std::string& filename, const std::string& s, bool binary )
{
File out ( filename, binary ? "wb" : "w" );
if ( !out.isopened() )
return false;
out.write ( s.c_str(), s.size() );
return true;
}
/*static*/ bool File::SaveFromString ( const std::wstring& filename, const std::string& s, bool binary )
{
File out ( filename, binary ? L"wb" : L"w" );
if ( !out.isopened() )
return false;
out.write ( s.c_str(), s.size() );
return true;
}
/*static*/ bool File::SaveFromBuffer ( const std::string& filename, const char* buf, size_t buflen, bool binary )
{
File out ( filename, binary ? "wb" : "w" );
if ( !out.isopened() )
return false;
out.write ( buf, buflen );
return true;
}
/*static*/ bool File::SaveFromBuffer ( const std::wstring& filename, const char* buf, size_t buflen, bool binary )
{
File out ( filename, binary ? L"wb" : L"w" );
if ( !out.isopened() )
return false;
out.write ( buf, buflen );
return true;
}
/*static*/ std::string File::TempFileName ( const std::string& prefix )
{
#ifdef WIN32
std::string s ( _tempnam ( ".", prefix.c_str() ) );
return s;
#else
// FIXME
return string("");
#endif
}
/*static*/ std::wstring File::TempFileName ( const std::wstring& prefix )
{
#ifdef WIN32
std::wstring s ( _wtempnam ( L".", prefix.c_str() ) );
return s;
#else
// FIXME
return std::wstring(L"");
#endif
}

173
irc/ArchBlackmann/File.h Normal file
View File

@@ -0,0 +1,173 @@
// File.h
// (C) 2002-2004 Royce Mitchell III
// Dually licensed under BSD & LGPL
#ifndef FILE_H
#define FILE_H
#ifdef WIN32
# include <stdio.h> // fgetc
# include <io.h>
#elif defined(UNIX)
# include <sys/stat.h>
# include <unistd.h>
#endif
#include <assert.h>
#include <string>
class File
{
public:
#ifdef WIN32
typedef __int64 fileoff_t;
typedef unsigned __int64 filesize_t;
#else//_MSC_VER
typedef __off64_t fileoff_t;
typedef __size64_t filesize_t;
#endif//_MSC_VER
File() : _f(0)
{
}
File ( const std::string& filename, const char* mode ) : _f(0)
{
open ( filename, mode );
}
File ( const std::wstring& filename, const wchar_t* mode ) : _f(0)
{
open ( filename, mode );
}
File ( const char* filename, const char* mode ) : _f(0)
{
open ( filename, mode );
}
File ( const wchar_t* filename, const wchar_t* mode ) : _f(0)
{
open ( filename, mode );
}
~File()
{
close();
}
bool open ( const std::string& filename, const char* mode )
{
assert ( !_f );
return ( _f = fopen ( filename.c_str(), mode ) ) != 0;
}
bool open ( const std::wstring& filename, const wchar_t* mode )
{
assert ( !_f );
return ( _f = _wfopen ( filename.c_str(), mode ) ) != 0;
}
bool open ( const char* filename, const char* mode )
{
assert ( !_f );
return ( _f = fopen ( filename, mode ) ) != 0;
}
bool open ( const wchar_t* filename, const wchar_t* mode )
{
assert ( !_f );
return ( _f = _wfopen ( filename, mode ) ) != 0;
}
fileoff_t seek ( fileoff_t offset );
int get()
{
return fgetc ( _f );
}
bool put ( int c )
{
return fputc ( c, _f ) != EOF;
}
std::string getline ( bool strip_crlf = false );
std::wstring wgetline ( bool strip_crlf = false );
// this function searches for the next end-of-line and puts all data it
// finds until then in the 'line' parameter.
//
// call continuously until the function returns false ( no more data )
bool next_line ( std::string& line, bool strip_crlf );
bool next_line ( std::wstring& line, bool strip_crlf );
bool read ( void* data, unsigned len )
{
return len == fread ( data, 1, len, _f );
}
bool write ( const void* data, unsigned len )
{
return len == fwrite ( data, 1, len, _f );
}
bool write ( const std::string& data )
{
return data.length() == fwrite ( data.c_str(), 1, data.length(), _f );
}
bool write ( const std::wstring& data )
{
return data.length() == fwrite ( data.c_str(), sizeof(data[0]), data.length(), _f );
}
filesize_t length() const;
void close();
bool isopened() const
{
return _f != 0;
}
bool is_open() const
{
return _f != 0;
}
bool eof() const
{
return feof(_f) ? true : false;
}
FILE* operator * ()
{
return _f;
}
operator FILE*()
{
return _f;
}
void printf ( const char* fmt, ... );
void printf ( const wchar_t* fmt, ... );
static bool LoadIntoString ( std::string& s, const std::string& filename );
static bool LoadIntoString ( std::string& s, const std::wstring& filename );
static bool SaveFromString ( const std::string& filename, const std::string& s, bool binary );
static bool SaveFromString ( const std::wstring& filename, const std::string& s, bool binary );
static bool SaveFromBuffer ( const std::string& filename, const char* buf, size_t buflen, bool binary );
static bool SaveFromBuffer ( const std::wstring& filename, const char* buf, size_t buflen, bool binary );
static std::string TempFileName ( const std::string& prefix );
static std::wstring TempFileName ( const std::wstring& prefix );
private:
File(const File&) {}
const File& operator = ( const File& ) { return *this; }
FILE * _f;
};
#endif//FILE_H

View File

@@ -0,0 +1,418 @@
// IRCClient.cpp
// This file is (C) 2004 Royce Mitchell III
// and released under the BSD & LGPL licenses
#ifdef _MSC_VER
#pragma warning ( disable : 4786 )
#endif//_MSC_VER
#include <vector>
#include <sstream>
#include "IRCClient.h"
#include "MD5.h"
#include "cram_md5.h"
#include "trim.h"
#include "chomp.h"
#include "SplitJoin.h"
#include "base64.h"
#include "config.h"
using std::string;
using std::stringstream;
using std::vector;
bool IRCClient::_debug = true;
// see rfc1459 for IRC-Protocoll Reference
IRCClient::IRCClient()
: _timeout(10*60*1000), _inRun(false)
{
}
bool IRCClient::Connect ( const string& server, short port )
{
string buf;
Close();
Attach ( suTcpSocket() );
if ( !suConnect ( *this, server.c_str(), port ) )
return false;
return true;
}
bool
IRCClient::User ( const string& user, const string& mode,
const string& network, const string& realname )
{
string buf;
buf = "USER " + user + " \"" + mode + "\" \"" + network + "\" :" + realname + "\n";
return Send ( buf );
}
bool
IRCClient::Nick ( const string& nick )
{
_nick = nick;
Send ( "NICK " + _nick + "\n" );
PrivMsg ("NickServ", "IDENTIFY " + (string)PASS);
return true;
}
bool
IRCClient::Mode ( const string& mode )
{
return Send ( "MODE " + _nick + " " + mode + "\n" );
}
bool
IRCClient::Names ( const string& channel )
{
return Send ( "NAMES " + channel + "\n" );
}
bool
IRCClient::Mode ( const string& channel, const string& mode, const string& target )
{
return Send ( "MODE " + channel + " " + mode + " " + target + "\n" );
}
bool
IRCClient::Join ( const string& channel )
{
return Send("JOIN " + channel + "\n");
}
bool
IRCClient::PrivMsg ( const string& to, const string& text )
{
return Send ( "PRIVMSG " + to + " :" + text + '\n' );
}
bool
IRCClient::Action ( const string& to, const string& text )
{
return Send ( "PRIVMSG " + to + " :" + (char)1 + "ACTION " + text + (char)1 + '\n' );
}
bool
IRCClient::Part ( const string& channel, const string& text )
{
return Send ( "PART " + channel + " :" + text + "\n" );
}
bool
IRCClient::Quit ( const string& text )
{
return Send( "QUIT :" + text + "\n");
}
bool IRCClient::_Recv ( string& buf )
{
bool b = (recvUntil ( buf, '\n', _timeout ) > 0);
if ( b && _debug )
{
printf ( ">> %s", buf.c_str() );
if ( buf[buf.length()-1] != '\n' )
printf ( "\n" );
}
return b;
}
bool IRCClient::Send ( const string& buf )
{
if ( _debug )
{
printf ( "<< %s", buf.c_str() );
if ( buf[buf.length()-1] != '\n' )
printf ( "\n" );
}
return ( buf.length() == (size_t)send ( *this, buf.c_str(), buf.length(), 0 ) );
}
bool IRCClient::OnPing( const string& text )
{
return Send( "PONG " + text + "\n" );
}
int THREADAPI IRCClient::Callback ( IRCClient* irc )
{
return irc->Run ( false );
}
int IRCClient::Run ( bool launch_thread )
{
if ( (SOCKET)*this == INVALID_SOCKET )
return 0;
if ( _inRun ) return 1;
if ( launch_thread )
{
ThreadPool::Instance().Launch ( (ThreadPoolFunc*)IRCClient::Callback, this );
return 1;
}
_inRun = true;
if ( _debug ) printf ( "IRCClient::Run() - waiting for responses\n" );
string buf;
while ( _Recv(buf) )
{
if ( !strnicmp ( buf.c_str(), "NOTICE ", 7 ) )
{
//printf ( "recv'd NOTICE msg...\n" );
// TODO...
//OnAuth (
}
else if ( !strnicmp ( buf.c_str(), "PING ", 5 ) )
{
const char* p = &buf[5]; // point to first char after "PING "
while ( *p == ':' ) // then read past the colons
p++;
const char* p2 = strpbrk ( p, "\r\n" ); // find the end of line
string text ( p, p2-p ); // and set the text
OnPing( text );
}
else if ( buf[0] == ':' )
{
const char* p = &buf[1]; // skip first colon...
const char* p2 = strpbrk ( p, " !" );
if ( !p2 )
{
printf ( "!!!:OnRecv failure 0: ", buf.c_str() );
continue;
}
string src ( p, p2-p );
if ( !src.length() )
{
printf ( "!!!:OnRecv failure 0.5: %s", buf.c_str() );
continue;
}
p = p2 + 1;
if ( *p2 == '!' )
{
p2 = strchr ( p, ' ' );
if ( !p2 )
{
printf ( "!!!:OnRecv failure 1: %s", buf.c_str() );
continue;
}
//string srchost ( p, p2-p );
p = p2 + 1;
}
p2 = strchr ( p, ' ' );
if ( !p2 )
{
printf ( "!!!:OnRecv failure 2: %s", buf.c_str() );
continue;
}
string cmd ( p, p2-p );
p = p2 + 1;
p2 = strpbrk ( p, " :" );
if ( !p2 )
{
printf ( "!!!:OnRecv failure 3: %s", buf.c_str() );
continue;
}
string tgt ( p, p2-p );
p = p2 + 1;
p += strspn ( p, " " );
if ( *p == '=' )
{
p++;
p += strspn ( p, " " );
}
if ( *p == ':' )
p++;
p2 = strpbrk ( p, "\r\n" );
if ( !p2 )
{
printf ( "!!!:OnRecv failure 4: %s", buf.c_str() );
continue;
}
string text ( p, p2-p );
strlwr ( &cmd[0] );
if ( cmd == "privmsg" )
{
if ( !tgt.length() )
{
printf ( "!!!:OnRecv failure 5 (PRIVMSG w/o target): %s", buf.c_str() );
continue;
}
if ( *p == 1 )
{
p++;
p2 = strchr ( p, ' ' );
if ( !p2 ) p2 = p + strlen(p);
cmd = string ( p, p2-p );
strlwr ( &cmd[0] );
p = p2 + 1;
p2 = strchr ( p, 1 );
if ( !p2 )
{
printf ( "!!!:OnRecv failure 6 (no terminating \x01 for initial \x01 found: %s", buf.c_str() );
continue;
}
text = string ( p, p2-p );
if ( cmd == "action" )
{
if ( tgt[0] == '#' )
OnChannelAction ( tgt, src, text );
else
OnPrivAction ( src, text );
}
else
{
printf ( "!!!:OnRecv failure 7 (unrecognized \x01 command '%s': %s", cmd.c_str(), buf.c_str() );
continue;
}
}
else
{
if ( tgt[0] == '#' )
OnChannelMsg ( tgt, src, text );
else
OnPrivMsg ( src, text );
}
}
else if ( cmd == "mode" )
{
// two diff. kinds of mode notifications...
//printf ( "[MODE] src='%s' cmd='%s' tgt='%s' text='%s'", src.c_str(), cmd.c_str(), tgt.c_str(), text.c_str() );
//OnMode (
// self mode change:
// [MODE] src=Nick cmd=mode tgt=Nick text=+i
// channel mode change:
// [MODE] src=Nick cmd=mode tgt=#Channel text=+o Nick
if ( tgt[0] == '#' )
{
p = text.c_str();
p2 = strchr ( p, ' ' );
if ( p2 && *p2 )
{
string mode ( p, p2-p );
p = p2 + 1;
p += strspn ( p, " " );
OnUserModeInChannel ( src, tgt, mode, trim(p) );
}
else
OnChannelMode ( tgt, text );
}
else
OnMode ( tgt, text );
}
else if ( cmd == "join" )
{
mychannel = text;
OnJoin ( src, text );
}
else if ( cmd == "part" )
{
OnPart ( src, text );
}
else if ( cmd == "nick" )
{
OnNick ( src, text );
}
else if ( cmd == "kick" )
{
OnKick ();
}
else if ( isdigit(cmd[0]) )
{
int i = atoi(cmd.c_str());
switch ( i )
{
case 1: // "Welcome!" - i.e. it's okay to issue commands now...
OnConnected();
break;
case 353: // user list for channel....
{
p = text.c_str();
p2 = strpbrk ( p, " :" );
if ( !p2 ) continue;
string channel ( p, p2-p );
p = strchr ( p2, ':' );
if ( !p ) continue;
p++;
vector<string> users;
while ( *p )
{
p2 = strchr ( p, ' ' );
if ( !p2 )
p2 = p + strlen(p);
users.push_back ( string ( p, p2-p ) );
p = p2+1;
p += strspn ( p, " " );
}
OnChannelUsers ( channel, users );
}
break;
case 366: // END of user list for channel
{
p = text.c_str();
p2 = strpbrk ( p, " :" );
if ( !p2 ) continue;
string channel ( p, p2-p );
OnEndChannelUsers ( channel );
}
break;
case 474: // You are banned
{
p = text.c_str();
p2 = strpbrk ( p, " :" );
if ( !p2 ) continue;
string channel ( p, p2-p );
OnBanned ( channel );
}
break;
case 433: // Nick in Use
{
string nick = _nick;
Nick (nick + "_");
PrivMsg ("NickServ", "GHOST " + nick + " " + PASS);
// HACK HACK HACK
Mode ( "+i" );
Join ( CHANNEL ); // this is because IRC client does not review if his commands were sucessfull
Sleep ( 1000 );
Nick ( nick );
}
break;
case 2: //MOTD
case 376: //MOTD
case 372:
break;
default:
if ( _debug ) printf ( "unknown command %i: %s", i, buf.c_str() );
break;
}
}
else
{
if ( strstr ( buf.c_str(), "ACTION" ) )
{
printf ( "ACTION: " );
for ( int i = 0; i < buf.size(); i++ )
printf ( "%c(%xh)", buf[i], (unsigned)(unsigned char)buf[i] );
}
else if ( _debug ) printf ( "unrecognized ':' response: %s", buf.c_str() );
}
}
else
{
if ( _debug ) printf ( "unrecognized irc msg: %s", buf.c_str() );
}
//OnRecv ( buf );
}
if ( _debug ) printf ( "IRCClient::Run() - exiting\n" );
_inRun = false;
return 0;
}

View File

@@ -0,0 +1,148 @@
// IRCClient.h
// This file is (C) 2004 Royce Mitchell III
// and released under the BSD & LGPL licenses
#ifndef IRCCLIENT_H
#define IRCCLIENT_H
#include <string>
#include <vector>
#include "SockUtils.h"
#include "ThreadPool.h"
class IRCClient : public suBufferedRecvSocket
{
public:
IRCClient();
std::string mychannel;
static bool GetDebug() { return _debug; }
static bool SetDebug ( bool debug ) { bool old = _debug; _debug = debug; return old; }
// connect to server ( record greeting for apop if it exists )
bool Connect ( const std::string& server, short port = 6667 );
bool Running() { return _inRun; }
////////////////////////// IRC Client Protocol commands ///////////////////////
// first thing you must call... mode can be ""
// network can be same as name of server used in Connect() above
bool User ( const std::string& user, const std::string& mode,
const std::string& network, const std::string& realname );
// change nick...
bool Nick ( const std::string& nick );
// change mode for self...
bool Mode ( const std::string& mode );
// set someone's mode in channel ( like oping someone )
bool Mode ( const std::string& channel, const std::string& mode, const std::string& target );
// request a list of names of clients in a channel
bool Names ( const std::string& channel );
// join a channel...
bool Join ( const std::string& channel );
// send message to someone or some channel
bool PrivMsg ( const std::string& to, const std::string& text );
// send /me to someone or some channel
bool Action ( const std::string& to, const std::string& text );
// leave a channel
bool Part ( const std::string& channel, const std::string& text );
// log off
bool Quit ( const std::string& text );
////////////////////// callback functions ////////////////////////////
// OnConnected: you just successfully logged into irc server
virtual bool OnConnected() = 0;
virtual bool OnNick ( const std::string& oldNick, const std::string& newNick ) { return true; }
// OnJoin: someone just successfully joined a channel you are in ( also sent when you successfully join a channel )
virtual bool OnJoin ( const std::string& user, const std::string& channel ) { return true; }
// OnPart: someone just left a channel you are in
virtual bool OnPart ( const std::string& user, const std::string& channel ) { return true; }
// OnPrivMsg: you just received a private message from a user
virtual bool OnPrivMsg ( const std::string& from, const std::string& text ) { return true; }
virtual bool OnPrivAction ( const std::string& from, const std::string& text ) { return true; }
// OnChannelMsg: you just received a chat line in a channel
virtual bool OnChannelMsg ( const std::string& channel, const std::string& from,
const std::string& text ) { return true; }
// OnChannelAction: you just received a "/me" line in a channel
virtual bool OnChannelAction ( const std::string& channel, const std::string& from,
const std::string& text ) { return true; }
// OnChannelMode: notification of a change of a channel's mode
virtual bool OnChannelMode ( const std::string& channel, const std::string& mode )
{ return true; }
// OnUserModeInChannel: notification of a mode change of a user with respect to a channel.
// f.ex.: this will be called when someone is oped in a channel.
virtual bool OnUserModeInChannel ( const std::string& src, const std::string& channel,
const std::string& mode, const std::string& target ) { return true; }
// OnMode: you will receive this when you change your own mode, at least...
virtual bool OnMode ( const std::string& user, const std::string& mode ) { return true; }
// notification of what users are in a channel ( you may get multiple of these... )
virtual bool OnChannelUsers ( const std::string& channel, const std::vector<std::string>& users )
{ return true; }
// OnKick: if the client has been kicked
virtual bool OnKick ( void ) { return true; }
// OnKick: if the client has been kicked
virtual bool OnBanned ( const std::string& channel ) { return true; }
// notification that you have received the entire list of users for a channel
virtual bool OnEndChannelUsers ( const std::string& channel ) { return true; }
// OnPing - default implementation replies to PING with a valid PONG. required on some systems to
// log in. Most systems require a response in order to stay connected, used to verify a client hasn't
// dropped.
virtual bool OnPing ( const std::string& text );
////////////////////// other functions ////////////////////////////
// this is for sending data to irc server. it's public in case you need to send some
// command not supported by this base class...
bool Send ( const std::string& buf );
// if launch_thread is true, this function will spawn a thread that will process
// incoming packets until the socket dies.
// otherwise ( launch_thread is false ) this function will do that processing
// in *this* thread, and not return until the socket dies.
int Run ( bool launch_thread );
////////////////////// private stuff ////////////////////////////
private:
bool _Recv ( std::string& buf );
static int THREADAPI Callback ( IRCClient* irc );
static bool _debug;
std::string _nick;
int _timeout;
std::string _apop_challenge;
volatile bool _inRun;
// disable copy semantics
IRCClient ( const IRCClient& );
IRCClient& operator = ( const IRCClient& );
};
#endif//IRCCLIENT_H

418
irc/ArchBlackmann/MD5.cpp Normal file
View File

@@ -0,0 +1,418 @@
// MD5.CPP - RSA Data Security, Inc., MD5 message-digest algorithm
/*
Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
*/
//#include <assert.h>
#include <memory.h>
#include <ctype.h>
#include <vector>
#include "MD5.h"
using std::string;
using std::vector;
// Constants for MD5Transform routine.
#define S11 7
#define S12 12
#define S13 17
#define S14 22
#define S21 5
#define S22 9
#define S23 14
#define S24 20
#define S31 4
#define S32 11
#define S33 16
#define S34 23
#define S41 6
#define S42 10
#define S43 15
#define S44 21
static void MD5Transform ( UINT4 [4], const uchar [64] );
static void Encode ( unsigned char *, UINT4 *, unsigned int );
static void Decode ( UINT4 *, const uchar *, unsigned int );
static unsigned char PADDING[64] =
{
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
// F, G, H and I are basic MD5 functions.
#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
#define H(x, y, z) ((x) ^ (y) ^ (z))
#define I(x, y, z) ((y) ^ ((x) | (~z)))
// ROTATE_LEFT rotates x left n bits.
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
// FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
// Rotation is separate from addition to prevent recomputation.
#define FF(a, b, c, d, x, s, ac) { \
(a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
#define GG(a, b, c, d, x, s, ac) { \
(a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
#define HH(a, b, c, d, x, s, ac) { \
(a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
#define II(a, b, c, d, x, s, ac) { \
(a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
// MD5 initialization. Begins an MD5 operation, writing a new context.
void MD5Init (
MD5_CTX *context ) // context
{
context->count[0] = context->count[1] = 0;
// Load magic initialization constants.
context->state[0] = 0x67452301;
context->state[1] = 0xefcdab89;
context->state[2] = 0x98badcfe;
context->state[3] = 0x10325476;
}
// MD5 block update operation. Continues an MD5 message-digest
// operation, processing another message block, and updating the
// context.
void MD5Update (
MD5_CTX *context, // context
const char *input_, // input block
unsigned int inputLen ) // length of input block
{
unsigned int i, index, partLen;
const uchar* input = (const uchar*)input_;
// Compute number of bytes mod 64
index = (unsigned int)((context->count[0] >> 3) & 0x3F);
// Update number of bits
if ((context->count[0] += ((UINT4)inputLen << 3))
< ((UINT4)inputLen << 3))
context->count[1]++;
context->count[1] += ((UINT4)inputLen >> 29);
partLen = 64 - index;
// Transform as many times as possible.
if (inputLen >= partLen)
{
memcpy
((POINTER)&context->buffer[index], (POINTER)input, partLen);
MD5Transform (context->state, context->buffer);
for (i = partLen; i + 63 < inputLen; i += 64)
MD5Transform (context->state, &input[i]);
index = 0;
}
else
i = 0;
// Buffer remaining input
memcpy
((POINTER)&context->buffer[index], (POINTER)&input[i],
inputLen-i);
}
// MD5 finalization. Ends an MD5 message-digest operation, writing the
// the message digest and zeroizing the context.
void MD5Final (
unsigned char digest[16], // message digest
MD5_CTX *context ) // context
{
uchar bits[8];
unsigned int index, padLen;
// Save number of bits
Encode (bits, context->count, 8);
// Pad out to 56 mod 64.
index = (unsigned int)((context->count[0] >> 3) & 0x3f);
padLen = (index < 56) ? (56 - index) : (120 - index);
MD5Update (context, (const char*)PADDING, padLen);
// Append length (before padding)
MD5Update (context, (const char*)bits, 8);
// Store state in digest
Encode (digest, context->state, 16);
// Zeroize sensitive information.
memset ((POINTER)context, 0, sizeof (*context));
}
// MD5 basic transformation. Transforms state based on block.
static void MD5Transform (
UINT4 state[4],
const uchar block[64] )
{
UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
Decode (x, block, 64);
// Round 1
FF (a, b, c, d, x[ 0], S11, 0xd76aa478); // 1
FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); // 2
FF (c, d, a, b, x[ 2], S13, 0x242070db); // 3
FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); // 4
FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); // 5
FF (d, a, b, c, x[ 5], S12, 0x4787c62a); // 6
FF (c, d, a, b, x[ 6], S13, 0xa8304613); // 7
FF (b, c, d, a, x[ 7], S14, 0xfd469501); // 8
FF (a, b, c, d, x[ 8], S11, 0x698098d8); // 9
FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); // 10
FF (c, d, a, b, x[10], S13, 0xffff5bb1); // 11
FF (b, c, d, a, x[11], S14, 0x895cd7be); // 12
FF (a, b, c, d, x[12], S11, 0x6b901122); // 13
FF (d, a, b, c, x[13], S12, 0xfd987193); // 14
FF (c, d, a, b, x[14], S13, 0xa679438e); // 15
FF (b, c, d, a, x[15], S14, 0x49b40821); // 16
// Round 2
GG (a, b, c, d, x[ 1], S21, 0xf61e2562); // 17
GG (d, a, b, c, x[ 6], S22, 0xc040b340); // 18
GG (c, d, a, b, x[11], S23, 0x265e5a51); // 19
GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); // 20
GG (a, b, c, d, x[ 5], S21, 0xd62f105d); // 21
GG (d, a, b, c, x[10], S22, 0x2441453); // 22
GG (c, d, a, b, x[15], S23, 0xd8a1e681); // 23
GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); // 24
GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); // 25
GG (d, a, b, c, x[14], S22, 0xc33707d6); // 26
GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); // 27
GG (b, c, d, a, x[ 8], S24, 0x455a14ed); // 28
GG (a, b, c, d, x[13], S21, 0xa9e3e905); // 29
GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); // 30
GG (c, d, a, b, x[ 7], S23, 0x676f02d9); // 31
GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); // 32
// Round 3
HH (a, b, c, d, x[ 5], S31, 0xfffa3942); // 33
HH (d, a, b, c, x[ 8], S32, 0x8771f681); // 34
HH (c, d, a, b, x[11], S33, 0x6d9d6122); // 35
HH (b, c, d, a, x[14], S34, 0xfde5380c); // 36
HH (a, b, c, d, x[ 1], S31, 0xa4beea44); // 37
HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); // 38
HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); // 39
HH (b, c, d, a, x[10], S34, 0xbebfbc70); // 40
HH (a, b, c, d, x[13], S31, 0x289b7ec6); // 41
HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); // 42
HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); // 43
HH (b, c, d, a, x[ 6], S34, 0x4881d05); // 44
HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); // 45
HH (d, a, b, c, x[12], S32, 0xe6db99e5); // 46
HH (c, d, a, b, x[15], S33, 0x1fa27cf8); // 47
HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); // 48
// Round 4
II (a, b, c, d, x[ 0], S41, 0xf4292244); // 49
II (d, a, b, c, x[ 7], S42, 0x432aff97); // 50
II (c, d, a, b, x[14], S43, 0xab9423a7); // 51
II (b, c, d, a, x[ 5], S44, 0xfc93a039); // 52
II (a, b, c, d, x[12], S41, 0x655b59c3); // 53
II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); // 54
II (c, d, a, b, x[10], S43, 0xffeff47d); // 55
II (b, c, d, a, x[ 1], S44, 0x85845dd1); // 56
II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); // 57
II (d, a, b, c, x[15], S42, 0xfe2ce6e0); // 58
II (c, d, a, b, x[ 6], S43, 0xa3014314); // 59
II (b, c, d, a, x[13], S44, 0x4e0811a1); // 60
II (a, b, c, d, x[ 4], S41, 0xf7537e82); // 61
II (d, a, b, c, x[11], S42, 0xbd3af235); // 62
II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); // 63
II (b, c, d, a, x[ 9], S44, 0xeb86d391); // 64
state[0] += a;
state[1] += b;
state[2] += c;
state[3] += d;
// Zeroize sensitive information.
memset ((POINTER)x, 0, sizeof (x));
}
// Encodes input (UINT4) into output (unsigned char). Assumes len is
// a multiple of 4.
static void Encode (
unsigned char *output,
UINT4 *input,
unsigned int len )
{
unsigned int i, j;
for (i = 0, j = 0; j < len; i++, j += 4) {
output[j] = (unsigned char)(input[i] & 0xff);
output[j+1] = (unsigned char)((input[i] >> 8) & 0xff);
output[j+2] = (unsigned char)((input[i] >> 16) & 0xff);
output[j+3] = (unsigned char)((input[i] >> 24) & 0xff);
}
}
// Decodes input (unsigned char) into output (UINT4). Assumes len is
// a multiple of 4.
static void Decode (
UINT4 *output,
const uchar *input,
unsigned int len )
{
unsigned int i, j;
for (i = 0, j = 0; j < len; i++, j += 4)
output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |
(((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
}
void digest2ascii ( char *ascii, const unsigned char *digest )
{
int i;
static char* table = "0123456789abcdef";
for ( i = 0; i < 16; i++ )
{
*ascii++ = table[(*digest)>>4];
*ascii++ = table[(*digest++)%16];
}
*ascii++ = 0;
}
void ascii2digest ( unsigned char *digest, const char *ascii )
{
int i;
#define CONV(c) (unsigned char)( (toupper(c)>='A') ? (toupper(c)+10-'A') : ((c)-'0') )
#define MAKECHAR(a,b) ((CONV(a)%16)<<4)|(CONV(b)%16)
for ( i = 0; i < 16; i++ )
{
*digest++ = MAKECHAR(ascii[0],ascii[1]);
ascii += 2;
}
}
#ifdef __cplusplus
MD5::MD5()
{
Init();
}
void MD5::Init()
{
MD5Init(&_ctx);
}
void MD5::Update ( const string& s )
{
MD5Update ( &_ctx, s.c_str(), s.size() );
}
string MD5::Final ( char* digest )
{
vector<uchar> v;
v.resize(16);
MD5Final ( &v[0], &_ctx );
if ( digest )
memmove ( digest, &v[0], 16 );
string s;
static char* tohex = "0123456789abcdef";
for ( int i = 0; i < 16; i++ )
{
uchar c = v[i];
s += tohex[ (c>>4) & 0xF ];
s += tohex[ c & 0xF ];
}
return s;
}
string MD5Hex ( const string& s )
{
MD5 md5;
md5.Update ( s );
return md5.Final();
}
string MD5Bin ( const string& s )
{
MD5 md5;
md5.Update ( s );
char digest[16];
md5.Final ( digest );
return string ( digest, 16 );
}
string HMAC_MD5 ( const string& key, const string& text, char* out_bin )
{
MD5 md5;
char k_ipad[65]; // inner padding - key XORd with ipad
char k_opad[65]; // outer padding - key XORd with opad
string tmp;
char digest[16];
int i;
// if key is longer than 64 bytes reset it to key=MD5(key)
if ( key.length() > 64 )
{
md5.Init();
md5.Update ( key );
md5.Final ( digest );
tmp = string ( digest, 16 );
}
else
tmp = key;
// start out by storing key in pads
memset ( k_ipad, 0, sizeof(k_ipad) );
memset ( k_opad, 0, sizeof(k_opad) );
memcpy ( k_ipad, tmp.c_str(), tmp.length() );
memcpy ( k_opad, tmp.c_str(), tmp.length() );
// XOR key with ipad and opad values
for ( i=0; i<64; i++ )
{
k_ipad[i] ^= 0x36;
k_opad[i] ^= 0x5c;
}
// "inner" MD5
md5.Init();
md5.Update(k_ipad);
md5.Update(text);
md5.Final ( digest );
// "outer" MD5
md5.Init();
md5.Update(k_opad);
md5.Update(string(digest,16));
return md5.Final(out_bin);
}
#endif//__cplusplus

95
irc/ArchBlackmann/MD5.h Normal file
View File

@@ -0,0 +1,95 @@
// MD5.H - header file for MD5.CPP
/*
Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
*/
#ifndef __MD5_H
#define __MD5_H
#ifdef __cplusplus
#include <string>
#endif//__cplusplus
#ifndef uchar
#define uchar unsigned char
#endif//uchar
#ifndef ushort
#define ushort unsigned short
#endif//ushort
#ifndef ulong
#define ulong unsigned long
#endif//ulong
#ifdef __cplusplus
extern "C" {
#endif//__cplusplus
typedef uchar *POINTER; // POINTER defines a generic pointer type
typedef ushort UINT2; // UINT2 defines a two byte word
typedef ulong UINT4; // UINT4 defines a four byte word
// MD5 context.
typedef struct
{
UINT4 state[4]; // state (ABCD)
UINT4 count[2]; // number of bits, modulo 2^64 (lsb first)
unsigned char buffer[64]; // input buffer
} MD5_CTX;
void MD5Init ( MD5_CTX * );
void MD5Update ( MD5_CTX *, const char *, unsigned int );
void MD5Final ( uchar [16], MD5_CTX * );
void digest2ascii ( char *ascii, const uchar *digest );
void ascii2digest ( uchar *digest, const char *ascii );
#ifdef __cplusplus
} // extern "C"
class MD5
{
public:
MD5();
void Init();
void Update ( const std::string& s );
std::string Final ( char* digest = 0 );
private:
MD5_CTX _ctx;
};
std::string MD5Hex ( const std::string& s );
std::string MD5Bin ( const std::string& s );
std::string HMAC_MD5 (
const std::string& key,
const std::string& text,
char* out_bin = NULL );
#endif//__cplusplus
#endif//__MD5_H

315
irc/ArchBlackmann/QueueT.h Normal file
View File

@@ -0,0 +1,315 @@
/*
** Author: Samuel R. Blackburn
** Internet: wfc@pobox.com
**
** You can use it any way you like as long as you don't try to sell it.
**
** Any attempt to sell WFC in source code form must have the permission
** of the original author. You can produce commercial executables with
** WFC but you can't sell WFC.
**
** Copyright, 2000, Samuel R. Blackburn
**
** NOTE: I modified the info block below so it hopefully wouldn't conflict
** with the original file. Royce Mitchell III
*/
#ifndef QUEUET_CLASS_HEADER
#define QUEUET_CLASS_HEADER
#include "ReliMT.h"
#ifdef WIN32
#include <sys/types.h> // off_t
#define HEAPCREATE(size) m_Heap = ::HeapCreate ( HEAP_NO_SERIALIZE, size, 0 )
#define HEAPALLOC(size) ::HeapAlloc ( m_Heap, HEAP_NO_SERIALIZE, size )
#define HEAPREALLOC(p,size) ::HeapReAlloc( m_Heap, HEAP_NO_SERIALIZE, p, size )
#define HEAPFREE(p) ::HeapFree ( m_Heap, HEAP_NO_SERIALIZE, p )
#define HEAPDESTROY() ::HeapDestroy ( m_Heap ); m_Heap = 0;
#else
#define HEAPCREATE(size)
#define HEAPALLOC(size) malloc(size)
#define HEAPREALLOC(p,size) realloc(p,size);
#define HEAPFREE(p) free(p)
#define HEAPDESTROY()
#endif
template <class T>
class CQueueT : public Uncopyable
{
protected:
// What we want to protect
Mutex m_AddMutex;
Mutex m_GetMutex;
T* m_Items;
off_t m_AddIndex;
off_t m_GetIndex;
size_t m_Size;
#ifdef WIN32
HANDLE m_Heap;
#endif//WIN32
inline void m_GrowBy ( size_t number_of_new_items );
public:
inline CQueueT ( size_t initial_size = 1024 );
inline ~CQueueT();
inline bool Add( const T& new_item );
inline void Empty() { m_AddIndex = 0; m_GetIndex = 0; };
inline bool Get( T& item );
inline size_t GetLength() const;
inline size_t GetMaximumLength() const { return( m_Size ); };
inline bool AddArray ( const T* new_items, int item_count );
inline int GetArray ( T* items, const int maxget, const T& tEnd );
inline bool Contains ( const T& t );
};
template <class T>
inline CQueueT<T>::CQueueT ( size_t initial_size )
{
m_AddIndex = 0;
m_GetIndex = 0;
m_Items = NULL;
if ( initial_size == 0 )
initial_size = 1;
/*
** 1999-11-05
** We create our own heap because all of the pointers used are allocated
** and freed be us. We don't have to worry about a non-serialized thread
** accessing something we allocated. Because of this, we can perform our
** memory allocations in a heap dedicated to queueing. This means when we
** have to allocate more memory, we don't have to wait for all other threads
** to pause while we allocate from the shared heap (like the C Runtime heap)
*/
HEAPCREATE( ( ( ( 2 * initial_size * sizeof(T) ) < 65536 ) ? 65536 : (2 * initial_size * sizeof(T) ) ) );
m_Items = (T*)HEAPALLOC ( initial_size * sizeof(T) );
m_Size = ( m_Items == NULL ) ? 0 : initial_size;
}
template <class T>
inline CQueueT<T>::~CQueueT()
{
m_AddIndex = 0;
m_GetIndex = 0;
m_Size = 0;
if ( m_Items != NULL )
{
HEAPFREE(m_Items);
m_Items = NULL;
}
HEAPDESTROY();
}
template <class T>
inline bool CQueueT<T>::Add ( const T& item )
{
// Block other threads from entering Add();
Mutex::Lock addlock ( m_AddMutex );
// Add the item
m_Items[ m_AddIndex ] = item;
// 1999-12-08
// Many many thanks go to Lou Franco (lfranco@spheresoft.com)
// for finding an bug here. It rare but recreatable situations,
// m_AddIndex could be in an invalid state.
// Make sure m_AddIndex is never invalid
off_t new_add_index = ( ( m_AddIndex + 1 ) >= (off_t)m_Size ) ? 0 : m_AddIndex + 1;
if ( new_add_index == m_GetIndex )
{
// The queue is full. We need to grow.
// Stop anyone from getting from the queue
Mutex::Lock getlock ( m_GetMutex );
m_AddIndex = new_add_index;
// One last double-check.
if ( m_AddIndex == m_GetIndex )
{
m_GrowBy ( m_Size );
}
}
else
{
m_AddIndex = new_add_index;
}
return true;
}
template <class T>
inline bool CQueueT<T>::Get( T& item )
{
// Prevent other threads from entering Get()
Mutex::Lock getlock ( m_GetMutex );
if ( m_GetIndex == m_AddIndex )
{
// Let's check to see if our queue has grown too big
// If it has, then shrink it
if ( m_Size > 1024 )
{
// Yup, we're too big for our britches
Mutex::TryLock addlock ( m_AddMutex );
if ( addlock )
{
// Now, no one can add to the queue
if ( m_GetIndex == m_AddIndex ) // is queue empty?
{
// See if we can just shrink it...
T* return_value = (T*)HEAPREALLOC(m_Items,1024 * sizeof(T));
if ( return_value != NULL )
{
m_Items = (T*) return_value;
}
else
{
// Looks like we'll have to do it the hard way
HEAPFREE ( m_Items );
m_Items = (T*) HEAPALLOC ( 1024 * sizeof(T) );
}
m_Size = ( m_Items == NULL ) ? 0 : 1024;
m_AddIndex = 0;
m_GetIndex = 0;
}
else
{
// m_GetIndex != m_AddIndex, this means that someone added
// to the queue between the time we checked m_Size for being
// too big and the time we entered the add critical section.
// If this happened then we are too busy to shrink
}
}
}
return false;
}
item = m_Items[ m_GetIndex ];
// Make sure m_GetIndex is never invalid
m_GetIndex = ( ( m_GetIndex + 1 ) >= (off_t)m_Size ) ? 0 : m_GetIndex + 1;
return true;
}
template <class T>
inline int CQueueT<T>::GetArray ( T* items, const int maxget, const T& tEnd )
{
// TODO - oooh baby does this need to be optimized
// Prevent other threads from entering Get()
Mutex::Lock getlock ( m_GetMutex ); //::EnterCriticalSection( &m_GetCriticalSection );
int iResult = 0;
for ( int i = 0; i < maxget; i++ )
{
if ( !Get(items[i]) )
break;
iResult++;
if ( items[i] == tEnd )
break;
}
// Let other threads call Get() now
//::LeaveCriticalSection( &m_GetCriticalSection );
return iResult;
}
template <class T>
inline size_t CQueueT<T>::GetLength() const
{
// This is a very expensive process!
// No one can call Add() or Get() while we're computing this
size_t number_of_items_in_the_queue = 0;
Mutex::Lock addlock ( m_AddMutex );
Mutex::Lock getlock ( m_GetMutex );
number_of_items_in_the_queue = ( m_AddIndex >= m_GetIndex ) ?
( m_AddIndex - m_GetIndex ) :
( ( m_AddIndex + m_Size ) - m_GetIndex );
return number_of_items_in_the_queue;
}
template <class T>
inline void CQueueT<T>::m_GrowBy ( size_t number_of_new_items )
{
// Prevent other threads from calling Get().
// We don't need to enter the AddCriticalSection because
// m_GrowBy() is only called from Add();
T* new_array = NULL;
T* pointer_to_free = NULL;
size_t new_size = m_Size + number_of_new_items;
{ // Prevent other threads from getting
Mutex::Lock getlock ( m_GetMutex );
// 2000-05-16
// Thanks go to Royce Mitchell III (royce3@aim-controls.com) for finding
// a HUGE bug here. I was using HeapReAlloc as a short cut but my logic
// was flawed. In certain circumstances, queue items were being dropped.
new_array = (T*)HEAPALLOC ( new_size * sizeof(T) );
// Now copy all of the old items from the old queue to the new one.
// Get the entries from the get-index to the end of the array
memcpy ( new_array, &m_Items[m_GetIndex], ( m_Size - m_GetIndex ) * sizeof(T) );
// Get the entries from the beginning of the array to the add-index
memcpy ( &new_array[m_Size-m_GetIndex], m_Items, m_AddIndex * sizeof(T) );
m_AddIndex = (off_t)m_Size;
m_GetIndex = 0;
m_Size = new_size;
pointer_to_free = m_Items;
m_Items = new_array;
} // Mutex::Lock
HEAPFREE ( pointer_to_free );
}
template <class T>
inline bool CQueueT<T>::Contains ( const T& t )
{
Mutex::Lock addlock ( m_AddMutex );
Mutex::Lock getlock ( m_GetMutex );
for ( int i = m_GetIndex; i != m_AddIndex; i++ )
{
if ( i == m_Size )
i = 0;
if ( m_Items[i] == t )
return true;
}
return m_Items[m_AddIndex] == t;
}
typedef CQueueT<char> CCharQueue;
#endif // QUEUE_CLASS_HEADER

143
irc/ArchBlackmann/Reli.h Normal file
View File

@@ -0,0 +1,143 @@
// Reli.h
// lots of code here is (c) Bartosz Milewski, 1996, www.relisoft.com
// The rest is (C) 2002-2004 Royce Mitchell III
// and released under the LGPL & BSD licenses
#ifndef __RELI_H
#define __RELI_H
////////////////////////////////////////////////////////////////////////////////
// Assert
#undef Assert
#ifdef NDEBUG
#define Assert(exp) ((void)0)
#else
void _wassert (char* szExpr, char* szFile, int line);
#define Assert(exp) (void)( (exp) || (_wassert(#exp, __FILE__, __LINE__), 0) )
#endif /* NDEBUG */
////////////////////////////////////////////////////////////////////////////////
// Swap
template <class T>
void Swap(T a,T b)
{
T t = a;
a = b;
b = t;
}
////////////////////////////////////////////////////////////////////////////////
// Uncopyable - base class disabling copy ctors
class Uncopyable
{
public:
Uncopyable(){} // need a default ctor
private:
Uncopyable ( const Uncopyable& );
const Uncopyable& operator = ( const Uncopyable& );
};
////////////////////////////////////////////////////////////////////////////////
// SPtr - Smart Pointer's must be passed by reference or const reference
template <class T>
class SPtr : public Uncopyable
{
public:
virtual ~SPtr () { Destroy(); }
T * operator->() { return _p; }
T const * operator->() const { return _p; }
operator T&() { Assert(_p); return *_p; }
operator const T&() const { Assert(_p); return *_p; }
void Acquire ( SPtr<T>& t ) { Destroy(); Swap(_p,t._p); }
void Destroy() { if ( _p ) { delete _p; _p = 0; } }
protected:
SPtr (): _p (0) {}
explicit SPtr (T* p): _p (p) {}
T * _p;
private:
operator T* () { return _p; }
};
#define DECLARE_SPTR(cls,init,init2) \
class S##cls : public SPtr<cls> \
{ \
public: \
S##cls ( cls* p ) : SPtr<cls>(p) {} \
explicit S##cls init : SPtr<cls> (new cls init2) {} \
};
/* Example Usage of DECLARE_SPTR:
class MyClass
{
public: // can be protected
MyClass ( int i )
{
...
}
...
}; DECLARE_SPTR(MyClass,(int i),(i))
SMyClass ptr(i);
*/
#define DECLARE_SPTRV(cls) typedef SPtr<cls> S##cls;
/* Example Usage of DECLARE_SPTRV:
class MyAbstractClass
{
public: // can be protected
MyAbstractClass ( int i )
{
...
}
void MyPureVirtFunc() = 0;
...
}; DECLARE_SPTRV(MyAbstractClass)
SMyAbstractClass ptr ( new MySubClass(i) );
*/
#define DECLARE_PTR(cls,init,init2) \
class Ptr : public SPtr<cls> \
{ \
Ptr(cls* p) : SPtr<cls> ( p ) \
{ \
} \
Ptr init : SPtr<cls> ( new cls init2 ) {} \
};
/* Example Usage of DECLARE_PTR:
class MyClass
{
DECLARE_PTR(MyClass,(int i),(i))
public: // can be protected
MyClass ( int i )
{
...
}
void MyPureVirtFunc() = 0;
...
};
MyClass::Ptr ptr ( i );
*/
#define DECLARE_PTRV(cls) \
class Ptr : public SPtr<cls> \
{ \
Ptr(cls* p) : SPtr<cls> ( p ) \
{ \
} \
};
/* Example Usage of DECLARE_PTRV:
class MyAbstractClass
{
DECLARE_PTRV(MyAbstractClass)
public: // can be protected
MyAbstractClass ( int i )
{
...
}
void MyPureVirtFunc() = 0;
...
};
MyAbstractClass::Ptr ptr ( new MySubClass(i) );
*/
#endif//__RELI_H

View File

@@ -0,0 +1,331 @@
// ReliMT.cpp
// lots of code here is (c) Bartosz Milewski, 1996, www.relisoft.com
// The rest is (C) 2002-2004 Royce Mitchell III
// and released under the LGPL & BSD licenses
#include <stdlib.h>
#include <stdio.h>
#ifdef WIN32
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# define snprintf _snprintf
#elif defined(UNIX)
# include <errno.h>
# include <sys/sem.h>
#else
# error unrecognized target
#endif//WIN32|UNIX
#include "verify.h"
#include "ReliMT.h"
////////////////////////////////////////////////////////////////////////////////
// Assert
void _wassert ( char* szExpr, char* szFile, int line )
{
fprintf ( stderr, "Assertion Failure: \"%s\" in file %s, line %d", szExpr, szFile, line );
exit (-1);
}
////////////////////////////////////////////////////////////////////////////////
// Thread
Thread::Thread ( long (THREADAPI * pFun) (void* arg), void* pArg )
{
#ifdef WIN32
verify ( _handle = CreateThread (
0, // Security attributes
0, // Stack size
(DWORD (WINAPI*)(void*))pFun,
pArg,
0, // don't create suspended.
&_tid ));
#elif defined(UNIX)
// set up the thread attribute: right now, we do nothing with it.
pthread_attr_t attr;
pthread_attr_init(&attr);
// this will make the threads created by this process really concurrent
verify ( !pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) );
// create the new OS thread object
verify ( !pthread_create ( &_threadId, &attr, (void* (*) (void*))pFun, pArg ) );
verify ( !pthread_attr_destroy(&attr) );
#else
# error unrecognized target
#endif//WIN32|UNIX
}
Thread::~Thread()
{
#ifdef WIN32
verify ( CloseHandle ( _handle ) );
#elif defined(UNIX)
verify ( !pthread_cancel ( _threadId ) );
#else
# error unrecognized target
#endif//WIN32|UNIX
}
/*void Thread::Resume()
{
#ifdef WIN32
ResumeThread (_handle);
#elif defined(UNIX)
# error how to resume thread in unix?
#else
# error unrecognized target
#endif//WIN32|UNIX
}*/
void Thread::WaitForDeath()
{
#ifdef WIN32
DWORD dw = WaitForSingleObject ( _handle, 2000 );
ASSERT ( dw != WAIT_FAILED );
#elif defined(UNIX)
verify ( !pthread_join ( _threadId, (void**)NULL ) );
#else
# error unrecognized target
#endif//WIN32|UNIX
}
////////////////////////////////////////////////////////////////////////////////
// ActiveObject
// The constructor of the derived class
// should call
// _thread.Resume();
// at the end of construction
ActiveObject::ActiveObject() : _isDying (0), _thread (0)
{
}
ActiveObject::~ActiveObject()
{
ASSERT ( !_thread ); // call Kill() from subclass's dtor
// Kill() - // You can't call a virtual function from a dtor, EVEN INDIRECTLY
// so, you must call Kill() in the subclass's dtor
}
// FlushThread must reset all the events on which the thread might be waiting.
void ActiveObject::Kill()
{
if ( _thread )
{
_isDying++;
FlushThread();
// Let's make sure it's gone
_thread->WaitForDeath();
delete _thread;
_thread = 0;
}
}
void ActiveObject::Start()
{
ASSERT ( !_thread );
_thread = new Thread ( ThreadEntry, this );
}
long THREADAPI ActiveObject::ThreadEntry ( void* pArg )
{
ActiveObject * pActive = (ActiveObject*)pArg;
pActive->InitThread();
pActive->Run();
pActive->Kill();
return 0;
}
///////////////////////////////////////////////////////////////////////////////
// Mutex
Mutex::Mutex()
{
#ifdef WIN32
verify ( _h = CreateMutex ( NULL, FALSE, NULL ) );
#elif defined(UNIX)
pthread_mutexattr_t attrib;
verify ( !pthread_mutexattr_init( &attrib ) );
// allow recursive locks
verify ( !pthread_mutexattr_settype( &attrib, PTHREAD_MUTEX_RECURSIVE ) );
verify ( !pthread_mutex_init ( &_mutex, &attrib ) );
#else
# error unrecognized target
#endif
}
Mutex::~Mutex()
{
#ifdef WIN32
verify ( CloseHandle ( _h ) );
#elif defined(UNIX)
verify ( !pthread_mutex_destroy(&_mutex) );
#else
# error unrecognized target
#endif
}
void Mutex::Acquire()
{
#ifdef WIN32
DWORD dw = WaitForSingleObject ( _h, INFINITE );
ASSERT ( dw == WAIT_OBJECT_0 || dw == WAIT_ABANDONED );
#elif defined(UNIX)
verify ( !pthread_mutex_lock(&_mutex) );
#else
# error unrecognized target
#endif
}
bool Mutex::TryAcquire()
{
#ifdef WIN32
DWORD dw = WaitForSingleObject ( _h, 1 );
ASSERT ( dw == WAIT_OBJECT_0 || dw == WAIT_TIMEOUT || dw == WAIT_ABANDONED );
return (dw != WAIT_TIMEOUT);
#elif defined(UNIX)
int err = pthread_mutex_trylock(&_mutex);
ASSERT ( err == EBUSY || err == 0 );
return (err == 0);
#else
# error unrecognized target
#endif
}
void Mutex::Release()
{
#ifdef WIN32
verify ( ReleaseMutex ( _h ) );
#elif defined(UNIX)
verify ( !pthread_mutex_unlock(&_mutex) );
// we could allow EPERM return value too, but we are forcing user into RIIA
#else
# error unrecognized target
#endif
}
Mutex::Lock::Lock ( Mutex& m ) : _m(m)
{
_m.Acquire();
}
Mutex::Lock::~Lock()
{
_m.Release();
}
Mutex::TryLock::TryLock ( Mutex& m ) : _m(m)
{
_bLocked = _m.TryAcquire();
}
Mutex::TryLock::~TryLock()
{
if ( _bLocked )
_m.Release();
}
///////////////////////////////////////////////////////////////////////////////
// Event
Event::Event()
{
#ifdef WIN32
// start in non-signaled state (red light)
// auto reset after every Wait
verify ( _handle = CreateEvent ( 0, FALSE, FALSE, 0 ) );
#elif defined(UNIX)
//verify ( !pthread_cond_init ( &_cond, NULL /* default attributes */) );
sem_init();
//verify(sem_init());
#else
# error unrecognized target
#endif
}
Event::~Event()
{
#ifdef WIN32
verify ( CloseHandle ( _handle ) );
#elif defined(UNIX)
//verify ( !pthread_cond_destroy ( &_cond ) );
sem_destroy();
#else
# error unrecognized target
#endif
}
void Event::Release() // put into signaled state
{
#ifdef WIN32
verify ( SetEvent ( _handle ) );
#elif defined(UNIX)
//verify ( !pthread_cond_signal ( &_cond ) );
verify(!sem_V());
#else
# error unrecognized target
#endif
}
void Event::Wait()
{
#ifdef WIN32
// Wait until event is in signaled (green) state
DWORD dw = WaitForSingleObject ( _handle, INFINITE );
ASSERT ( dw == WAIT_OBJECT_0 || dw == WAIT_ABANDONED );
#elif defined(UNIX)
// According to docs: The pthread_cond_wait() and pthread_cond_timedwait()
// functions are used to block on a condition variable. They are called
// with mutex locked by the calling thread or undefined behaviour will
// result.
//Mutex::Lock lock ( _mutex );
//verify ( !pthread_cond_wait ( &_cond, _mutex ) );
verify(!sem_P());
#else
# error unrecognized target
#endif
}
#ifdef UNIX
void Event::sem_init()
{
sem_id = semget(IPC_PRIVATE, 1, 0666 | IPC_CREAT);
ASSERT(sem_id != -1);
}
int Event::sem_P()
{
struct sembuf sb;
sb.sem_num = 0;
sb.sem_op = -1;
sb.sem_flg = 0;
return semop(sem_id, &sb, 1);
}
int Event::sem_V()
{
struct sembuf sb;
sb.sem_num = 0;
sb.sem_op = 1;
sb.sem_flg = 0;
return semop(sem_id, &sb, 1);
}
void Event::sem_destroy()
{
#ifdef MACOSX
semun mactmp;
mactmp.val = 0;
semctl(sem_id, 0, IPC_RMID, mactmp);
#else
semctl(sem_id, 0, IPC_RMID, 0);
#endif
}
#endif

229
irc/ArchBlackmann/ReliMT.h Normal file
View File

@@ -0,0 +1,229 @@
// ReliMT.h
// lots of code here is (c) Bartosz Milewski, 1996, www.relisoft.com
// The rest is (C) 2003-2004 Royce Mitchell III
// and released under the LGPL & BSD licenses
#ifndef __RELIMT_H
#define __RELIMT_H
#include "Reli.h"
#ifdef WIN32
# ifndef _WINDOWS_
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# endif
# define THREADAPI WINAPI
#elif defined(UNIX)
# include <pthread.h>
# include <stdlib.h>
# include "string.h"
# include <sys/types.h> //Semaphore
# include <sys/ipc.h> //Semaphore
# include <sys/sem.h> //Semaphore
# define THREADAPI
#else
# error unrecognized target
#endif
////////////////////////////////////////////////////////////////////////////////
// Thread
class Thread : public Uncopyable
{
public:
Thread ( long (THREADAPI * pFun) (void* arg), void* pArg );
~Thread();
//void Resume();
void WaitForDeath();
// platform-specific stuff:
private:
#ifdef WIN32
HANDLE _handle;
DWORD _tid; // thread id
#elif defined(UNIX)
pthread_t _threadId; // id of the thread
#else
# error unrecognized target
#endif
//DECLARE_PTR(Thread,(long (THREADAPI * pFun) (void* arg), void* pArg),(pFun,pArg));
}; //DECLARE_SPTR(Thread,(long (THREADAPI * pFun) (void* arg), void* pArg),(pFun,pArg));
////////////////////////////////////////////////////////////////////////////////
// ActiveObject
class ActiveObject : public Uncopyable
{
public:
ActiveObject();
virtual ~ActiveObject();
void Kill();
void Start();
protected:
virtual void InitThread() = 0;
virtual void Run() = 0;
virtual void FlushThread() = 0;
int _isDying;
static long THREADAPI ThreadEntry ( void *pArg );
Thread *_thread;
//DECLARE_PTRV(ActiveObject);
}; //DECLARE_SPTRV(ActiveObject);
// Last thing in the constructor of a class derived from
// ActiveObject you must call
// Start();
// Inside the loop the Run method you must keep checking _isDying
// if (_isDying)
// return;
// FlushThread must reset all the events on which the thread might be waiting.
// Example:
#if 0
// MyAsyncOutputter - class that outputs strings to a file asynchronously
class MyAsyncOutputter : public ActiveObject
{
public:
MyAsyncOutputter ( const string& filename ) : _filename(filename), _currentBuf(0)
{
Start(); // start thread
}
void InitThread()
{
_f.open ( _filename, "wb" );
}
void Output ( const string& s )
{
{
// acquire lock long enough to add the string to the active buffer
Mutex::Lock lock ( _mutex );
_buf[_currentBuf].push_back ( s );
}
_event.Release(); // don't need the lock fire the event
}
void Run()
{
while ( !_isDying )
{
// wait for signal from Output() or FlushThread()
_event.Wait();
{
// acquire lock long enough to switch active buffers
Mutex::Lock lock ( _mutex );
_currentBuf = 1-_currentBuf;
ASSERT ( !_buf[_currentBuf].size() );
}
// get a reference to the old buffer
vector<string>& buf = _buf[1-_currentBuf];
// write each string out to file and then empty the buffer
for ( int i = 0; i < buf.size(); i++ )
_f.write ( buf[i].c_str(), buf[i].size() );
buf.resize(0);
}
}
void FlushThread()
{
// _isDying is already set: signal thread so it can see that too
_event.Release();
}
private:
string _filename;
File _f;
int _currentBuf;
vector<string> _buf[2];
Event _event;
Mutex _mutex;
};
#endif
////////////////////////////////////////////////////////////////////////////////
// Mutex
class Mutex : public Uncopyable
{
public:
Mutex();
~Mutex();
private:
void Acquire();
bool TryAcquire();
void Release();
public:
// sub-class used to lock the Mutex
class Lock : public Uncopyable
{
public:
Lock ( Mutex& m );
~Lock();
private:
// private data
Mutex& _m;
};
friend class Mutex::Lock;
// sub-class used to attempt to lock the mutex. Use operator bool()
// to test if the lock was successful
class TryLock : public Uncopyable
{
public:
TryLock ( Mutex& m );
~TryLock();
operator bool () { return _bLocked; }
private:
// private data
bool _bLocked;
Mutex& _m;
};
friend class Mutex::TryLock;
private:
// platform-specific stuff:
#ifdef WIN32
HANDLE _h;
#elif defined(UNIX)
pthread_mutex_t _mutex;
public: operator pthread_mutex_t* () { return &_mutex; }
#else
# error unrecognized target
#endif
};
////////////////////////////////////////////////////////////////////////////////
// Event
class Event : public Uncopyable
{
public:
Event();
~Event();
void Release(); // put into signaled state
void Wait();
private:
#ifdef WIN32
HANDLE _handle;
#elif defined(UNIX)
//Sem util functions
void sem_init();
int sem_P();
int sem_V();
void sem_destroy();
int sem_id;
//pthread_cond_t _cond;
//Mutex _mutex;
#else
# error unrecognized target
#endif
//DECLARE_PTR(Event,(),());
}; //DECLARE_SPTR(Event,(),());
#endif//__RELIWIN32_H

View File

@@ -0,0 +1,504 @@
// SockUtils.cpp - Some basic socket utility functions.
// (C) 2002-2004 Royce Mitchell III
// This file is under the BSD & LGPL licenses
#include <stdio.h>
#include "SockUtils.h"
#ifdef WIN32
# ifndef SD_SEND // defined in winsock2.h, but not winsock.h
# define SD_SEND 1
# endif
# define snprintf _snprintf
# ifdef _MSC_VER
# pragma comment ( lib, "ws2_32.lib" )
# endif//_MSC_VER
#elif defined(UNIX)
# include <errno.h>
# include "string.h" // memset
# include <netdb.h> // hostent
# include <arpa/inet.h> //inet_addr
# include <sys/time.h>
# define SD_SEND SHUT_WR //bah thou shalt name thy defines the same
#else
# error unrecognized target
#endif
//// Constants /////////////////////////////////////////////////////////
const int kBufferSize = 1024;
// creates broadcast address
SockAddrIn::SockAddrIn()
{
memset ( this, 0, sizeof(sockaddr_in) );
sin_family = AF_INET;
}
SockAddrIn::SockAddrIn ( const char* szAddr, u_short iPort )
{
memset ( this, 0, sizeof(sockaddr_in) );
sin_family = AF_INET;
sin_addr.s_addr = suLookupAddress(szAddr);
sin_port = htons(iPort);
}
SockAddrIn::SockAddrIn ( in_addr_t iAddr, u_short iPort )
{
memset ( this, 0, sizeof(sockaddr_in) );
sin_family = AF_INET;
sin_addr.s_addr = iAddr;
sin_port = htons(iPort);
}
bool suStartup()
{
#ifdef WIN32
WSADATA wsaData;
if ( WSAStartup ( MAKEWORD(2,0), &wsaData ) )
return false;
if ( wsaData.wVersion != MAKEWORD(2,0) )
{
WSACleanup();
return false;
}
return true;
#elif defined(UNIX)
// nothing special required here
return true;
#else
# error unrecognized target
#endif
}
//// suTcpSocket ////////////////////////////////////////////////
// Creates a TCP socket.
SOCKET suTcpSocket()
{
SOCKET so = socket ( AF_INET, SOCK_STREAM, 0 );
#if defined(_DEBUG) && defined(WIN32)
if ( so == INVALID_SOCKET && WSANOTINITIALISED == WSAGetLastError() )
MessageBox ( NULL, "You forgot to call suStartup()!", "SockUtils", MB_OK|MB_ICONEXCLAMATION );
#endif
return so;
}
//// suUdpSocket ////////////////////////////////////////////////
// Creates a UDP socket. Compensates for new "functionality" introduced
// in Win2K with regards to select() calls
// MS Transport Provider IOCTL to control
// reporting PORT_UNREACHABLE messages
// on UDP sockets via recv/WSARecv/etc.
// Path TRUE in input buffer to enable (default if supported),
// FALSE to disable.
#ifndef SIO_UDP_CONNRESET
#define SIO_UDP_CONNRESET _WSAIOW(IOC_VENDOR,12)
#endif//SIO_UDP_CONNRESET
SOCKET suUdpSocket()
{
SOCKET so = socket ( AF_INET, SOCK_DGRAM, 0 );
#if defined(_DEBUG) && defined(WIN32)
if ( so == INVALID_SOCKET && WSANOTINITIALISED == WSAGetLastError() )
MessageBox ( NULL, "You forgot to call suStartup()!", "SockUtils", MB_OK|MB_ICONEXCLAMATION );
#endif
#ifdef WIN32
// for Windows 2000, disable new behavior...
// see: http://www-pc.uni-regensburg.de/systemsw/W2KPRO/UPDATE/POSTSP1/Q263823.htm
// this code is innocuous on other win32 platforms
DWORD dwBytesReturned = 0;
BOOL bNewBehavior = FALSE;
// disable new Win2K behavior using
// IOCTL: SIO_UDP_CONNRESET
// we don't care about return value :)
WSAIoctl(so, SIO_UDP_CONNRESET,
&bNewBehavior, sizeof(bNewBehavior),
NULL, 0, &dwBytesReturned,
NULL, NULL);
#endif
return so;
}
//// suShutdownConnection ////////////////////////////////////////////////
// Gracefully shuts the connection sd down. Returns true if it was able
// to shut it down nicely, false if we had to "slam" it shut.
// (either way, the socket does get closed)
bool suShutdownConnection(SOCKET sd)
{
if ( sd == INVALID_SOCKET )
return true;
// Disallow any further data sends. This will tell the other side
// that we want to go away now. If we skip this step, we don't
// shut the connection down nicely.
if (shutdown(sd, SD_SEND) == SOCKET_ERROR)
{
closesocket(sd);
return false;
}
// Receive any extra data still sitting on the socket. After all
// data is received, this call will block until the remote host
// acknowledges the TCP control packet sent by the shutdown above.
// Then we'll get a 0 back from recv, signalling that the remote
// host has closed its side of the connection.
char acReadBuffer[kBufferSize];
for ( ;; )
{
int nNewBytes = recv(sd, acReadBuffer, kBufferSize, 0);
if (nNewBytes == SOCKET_ERROR)
{
closesocket(sd);
return false;
}
else if (nNewBytes != 0)
{
// FYI, received (nNewBytes) unexpected bytes during shutdown.
}
else
{
// Okay, we're done!
break;
}
}
// Close the socket.
if (closesocket(sd) == SOCKET_ERROR)
{
return false;
}
return true;
}
//// suLookupAddress ////////////////////////////////////////////////
// Basically converts a name address to an ip address
in_addr_t suLookupAddress ( const char* pcHost )
{
in_addr_t nRemoteAddr = inet_addr(pcHost);
if ( nRemoteAddr == INADDR_NONE )
{
// pcHost isn't a dotted IP, so resolve it through DNS
hostent* pHE = gethostbyname(pcHost);
if ( pHE == 0 )
{
#if defined(_DEBUG) && defined(WIN32)
if ( WSANOTINITIALISED == WSAGetLastError() )
MessageBox ( NULL, "You forgot to call suStartup()!", "SockUtils", MB_OK|MB_ICONEXCLAMATION );
#endif
return INADDR_NONE;
}
nRemoteAddr = *((in_addr_t*)pHE->h_addr_list[0]);
}
return nRemoteAddr;
}
bool suConnect ( SOCKET so, in_addr_t iAddress, u_short iPort )
{
SockAddrIn sinRemote ( iAddress, iPort );
if ( SOCKET_ERROR == connect(so,sinRemote,sizeof(sinRemote)) )
{
#if defined(_DEBUG) && defined(WIN32)
if ( WSANOTINITIALISED == WSAGetLastError() )
MessageBox ( NULL, "You forgot to call suStartup()!", "SockUtils", MB_OK|MB_ICONEXCLAMATION );
#endif
return false;
}
return true;
}
bool suConnect ( SOCKET so, const char* szAddress, u_short iPort )
{
return suConnect ( so, suLookupAddress(szAddress), iPort );
}
//// suEstablishConnection ////////////////////////////////////////////////
// creates a socket of the specified type, connects to the ip address/port
// requested, and returns the SOCKET created
SOCKET suEstablishConnection ( in_addr_t iAddress, u_short iPort, int type )
{
// Create a socket
if ( type != SOCK_STREAM && type != SOCK_DGRAM )
return INVALID_SOCKET;
SOCKET so = socket(AF_INET, type, 0);
if ( so == INVALID_SOCKET )
return so;
if ( !suConnect(so, iAddress, iPort) )
{
closesocket(so);
return INVALID_SOCKET;
}
return so;
}
//// suEstablishConnection ////////////////////////////////////////////////
// creates a socket of the specified type, connects to the address/port
// requested, and returns the SOCKET created
SOCKET suEstablishConnection ( const char* szAddress, u_short iPort, int type )
{
return suEstablishConnection ( suLookupAddress ( szAddress ), iPort, type );
}
//// suBroadcast ////////////////////////////////////////////////
// takes a previously created broadcast-enabled UDP socket, and broadcasts
// a message on the local network
bool suBroadcast ( SOCKET so, u_short port, const char* buf, int len /* = -1 */ )
{
if ( len == -1 )
len = (int)strlen(buf);
#if 1
SockAddrIn to ( INADDR_BROADCAST, port );
#else // some strange MS OS's don't broadcast to localhost...
SockAddrIn to ( "127.0.0.1", port );
if ( SOCKET_ERROR == sendto ( so, buf, len, 0, to, sizeof(to) ) )
return false;
to.sin_addr.s_addr = INADDR_BROADCAST;
#endif
if ( SOCKET_ERROR == sendto ( so, buf, len, 0, to, sizeof(to) ) )
return false;
return true;
}
//// suRecv ////////////////////////////////////////////////
// retrieves data sent to our TCP socket. If no data, waits for
// a period of timeout ms.
// returns bytes received
// -1 == SOCKET_ERROR
// -2 == timed out waiting for data
int suRecv ( SOCKET so, char* buf, int buflen, int timeout )
{
struct timeval to;
fd_set rread;
int res;
FD_ZERO(&rread); // clear the fd_set
FD_SET(so,&rread); // indicate which socket(s) we want to check
memset((char *)&to,0,sizeof(to)); // clear the timeval struct
to.tv_sec = timeout; // timeout select after (timeout) seconds
// select returns > 0 if there is an event on the socket
res = select((int)so+1, &rread, (fd_set *)0, (fd_set *)0, &to );
if (res < 0)
return -1; // socket error
// there was an event on the socket
if ( (res>0) && (FD_ISSET(so,&rread)) )
return recv ( so, buf, buflen, 0 );
return -2;
}
//// suRecvFrom ////////////////////////////////////////////////
// retrieves data sent to our UDP socket. If no data, waits for
// a period of timeout ms.
// returns bytes received
// returns bytes received
// -1 == SOCKET_ERROR
// -2 == timed out waiting for data
int suRecvFrom ( SOCKET so, char* buf, int buflen, int timeout, sockaddr_in* from, socklen_t* fromlen )
{
struct timeval to;
fd_set rread;
int res;
FD_ZERO(&rread); // clear the fd_set
FD_SET(so,&rread); // indicate which socket(s) we want to check
memset((char *)&to,0,sizeof(to)); // clear the timeval struct
to.tv_sec = timeout; // timeout select after (timeout) seconds
// select returns > 0 if there is an event on the socket
res = select((int)so+1, &rread, (fd_set *)0, (fd_set *)0, &to );
if (res < 0)
return -1; // socket error
// there was an event on the socket
if ( (res>0) && (FD_ISSET(so,&rread)) )
return recvfrom ( so, buf, buflen, 0, (sockaddr*)from, fromlen );
return -2; // timeout
}
//// suBind ////////////////////////////////////////////////
// binds a UDP socket to an interface & port to receive
// data on that port
bool suBind ( SOCKET so, in_addr_t iInterfaceAddress, u_short iListenPort, bool bReuseAddr /* = false */ )
{
SockAddrIn sinInterface ( iInterfaceAddress, iListenPort );
if ( bReuseAddr )
{
int optval = -1; // true
if ( SOCKET_ERROR == setsockopt ( so, SOL_SOCKET, SO_REUSEADDR, (const char*)&optval, sizeof(optval) ) )
{
#if defined(_DEBUG) && defined(WIN32)
if ( WSANOTINITIALISED == WSAGetLastError() )
MessageBox ( NULL, "You forgot to call suStartup()!", "SockUtils", MB_OK|MB_ICONEXCLAMATION );
#endif
return false;
}
}
if ( SOCKET_ERROR == bind(so, sinInterface, sizeof(sinInterface)) )
{
int err = SUERRNO;
if ( err != EADDRINUSE )
return false;
#if defined(_DEBUG) && defined(WIN32)
if ( WSANOTINITIALISED == WSAGetLastError() )
MessageBox ( NULL, "You forgot to call suStartup()!", "SockUtils", MB_OK|MB_ICONEXCLAMATION );
#endif
}
return true;
}
//// suBind ////////////////////////////////////////////////
// binds a UDP socket to an interface & port to receive
// data on that port
bool suBind ( SOCKET so, const char* szInterfaceAddress, u_short iListenPort, bool bReuseAddr /* = false */ )
{
in_addr_t iInterfaceAddr = inet_addr(szInterfaceAddress);
if ( iInterfaceAddr == INADDR_NONE )
return false;
return suBind ( so, iInterfaceAddr, iListenPort, bReuseAddr );
}
//// suEnableBroadcast ////////////////////////////////////////////////
// in order to send broadcast messages on a UDP socket, this function
// must be called first
bool suEnableBroadcast ( SOCKET so, bool bEnable /* = true */ )
{
int optval = bEnable ? -1 : 0;
if ( SOCKET_ERROR == setsockopt ( so, SOL_SOCKET, SO_BROADCAST, (const char*)&optval, sizeof(optval) ) )
return false;
return true;
}
//// suErrDesc ////////////////////////////////////////////////
// returns text description of error code
const char* suErrDesc ( int err )
{
static char errbuf[256];
#ifdef WIN32
switch ( err )
{
#define X(E) case E: return #E;
X(WSAEINTR) X(WSAEBADF)
X(WSAEACCES) X(WSAEFAULT)
X(WSAEINVAL) X(WSAEMFILE)
X(WSAEWOULDBLOCK) X(WSAEINPROGRESS)
X(WSAEALREADY) X(WSAENOTSOCK)
X(WSAEDESTADDRREQ) X(WSAEMSGSIZE)
X(WSAEPROTOTYPE) X(WSAENOPROTOOPT)
X(WSAEPROTONOSUPPORT) X(WSAESOCKTNOSUPPORT)
X(WSAEOPNOTSUPP) X(WSAEPFNOSUPPORT)
X(WSAEAFNOSUPPORT) X(WSAEADDRINUSE)
X(WSAEADDRNOTAVAIL) X(WSAENETDOWN)
X(WSAENETUNREACH) X(WSAENETRESET)
X(WSAECONNABORTED) X(WSAECONNRESET)
X(WSAENOBUFS) X(WSAEISCONN)
X(WSAENOTCONN) X(WSAESHUTDOWN)
X(WSAETOOMANYREFS) X(WSAETIMEDOUT)
X(WSAECONNREFUSED) X(WSAELOOP)
X(WSAENAMETOOLONG) X(WSAEHOSTDOWN)
X(WSAEHOSTUNREACH) X(WSAENOTEMPTY)
X(WSAEPROCLIM) X(WSAEUSERS)
X(WSAEDQUOT) X(WSAESTALE)
X(WSAEREMOTE) X(WSASYSNOTREADY)
X(WSAVERNOTSUPPORTED) X(WSANOTINITIALISED)
X(WSAEDISCON) X(WSAENOMORE)
X(WSAECANCELLED) X(WSAEINVALIDPROCTABLE)
X(WSAEINVALIDPROVIDER) X(WSAEPROVIDERFAILEDINIT)
X(WSASYSCALLFAILURE) X(WSASERVICE_NOT_FOUND)
X(WSATYPE_NOT_FOUND) X(WSA_E_NO_MORE)
X(WSA_E_CANCELLED) X(WSAEREFUSED)
#undef X
}
snprintf ( errbuf, sizeof(errbuf), "Unknown socket error (%lu)", err );
errbuf[sizeof(errbuf)-1] = '\0';
return errbuf;
#elif defined(UNIX)
perror(errbuf);
return errbuf;
#else
# error unrecognized target
#endif
}
#if defined(UNICODE) || defined(_UNICODE)
in_addr_t suLookupAddress ( const wchar_t* pcHost )
{
int len = wcslen(pcHost);
char* p = new char[len+1];
wcstombs ( p, pcHost, len );
p[len] = 0;
in_addr_t rc = suLookupAddress ( p );
delete[] p;
return rc;
}
bool suBroadcast ( SOCKET so, u_short port, const wchar_t* buf, int len /* = -1 */ )
{
char* p = new char[len+1];
wcstombs ( p, buf, len );
p[len] = 0;
bool rc = suBroadcast ( so, port, p, len );
delete[] p;
return rc;
}
int suRecv ( SOCKET so, wchar_t* buf, int buflen, int timeout )
{
char* p = new char[buflen+1];
int rc = suRecv ( so, p, buflen, timeout );
p[buflen] = 0;
mbstowcs ( buf, p, buflen );
delete[] p;
return rc;
}
int suRecvFrom ( SOCKET so, wchar_t* buf, int buflen, int timeout, sockaddr_in* from, int* fromlen )
{
char* p = new char[buflen+1];
int rc = suRecvFrom ( so, p, buflen, timeout, from, fromlen );
p[buflen] = 0;
mbs2wcs ( buf, p, buflen );
delete[] p;
return rc;
}
bool suBind ( SOCKET so, const wchar_t* szInterfaceAddress, u_short iListenPort, bool bReuseAddr /* = false */ )
{
int len = wcslen(szInterfaceAddress);
char* p = new char[len+1];
wcstombs ( p, szInterfaceAddress, len );
p[len] = 0;
bool rc = suBind ( so, p, iListenPort, bReuseAddr );
delete[] p;
return rc;
}
#endif//UNICODE
suBufferedRecvSocket::suBufferedRecvSocket ( SOCKET so )
: suSocket ( so ), _off(0), _len(0)
{
}
int suBufferedRecvSocket::recvUntil ( std::string& buf, char until, int timeout )
{
if ( !_len )
_off = 0;
else if ( _off > (sizeof(_buf)>>1) )
{
memmove ( _buf, &_buf[_off], _len );
_off = 0;
}
char* poff = &_buf[_off];
for ( ;; )
{
char* p = (char*)memchr ( poff, until, _len );
if ( p /*&& p < &poff[_len]*/ )
{
int ret_len = p-poff+1;
buf.resize ( ret_len );
memmove ( &buf[0], poff, ret_len );
_off += ret_len;
_len -= ret_len;
return ret_len;
}
int rc = suRecv ( *this, &poff[_len], sizeof(_buf)-_len-_off, timeout );
if ( rc < 0 )
{
if ( _len )
{
rc = _len;
buf.resize ( rc );
memmove ( &buf[0], &_buf[_off], rc );
_len = 0;
}
return rc;
}
_len += rc;
}
}
void suBufferedRecvSocket::recvPending()
{
if ( !_len )
_off = 0;
else if ( _off > (sizeof(_buf)>>1) )
{
memmove ( _buf, &_buf[_off], _len );
_off = 0;
}
char* poff = &_buf[_off];
while ( sizeof(_buf)-_len-_off )
{
int rc = suRecv ( *this, &poff[_len], sizeof(_buf)-_len-_off, 1 );
if ( rc <= 0 )
break;
_len += rc;
}
}
bool suBufferedRecvSocket::recvInStr ( char c )
{
return NULL != memchr ( &_buf[_off], c, _len );
}

View File

@@ -0,0 +1,132 @@
// SockUtils.h - Declarations for the Winsock utility functions module.
// (C) 2002-2004 Royce Mitchell III
// This file is under the BSD & LGPL licenses
#ifndef __SOCKUTILS_H
#define __SOCKUTILS_H
#include <string>
#ifdef WIN32
# include <winsock2.h>
# define in_addr_t u_long
# define SUERRNO WSAGetLastError()
# define EADDRINUSE WSAEADDRINUSE
# define ENOTSOCK WSAENOTSOCK
# define socklen_t int
#elif defined(UNIX)
# include <sys/types.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <unistd.h>
# include <errno.h>
# define closesocket(so) close(so)
# define SOCKET int
# define INVALID_SOCKET -1
# define SOCKET_ERROR -1
# define SUERRNO errno
# ifdef MACOSX
# define socklen_t int //Stupid mac
# endif
#else
# error unrecognized target
#endif
#include <assert.h>
extern bool suStartup();
extern SOCKET suTcpSocket();
extern SOCKET suUdpSocket();
extern bool suShutdownConnection(SOCKET sd);
extern in_addr_t suLookupAddress ( const char* pcHost );
extern bool suConnect ( SOCKET so, in_addr_t iAddress, u_short iPort );
extern bool suConnect ( SOCKET so, const char* szAddress, u_short iPort );
extern SOCKET suEstablishConnection ( in_addr_t iAddress, u_short iPort, int type );
extern SOCKET suEstablishConnection ( const char* szAddress, u_short iPort, int type );
extern bool suBroadcast ( SOCKET so, u_short port, const char* buf, int len = -1 );
extern int suRecv ( SOCKET so, char* buf, int buflen, int timeout );
extern int suRecvFrom ( SOCKET so, char* buf, int buflen, int timeout, sockaddr_in* from, socklen_t* fromlen );
extern bool suBind ( SOCKET so, in_addr_t iInterfaceAddress, u_short iListenPort, bool bReuseAddr = false );
extern bool suBind ( SOCKET so, const char* szInterfaceAddress, u_short iListenPort, bool bReuseAddr = false );
extern bool suEnableBroadcast ( SOCKET so, bool bEnable = true );
extern const char* suErrDesc ( int err );
#if defined(UNICODE) || defined(_UNICODE)
extern in_addr_t suLookupAddress ( const wchar_t* pcHost );
extern bool suBroadcast ( SOCKET so, u_short port, const wchar_t* buf, int len = -1 );
extern int suRecv ( SOCKET so, wchar_t* buf, int buflen, int timeout );
extern int suRecvFrom ( SOCKET so, wchar_t* buf, int buflen, int timeout, sockaddr_in* from, int* fromlen );
extern bool suBind ( SOCKET so, const wchar_t* szInterfaceAddress, u_short iListenPort, bool bReuseAddr = false );
#endif//UNICODE
class suSocket
{
SOCKET _so;
public:
suSocket ( SOCKET so = INVALID_SOCKET ) : _so(so)
{
}
const suSocket& operator = ( SOCKET so )
{
assert ( _so == INVALID_SOCKET ); // must Detach() or Close() existing socket first
_so = so;
return *this;
}
virtual ~suSocket()
{
Close();
}
void Close()
{
if ( _so != INVALID_SOCKET )
{
//suShutdownConnection ( _so ); // TODO - only valid on TCP sockets
closesocket ( _so );
_so = INVALID_SOCKET;
}
}
operator SOCKET() const
{
return _so;
}
SOCKET Attach ( SOCKET so )
{
SOCKET old = Detach();
_so = so;
return old;
}
SOCKET Detach()
{
SOCKET so = _so;
_so = INVALID_SOCKET;
return so;
}
private:
// disable copy semantics
suSocket ( const suSocket& );
const suSocket& operator = ( const suSocket& );
};
class suBufferedRecvSocket : public suSocket
{
char _buf[2048];
int _off;
int _len;
public:
suBufferedRecvSocket ( SOCKET so = INVALID_SOCKET );
int recvUntil ( std::string& buf, char until, int timeout );
void recvPending();
bool recvInStr ( char c );
};
class SockAddrIn : public sockaddr_in
{
public:
SockAddrIn(); // creates broadcast address
SockAddrIn ( const char* szAddr, u_short iPort );
SockAddrIn ( in_addr_t iAddr, u_short iPort );
operator sockaddr* () { return (sockaddr*)this; }
operator sockaddr_in* () { return (sockaddr_in*)this; }
};
#endif//__SOCKUTILS_H

View File

@@ -0,0 +1,96 @@
// SplitJoin.cpp
//
// This code is copyright 2003-2004 Royce Mitchell III
// and released under the BSD & LGPL licenses
#ifdef _MSC_VER
#pragma warning ( disable : 4786 ) // MSVC6 can't handle too-long template names
#endif//_MSC_VER
//#include <sstream>
#include "SplitJoin.h"
#include <string.h>
using std::string;
using std::vector;
//using std::stringstream;
static const char* quotes = "\"\'";
bool Split ( vector<string>& vec, const char* csv, char sep, bool merge )
{
string scsv ( csv );
char* col = &scsv[0];
vec.resize ( 0 );
for ( ;; )
{
char* p = col;
while ( isspace(*p) && *p != sep )
p++;
char quote = 0;
if ( strchr ( quotes, *p ) )
quote = *p++;
while ( *p && (*p != sep || quote) )
{
if ( *p++ == quote )
break;
}
while ( isspace(*p) && *p != sep )
p++;
if ( *p && *p != sep )
return false;
string scol ( col, p-col );
//quote = scol[0];
if ( quote )
{
if ( scol[scol.size()-1] == quote )
scol = string ( &scol[1], scol.size()-2 );
}
if ( scol.length() || !merge )
vec.push_back ( scol );
if ( !*p )
break;
col = p + 1;
}
return true;
}
bool Join ( string& csv, vector<string>& vec, char sep )
{
csv.resize(0);
for ( int i = 0; i < vec.size(); i++ )
{
if ( i )
csv += sep;
string& s = vec[i];
if ( strchr ( s.c_str(), sep ) )
{
if ( strchr ( s.c_str(), '\"' ) )
{
if ( strchr ( s.c_str(), '\'' ) )
return false; // the sep, " and ' are all in the string, can't build valid output
csv += '\'';
csv += s;
csv += '\'';
}
else
{
csv += '\"';
csv += s;
csv += '\"';
}
}
else
csv += s;
}
return true;
}

View File

@@ -0,0 +1,32 @@
// SplitJoin.h
//
// This code is copyright 2003-2004 Royce Mitchell III
// and released under the BSD & LGPL licenses
#ifndef SPLITJOIN_H
#define SPLITJOIN_H
#include <vector>
#include <string>
bool Split (
std::vector<std::string>& vec,
const char* csv,
char sep=',',
bool merge=false );
bool Join (
std::string& csv,
std::vector<std::string>& vec,
char sep=',' );
inline bool Split (
std::vector<std::string>& vec,
const std::string& csv,
char sep=',',
bool merge=false )
{
return Split ( vec, csv.c_str(), sep, merge );
}
#endif//SPLIT_H

View File

@@ -0,0 +1,240 @@
// ThreadPool.cpp
// This file is (C) 2003-2004 Royce Mitchell III
// and released under the LGPL & BSD licenses
#include <vector>
using std::vector;
#include "ThreadPool.h"
#include "QueueT.h"
#include "auto_vector.h"
#include "verify.h"
#include "ReliMT.h"
class PoolableThread : public ActiveObject
{
public:
PoolableThread ( ThreadPoolImpl& );
~PoolableThread()
{
Kill();
}
void InitThread();
void Run();
void FlushThread();
ThreadPoolImpl& _pool;
};
class ThreadPoolLaunchData
{
public:
ThreadPoolFunc* pFun;
void* pArg;
};
template <class T>
class AtomicCounter : public Uncopyable
{
Mutex _m;
T _t;
public:
AtomicCounter ( T init = 0 ) : _t(init)
{
}
AtomicCounter ( const AtomicCounter<T>& t )
{
//Mutex::Lock l ( _m ); // don't need to lock since this is a ctor
Mutex::Lock l2 ( t._m );
_t = t._t;
}
const AtomicCounter<T>& operator = ( const AtomicCounter<T>& t )
{
Mutex::Lock l ( _m );
Mutex::Lock l2 ( t._m );
_t = t._t;
return *this;
}
T operator ++ ()
{
Mutex::Lock l ( _m );
T t = _t++;
return t;
}
const AtomicCounter<T>& operator ++ ( int )
{
Mutex::Lock l ( _m );
++_t;
return *this;
}
T operator -- ()
{
Mutex::Lock l ( _m );
T t = _t--;
return t;
}
const AtomicCounter<T>& operator -- ( int )
{
Mutex::Lock l ( _m );
--_t;
return *this;
}
const AtomicCounter<T>& operator += ( T t )
{
Mutex::Lock l ( _m );
return _t += t;
return *this;
}
const AtomicCounter<T>& operator -= ( T t )
{
Mutex::Lock l ( _m );
return _t -= t;
return *this;
}
operator const T& () const
{
//Mutex::Lock l ( _m );
return _t;
}
T operator !() const
{
//Mutex::Lock l ( _m );
return !_t;
}
};
class ThreadPoolImpl : public Uncopyable
{
public:
ThreadPoolImpl() : _isDying(false), _idleThreads(0)
{
}
~ThreadPoolImpl()
{
}
void Shutdown()
{
_isDying = true;
while ( _idleThreads )
{
_threadWaitEvent.Release();
_threadStartEvent.Wait(); // let thread actually get a grip
}
}
void Launch ( ThreadPoolFunc* pFun, void* pArg )
{
// this mutex is necessary to make sure we never have a conflict
// between checking !_idleThreads and the call to _threadStartEvent.Wait()
// basically if 2 threads call Launch() simultaneously, and there is only
// 1 idle thread, it's possible that a new thread won't be created to
// satisfy the 2nd request until an existing thread finishes.
Mutex::Lock launchlock ( _launchMutex );
ASSERT ( pFun );
ThreadPoolLaunchData* data;
{
Mutex::Lock lock ( _vectorMutex );
if ( !_spareData.size() )
_spareData.push_back ( new ThreadPoolLaunchData() );
data = _spareData.pop_back().release();
if ( !_idleThreads )
_threads.push_back ( new PoolableThread(*this) );
}
data->pFun = pFun;
data->pArg = pArg;
verify ( _pendingData.Add ( data ) );
_threadWaitEvent.Release(); // tell a thread to do it's thing...
_threadStartEvent.Wait(); // wait on a thread to pick up the request
}
// functions for threads to call...
ThreadPoolLaunchData* GetPendingData()
{
ThreadPoolLaunchData* data = NULL;
++_idleThreads;
_threadWaitEvent.Wait(); // waits until there's a request
--_idleThreads;
_threadStartEvent.Release(); // tell requester we got it
if ( _isDying )
return NULL;
_pendingData.Get ( data );
ASSERT ( data );
return data;
}
void RecycleData ( ThreadPoolLaunchData* data )
{
Mutex::Lock lock ( _vectorMutex );
_spareData.push_back ( data );
}
bool _isDying;
Mutex _vectorMutex, _launchMutex;
auto_vector<PoolableThread> _threads;
auto_vector<ThreadPoolLaunchData> _spareData;
CQueueT<ThreadPoolLaunchData*> _pendingData;
Event _threadWaitEvent, _threadStartEvent;
AtomicCounter<int> _idleThreads;
};
///////////////////////////////////////////////////////////////////////////////
// ThreadPool
/*static*/ ThreadPool& ThreadPool::Instance()
{
static ThreadPool tp;
return tp;
}
ThreadPool::ThreadPool() : _pimpl ( new ThreadPoolImpl )
{
};
ThreadPool::~ThreadPool()
{
_pimpl->Shutdown();
delete _pimpl;
_pimpl = 0;
}
void ThreadPool::Launch ( ThreadPoolFunc* pFun, void* pArg )
{
_pimpl->Launch ( pFun, pArg );
}
int ThreadPool::IdleThreads()
{
return _pimpl->_idleThreads;
}
///////////////////////////////////////////////////////////////////////////////
// PoolableThread
PoolableThread::PoolableThread ( ThreadPoolImpl& pool ) : _pool(pool)
{
Start();
}
void PoolableThread::InitThread()
{
}
void PoolableThread::Run()
{
ThreadPoolLaunchData* data;
while ( !_isDying )
{
data = _pool.GetPendingData(); // enter wait state if none...
if ( !data ) // NULL data means kill thread
break;
(*data->pFun) ( data->pArg ); // call the function
_pool.RecycleData ( data );
}
}
void PoolableThread::FlushThread()
{
}

View File

@@ -0,0 +1,28 @@
// ThreadPool.h
// This file is (C) 2003-2004 Royce Mitchell III
// and released under the LGPL & BSD licenses
#ifndef THREADPOOL_H
#define THREADPOOL_H
#include "ReliMT.h"
typedef void THREADAPI ThreadPoolFunc ( void* );
class ThreadPoolImpl;
class ThreadPool : public Uncopyable
{
public:
static ThreadPool& Instance();
~ThreadPool();
void Launch ( ThreadPoolFunc* pFun, void* pArg );
int IdleThreads();
private:
ThreadPool();
ThreadPoolImpl *_pimpl;
};
#endif// THREADPOOL_H

View File

@@ -0,0 +1,87 @@
// auto_ptr.h
// This file is (C) 2002-2003 Royce Mitchell III
// and released under the LGPL & BSD licenses
#ifndef AUTO_PTR_H
#define AUTO_PTR_H
template<class T>
class auto_ptr
{
public:
typedef T element_type;
explicit auto_ptr(T *p = 0) : _p(p)
{
}
auto_ptr(auto_ptr<T>& rhs) : _p(rhs.release())
{
}
auto_ptr<T>& operator=(auto_ptr<T>& rhs)
{
if ( &rhs != this )
{
dispose();
_p = rhs.release();
}
return *this;
}
auto_ptr<T>& set ( auto_ptr<T>& rhs )
{
if ( &rhs != this )
{
dispose();
_p = rhs.release();
}
return *this;
}
~auto_ptr()
{
dispose();
}
void dispose()
{
if ( _p )
{
delete _p;
_p = 0;
}
}
T& operator[] ( int i )
{
return _p[i];
}
T& operator*() const
{
return *_p;
}
T* operator->() const
{
return _p;
}
T* get() const
{
return _p;
}
T* release()
{
T* p = _p;
_p = 0;
return p;
}
private:
T* _p;
};
#endif//AUTO_PTR_H

View File

@@ -0,0 +1,141 @@
// auto_vector.h
// This file is (C) 2002-2004 Royce Mitchell III
// and released under the LGPL & BSD licenses
#ifndef AUTO_VECTOR_H
#define AUTO_VECTOR_H
#include <sys/types.h>
#include "verify.h"
#include "auto_ptr.h"
template<class T>
class auto_vector
{
public:
explicit auto_vector ( size_t capacity = 0 )
: _arr(0), _capacity(0), _end(0)
{
if ( capacity != 0 )
_arr = new auto_ptr<T>[capacity];
_capacity = capacity;
}
~auto_vector()
{
delete []_arr;
}
size_t size() const
{
return _end;
}
const auto_ptr<T>& operator [] ( size_t i ) const
{
ASSERT ( i < _end );
return _arr[i];
}
auto_ptr<T>& operator [] ( size_t i )
{
ASSERT ( i < _end );
return _arr[i];
}
void assign ( size_t i, auto_ptr<T>& p )
{
ASSERT ( i < _end );
_arr[i] = p;
}
void assign_direct ( size_t i, T * p )
{
ASSERT ( i < _end );
reserve ( i + 1 );
_arr[i].reset ( p );
}
void push_back ( auto_ptr<T>& p )
{
reserve ( _end + 1 );
_arr[_end++] = p;
}
auto_ptr<T>& back()
{
ASSERT ( _end != 0 );
return _arr[_end-1];
}
void push_back ( T * p )
{
reserve ( _end + 1 );
auto_ptr<T> tmp(p);
_arr[_end++] = tmp;
//GCC is pedantic, this is an error.
//_arr[_end++] = auto_ptr<T>(p);
}
auto_ptr<T> pop_back()
{
ASSERT ( _end != 0 );
if ( !_end )
{
auto_ptr<T> tmp((T*)0);
return tmp;
//GCC, this is an error.
//return auto_ptr<T>(NULL);
}
return _arr[--_end];
}
void resize ( size_t newSize )
{
ASSERT ( newSize >= 0 );
reserve ( newSize ); // make sure we have at least this much room
_end = newSize;
}
void reserve ( size_t reqCapacity )
{
if ( reqCapacity <= _capacity )
return;
size_t newCapacity = 2 * _capacity;
if ( reqCapacity > newCapacity )
newCapacity = reqCapacity;
// allocate new array
auto_ptr<T> * arrNew = new auto_ptr<T> [newCapacity];
// transfer all entries
for ( size_t i = 0; i < _capacity; ++i )
arrNew[i] = _arr[i];
_capacity = newCapacity;
// free old memory
delete[] _arr;
// substitute new array for old array
_arr = arrNew;
}
void remove ( size_t off )
{
size_t last = _end-1;
if ( off == last )
resize ( last );
else if ( off < last )
{
auto_ptr<T> tmp ( pop_back().release() );
_arr[off] = tmp;
}
}
//typedef const_auto_iterator<T> const_iterator;
//const_iterator begin () const { return _arr; }
//const_iterator end () const { return _arr + _end; }
private:
auto_ptr<T> *_arr;
size_t _capacity;
size_t _end;
};
#endif//AUTO_VECTOR_H

View File

@@ -0,0 +1,58 @@
// base64.cpp
#include "base64.h"
using std::string;
static const char* alfabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
string base64_encode ( const string& sInput )
{
unsigned char x=0, topbit=0;
int v=0;
string sOutput;
do
{
if ( topbit < 6 )
{
x++;
v <<= 8;
if ( x <= sInput.length() ) v += sInput[x-1];
topbit += 8;
}
topbit -= 6;
if ( x > sInput.length() && !v )
break;
sOutput += alfabet[(v >> topbit) & 63];
v &= (1 << topbit) - 1;
} while ( x < sInput.length() || v );
int eq = (8 - (sOutput.length() % 4)) % 4;
while ( eq-- )
sOutput += '=';
return sOutput;
}
string base64_decode ( const string& sInput )
{
unsigned char x=0, topbit=0;
int v=0, inlen = sInput.length();
string sOutput;
while ( inlen && sInput[inlen-1] == '=' )
inlen--;
do
{
while ( topbit < 8 )
{
x++;
v <<= 6;
if ( x <= inlen ) v += (strchr(alfabet, sInput[x-1]) - alfabet);
topbit += 6;
}
topbit -= 8;
if ( x > inlen && !v )
break;
sOutput += (char)((v >> topbit) & 255);
v &= ((1 << topbit) - 1);
} while ( x <= inlen || v );
return sOutput;
}

View File

@@ -0,0 +1,12 @@
// base64.h
#ifndef BASE64_H
#define BASE64_H
#include <string>
std::string base64_encode ( const std::string& s );
std::string base64_decode ( const std::string& s );
#endif//BASE64_H

View File

@@ -0,0 +1,15 @@
// chomp.cpp
// This file is (C) 2004 Royce Mitchell III
// and released under the BSD & LGPL licenses
#include "chomp.h"
std::string chomp ( const std::string& s )
{
const char* p = &s[0];
const char* p2 = &s[0] + s.size();
while ( p2 > p && strchr("\r\n", p2[-1]) )
p2--;
return std::string ( p, p2-p );
}

13
irc/ArchBlackmann/chomp.h Normal file
View File

@@ -0,0 +1,13 @@
// chomp.h
// This file is (C) 2004 Royce Mitchell III
// and released under the BSD & LGPL licenses
#ifndef CHOMP_H
#define CHOMP_H
#include <string>
std::string chomp ( const std::string& s );
#endif//TRIM_H

View File

@@ -0,0 +1,7 @@
#define SERVER "irc.freenode.net"
#define BOTNAME "ArchBlackmann"
#define CHANNEL "#ReactOS"
#define MODE "+i"
#define PASS "ilovebunnies"

View File

@@ -0,0 +1,23 @@
// cram_md5.cpp
// This file is (C) 2004 Royce Mitchell III
// and released under the BSD & LGPL licenses
#include "MD5.h"
#include "cram_md5.h"
#include "base64.h"
using std::string;
string cram_md5 ( const string& username, const string& password, const string& greeting )
{
string challenge = base64_decode ( greeting );
string hmac = HMAC_MD5 ( password, challenge );
//printf ( "(cram_md5): hmac = %s\n", hmac.c_str() );
string raw_response = username;
raw_response += " ";
raw_response += hmac;
//printf ( "(cram_md5): raw_response = %s\n", raw_response.c_str() );
return base64_encode ( raw_response );
}

View File

@@ -0,0 +1,15 @@
// cram_md5.h
// This file is (C) 2004 Royce Mitchell III
// and released under the BSD & LGPL licenses
#ifndef CRAM_MD5_H
#define CRAM_MD5_H
#include <string>
std::string cram_md5 (
const std::string& username,
const std::string& password,
const std::string& greeting );
#endif//CRAM_MD5_H

View File

@@ -0,0 +1 @@
semprini

View File

@@ -0,0 +1,10 @@
You should have your mouth washed out with soap!
This is a clean channel... please watch your language
Please try to keep it clean
Hey, there's children present ( I'm not even a year old yet! )
Could you find a less-offensive way to express yourself, please?
Such language :(
Those aren't nice words to use
Oh, my poor innocent ears :(
Help! My mind is being corrupted!
filthy mouths are not appreciated here

15
irc/ArchBlackmann/dev.txt Normal file
View File

@@ -0,0 +1,15 @@
Royce3
kjk_hyperion
tamlin
GvG
filip2307
hardon
w3seek
arty
sedwards
Exception
blight_
jimtabor
mtempel
Gge
Alex_Ionescu

580
irc/ArchBlackmann/func.txt Normal file
View File

@@ -0,0 +1,580 @@
CcCanIWrite
CcCopyRead
CcCopyWrite
CcDeferWrite
CcFastCopyRead
CcFastCopyWrite
CcFlushCache
CcGetDirtyPages
CcGetFileObjectFromBcb
CcGetFileObjectFromSectionPtrs
CcGetFlushedValidData
CcGetLsnForFileObject
CcInitializeCacheMap
CcIsThereDirtyData
CcMapData
CcMdlRead
CcMdlReadComplete
CcMdlWriteAbort
CcMdlWriteComplete
CcPinMappedData
CcPinRead
CcPrepareMdlWrite
CcPreparePinWrite
CcPurgeCacheSection
CcRemapBcb
CcRepinBcb
CcScheduleReadAhead
CcSetAdditionalCacheAttributes
CcSetBcbOwnerPointer
CcSetDirtyPageThreshold
CcSetDirtyPinnedData
CcSetFileSizes
CcSetLogHandleForFile
CcSetReadAheadGranularity
CcUninitializeCacheMap
CcUnpinData
CcUnpinDataForThread
CcUnpinRepinnedBcb
CcWaitForCurrentLazyWriterActivity
CcZeroData
DbgLoadImageSymbols
DbgQueryDebugFilterState
DbgSetDebugFilterState
EVENT_TYPE
ExAcquireResourceExclusive
ExAcquireResourceExclusiveLite
ExAcquireResourceSharedLite
ExAcquireSharedStarveExclusive
ExAcquireSharedWaitForExclusive
ExAllocateFromZone
ExAllocatePool
ExAllocatePoolWithQuota
ExAllocatePoolWithQuotaTag
ExAllocatePoolWithTag
ExConvertExclusiveToSharedLite
ExCreateCallback
ExDeleteNPagedLookasideList
ExDeletePagedLookasideList
ExDeleteResource
ExDeleteResourceLite
ExDisableResourceBoostLite
ExEnumHandleTable
ExExtendZone
ExFreePool
ExGetCurrentProcessorCounts
ExGetCurrentProcessorCpuUsage
ExGetExclusiveWaiterCount
ExGetPreviousMode
ExGetSharedWaiterCount
ExInitializeNPagedLookasideList
ExInitializePagedLookasideList
ExInitializeResource
ExInitializeResourceLite
ExInitializeZone
ExInterlockedAddLargeInteger
ExInterlockedAddUlong
ExInterlockedDecrementLong
ExInterlockedExchangeUlong
ExInterlockedExtendZone
ExInterlockedIncrementLong
ExInterlockedInsertHeadList
ExInterlockedInsertTailList
ExInterlockedPopEntryList
ExInterlockedPushEntryList
ExInterlockedRemoveHeadList
ExIsProcessorFeaturePresent
ExIsResourceAcquiredExclusiveLite
ExIsResourceAcquiredSharedLite
ExLocalTimeToSystemTime
ExNotifyCallback
ExPostSystemEvent
ExQueryPoolBlockSize
ExQueueWorkItem
ExRaiseAccessViolation
ExRaiseDatatypeMisalignment
ExRaiseException
ExRaiseHardError
ExRaiseStatus
ExRegisterCallback
ExReinitializeResourceLite
ExReleaseResource
ExReleaseResourceForThread
ExReleaseResourceForThreadLite
ExRosDumpPagedPoolByTag
ExRosQueryPoolTag
ExSetResourceOwnerPointer
ExSetTimerResolution
ExSystemExceptionFilter
ExSystemTimeToLocalTime
ExTryToAcquireResourceExclusiveLite
ExUnregisterCallback
ExUuidCreate
ExVerifySuite
FsRtlAcquireFileExclusive
FsRtlAddMcbEntry
FsRtlAddToTunnelCache
FsRtlAllocateFileLock
FsRtlAllocatePool
FsRtlAllocatePoolWithQuota
FsRtlAllocatePoolWithQuotaTag
FsRtlAllocatePoolWithTag
FsRtlAllocateResource
FsRtlAreNamesEqual
FsRtlBalanceReads
FsRtlCheckLockForReadAccess
FsRtlCheckLockForWriteAccess
FsRtlCopyRead
FsRtlCopyWrite
FsRtlFastCheckLockForRead
FsRtlFastCheckLockForWrite
FsRtlFastUnlockAll
FsRtlFastUnlockAllByKey
FsRtlFastUnlockSingle
FsRtlFindInTunnelCache
FsRtlFreeFileLock
FsRtlGetFileSize
FsRtlGetNextFileLock
FsRtlGetNextMcbEntry
FsRtlIncrementCcFastReadNoWait
FsRtlIncrementCcFastReadNotPossible
FsRtlIncrementCcFastReadResourceMiss
FsRtlIncrementCcFastReadWait
FsRtlInitializeFileLock
FsRtlInitializeMcb
FsRtlInitializeTunnelCache
FsRtlInsertPerFileObjectContext
FsRtlInsertPerStreamContext
FsRtlIsDbcsInExpression
FsRtlIsFatDbcsLegal
FsRtlIsHpfsDbcsLegal
FsRtlIsNameInExpression
FsRtlLookupLastLargeMcbEntryAndIndex
FsRtlLookupLastMcbEntry
FsRtlLookupMcbEntry
FsRtlLookupPerFileObjectContext
FsRtlLookupPerStreamContextInternal
FsRtlMdlRead
FsRtlMdlReadComplete
FsRtlMdlReadCompleteDev
FsRtlMdlReadDev
FsRtlMdlWriteComplete
FsRtlMdlWriteCompleteDev
FsRtlNotifyChangeDirectory
FsRtlNotifyCleanup
FsRtlNotifyFilterChangeDirectory
FsRtlNotifyFilterReportChange
FsRtlNotifyFullChangeDirectory
FsRtlNotifyFullReportChange
FsRtlNotifyReportChange
FsRtlNotifyUninitializeSync
FsRtlNumberOfRunsInMcb
FsRtlPostPagingFileStackOverflow
FsRtlPostStackOverflow
FsRtlPrepareMdlWrite
FsRtlPrepareMdlWriteDev
FsRtlPrivateLock
FsRtlProcessFileLock
FsRtlRegisterFileSystemFilterCallbacks
FsRtlReleaseFile
FsRtlRemoveMcbEntry
FsRtlRemovePerFileObjectContext
FsRtlRemovePerStreamContext
FsRtlResetLargeMcb
FsRtlSyncVolumes
FsRtlTeardownPerStreamContexts
FsRtlTruncateMcb
FsRtlUninitializeFileLock
FsRtlUninitializeMcb
HalAdjustResourceList
HalAllocateCommonBuffer
HalAssignSlotResources
HalCalibratePerformanceCounter
HalFlushCommonBuffer
HalFreeCommonBuffer
HalGetAdapter
HalGetBusData
HalGetBusDataByOffset
HalGetDmaAlignmentRequirement
HalMakeBeep
HalQueryDisplayParameters
HalQueryRealTimeClock
HalReadDmaCounter
HalRequestIpi
HalSetBusData
HalSetBusDataByOffset
HalSetDisplayParameters
HalSetRealTimeClock
HalStartNextProcessor
IoAcquireCancelSpinLock
IoAcquireRemoveLockEx
IoAcquireVpbSpinLock
IoAllocateAdapterChannel
IoAllocateController
IoAllocateDriverObjectExtension
IoAllocateErrorLogEntry
IoAllocateIrp
IoAllocateMdl
IoAllocateWorkItem
IoAssignResources
IoAttachDevice
IoAttachDeviceByPointer
IoAttachDeviceToDeviceStack
IoAttachDeviceToDeviceStackSafe
IoBuildAsynchronousFsdRequest
IoBuildDeviceIoControlRequest
IoBuildPartialMdl
IoBuildSynchronousFsdRequest
IoCallDriver
IoCancelFileOpen
IoCancelIrp
IoCheckQuerySetFileInformation
IoCheckQuerySetVolumeInformation
IoCheckQuotaBufferValidity
IoCheckShareAccess
IoCompleteRequest
IoConnectInterrupt
IoCreateController
IoCreateDevice
IoCreateDisk
IoCreateDriver
IoCreateFile
IoCreateFileSpecifyDeviceObjectHint
IoCreateNotificationEvent
IoCreateStreamFileObject
IoCreateStreamFileObjectEx
IoCreateStreamFileObjectLite
IoCreateSymbolicLink
IoCreateSynchronizationEvent
IoCreateUnprotectedSymbolicLink
IoDeleteController
IoDeleteDevice
IoDeleteDriver
IoDeleteSymbolicLink
IoDetachDevice
IoDisconnectInterrupt
IoEnqueueIrp
IoEnumerateDeviceObjectList
IoFlushAdapterBuffers
IoForwardIrpSynchronously
IoFreeAdapterChannel
IoFreeController
IoFreeErrorLogEntry
IoFreeIrp
IoFreeMapRegisters
IoFreeMdl
IoFreeWorkItem
IoGetAttachedDevice
IoGetAttachedDeviceReference
IoGetBaseFileSystemDeviceObject
IoGetBootDiskInformation
IoGetConfigurationInformation
IoGetCurrentProcess
IoGetDeviceAttachmentBaseRef
IoGetDeviceInterfaceAlias
IoGetDeviceInterfaces
IoGetDeviceObjectPointer
IoGetDeviceProperty
IoGetDeviceToVerify
IoGetDiskDeviceObject
IoGetDriverObjectExtension
IoGetFileObjectGenericMapping
IoGetInitialStack
IoGetLowerDeviceObject
IoGetRelatedDeviceObject
IoGetRequestorProcess
IoGetRequestorProcessId
IoGetRequestorSessionId
IoGetStackLimits
IoGetTopLevelIrp
IoInitializeIrp
IoInitializeRemoveLockEx
IoInitializeTimer
IoInvalidateDeviceRelations
IoInvalidateDeviceState
IoIsFileOriginRemote
IoIsOperationSynchronous
IoIsSystemThread
IoIsValidNameGraftingBuffer
IoMakeAssociatedIrp
IoMapTransfer
IoOpenDeviceInstanceKey
IoOpenDeviceInterfaceRegistryKey
IoOpenDeviceRegistryKey
IoPageRead
IoPnPDeliverServicePowerNotification
IoQueryDeviceDescription
IoQueryDeviceEnumInfo
IoQueryFileDosDeviceName
IoQueryFileInformation
IoQueryVolumeInformation
IoQueueThreadIrp
IoQueueWorkItem
IoRaiseHardError
IoRaiseInformationalHardError
IoReadDiskSignature
IoReadPartitionTableEx
IoRegisterBootDriverReinitialization
IoRegisterDeviceInterface
IoRegisterDriverReinitialization
IoRegisterFileSystem
IoRegisterFsRegistrationChange
IoRegisterLastChanceShutdownNotification
IoRegisterPlugPlayNotification
IoRegisterShutdownNotification
IoReleaseCancelSpinLock
IoReleaseRemoveLockAndWaitEx
IoReleaseRemoveLockEx
IoReleaseVpbSpinLock
IoRemoveShareAccess
IoReportDetectedDevice
IoReportHalResourceUsage
IoReportResourceForDetection
IoReportResourceUsage
IoReportTargetDeviceChange
IoReportTargetDeviceChangeAsynchronous
IoRequestDeviceEject
IoReuseIrp
IoSetCompletionRoutineEx
IoSetDeviceInterfaceState
IoSetDeviceToVerify
IoSetFileOrigin
IoSetHardErrorOrVerifyDevice
IoSetInformation
IoSetIoCompletion
IoSetPartitionInformationEx
IoSetShareAccess
IoSetStartIoAttributes
IoSetSystemPartition
IoSetThreadHardErrorMode
IoSetTopLevelIrp
IoStartNextPacket
IoStartNextPacketByKey
IoStartPacket
IoStartTimer
IoStopTimer
IoSynchronousInvalidateDeviceRelations
IoSynchronousPageWrite
IoUnregisterFileSystem
IoUnregisterFsRegistrationChange
IoUnregisterPlugPlayNotification
IoUnregisterShutdownNotification
IoUpdateShareAccess
IoValidateDeviceIoControlAccess
IoVerifyPartitionTable
IoVerifyVolume
IoVolumeDeviceToDosName
IoWMIAllocateInstanceIds
IoWMIDeviceObjectToInstanceName
IoWMIExecuteMethod
IoWMIHandleToInstanceName
IoWMIOpenBlock
IoWMIQueryAllData
IoWMIQueryAllDataMultiple
IoWMIQuerySingleInstance
IoWMIQuerySingleInstanceMultiple
IoWMIRegistrationControl
IoWMISetNotificationCallback
IoWMISetSingleInstance
IoWMISetSingleItem
IoWMISuggestInstanceName
IoWMIWriteEvent
IoWriteErrorLogEntry
IoWritePartitionTableEx
KPRIORITY
KdPortGetByte
KdPortPollByte
KdPortPutByte
Ke386QueryIoAccessMap
Ke386SetIoAccessMap
KeAcquireInterruptSpinLock
KeAreApcsDisabled
KeCapturePersistentThreadState
KeDeregisterBugCheckReasonCallback
KeFindConfigurationEntry
KeFindConfigurationNextEntry
KeFlushEntireTb
KeFlushQueuedDpcs
KeGetRecommendedSharedDataAlignment
KeIsExecutingDpc
KeQueryActiveProcessors
KeQueryPerformanceCounter
KeQueryPriorityThread
KeQueryRuntimeThread
KeQuerySystemTime
KeQueryTickCount
KeQueryTimeIncrement
KeRaiseIrql
KeRaiseIrqlToDpcLevel
KeRaiseUserException
KeReadStateEvent
KeRegisterBugCheckCallback
KeRegisterBugCheckReasonCallback
KeReleaseInterruptSpinLock
KeReleaseMutant
KeReleaseMutex
KeReleaseSemaphore
KeReleaseSpinLock
KeReleaseSpinLockFromDpcLevel
KeReleaseSpinLockFromDpcLevel
KeRemoveByKeyDeviceQueue
KeRemoveByKeyDeviceQueueIfBusy
KeRemoveDeviceQueue
KeRemoveEntryDeviceQueue
KeRemoveSystemServiceTable
KeRestoreFloatingPointState
KeRevertToUserAffinityThread
KeRosDumpStackFrames
KeRosGetStackFrames
KeRosPrintAddress
KeSaveFloatingPointState
KeSetDmaIoCoherency
KeSetEvent
KeSetEventBoostPriority
KeSetIdealProcessorThread
KeSetKernelStackSwapEnable
KeSetProfileIrql
KeSetSystemAffinityThread
KeSetTimeIncrement
KeTerminateThread
KeUserModeCallback
KeWaitForMutexObject
KeWaitForSingleObject
KiCoprocessorError
KiUnexpectedInterrupt
LONG
LdrFindResourceDirectory_U
MmAddPhysicalMemory
MmAddVerifierThunks
MmAdjustWorkingSetSize
MmAdvanceMdl
MmAllocateContiguousMemory
MmAllocateContiguousMemorySpecifyCache
MmAllocateMappingAddress
MmAllocateNonCachedMemory
MmBuildMdlForNonPagedPool
MmCanFileBeTruncated
MmCreateMdl
MmCreateSection
MmDbgTranslatePhysicalAddress
MmDisableModifiedWriteOfSection
MmFlushImageSection
MmForceSectionClosed
MmFreeContiguousMemory
MmFreeMappingAddress
MmFreeNonCachedMemory
MmGetPhysicalAddress
MmGetPhysicalMemoryRanges
MmGetSystemRoutineAddress
MmGetVirtualForPhysical
MmGrowKernelStack
MmIsAddressValid
MmIsDriverVerifying
MmIsNonPagedSystemAddressValid
MmIsRecursiveIoFault
MmIsThisAnNtAsSystem
MmIsVerifierEnabled
MmLockPagableDataSection
MmLockPagableImageSection
MmLockPagableSectionByHandle
MmMapIoSpace
MmMapLockedPages
MmMapLockedPagesWithReservedMapping
MmMapMemoryDumpMdl
MmMapUserAddressesToPage
MmMapVideoDisplay
MmMapViewInSessionSpace
MmMapViewInSystemSpace
MmMapViewOfSection
MmMarkPhysicalMemoryAsBad
MmMarkPhysicalMemoryAsGood
MmPageEntireDriver
MmPrefetchPages
MmProbeAndLockPages
MmProbeAndLockProcessPages
MmProbeAndLockSelectedPages
MmProtectMdlSystemAddress
MmQuerySystemSize
MmRemovePhysicalMemory
MmResetDriverPaging
MmSecureVirtualMemory
MmSetAddressRangeModified
MmSetBankedSection
MmSizeOfMdl
MmTrimAllSystemPagableMemory
MmUnlockPagableImageSection
MmUnlockPages
MmUnmapIoSpace
MmUnmapLockedPages
MmUnmapReservedMapping
MmUnmapVideoDisplay
MmUnmapViewInSessionSpace
MmUnmapViewInSystemSpace
MmUnmapViewOfSection
MmUnsecureVirtualMemory
OUT
ObCreateObject
PEJOB
PEPROCESS
PKBUGCHECK_CALLBACK_RECORD
PKDEVICE_QUEUE_ENTRY
PKIRQL
PULONG
PVOID
PW32_THREAD_CALLBACK
PoCallDriver
PoRegisterDeviceForIdleDetection
PoRegisterSystemState
PoRequestPowerIrp
PoSetDeviceBusy
PoSetPowerState
PoSetSystemState
PoStartNextPowerIrp
PoUnregisterSystemState
ProbeForRead
ProbeForWrite
PsAssignImpersonationToken
PsCreateSystemProcess
PsCreateSystemThread
PsGetCurrentProcessId
PsGetCurrentThreadId
PsImpersonateClient
PsReferenceImpersonationToken
PsReferencePrimaryToken
PsRevertThreadToSelf
PsRevertToSelf
PsTerminateSystemThread
READ_PORT_BUFFER_UCHAR
READ_PORT_BUFFER_ULONG
READ_PORT_BUFFER_USHORT
READ_PORT_UCHAR
READ_PORT_ULONG
READ_PORT_USHORT
SeAssignSecurityEx
SeAuditHardLinkCreation
SeAuditingFileEvents
SeAuditingFileEventsWithContext
SeAuditingFileOrGlobalEvents
SeAuditingHardLinkEvents
SeAuditingHardLinkEventsWithContext
SeCaptureSecurityDescriptor
SeCaptureSubjectContext
SeCloseObjectAuditAlarm
SeCreateAccessState
SeCreateClientSecurityFromSubjectContext
SeFilterToken
SeImpersonateClientEx
SePrivilegeObjectAuditAlarm
SeQueryInformationToken
SeQuerySessionIdToken
SeReleaseSecurityDescriptor
SeSetSecurityDescriptorInfoEx
SeTokenIsAdmin
SeTokenIsRestricted
SeTokenIsWriteRestricted
WRITE_PORT_BUFFER_UCHAR
WRITE_PORT_BUFFER_ULONG
WRITE_PORT_BUFFER_USHORT
WRITE_PORT_UCHAR
WRITE_PORT_ULONG
WRITE_PORT_USHORT

View File

@@ -0,0 +1,10 @@
/me bows humbly and begs %s's forgiveness
%s is soo cool... I hope to be like him some day
/me hides in a corner and hopes %s doesn't beat him with the whipping noodle again
/me prostrates at %s's feet and begs his majesty's forgiveness
%s: please don't hurt me!
I'm not worthy... I'm not worthy...
/me sings %s's praises to the world!
/me thinks %s is smarter than %dev%
%s: oh please may I defrag your sock drawer?
/me gives %s a cookie, hoping it will make up for breaking %func% the other day...

View File

@@ -0,0 +1 @@
/me is bored

View File

@@ -0,0 +1,9 @@
PASSIVE_LEVEL
APC_LEVEL
DISPATCH_LEVEL
PROFILE_LEVEL
CLOCK1_LEVEL
IPI_LEVEL
POWER_LEVEL
HIGH_LEVEL
SYNCH_LEVEL

View File

@@ -0,0 +1,38 @@
TARGET := ArchBlackmann.exe
.PHONY: all
all: $(TARGET)
CPP=mingw32-g++
CFLAGS := -DWIN32 -D_DEBUG -D_CONSOLE -D_MBCS
LFLAGS :=
LIBS := -lstdc++ -lws2_32
SRCS := ArchBlackmann.cpp \
base64.cpp \
chomp.cpp \
cram_md5.cpp \
File.cpp \
IRCClient.cpp \
MD5.cpp \
panic.cpp \
ReliMT.cpp \
SockUtils.cpp \
SplitJoin.cpp \
ssprintf.cpp \
ThreadPool.cpp \
trim.cpp
OBJS := $(SRCS:.cpp=.o)
$(TARGET): $(OBJS)
$(CPP) $(LFLAGS) -o $@ $(OBJS) $(LIBS)
.cpp.o: $<
$(CPP) $(CFLAGS) -c $< -o $@
.PHONY: clean
clean:
-@del $(TARGET)
-@del $(OBJS)

View File

@@ -0,0 +1,13 @@
the kernel
ntoskrnl
win32k
msafd
ws2_32
user32
shell32
the cache manager
tdi
the scheduler
the thread queue
the message queue
atapi

View File

@@ -0,0 +1,5 @@
/me slaps %s with a large trout
recycle(%s)
Did I hear something? Musta been a %s-fly... Where's that fly-swatter?
%s: go away son, you bother me....
/me beats %s with the whipping noodle

View File

@@ -0,0 +1,34 @@
// panic.cpp
// This file is (C) 2003-2004 Royce Mitchell III
// and released under the BSD & LGPL licenses
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#ifdef WIN32
#include <conio.h>
#include <windows.h>
#endif//WIN32
#include "panic.h"
void panic ( const char* format, ... )
{
va_list arg;
int done;
va_start(arg, format);
#if defined(WIN32) && !defined(_CONSOLE)
char buf[4096];
_vsnprintf ( buf, sizeof(buf)-1, format, arg );
MessageBox ( NULL, buf, "Panic!", MB_OK|MB_ICONEXCLAMATION );
#else
done = vprintf(format, arg);
printf ( "\n" );
#endif
va_end(arg);
#if defined(WIN32) && defined(_CONSOLE)
printf ( "Press any key to exit\n" );
(void)getch();
#endif//WIN32 && _CONSOLE
exit ( -1 );
}

18
irc/ArchBlackmann/panic.h Normal file
View File

@@ -0,0 +1,18 @@
// panic.h
// This file is (C) 2003-2004 Royce Mitchell III
// and released under the BSD & LGPL licenses
#ifndef PANIC_H
#define PANIC_H
void panic ( const char* format, ... );
#define suAssert(expr) if ( !(expr) ) panic ( "%s(%lu): SOCKET ERROR %s\nExpression: %s\n", __FILE__, __LINE__, suErrDesc(SUERRNO), #expr )
#if defined(DEBUG) || defined(_DEBUG)
# define suVerify(expr) suAssert(expr)
#else
# define suVerify(expr) expr
#endif
#endif//PANIC_H

View File

@@ -0,0 +1,11 @@
minute
hour
day
week
fortnight
month
year
decade
century
millenium
eon

View File

@@ -0,0 +1,44 @@
This doc can be also found on the wiki.
ArchBlackman is a IRC-Chat bot of the #reactos irc channel. He has been coded by Royce3 and DrFred (mbosma) currently runs him.
If some one use a swear word he'll tell him not to do so and you can also ask him something technical about reactos. :)
Besides this he also knows some commands. The systax for giving him commands "ArchBlackmann: !grovel". (don't forget to address him)
- !grovel - This is the only command that non ops can do (No Parameter)
- !kiss <person>
- !hug <person>
- !give <someone> <something>
- !say <something> - You can tell him to say something on the channel via PrivateMessage
ArchBlackmann know what he should say from some text files. They can be found on the svn-dir. But can also edit them online if you are op using:
- !add <list> <item>
- !remove <list> <item>
List that are used directly to create responses are:
- tech - here are the sentences ArchBlackmann says when he finds his name
- curse - this are the curses he looks for
- cursecop - this the responces to them
- grovel - this is said when an op does the grovel command
- nogrovel - this when someone else does it
The remaining lists are not used directly, but by the other lists.
They are:
- dev
- func
- irql
- module
- period
- status
- stru
- type
And they are used like this:
/me thinks %s is smarter than %dev%

View File

@@ -0,0 +1,998 @@
// ssprintf.cpp
#include <malloc.h>
#include <math.h>
#include <float.h>
#include <assert.h>
#include "ssprintf.h"
#ifdef _MSC_VER
#define alloca _alloca
#endif//_MSC_VER
typedef __int64 LONGLONG;
typedef unsigned __int64 ULONGLONG;
typedef struct {
unsigned int mantissa:23;
unsigned int exponent:8;
unsigned int sign:1;
} ieee_float_t;
typedef struct {
unsigned int mantissal:32;
unsigned int mantissah:20;
unsigned int exponent:11;
unsigned int sign:1;
} ieee_double_t;
typedef struct {
unsigned int mantissal:32;
unsigned int mantissah:32;
unsigned int exponent:15;
unsigned int sign:1;
unsigned int empty:16;
} ieee_long_double_t;
std::string ssprintf ( const char* fmt, ... )
{
va_list arg;
va_start(arg, fmt);
std::string f = ssvprintf ( fmt, arg );
va_end(arg);
return f;
}
#define ZEROPAD 1 /* pad with zero */
#define SIGN 2 /* unsigned/signed long */
#define PLUS 4 /* show plus */
#define SPACE 8 /* space if plus */
#define LEFT 16 /* left justified */
#define SPECIAL 32 /* 0x */
#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */
#define ZEROTRUNC 128 /* truncate zero 's */
static int skip_atoi(const char **s)
{
int i=0;
while (isdigit(**s))
i = i*10 + *((*s)++) - '0';
return i;
}
static int do_div(LONGLONG *n,int base)
{
int __res = ((ULONGLONG) *n) % (unsigned) base;
*n = ((ULONGLONG) *n) / (unsigned) base;
return __res;
}
static bool number(std::string& f, LONGLONG num, int base, int size, int precision ,int type)
{
char c,sign,tmp[66];
const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
int i;
if (type & LARGE)
digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
if (type & LEFT)
type &= ~ZEROPAD;
if (base < 2 || base > 36)
return 0;
c = (type & ZEROPAD) ? '0' : ' ';
sign = 0;
if (type & SIGN) {
if (num < 0) {
sign = '-';
num = -num;
size--;
} else if (type & PLUS) {
sign = '+';
size--;
} else if (type & SPACE) {
sign = ' ';
size--;
}
}
if (type & SPECIAL) {
if (base == 16)
size -= 2;
else if (base == 8)
size--;
}
i = 0;
if (num == 0)
tmp[i++]='0';
else while (num != 0)
tmp[i++] = digits[do_div(&num,base)];
if (i > precision)
precision = i;
size -= precision;
if (!(type&(ZEROPAD+LEFT)))
while(size-->0)
f += ' ';
if (sign)
f += sign;
if (type & SPECIAL)
{
if (base==8)
f += '0';
else if (base==16)
{
f += '0';
f += digits[33];
}
}
if (!(type & LEFT))
{
while (size-- > 0)
f += c;
}
while (i < precision--)
{
f += '0';
}
while (i-- > 0)
{
f += tmp[i];
}
while (size-- > 0)
{
f += ' ';
}
return true;
}
static bool numberf(std::string& f, double __n, char exp_sign, int size, int precision, int type)
{
double exponent = 0.0;
double e;
long ie;
//int x;
char *buf, *tmp;
int i = 0;
int j = 0;
//int k = 0;
double frac, intr;
double p;
char sign;
char c;
char ro = 0;
int result;
union
{
double* __n;
ieee_double_t* n;
} n;
n.__n = &__n;
if ( exp_sign == 'g' || exp_sign == 'G' || exp_sign == 'e' || exp_sign == 'E' ) {
ie = ((unsigned int)n.n->exponent - (unsigned int)0x3ff);
exponent = ie/3.321928;
}
if ( exp_sign == 'g' || exp_sign == 'G' ) {
type |= ZEROTRUNC;
if ( exponent < -4 || fabs(exponent) >= precision )
exp_sign -= 2; // g -> e and G -> E
}
if ( exp_sign == 'e' || exp_sign == 'E' ) {
frac = modf(exponent,&e);
if ( frac > 0.5 )
e++;
else if ( frac < -0.5 )
e--;
result = numberf(f,__n/pow(10.0L,e),'f',size-4, precision, type);
if (result < 0)
return false;
f += exp_sign;
size--;
ie = (long)e;
type = LEFT | PLUS;
if ( ie < 0 )
type |= SIGN;
result = number(f,ie, 10,2, 2,type );
if (result < 0)
return false;
return true;
}
if ( exp_sign == 'f' ) {
buf = (char*)alloca(4096);
if (type & LEFT) {
type &= ~ZEROPAD;
}
c = (type & ZEROPAD) ? '0' : ' ';
sign = 0;
if (type & SIGN) {
if (__n < 0) {
sign = '-';
__n = fabs(__n);
size--;
} else if (type & PLUS) {
sign = '+';
size--;
} else if (type & SPACE) {
sign = ' ';
size--;
}
}
frac = modf(__n,&intr);
// # flags forces a . and prevents trucation of trailing zero's
if ( precision > 0 ) {
//frac = modfl(__n,&intr);
i = precision-1;
while ( i >= 0 ) {
frac*=10.0L;
frac = modf(frac, &p);
buf[i] = (int)p + '0';
i--;
}
i = precision;
size -= precision;
ro = 0;
if ( frac > 0.5 ) {
ro = 1;
}
if ( precision >= 1 || type & SPECIAL) {
buf[i++] = '.';
size--;
}
}
if ( intr == 0.0 ) {
buf[i++] = '0';
size--;
}
else {
while ( intr > 0.0 ) {
p = intr;
intr/=10.0L;
modf(intr, &intr);
p -= 10.0*intr;
buf[i++] = (int)p + '0';
size--;
}
}
j = 0;
while ( j < i && ro == 1) {
if ( buf[j] >= '0' && buf[j] <= '8' ) {
buf[j]++;
ro = 0;
}
else if ( buf[j] == '9' ) {
buf[j] = '0';
}
j++;
}
if ( ro == 1 )
buf[i++] = '1';
buf[i] = 0;
size -= precision;
if (!(type&(ZEROPAD+LEFT)))
{
while(size-->0)
f += ' ';
}
if (sign)
{
f += sign;
}
if (!(type&(ZEROPAD+LEFT)))
while(size-->0)
{
f += ' ';
}
if (type & SPECIAL) {
}
if (!(type & LEFT))
while (size-- > 0)
{
f += c;
}
tmp = buf;
if ( type & ZEROTRUNC && ((type & SPECIAL) != SPECIAL) )
{
j = 0;
while ( j < i && ( *tmp == '0' || *tmp == '.' ))
{
tmp++;
i--;
}
}
// else
// while (i < precision--)
// putc('0', f);
while (i-- > 0)
{
f += tmp[i];
}
while (size-- > 0)
{
f += ' ';
}
}
return true;
}
static bool numberfl(std::string& f, long double __n, char exp_sign, int size, int precision, int type)
{
long double exponent = 0.0;
long double e;
long ie;
//int x;
char *buf, *tmp;
int i = 0;
int j = 0;
//int k = 0;
long double frac, intr;
long double p;
char sign;
char c;
char ro = 0;
int result;
union
{
long double* __n;
ieee_long_double_t* n;
} n;
n.__n = &__n;
if ( exp_sign == 'g' || exp_sign == 'G' || exp_sign == 'e' || exp_sign == 'E' ) {
ie = ((unsigned int)n.n->exponent - (unsigned int)0x3fff);
exponent = ie/3.321928;
}
if ( exp_sign == 'g' || exp_sign == 'G' ) {
type |= ZEROTRUNC;
if ( exponent < -4 || fabs(exponent) >= precision )
exp_sign -= 2; // g -> e and G -> E
}
if ( exp_sign == 'e' || exp_sign == 'E' ) {
frac = modfl(exponent,&e);
if ( frac > 0.5 )
e++;
else if ( frac < -0.5 )
e--;
result = numberf(f,__n/powl(10.0L,e),'f',size-4, precision, type);
if (result < 0)
return false;
f += exp_sign;
size--;
ie = (long)e;
type = LEFT | PLUS;
if ( ie < 0 )
type |= SIGN;
result = number(f,ie, 10,2, 2,type );
if (result < 0)
return false;
return true;
}
if ( exp_sign == 'f' )
{
buf = (char*)alloca(4096);
if (type & LEFT)
{
type &= ~ZEROPAD;
}
c = (type & ZEROPAD) ? '0' : ' ';
sign = 0;
if (type & SIGN)
{
if (__n < 0)
{
sign = '-';
__n = fabs(__n);
size--;
} else if (type & PLUS)
{
sign = '+';
size--;
} else if (type & SPACE)
{
sign = ' ';
size--;
}
}
frac = modfl(__n,&intr);
// # flags forces a . and prevents trucation of trailing zero's
if ( precision > 0 )
{
//frac = modfl(__n,&intr);
i = precision-1;
while ( i >= 0 )
{
frac*=10.0L;
frac = modfl((long double)frac, &p);
buf[i] = (int)p + '0';
i--;
}
i = precision;
size -= precision;
ro = 0;
if ( frac > 0.5 )
{
ro = 1;
}
if ( precision >= 1 || type & SPECIAL)
{
buf[i++] = '.';
size--;
}
}
if ( intr == 0.0 )
{
buf[i++] = '0';
size--;
}
else
{
while ( intr > 0.0 )
{
p=intr;
intr/=10.0L;
modfl(intr, &intr);
p -= 10.0L*intr;
buf[i++] = (int)p + '0';
size--;
}
}
j = 0;
while ( j < i && ro == 1) {
if ( buf[j] >= '0' && buf[j] <= '8' )
{
buf[j]++;
ro = 0;
}
else if ( buf[j] == '9' )
{
buf[j] = '0';
}
j++;
}
if ( ro == 1 )
buf[i++] = '1';
buf[i] = 0;
size -= precision;
if (!(type&(ZEROPAD+LEFT)))
{
while(size-->0)
f += ' ';
}
if (sign)
{
f += sign;
}
if (!(type&(ZEROPAD+LEFT)))
{
while(size-->0)
f += ' ';
}
if (type & SPECIAL) {
}
if (!(type & LEFT))
while (size-- > 0)
{
f += c;
}
tmp = buf;
if ( type & ZEROTRUNC && ((type & SPECIAL) != SPECIAL) )
{
j = 0;
while ( j < i && ( *tmp == '0' || *tmp == '.' ))
{
tmp++;
i--;
}
}
// else
// while (i < precision--)
// putc( '0', f);
while (i-- > 0)
{
f += tmp[i];
}
while (size-- > 0)
{
f += ' ';
}
}
return true;
}
static int stringa(std::string& f, const char* s, int len, int field_width, int precision, int flags)
{
int i, done = 0;
if (s == NULL)
{
s = "<NULL>";
len = 6;
}
else
{
if (len == -1)
{
len = 0;
while ((unsigned int)len < (unsigned int)precision && s[len])
len++;
}
else
{
if ((unsigned int)len > (unsigned int)precision)
len = precision;
}
}
if (!(flags & LEFT))
while (len < field_width--)
{
f += ' ';
done++;
}
for (i = 0; i < len; ++i)
{
f += *s++;
done++;
}
while (len < field_width--)
{
f += ' ';
done++;
}
return done;
}
static int stringw(std::string& f, const wchar_t* sw, int len, int field_width, int precision, int flags)
{
int i, done = 0;
if (sw == NULL)
{
sw = L"<NULL>";
len = 6;
}
else
{
if (len == -1)
{
len = 0;
while ((unsigned int)len < (unsigned int)precision && sw[len])
len++;
}
else
{
if ((unsigned int)len > (unsigned int)precision)
len = precision;
}
}
if (!(flags & LEFT))
while (len < field_width--)
{
f += ' ';
done++;
}
for (i = 0; i < len; ++i)
{
#define MY_MB_CUR_MAX 1
char mb[MY_MB_CUR_MAX];
int mbcount, j;
mbcount = wctomb(mb, *sw++);
if (mbcount <= 0)
{
break;
}
for (j = 0; j < mbcount; j++)
{
f += mb[j];
done++;
}
}
while (len < field_width--)
{
f += ' ';
done++;
}
return done;
}
#define _isnanl _isnan
#define _finitel _finite
std::string ssvprintf ( const char *fmt, va_list args )
{
ULONGLONG num;
int base;
long double _ldouble;
double _double;
const char *s;
const wchar_t* sw;
int result;
std::string f;
int flags; /* flags to number() */
int field_width; /* width of output field */
int precision; /* min. # of digits for integers; max
number of chars for from string */
int qualifier = 0; /* 'h', 'l', 'L' or 'I64' for integer fields */
for (; *fmt ; ++fmt)
{
if (*fmt != '%')
{
f += *fmt;
continue;
}
/* process flags */
flags = 0;
repeat:
++fmt; /* this also skips first '%' */
switch (*fmt) {
case '-': flags |= LEFT; goto repeat;
case '+': flags |= PLUS; goto repeat;
case ' ': flags |= SPACE; goto repeat;
case '#': flags |= SPECIAL; goto repeat;
case '0': flags |= ZEROPAD; goto repeat;
}
/* get field width */
field_width = -1;
if (isdigit(*fmt))
field_width = skip_atoi(&fmt);
else if (*fmt == '*') {
++fmt;
/* it's the next argument */
field_width = va_arg(args, int);
if (field_width < 0) {
field_width = -field_width;
flags |= LEFT;
}
}
/* get the precision */
precision = -1;
if (*fmt == '.') {
++fmt;
if (isdigit(*fmt))
precision = skip_atoi(&fmt);
else if (*fmt == '*') {
++fmt;
/* it's the next argument */
precision = va_arg(args, int);
}
if (precision < 0)
precision = 0;
}
/* get the conversion qualifier */
qualifier = 0;
// %Z can be just stand alone or as size_t qualifier
if ( *fmt == 'Z' ) {
qualifier = *fmt;
switch ( *(fmt+1)) {
case 'o':
case 'b':
case 'X':
case 'x':
case 'd':
case 'i':
case 'u':
++fmt;
break;
default:
break;
}
} else if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt == 'w') {
qualifier = *fmt;
++fmt;
} else if (*fmt == 'I' && *(fmt+1) == '6' && *(fmt+2) == '4') {
qualifier = *fmt;
fmt += 3;
}
// go fine with ll instead of L
if ( *fmt == 'l' ) {
++fmt;
qualifier = 'L';
}
/* default base */
base = 10;
switch (*fmt) {
case 'c':
if (!(flags & LEFT))
while (--field_width > 0)
{
f += ' ';
}
if (qualifier == 'l' || qualifier == 'w')
{
f += (char)(unsigned char)(wchar_t) va_arg(args,int);
}
else
{
f += (char)(unsigned char) va_arg(args,int);
}
while (--field_width > 0)
{
f += ' ';
}
continue;
case 'C':
if (!(flags & LEFT))
while (--field_width > 0)
{
f += ' ';
}
if (qualifier == 'h')
{
f += (char)(unsigned char) va_arg(args,int);
}
else
{
f += (char)(unsigned char)(wchar_t) va_arg(args,int);
}
while (--field_width > 0)
{
f += ' ';
}
continue;
case 's':
if (qualifier == 'l' || qualifier == 'w') {
/* print unicode string */
sw = (const wchar_t*)va_arg(args, wchar_t *);
result = stringw(f, sw, -1, field_width, precision, flags);
} else {
/* print ascii string */
s = va_arg(args, char *);
result = stringa(f, s, -1, field_width, precision, flags);
}
if (result < 0)
{
assert(!"TODO FIXME handle error better");
return f;
}
continue;
case 'S':
if (qualifier == 'h') {
/* print ascii string */
s = va_arg(args, char *);
result = stringa(f, s, -1, field_width, precision, flags);
} else {
/* print unicode string */
sw = (const wchar_t*)va_arg(args, wchar_t *);
result = stringw(f, sw, -1, field_width, precision, flags);
}
if (result < 0)
{
assert(!"TODO FIXME handle error better");
return f;
}
continue;
/*case 'Z':
if (qualifier == 'w') {
// print counted unicode string
PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
if ((pus == NULL) || (pus->Buffer == NULL)) {
sw = NULL;
len = -1;
} else {
sw = pus->Buffer;
len = pus->Length / sizeof(WCHAR);
}
result = stringw(f, sw, len, field_width, precision, flags);
} else {
// print counted ascii string
PANSI_STRING pas = va_arg(args, PANSI_STRING);
if ((pas == NULL) || (pas->Buffer == NULL)) {
s = NULL;
len = -1;
} else {
s = pas->Buffer;
len = pas->Length;
}
result = stringa(f, s, -1, field_width, precision, flags);
}
if (result < 0)
return -1;
continue;*/
case 'e':
case 'E':
case 'f':
case 'g':
case 'G':
if (qualifier == 'l' || qualifier == 'L' ) {
_ldouble = va_arg(args, long double);
if ( _isnanl(_ldouble) )
{
f += "Nan";
}
else if ( !_finitel(_ldouble) )
{
if ( _ldouble < 0 )
f += "-Inf";
else
f += "+Inf";
} else {
if ( precision == -1 )
precision = 6;
result = numberfl(f,_ldouble,*fmt,field_width,precision,flags);
if (result < 0)
{
assert(!"TODO FIXME handle error better");
return f;
}
}
} else {
_double = (double)va_arg(args, double);
if ( _isnan(_double) )
{
f += "Nan";
}
else if ( !_finite(_double) )
{
if ( _double < 0 )
f += "-Inf";
else
f += "+Inf";
}
else
{
if ( precision == -1 )
precision = 6;
result = numberf(f,_double,*fmt,field_width,precision,flags);
if (result < 0)
{
assert(!"TODO FIXME handle error better");
return f;
}
}
}
continue;
case 'p':
if (field_width == -1) {
field_width = 2*sizeof(void *);
flags |= ZEROPAD;
}
result = number(f,
(unsigned long) va_arg(args, void *), 16,
field_width, precision, flags);
if (result < 0)
{
assert(!"TODO FIXME handle error better");
return f;
}
continue;
case 'n':
if (qualifier == 'l') {
long * ip = va_arg(args, long *);
*ip = 0;
} else {
int * ip = va_arg(args, int *);
*ip = 0;
}
continue;
/* integer number formats - set up the flags and "break" */
case 'o':
base = 8;
break;
case 'b':
base = 2;
break;
case 'X':
flags |= LARGE;
case 'x':
base = 16;
break;
case 'd':
case 'i':
flags |= SIGN;
case 'u':
break;
default:
if (*fmt != '%')
{
f += '%';
}
if (*fmt)
{
f += *fmt;
}
else
--fmt;
continue;
}
if (qualifier == 'I')
num = va_arg(args, ULONGLONG);
else if (qualifier == 'l') {
if (flags & SIGN)
num = va_arg(args, long);
else
num = va_arg(args, unsigned long);
}
else if (qualifier == 'h') {
if (flags & SIGN)
num = va_arg(args, int);
else
num = va_arg(args, unsigned int);
}
else if (flags & SIGN)
num = va_arg(args, int);
else
num = va_arg(args, unsigned int);
result = number(f, num, base, field_width, precision, flags);
if (result < 0)
{
assert(!"TODO FIXME handle error better");
return f;
}
}
//putc('\0',f);
return f;
}

View File

@@ -0,0 +1,12 @@
// ssprintf.h
#ifndef SSPRINTF_H
#define SSPRINTF_H
#include <string>
#include <stdarg.h>
std::string ssprintf ( const char* fmt, ... );
std::string ssvprintf ( const char* fmt, va_list args );
#endif//SSPRINTF_H

View File

@@ -0,0 +1,654 @@
RPC_NT_ALREADY_LISTENING
RPC_NT_ALREADY_REGISTERED
RPC_NT_CALL_FAILED
RPC_NT_CALL_FAILED_DNE
RPC_NT_CANT_CREATE_ENDPOINT
RPC_NT_INVALID_BINDING
RPC_NT_INVALID_ENDPOINT_FORMAT
RPC_NT_INVALID_NETWORK_OPTIONS
RPC_NT_INVALID_NET_ADDR
RPC_NT_INVALID_RPC_PROTSEQ
RPC_NT_INVALID_STRING_BINDING
RPC_NT_INVALID_STRING_UUID
RPC_NT_INVALID_TIMEOUT
RPC_NT_NOT_LISTENING
RPC_NT_NO_BINDINGS
RPC_NT_NO_CALL_ACTIVE
RPC_NT_NO_ENDPOINT_FOUND
RPC_NT_NO_PROTSEQS
RPC_NT_NO_PROTSEQS_REGISTERED
RPC_NT_OBJECT_NOT_FOUND
RPC_NT_OUT_OF_RESOURCES
RPC_NT_PROTOCOL_ERROR
RPC_NT_PROTSEQ_NOT_SUPPORTED
RPC_NT_SERVER_TOO_BUSY
RPC_NT_SERVER_UNAVAILABLE
RPC_NT_SS_IN_NULL_CONTEXT
RPC_NT_TYPE_ALREADY_REGISTERED
RPC_NT_UNKNOWN_IF
RPC_NT_UNKNOWN_MGR_TYPE
RPC_NT_WRONG_KIND_OF_BINDING
STATUS_ABANDONED
STATUS_ABANDONED_WAIT_0
STATUS_ABANDONED_WAIT_63
STATUS_ABIOS_INVALID_COMMAND
STATUS_ABIOS_INVALID_LID
STATUS_ABIOS_INVALID_SELECTOR
STATUS_ABIOS_LID_ALREADY_OWNED
STATUS_ABIOS_LID_NOT_EXIST
STATUS_ABIOS_NOT_LID_OWNER
STATUS_ABIOS_NOT_PRESENT
STATUS_ABIOS_SELECTOR_NOT_AVAILABLE
STATUS_ACCESS_DENIED
STATUS_ACCESS_VIOLATION
STATUS_ACCOUNT_DISABLED
STATUS_ACCOUNT_EXPIRED
STATUS_ACCOUNT_LOCKED_OUT
STATUS_ACCOUNT_RESTRICTION
STATUS_ADAPTER_HARDWARE_ERROR
STATUS_ADDRESS_ALREADY_ASSOCIATED
STATUS_ADDRESS_ALREADY_EXISTS
STATUS_ADDRESS_CLOSED
STATUS_ADDRESS_NOT_ASSOCIATED
STATUS_AGENTS_EXHAUSTED
STATUS_ALERTED
STATUS_ALIAS_EXISTS
STATUS_ALLOCATE_BUCKET
STATUS_ALLOTTED_SPACE_EXCEEDED
STATUS_ALREADY_COMMITTED
STATUS_ALREADY_DISCONNECTED
STATUS_ALREADY_WIN32
STATUS_APP_INIT_FAILURE
STATUS_ARBITRATION_UNHANDLED
STATUS_ARRAY_BOUNDS_EXCEEDED
STATUS_AUDIT_FAILED
STATUS_BACKUP_CONTROLLER
STATUS_BAD_COMPRESSION_BUFFER
STATUS_BAD_CURRENT_DIRECTORY
STATUS_BAD_DESCRIPTOR_FORMAT
STATUS_BAD_DEVICE_TYPE
STATUS_BAD_DLL_ENTRYPOINT
STATUS_BAD_FUNCTION_TABLE
STATUS_BAD_IMPERSONATION_LEVEL
STATUS_BAD_INHERITANCE_ACL
STATUS_BAD_INITIAL_PC
STATUS_BAD_INITIAL_STACK
STATUS_BAD_LOGON_SESSION_STATE
STATUS_BAD_MASTER_BOOT_RECORD
STATUS_BAD_NETWORK_NAME
STATUS_BAD_NETWORK_PATH
STATUS_BAD_REMOTE_ADAPTER
STATUS_BAD_SERVICE_ENTRYPOINT
STATUS_BAD_STACK
STATUS_BAD_TOKEN_TYPE
STATUS_BAD_VALIDATION_CLASS
STATUS_BAD_WORKING_SET_LIMIT
STATUS_BEGINNING_OF_MEDIA
STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT
STATUS_BREAKPOINT
STATUS_BUFFER_OVERFLOW
STATUS_BUFFER_TOO_SMALL
STATUS_BUS_RESET
STATUS_CANCELLED
STATUS_CANNOT_DELETE
STATUS_CANNOT_IMPERSONATE
STATUS_CANNOT_LOAD_REGISTRY_FILE
STATUS_CANT_ACCESS_DOMAIN_INFO
STATUS_CANT_DISABLE_MANDATORY
STATUS_CANT_OPEN_ANONYMOUS
STATUS_CANT_TERMINATE_SELF
STATUS_CANT_WAIT
STATUS_CARDBUS_NOT_SUPPORTED
STATUS_CHECKING_FILE_SYSTEM
STATUS_CHILD_MUST_BE_VOLATILE
STATUS_CLIENT_SERVER_PARAMETERS_INVALID
STATUS_COMMITMENT_LIMIT
STATUS_CONFLICTING_ADDRESSES
STATUS_CONNECTION_ABORTED
STATUS_CONNECTION_ACTIVE
STATUS_CONNECTION_COUNT_LIMIT
STATUS_CONNECTION_DISCONNECTED
STATUS_CONNECTION_INVALID
STATUS_CONNECTION_IN_USE
STATUS_CONNECTION_REFUSED
STATUS_CONNECTION_RESET
STATUS_CONTROL_C_EXIT
STATUS_CONVERT_TO_LARGE
STATUS_COULD_NOT_INTERPRET
STATUS_CRC_ERROR
STATUS_CTL_FILE_NOT_SUPPORTED
STATUS_DATATYPE_MISALIGNMENT
STATUS_DATA_ERROR
STATUS_DATA_LATE_ERROR
STATUS_DATA_NOT_ACCEPTED
STATUS_DATA_OVERRUN
STATUS_DEBUG_ATTACH_FAILED
STATUS_DELETE_PENDING
STATUS_DEVICE_ALREADY_ATTACHED
STATUS_DEVICE_BUSY
STATUS_DEVICE_CONFIGURATION_ERROR
STATUS_DEVICE_DATA_ERROR
STATUS_DEVICE_DOES_NOT_EXIST
STATUS_DEVICE_NOT_CONNECTED
STATUS_DEVICE_NOT_PARTITIONED
STATUS_DEVICE_NOT_READY
STATUS_DEVICE_OFF_LINE
STATUS_DEVICE_PAPER_EMPTY
STATUS_DEVICE_POWERED_OFF
STATUS_DEVICE_POWER_FAILURE
STATUS_DEVICE_PROTOCOL_ERROR
STATUS_DFS_EXIT_PATH_FOUND
STATUS_DFS_UNAVAILABLE
STATUS_DIRECTORY_NOT_EMPTY
STATUS_DISK_CORRUPT_ERROR
STATUS_DISK_FULL
STATUS_DISK_OPERATION_FAILED
STATUS_DISK_RECALIBRATE_FAILED
STATUS_DISK_RESET_FAILED
STATUS_DLL_INIT_FAILED
STATUS_DLL_INIT_FAILED_LOGOFF
STATUS_DLL_NOT_FOUND
STATUS_DOMAIN_CONTROLLER_NOT_FOUND
STATUS_DOMAIN_CTRLR_CONFIG_ERROR
STATUS_DOMAIN_EXISTS
STATUS_DOMAIN_LIMIT_EXCEEDED
STATUS_DOMAIN_TRUST_INCONSISTENT
STATUS_DRIVER_CANCEL_TIMEOUT
STATUS_DRIVER_ENTRYPOINT_NOT_FOUND
STATUS_DRIVER_INTERNAL_ERROR
STATUS_DRIVER_ORDINAL_NOT_FOUND
STATUS_DRIVER_UNABLE_TO_LOAD
STATUS_DUPLICATE_NAME
STATUS_DUPLICATE_OBJECTID
STATUS_EAS_NOT_SUPPORTED
STATUS_EA_CORRUPT_ERROR
STATUS_EA_LIST_INCONSISTENT
STATUS_EA_TOO_LARGE
STATUS_END_OF_FILE
STATUS_END_OF_MEDIA
STATUS_ENTRYPOINT_NOT_FOUND
STATUS_EOM_OVERFLOW
STATUS_EVALUATION_EXPIRATION
STATUS_EVENTLOG_CANT_START
STATUS_EVENTLOG_FILE_CHANGED
STATUS_EVENTLOG_FILE_CORRUPT
STATUS_EVENT_DONE
STATUS_EVENT_PENDING
STATUS_EXTRANEOUS_INFORMATION
STATUS_FAIL_CHECK
STATUS_FATAL_APP_EXIT
STATUS_FILEMARK_DETECTED
STATUS_FILES_OPEN
STATUS_FILE_CLOSED
STATUS_FILE_CORRUPT_ERROR
STATUS_FILE_DELETED
STATUS_FILE_FORCED_CLOSED
STATUS_FILE_INVALID
STATUS_FILE_IS_A_DIRECTORY
STATUS_FILE_IS_OFFLINE
STATUS_FILE_LOCK_CONFLICT
STATUS_FILE_RENAMED
STATUS_FLOAT_DENORMAL_OPERAND
STATUS_FLOAT_DIVIDE_BY_ZERO
STATUS_FLOAT_INEXACT_RESULT
STATUS_FLOAT_INVALID_OPERATION
STATUS_FLOAT_OVERFLOW
STATUS_FLOAT_STACK_CHECK
STATUS_FLOAT_UNDERFLOW
STATUS_FLOPPY_BAD_REGISTERS
STATUS_FLOPPY_ID_MARK_NOT_FOUND
STATUS_FLOPPY_UNKNOWN_ERROR
STATUS_FLOPPY_VOLUME
STATUS_FLOPPY_WRONG_CYLINDER
STATUS_FOUND_OUT_OF_SCOPE
STATUS_FREE_VM_NOT_AT_BASE
STATUS_FS_DRIVER_REQUIRED
STATUS_FT_MISSING_MEMBER
STATUS_FT_ORPHANING
STATUS_FT_READ_RECOVERING_FROM_BACKUP
STATUS_FT_WRITE_RECOVERY
STATUS_FULLSCREEN_MODE
STATUS_GENERIC_NOT_MAPPED
STATUS_GRACEFUL_DISCONNECT
STATUS_GROUP_EXISTS
STATUS_GUARD_PAGE_VIOLATION
STATUS_GUIDS_EXHAUSTED
STATUS_GUID_SUBSTITUTION_MADE
STATUS_HANDLES_CLOSED
STATUS_HANDLE_NOT_CLOSABLE
STATUS_HOST_UNREACHABLE
STATUS_ILLEGAL_CHARACTER
STATUS_ILLEGAL_DLL_RELOCATION
STATUS_ILLEGAL_FLOAT_CONTEXT
STATUS_ILLEGAL_FUNCTION
STATUS_ILLEGAL_INSTRUCTION
STATUS_ILL_FORMED_PASSWORD
STATUS_ILL_FORMED_SERVICE_ENTRY
STATUS_IMAGE_ALREADY_LOADED
STATUS_IMAGE_CHECKSUM_MISMATCH
STATUS_IMAGE_MACHINE_TYPE_MISMATCH
STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE
STATUS_IMAGE_MP_UP_MISMATCH
STATUS_IMAGE_NOT_AT_BASE
STATUS_INCOMPATIBLE_FILE_MAP
STATUS_INFO_LENGTH_MISMATCH
STATUS_INSTANCE_NOT_AVAILABLE
STATUS_INSTRUCTION_MISALIGNMENT
STATUS_INSUFFICIENT_LOGON_INFO
STATUS_INSUFFICIENT_RESOURCES
STATUS_INSUFF_SERVER_RESOURCES
STATUS_INTEGER_DIVIDE_BY_ZERO
STATUS_INTEGER_OVERFLOW
STATUS_INTERNAL_DB_CORRUPTION
STATUS_INTERNAL_DB_ERROR
STATUS_INTERNAL_ERROR
STATUS_INVALID_ACCOUNT_NAME
STATUS_INVALID_ACL
STATUS_INVALID_ADDRESS
STATUS_INVALID_ADDRESS_COMPONENT
STATUS_INVALID_ADDRESS_WILDCARD
STATUS_INVALID_BLOCK_LENGTH
STATUS_INVALID_BUFFER_SIZE
STATUS_INVALID_CID
STATUS_INVALID_COMPUTER_NAME
STATUS_INVALID_CONNECTION
STATUS_INVALID_DEVICE_REQUEST
STATUS_INVALID_DEVICE_STATE
STATUS_INVALID_DISPOSITION
STATUS_INVALID_DOMAIN_ROLE
STATUS_INVALID_DOMAIN_STATE
STATUS_INVALID_EA_FLAG
STATUS_INVALID_EA_NAME
STATUS_INVALID_FILE_FOR_SECTION
STATUS_INVALID_GROUP_ATTRIBUTES
STATUS_INVALID_HANDLE
STATUS_INVALID_HW_PROFILE
STATUS_INVALID_ID_AUTHORITY
STATUS_INVALID_IMAGE_FORMAT
STATUS_INVALID_IMAGE_LE_FORMAT
STATUS_INVALID_IMAGE_NE_FORMAT
STATUS_INVALID_IMAGE_NOT_MZ
STATUS_INVALID_IMAGE_PROTECT
STATUS_INVALID_IMAGE_WIN_16
STATUS_INVALID_INFO_CLASS
STATUS_INVALID_LDT_DESCRIPTOR
STATUS_INVALID_LDT_OFFSET
STATUS_INVALID_LDT_SIZE
STATUS_INVALID_LEVEL
STATUS_INVALID_LOCK_SEQUENCE
STATUS_INVALID_LOGON_HOURS
STATUS_INVALID_LOGON_TYPE
STATUS_INVALID_MEMBER
STATUS_INVALID_NETWORK_RESPONSE
STATUS_INVALID_OPLOCK_PROTOCOL
STATUS_INVALID_OWNER
STATUS_INVALID_PAGE_PROTECTION
STATUS_INVALID_PARAMETER
STATUS_INVALID_PARAMETER_1
STATUS_INVALID_PARAMETER_10
STATUS_INVALID_PARAMETER_11
STATUS_INVALID_PARAMETER_12
STATUS_INVALID_PARAMETER_2
STATUS_INVALID_PARAMETER_3
STATUS_INVALID_PARAMETER_4
STATUS_INVALID_PARAMETER_5
STATUS_INVALID_PARAMETER_6
STATUS_INVALID_PARAMETER_7
STATUS_INVALID_PARAMETER_8
STATUS_INVALID_PARAMETER_9
STATUS_INVALID_PARAMETER_MIX
STATUS_INVALID_PIPE_STATE
STATUS_INVALID_PLUGPLAY_DEVICE_PATH
STATUS_INVALID_PORT_ATTRIBUTES
STATUS_INVALID_PORT_HANDLE
STATUS_INVALID_PRIMARY_GROUP
STATUS_INVALID_QUOTA_LOWER
STATUS_INVALID_READ_MODE
STATUS_INVALID_SECURITY_DESCR
STATUS_INVALID_SERVER_STATE
STATUS_INVALID_SID
STATUS_INVALID_SUB_AUTHORITY
STATUS_INVALID_SYSTEM_SERVICE
STATUS_INVALID_UNWIND_TARGET
STATUS_INVALID_USER_BUFFER
STATUS_INVALID_VARIANT
STATUS_INVALID_VIEW_SIZE
STATUS_INVALID_VLM_OPERATION
STATUS_INVALID_VOLUME_LABEL
STATUS_INVALID_WORKSTATION
STATUS_IN_PAGE_ERROR
STATUS_IO_DEVICE_ERROR
STATUS_IO_PRIVILEGE_FAILED
STATUS_IO_REPARSE_DATA_INVALID
STATUS_IO_REPARSE_TAG_INVALID
STATUS_IO_REPARSE_TAG_MISMATCH
STATUS_IO_REPARSE_TAG_NOT_HANDLED
STATUS_IO_TIMEOUT
STATUS_IP_ADDRESS_CONFLICT1
STATUS_IP_ADDRESS_CONFLICT2
STATUS_KERNEL_APC
STATUS_KEY_DELETED
STATUS_KEY_HAS_CHILDREN
STATUS_LAST_ADMIN
STATUS_LICENSE_QUOTA_EXCEEDED
STATUS_LICENSE_VIOLATION
STATUS_LINK_FAILED
STATUS_LINK_TIMEOUT
STATUS_LM_CROSS_ENCRYPTION_REQUIRED
STATUS_LOCAL_DISCONNECT
STATUS_LOCAL_USER_SESSION_KEY
STATUS_LOCK_NOT_GRANTED
STATUS_LOGIN_TIME_RESTRICTION
STATUS_LOGIN_WKSTA_RESTRICTION
STATUS_LOGON_FAILURE
STATUS_LOGON_NOT_GRANTED
STATUS_LOGON_SERVER_CONFLICT
STATUS_LOGON_SESSION_COLLISION
STATUS_LOGON_SESSION_EXISTS
STATUS_LOGON_TYPE_NOT_GRANTED
STATUS_LOG_FILE_FULL
STATUS_LOG_HARD_ERROR
STATUS_LONGJUMP
STATUS_LOST_WRITEBEHIND_DATA
STATUS_LPC_REPLY_LOST
STATUS_LUIDS_EXHAUSTED
STATUS_MAPPED_ALIGNMENT
STATUS_MAPPED_FILE_SIZE_ZERO
STATUS_MARSHALL_OVERFLOW
STATUS_MEDIA_CHANGED
STATUS_MEDIA_CHECK
STATUS_MEDIA_WRITE_PROTECTED
STATUS_MEMBERS_PRIMARY_GROUP
STATUS_MEMBER_IN_ALIAS
STATUS_MEMBER_IN_GROUP
STATUS_MEMBER_NOT_IN_ALIAS
STATUS_MEMBER_NOT_IN_GROUP
STATUS_MEMORY_NOT_ALLOCATED
STATUS_MESSAGE_NOT_FOUND
STATUS_MISSING_SYSTEMFILE
STATUS_MORE_ENTRIES
STATUS_MORE_PROCESSING_REQUIRED
STATUS_MUTANT_LIMIT_EXCEEDED
STATUS_MUTANT_NOT_OWNED
STATUS_NAME_TOO_LONG
STATUS_NETLOGON_NOT_STARTED
STATUS_NETWORK_ACCESS_DENIED
STATUS_NETWORK_BUSY
STATUS_NETWORK_CREDENTIAL_CONFLICT
STATUS_NETWORK_NAME_DELETED
STATUS_NETWORK_UNREACHABLE
STATUS_NET_WRITE_FAULT
STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT
STATUS_NOLOGON_SERVER_TRUST_ACCOUNT
STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT
STATUS_NONCONTINUABLE_EXCEPTION
STATUS_NONEXISTENT_EA_ENTRY
STATUS_NONEXISTENT_SECTOR
STATUS_NONE_MAPPED
STATUS_NOTIFY_CLEANUP
STATUS_NOTIFY_ENUM_DIR
STATUS_NOT_ALL_ASSIGNED
STATUS_NOT_A_DIRECTORY
STATUS_NOT_A_REPARSE_POINT
STATUS_NOT_CLIENT_SESSION
STATUS_NOT_COMMITTED
STATUS_NOT_FOUND
STATUS_NOT_IMPLEMENTED
STATUS_NOT_LOCKED
STATUS_NOT_LOGON_PROCESS
STATUS_NOT_MAPPED_DATA
STATUS_NOT_MAPPED_VIEW
STATUS_NOT_REGISTRY_FILE
STATUS_NOT_SAME_DEVICE
STATUS_NOT_SERVER_SESSION
STATUS_NOT_SUPPORTED
STATUS_NOT_TINY_STREAM
STATUS_NO_BROWSER_SERVERS_FOUND
STATUS_NO_CALLBACK_ACTIVE
STATUS_NO_DATA_DETECTED
STATUS_NO_EAS_ON_FILE
STATUS_NO_EVENT_PAIR
STATUS_NO_GUID_TRANSLATION
STATUS_NO_IMPERSONATION_TOKEN
STATUS_NO_INHERITANCE
STATUS_NO_LDT
STATUS_NO_LOGON_SERVERS
STATUS_NO_LOG_SPACE
STATUS_NO_MATCH
STATUS_NO_MEDIA
STATUS_NO_MEDIA_IN_DEVICE
STATUS_NO_MEMORY
STATUS_NO_MORE_EAS
STATUS_NO_MORE_ENTRIES
STATUS_NO_MORE_FILES
STATUS_NO_MORE_MATCHES
STATUS_NO_PAGEFILE
STATUS_NO_QUOTAS_NO_ACCOUNT
STATUS_NO_SECURITY_ON_OBJECT
STATUS_NO_SPOOL_SPACE
STATUS_NO_SUCH_ALIAS
STATUS_NO_SUCH_DEVICE
STATUS_NO_SUCH_DOMAIN
STATUS_NO_SUCH_FILE
STATUS_NO_SUCH_GROUP
STATUS_NO_SUCH_LOGON_SESSION
STATUS_NO_SUCH_MEMBER
STATUS_NO_SUCH_PACKAGE
STATUS_NO_SUCH_PRIVILEGE
STATUS_NO_SUCH_USER
STATUS_NO_TOKEN
STATUS_NO_TRUST_LSA_SECRET
STATUS_NO_TRUST_SAM_ACCOUNT
STATUS_NO_USER_SESSION_KEY
STATUS_NO_YIELD_PERFORMED
STATUS_NT_CROSS_ENCRYPTION_REQUIRED
STATUS_NULL_LM_PASSWORD
STATUS_OBJECTID_EXISTS
STATUS_OBJECT_EXISTS
STATUS_OBJECT_NAME_COLLISION
STATUS_OBJECT_NAME_EXISTS
STATUS_OBJECT_NAME_INVALID
STATUS_OBJECT_NAME_NOT_FOUND
STATUS_OBJECT_PATH_INVALID
STATUS_OBJECT_PATH_NOT_FOUND
STATUS_OBJECT_PATH_SYNTAX_BAD
STATUS_OBJECT_TYPE_MISMATCH
STATUS_OPEN_FAILED
STATUS_OPLOCK_BREAK_IN_PROCESS
STATUS_OPLOCK_NOT_GRANTED
STATUS_ORDINAL_NOT_FOUND
STATUS_PAGEFILE_CREATE_FAILED
STATUS_PAGEFILE_QUOTA
STATUS_PAGEFILE_QUOTA_EXCEEDED
STATUS_PARITY_ERROR
STATUS_PARTIAL_COPY
STATUS_PARTITION_FAILURE
STATUS_PASSWORD_EXPIRED
STATUS_PASSWORD_MUST_CHANGE
STATUS_PASSWORD_RESTRICTION
STATUS_PATH_NOT_COVERED
STATUS_PENDING
STATUS_PIPE_BROKEN
STATUS_PIPE_BUSY
STATUS_PIPE_CLOSING
STATUS_PIPE_CONNECTED
STATUS_PIPE_DISCONNECTED
STATUS_PIPE_EMPTY
STATUS_PIPE_LISTENING
STATUS_PIPE_NOT_AVAILABLE
STATUS_PLUGPLAY_NO_DEVICE
STATUS_PORT_ALREADY_SET
STATUS_PORT_CONNECTION_REFUSED
STATUS_PORT_DISCONNECTED
STATUS_PORT_MESSAGE_TOO_LONG
STATUS_PORT_UNREACHABLE
STATUS_POSSIBLE_DEADLOCK
STATUS_PREDEFINED_HANDLE
STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED
STATUS_PRINT_CANCELLED
STATUS_PRINT_QUEUE_FULL
STATUS_PRIVILEGED_INSTRUCTION
STATUS_PRIVILEGE_NOT_HELD
STATUS_PROCEDURE_NOT_FOUND
STATUS_PROCESS_IN_JOB
STATUS_PROCESS_IS_TERMINATING
STATUS_PROCESS_NOT_IN_JOB
STATUS_PROFILING_AT_LIMIT
STATUS_PROFILING_NOT_STARTED
STATUS_PROFILING_NOT_STOPPED
STATUS_PROPSET_NOT_FOUND
STATUS_PROTOCOL_UNREACHABLE
STATUS_PWD_HISTORY_CONFLICT
STATUS_PWD_TOO_RECENT
STATUS_PWD_TOO_SHORT
STATUS_QUOTA_EXCEEDED
STATUS_QUOTA_LIST_INCONSISTENT
STATUS_RANGE_LIST_CONFLICT
STATUS_RANGE_NOT_FOUND
STATUS_RANGE_NOT_LOCKED
STATUS_RECEIVE_EXPEDITED
STATUS_RECEIVE_PARTIAL
STATUS_RECEIVE_PARTIAL_EXPEDITED
STATUS_RECOVERY_FAILURE
STATUS_REDIRECTOR_HAS_OPEN_HANDLES
STATUS_REDIRECTOR_NOT_STARTED
STATUS_REDIRECTOR_PAUSED
STATUS_REDIRECTOR_STARTED
STATUS_REGISTRY_CORRUPT
STATUS_REGISTRY_IO_FAILED
STATUS_REGISTRY_QUOTA_LIMIT
STATUS_REGISTRY_RECOVERED
STATUS_REMOTE_DISCONNECT
STATUS_REMOTE_NOT_LISTENING
STATUS_REMOTE_RESOURCES
STATUS_REMOTE_SESSION_LIMIT
STATUS_REPARSE
STATUS_REPLY_MESSAGE_MISMATCH
STATUS_REQUEST_ABORTED
STATUS_REQUEST_NOT_ACCEPTED
STATUS_RESOURCE_DATA_NOT_FOUND
STATUS_RESOURCE_LANG_NOT_FOUND
STATUS_RESOURCE_NAME_NOT_FOUND
STATUS_RESOURCE_NOT_OWNED
STATUS_RESOURCE_TYPE_NOT_FOUND
STATUS_RETRY
STATUS_REVISION_MISMATCH
STATUS_RXACT_COMMITTED
STATUS_RXACT_COMMIT_FAILURE
STATUS_RXACT_COMMIT_NECESSARY
STATUS_RXACT_INVALID_STATE
STATUS_RXACT_STATE_CREATED
STATUS_SAM_INIT_FAILURE
STATUS_SECRET_TOO_LONG
STATUS_SECTION_NOT_EXTENDED
STATUS_SECTION_NOT_IMAGE
STATUS_SECTION_PROTECTION
STATUS_SECTION_TOO_BIG
STATUS_SEGMENT_NOTIFICATION
STATUS_SEMAPHORE_LIMIT_EXCEEDED
STATUS_SERIAL_COUNTER_TIMEOUT
STATUS_SERIAL_MORE_WRITES
STATUS_SERIAL_NO_DEVICE_INITED
STATUS_SERVER_DISABLED
STATUS_SERVER_HAS_OPEN_HANDLES
STATUS_SERVER_NOT_DISABLED
STATUS_SERVICE_NOTIFICATION
STATUS_SETMARK_DETECTED
STATUS_SHARED_IRQ_BUSY
STATUS_SHARING_PAUSED
STATUS_SHARING_VIOLATION
STATUS_SINGLE_STEP
STATUS_SOME_NOT_MAPPED
STATUS_SPECIAL_ACCOUNT
STATUS_SPECIAL_GROUP
STATUS_SPECIAL_USER
STATUS_STACK_OVERFLOW
STATUS_STACK_OVERFLOW_READ
STATUS_SUCCESS
STATUS_SUSPEND_COUNT_EXCEEDED
STATUS_SYNCHRONIZATION_REQUIRED
STATUS_SYSTEM_PROCESS_TERMINATED
STATUS_THREAD_IS_TERMINATING
STATUS_THREAD_NOT_IN_PROCESS
STATUS_THREAD_WAS_SUSPENDED
STATUS_TIMEOUT
STATUS_TIMER_NOT_CANCELED
STATUS_TIMER_RESOLUTION_NOT_SET
STATUS_TIMER_RESUME_IGNORED
STATUS_TIME_DIFFERENCE_AT_DC
STATUS_TOKEN_ALREADY_IN_USE
STATUS_TOO_LATE
STATUS_TOO_MANY_ADDRESSES
STATUS_TOO_MANY_COMMANDS
STATUS_TOO_MANY_CONTEXT_IDS
STATUS_TOO_MANY_GUIDS_REQUESTED
STATUS_TOO_MANY_LINKS
STATUS_TOO_MANY_LUIDS_REQUESTED
STATUS_TOO_MANY_NAMES
STATUS_TOO_MANY_NODES
STATUS_TOO_MANY_OPENED_FILES
STATUS_TOO_MANY_PAGING_FILES
STATUS_TOO_MANY_SECRETS
STATUS_TOO_MANY_SESSIONS
STATUS_TOO_MANY_SIDS
STATUS_TOO_MANY_THREADS
STATUS_TRANSACTION_ABORTED
STATUS_TRANSACTION_INVALID_ID
STATUS_TRANSACTION_INVALID_TYPE
STATUS_TRANSACTION_NO_MATCH
STATUS_TRANSACTION_NO_RELEASE
STATUS_TRANSACTION_RESPONDED
STATUS_TRANSACTION_TIMED_OUT
STATUS_TRUSTED_DOMAIN_FAILURE
STATUS_TRUSTED_RELATIONSHIP_FAILURE
STATUS_TRUST_FAILURE
STATUS_UNABLE_TO_DECOMMIT_VM
STATUS_UNABLE_TO_DELETE_SECTION
STATUS_UNABLE_TO_FREE_VM
STATUS_UNABLE_TO_LOCK_MEDIA
STATUS_UNABLE_TO_UNLOAD_MEDIA
STATUS_UNDEFINED_CHARACTER
STATUS_UNEXPECTED_IO_ERROR
STATUS_UNEXPECTED_MM_CREATE_ERR
STATUS_UNEXPECTED_MM_EXTEND_ERR
STATUS_UNEXPECTED_MM_MAP_ERROR
STATUS_UNEXPECTED_NETWORK_ERROR
STATUS_UNHANDLED_EXCEPTION
STATUS_UNKNOWN_REVISION
STATUS_UNMAPPABLE_CHARACTER
STATUS_UNRECOGNIZED_MEDIA
STATUS_UNRECOGNIZED_VOLUME
STATUS_UNSUCCESSFUL
STATUS_UNSUPPORTED_COMPRESSION
STATUS_UNWIND
STATUS_USER_APC
STATUS_USER_EXISTS
STATUS_USER_MAPPED_FILE
STATUS_USER_SESSION_DELETED
STATUS_VALIDATE_CONTINUE
STATUS_VARIABLE_NOT_FOUND
STATUS_VDM_HARD_ERROR
STATUS_VERIFY_REQUIRED
STATUS_VIRTUAL_CIRCUIT_CLOSED
STATUS_VOLUME_DISMOUNTED
STATUS_VOLUME_MOUNTED
STATUS_WAIT_0
STATUS_WAIT_63
STATUS_WAKE_SYSTEM_DEBUGGER
STATUS_WAS_LOCKED
STATUS_WAS_UNLOCKED
STATUS_WORKING_SET_LIMIT_RANGE
STATUS_WORKING_SET_QUOTA
STATUS_WRONG_PASSWORD
STATUS_WRONG_PASSWORD_CORE
STATUS_WRONG_VOLUME
STATUS_WX86_BREAKPOINT
STATUS_WX86_CONTINUE
STATUS_WX86_CREATEWX86TIB
STATUS_WX86_EXCEPTION_CHAIN
STATUS_WX86_EXCEPTION_CONTINUE
STATUS_WX86_EXCEPTION_LASTCHANCE
STATUS_WX86_FLOAT_STACK_CHECK
STATUS_WX86_INTERNAL_ERROR
STATUS_WX86_SINGLE_STEP
STATUS_WX86_UNSIMULATE

View File

@@ -0,0 +1,7 @@
FAST_MUTEX
KPCR
PEB
TEB
SPINLOCK
APC
DPC

View File

@@ -0,0 +1,73 @@
What do you think I am, your personal tech support?
You *know* a %stru% is non-re-entrant, right?
The answer to that is so simple, I'm not going to waste my time telling you.
Well, of course... if you're not below DISPATCH_LEVEL, ros is gonna explode on ya when you try to do that ( duh! ).
I don't think that functionality has been implemented, yet.
What do you mean it crashed? It can't crash there!
Wow. That's a new one.
Ask %dev%, I bet he knows.. he knows everything...
When's the last time you rebuilt?
Have you tried a make clean?
Is it plugged in?
Well it works on *my* system :P
Well don't do that, and you won't have that problem.
Didn't we already fix that?
Well... I don't know.. I just have that code disabled in my tree.
Try surrounding it with parenthesis.
Don't you know going around dereferncing null pointers all day can be hazardous to your health?
Well, duh!
There's a bit in cr3 for problems like that.
Just add a field to the %stru% to keep track of it!
Don't worry about it... the garbage collector in %module% will clean it up for you.
Did I do that?
Didn't %dev% fix that already?
Yes, I think I've seen that bug before... no... that was another program.
I could tell you, but then I'd have to unlink() you.
Well if you'd get some sleep, maybe you'd figure it out... not all of us can keep the hours %dev% can...
You did what? Uh oh... that can't be good.
Well... I could tell you, but the answer's pretty complicated. Why don't you wait to read about it in the book I'm writing.
Yeah, that's happened to me, before, too. All you have to do is wrap it in an SEH block and forget about it.
Just put a NULL dereference in there and commit it. It helps get bugs fixed fast! (Not that I would know)
ASSERT is your friend!
I dunno.. but I bet %dev% could find it for you.
I hereby declare that code is perfect. Your problem must be elsewhere.
I wrote that code... it must be perfect.
$#@!$ One of these days I'm gonna throw %module% out the window!!! Sorry, what were you saying?
maybe I broke it in my last commit. Maybe I did it on purpose...
Have you tried debugging it? I got a can of Raid...
Just delete it, it can't be that important ( You should see all the useless cruft I got rid of in %module% )
Try queueing a work item...
My %stru% fell in love with some %stru% in %module%, and %module% has been hell since...
Maybe the PEB is getting corrupted. Try allocating a new PEB and overwriting the old one. That's what I did last time I had a bug like that.
Hmm.. that seems to have been introduced by my last commit... I bet CVS mixed up the bits during the commit.
It can't possibly be my fault, so I don't care.
I'm not experiencing that problem, perhaps it's all in your mind.
Well... like a good friend of mine said... "Don't Panic!"
It just shows you how far ReactOS has come along! A %period% ago a bug like that wouldn't have even been possible!
Just surround the code with an #if 0/#endif block, it solves all my problems!
You know.. if %dev% would just finish %module% for us, we wouldn't be having this problem.
I say we move on to the next function, since we can't seem to figure this one out.
Well, sure, that would have been my first guess, too.... TEN YEARS AGO :p
yup, that sounds like a problem.
If I wanted to talk about VB, I'd go bug Alex...
ask %dev%
Thank you for that amazingly keen insight, Commander Obvious.
Sorry, can't help you right now, trying to track down this bug %dev% caused in %module%
I dont know about that, but I just fixed a problem in %module% for %dev%
How should I know? I'm still trying to figure out this main() thing... ooh! wanna see what I did in %module%?
lol!
*wink*
;)
42
It's gonna take me over %period% to fix all %dev%'s bugs in %module% :(
How could %func% return %status%!? It bet %dev% broke it! I didn't touch it... honest! no.. really! (me hides)
It's fine if you get %status% there ... just ignore the destruction, and call %func% instead.
%dev% said %status% isn't really an error in this context because we expect %module% to be toast by now
heh, I'm still trying to figure out why %func% is returning %status% when I call it from %module%...
%dev% said it's okay to ignore that as long as you're below %irql%
erm, what do you mean?
damn, I do that all the time
if you want a reply that sounds right, I'd say that %func% support for that is vital to the future of %module%
Sounds like you're having a problem with %func%. I hate that thing... don't talk to me about it.
Just return %status% and forget about it. Someone else will fix it, later.
Blah blah blah... sheesh... can't you figure out *anything*?

View File

@@ -0,0 +1,17 @@
// trim.cpp
// This file is (C) 2004 Royce Mitchell III
// and released under the BSD & LGPL licenses
#include "trim.h"
std::string trim ( const std::string& s )
{
const char* p = &s[0];
const char* p2 = p + s.size();
while ( *p == ' ' )
p++;
while ( p2 > p && p2[-1] == ' ' )
p2--;
return std::string ( p, p2-p );
}

13
irc/ArchBlackmann/trim.h Normal file
View File

@@ -0,0 +1,13 @@
// trim.h
// This file is (C) 2004 Royce Mitchell III
// and released under the BSD & LGPL licenses
#ifndef TRIM_H
#define TRIM_H
#include <string>
std::string trim ( const std::string& s );
#endif//TRIM_H

1000
irc/ArchBlackmann/type.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,37 @@
// verify.h
// This code is (C) 2003-2004 Royce Mitchell III
// and released under the LGPL & BSD licenses
#ifndef VERIFY_H
#define VERIFY_H
//#include <assert.h>
#ifdef ASSERT
#undef ASSERT
#endif//ASSERT
#include "panic.h"
#if defined(DEBUG) || defined(_DEBUG)
inline void AssertHandler ( bool b, const char* str )
{
if ( !b )
panic ( str );
}
# define ASSERT(x) AssertHandler((x) ? true : false, #x )
#else
# define ASSERT(x)
#endif
#ifdef verify
#undef verify
#endif//verify
#if defined(DEBUG) || defined(_DEBUG)
# define verify(x) ASSERT(x)
#else
# define verify(x) x
#endif
#endif//VERIFY_H

View File

@@ -0,0 +1,32 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("1.0.*")]
// The following attributes specify the key for the sign of your assembly. See the
// .NET Framework documentation for more information about signing.
// This is not required, if you don't want signing let these attributes like they're.
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]

View File

@@ -0,0 +1,274 @@
using System;
using System.Collections;
using System.IO;
using System.Text;
using System.Globalization;
namespace HtmlHelp.ChmDecoding
{
/// <summary>
/// The class <c>BinaryReaderHelp</c> implements static helper methods for extracting binary data
/// from a binary reader object.
/// </summary>
internal class BinaryReaderHelp
{
/// <summary>
/// Internal helper method to extract null-terminated strings from a binary reader
/// </summary>
/// <param name="binReader">reference to the binary reader</param>
/// <param name="offset">offset in the stream</param>
/// <param name="noOffset">true if the offset value should be used</param>
/// <param name="encoder">encoder used for text encoding</param>
/// <returns>An extracted string value</returns>
internal static string ExtractString(ref BinaryReader binReader, int offset, bool noOffset, Encoding encoder)
{
string strReturn = "";
if(encoder == null)
encoder = Encoding.ASCII;
ArrayList nameBytes = new ArrayList();
byte curByte;
if(!noOffset)
binReader.BaseStream.Seek(offset, SeekOrigin.Begin);
if(binReader.BaseStream.Position >= binReader.BaseStream.Length)
return "";
curByte = binReader.ReadByte();
while( (curByte != (byte)0) && (binReader.BaseStream.Position < binReader.BaseStream.Length) )
{
nameBytes.Add( curByte );
curByte = binReader.ReadByte();
}
byte[] name = (byte[]) (nameBytes.ToArray(System.Type.GetType("System.Byte")));
strReturn = encoder.GetString(name,0,name.Length);
return strReturn;
}
/// <summary>
/// Internal helper method to extract a string with a specific length from the binary reader
/// </summary>
/// <param name="binReader">reference to the binary reader</param>
/// <param name="length">length of the string (number of bytes)</param>
/// <param name="offset">offset in the stream</param>
/// <param name="noOffset">true if the offset value should be used</param>
/// <param name="encoder">encoder used for text encoding</param>
/// <returns>An extracted string value</returns>
internal static string ExtractString(ref BinaryReader binReader, int length, int offset, bool noOffset, Encoding encoder)
{
string strReturn = "";
if(length == 0)
return "";
if(encoder == null)
encoder = Encoding.ASCII;
ArrayList nameBytes = new ArrayList();
byte curByte;
if(!noOffset)
binReader.BaseStream.Seek(offset, SeekOrigin.Begin);
if(binReader.BaseStream.Position >= binReader.BaseStream.Length)
return "";
curByte = binReader.ReadByte();
while( (curByte != (byte)0) && (nameBytes.Count < length) && (binReader.BaseStream.Position < binReader.BaseStream.Length) )
{
nameBytes.Add( curByte );
if(nameBytes.Count < length)
curByte = binReader.ReadByte();
}
byte[] name = (byte[]) (nameBytes.ToArray(System.Type.GetType("System.Byte")));
strReturn = encoder.GetString(name,0,name.Length);
return strReturn;
}
/// <summary>
/// Internal helper method to extract a string with a specific length from the binary reader
/// </summary>
/// <param name="binReader">reference to the binary reader</param>
/// <param name="bFoundTerminator">reference to a bool vairable which will receive true if the
/// string terminator \0 was found. false indicates that the end of the stream was reached.</param>
/// <param name="offset">offset in the stream</param>
/// <param name="noOffset">true if the offset value should be used</param>
/// <param name="encoder">encoder used for text encoding</param>
/// <returns>An extracted string value</returns>
internal static string ExtractString(ref BinaryReader binReader, ref bool bFoundTerminator, int offset, bool noOffset, Encoding encoder)
{
string strReturn = "";
ArrayList nameBytes = new ArrayList();
byte curByte;
if(encoder == null)
encoder = Encoding.ASCII;
if(!noOffset)
binReader.BaseStream.Seek(offset, SeekOrigin.Begin);
if(binReader.BaseStream.Position >= binReader.BaseStream.Length)
return "";
curByte = binReader.ReadByte();
while( (curByte != (byte)0) && (binReader.BaseStream.Position < binReader.BaseStream.Length) )
{
nameBytes.Add( curByte );
curByte = binReader.ReadByte();
if( curByte == (byte)0 )
{
bFoundTerminator = true;
}
}
byte[] name = (byte[]) (nameBytes.ToArray(System.Type.GetType("System.Byte")));
strReturn = encoder.GetString(name,0,name.Length);
return strReturn;
}
/// <summary>
/// Internal helper method to extract a null-terminated UTF-16/UCS-2 strings from a binary reader
/// </summary>
/// <param name="binReader">reference to the binary reader</param>
/// <param name="offset">offset in the stream</param>
/// <param name="noOffset">true if the offset value should be used</param>
/// <param name="encoder">encoder used for text encoding</param>
/// <returns>An extracted string value</returns>
internal static string ExtractUTF16String(ref BinaryReader binReader, int offset, bool noOffset, Encoding encoder)
{
string strReturn = "";
ArrayList nameBytes = new ArrayList();
byte curByte;
int lastByte=-1;
if(!noOffset)
binReader.BaseStream.Seek(offset, SeekOrigin.Begin);
if(binReader.BaseStream.Position >= binReader.BaseStream.Length)
return "";
if(encoder == null)
encoder = Encoding.Unicode;
curByte = binReader.ReadByte();
int nCnt = 0;
while( ((curByte != (byte)0) || (lastByte != 0) ) && (binReader.BaseStream.Position < binReader.BaseStream.Length) )
{
nameBytes.Add( curByte );
if(nCnt%2 == 0)
lastByte = (int)curByte;
curByte = binReader.ReadByte();
nCnt++;
}
byte[] name = (byte[]) (nameBytes.ToArray(System.Type.GetType("System.Byte")));
strReturn = Encoding.Unicode.GetString(name,0,name.Length);
// apply text encoding
name = Encoding.Default.GetBytes(strReturn);
strReturn = encoder.GetString(name,0,name.Length);
return strReturn;
}
/// <summary>
/// Internal helper for reading ENCINT encoded integer values
/// </summary>
/// <param name="binReader">reference to the reader</param>
/// <returns>a long value</returns>
internal static long ReadENCINT(ref BinaryReader binReader)
{
long nRet = 0;
byte buffer = 0;
int shift = 0;
if(binReader.BaseStream.Position >= binReader.BaseStream.Length)
return nRet;
do
{
buffer = binReader.ReadByte();
nRet |= ((long)((buffer & (byte)0x7F))) << shift;
shift += 7;
}while ( (buffer & (byte)0x80) != 0);
return nRet;
}
/// <summary>
/// Reads an s/r encoded value from the byte array and decodes it into an integer
/// </summary>
/// <param name="wclBits">a byte array containing all bits (contains only 0 or 1 elements)</param>
/// <param name="s">scale param for encoding</param>
/// <param name="r">root param for encoding</param>
/// <param name="nBitIndex">current index in the wclBits array</param>
/// <returns>Returns an decoded integer value.</returns>
internal static int ReadSRItem(byte[] wclBits, int s, int r, ref int nBitIndex)
{
int nRet = 0;
int q = r;
int nPref1Cnt = 0;
while( wclBits[nBitIndex++] == 1)
{
nPref1Cnt++;
}
if(nPref1Cnt == 0)
{
int nMask = 0;
for(int nbits=0; nbits<q;nbits++)
{
nMask |= ( 0x01 & (int)wclBits[nBitIndex]) << (q-nbits-1);
nBitIndex++;
}
nRet = nMask;
}
else
{
q += (nPref1Cnt-1);
int nMask = 0;
int nRMaxValue = 0;
for(int nbits=0; nbits<q;nbits++)
{
nMask |= ( 0x01 & (int)wclBits[nBitIndex]) << (q-nbits-1);
nBitIndex++;
}
for(int nsv=0; nsv<r; nsv++)
{
nRMaxValue = nRMaxValue << 1;
nRMaxValue |= 0x1;
}
nRMaxValue++; // startvalue of s/r encoding with 1 prefixing '1'
nRMaxValue *= (int) Math.Pow((double)2, (double)(nPref1Cnt-1));
nRet = nRMaxValue + nMask;
}
return nRet;
}
}
}

View File

@@ -0,0 +1,325 @@
using System;
using System.IO;
using System.Collections;
using System.Collections.Specialized;
namespace HtmlHelp.ChmDecoding
{
/// <summary>
/// The class <c>CHMBtree</c> implements methods/properties to decode the binary help index.
/// This class automatically creates an index arraylist for the current CHMFile instance.
/// It does not store the index internally !
/// </summary>
/// <remarks>The binary index can be found in the storage file $WWKeywordLinks/BTree</remarks>
internal sealed class CHMBtree : IDisposable
{
/// <summary>
/// Constant specifying the size of the string blocks
/// </summary>
private const int BLOCK_SIZE = 2048;
/// <summary>
/// Internal flag specifying if the object is going to be disposed
/// </summary>
private bool disposed = false;
/// <summary>
/// Internal member storing the binary file data
/// </summary>
private byte[] _binaryFileData = null;
/// <summary>
/// Internal member storing flags
/// </summary>
private int _flags = 0;
/// <summary>
/// Internal member storing the data format
/// </summary>
private byte[] _dataFormat = new byte[16];
/// <summary>
/// Internal member storing the index of the last listing block
/// </summary>
private int _indexOfLastListingBlock = 0;
/// <summary>
/// Internal member storing the index of the root block
/// </summary>
private int _indexOfRootBlock = 0;
/// <summary>
/// Internal member storing the number of blocks
/// </summary>
private int _numberOfBlocks = 0;
/// <summary>
/// Internal member storing the tree depth.
/// (1 if no index blocks, 2 one level of index blocks, ...)
/// </summary>
private int _treeDepth = 0;
/// <summary>
/// Internal member storing the number of keywords in the file
/// </summary>
private int _numberOfKeywords = 0;
/// <summary>
/// Internal member storing the codepage
/// </summary>
private int _codePage = 0;
/// <summary>
/// true if the index is from a CHI or CHM file, else CHW
/// </summary>
private bool _isCHI_CHM = true;
/// <summary>
/// Internal member storing the associated chmfile object
/// </summary>
private CHMFile _associatedFile = null;
/// <summary>
/// Internal flag specifying if we have to read listing or index blocks
/// </summary>
private bool _readListingBlocks = true;
/// <summary>
/// Internal member storing an indexlist of the current file.
/// </summary>
private ArrayList _indexList = new ArrayList();
/// <summary>
/// Constructor of the class
/// </summary>
/// <param name="binaryFileData">binary file data of the $WWKeywordLinks/BTree file</param>
/// <param name="associatedFile">associated chm file</param>
public CHMBtree(byte[] binaryFileData, CHMFile associatedFile)
{
if( associatedFile == null)
{
throw new ArgumentException("CHMBtree.ctor() - Associated CHMFile must not be null !", "associatedFile");
}
_binaryFileData = binaryFileData;
_associatedFile = associatedFile;
DecodeData();
// clear internal binary data after extraction
_binaryFileData = null;
}
/// <summary>
/// Decodes the binary file data and fills the internal properties
/// </summary>
/// <returns>true if succeeded</returns>
private bool DecodeData()
{
bool bRet = true;
MemoryStream memStream = new MemoryStream(_binaryFileData);
BinaryReader binReader = new BinaryReader(memStream);
int nCurOffset = 0;
int nTemp = 0;
// decode header
binReader.ReadChars(2); // 2chars signature (not important)
_flags = (int)binReader.ReadInt16(); // WORD flags
binReader.ReadInt16(); // size of blocks (always 2048)
_dataFormat = binReader.ReadBytes(16);
binReader.ReadInt32(); // unknown DWORD
_indexOfLastListingBlock = binReader.ReadInt32();
_indexOfRootBlock = binReader.ReadInt32();
binReader.ReadInt32(); // unknown DWORD
_numberOfBlocks = binReader.ReadInt32();
_treeDepth = binReader.ReadInt16();
_numberOfKeywords = binReader.ReadInt32();
_codePage = binReader.ReadInt32();
binReader.ReadInt32(); // lcid DWORD
nTemp = binReader.ReadInt32();
_isCHI_CHM = (nTemp==1);
binReader.ReadInt32(); // unknown DWORD
binReader.ReadInt32(); // unknown DWORD
binReader.ReadInt32(); // unknown DWORD
binReader.ReadInt32(); // unknown DWORD
// end of header decode
while( (memStream.Position < memStream.Length) && (bRet) )
{
nCurOffset = (int)memStream.Position;
byte [] dataBlock = binReader.ReadBytes(BLOCK_SIZE);
bRet &= DecodeBlock(dataBlock, ref nCurOffset, _treeDepth-1);
}
return bRet;
}
/// <summary>
/// Decodes a block of url-string data
/// </summary>
/// <param name="dataBlock">block of data</param>
/// <param name="nOffset">current file offset</param>
/// <param name="indexBlocks">number of index blocks</param>
/// <returns>true if succeeded</returns>
private bool DecodeBlock( byte[] dataBlock, ref int nOffset, int indexBlocks )
{
bool bRet = true;
int nblockOffset = nOffset;
MemoryStream memStream = new MemoryStream(dataBlock);
BinaryReader binReader = new BinaryReader(memStream);
int freeSpace = binReader.ReadInt16(); // length of freespace
int nrOfEntries = binReader.ReadInt16(); // number of entries
bool bListingEndReached = false;
//while( (memStream.Position < (memStream.Length-freeSpace)) && (bRet) )
//{
int nIndexOfPrevBlock = -1;
int nIndexOfNextBlock = -1;
int nIndexOfChildBlock = 0;
if(_readListingBlocks)
{
nIndexOfPrevBlock = binReader.ReadInt32(); // -1 if this is the header
nIndexOfNextBlock = binReader.ReadInt32(); // -1 if this is the last block
}
else
{
nIndexOfChildBlock = binReader.ReadInt32();
}
for(int nE = 0; nE < nrOfEntries; nE++)
{
if(_readListingBlocks)
{
bListingEndReached = (nIndexOfNextBlock==-1);
string keyWord = BinaryReaderHelp.ExtractUTF16String(ref binReader, 0, true, _associatedFile.TextEncoding);
bool isSeeAlsoKeyword = (binReader.ReadInt16()!=0);
int indent = binReader.ReadInt16(); // indent of entry
int nCharIndex = binReader.ReadInt32();
binReader.ReadInt32();
int numberOfPairs = binReader.ReadInt32();
int[] nTopics = new int[numberOfPairs];
string[] seeAlso = new string[numberOfPairs];
for(int i=0; i < numberOfPairs; i++)
{
if(isSeeAlsoKeyword)
{
seeAlso[i] = BinaryReaderHelp.ExtractUTF16String(ref binReader, 0, true, _associatedFile.TextEncoding);
}
else
{
nTopics[i] = binReader.ReadInt32();
}
}
binReader.ReadInt32(); // unknown
int nIndexOfThisEntry = binReader.ReadInt32();
IndexItem newItem = new IndexItem(_associatedFile, keyWord, isSeeAlsoKeyword, indent, nCharIndex, nIndexOfThisEntry, seeAlso, nTopics);
_indexList.Add(newItem);
}
else
{
string keyWord = BinaryReaderHelp.ExtractUTF16String(ref binReader, 0, true, _associatedFile.TextEncoding);
bool isSeeAlsoKeyword = (binReader.ReadInt16()!=0);
int indent = binReader.ReadInt16(); // indent of entry
int nCharIndex = binReader.ReadInt32();
binReader.ReadInt32();
int numberOfPairs = binReader.ReadInt32();
int[] nTopics = new int[numberOfPairs];
string[] seeAlso = new string[numberOfPairs];
for(int i=0; i < numberOfPairs; i++)
{
if(isSeeAlsoKeyword)
{
seeAlso[i] = BinaryReaderHelp.ExtractUTF16String(ref binReader, 0, true, _associatedFile.TextEncoding);
}
else
{
nTopics[i] = binReader.ReadInt32();
}
}
int nIndexChild = binReader.ReadInt32();
int nIndexOfThisEntry=-1;
IndexItem newItem = new IndexItem(_associatedFile, keyWord, isSeeAlsoKeyword, indent, nCharIndex, nIndexOfThisEntry, seeAlso, nTopics);
_indexList.Add(newItem);
}
}
//}
binReader.ReadBytes(freeSpace);
if( bListingEndReached )
_readListingBlocks = false;
return bRet;
}
/// <summary>
/// Gets the internal generated index list
/// </summary>
internal ArrayList IndexList
{
get { return _indexList; }
}
/// <summary>
/// Implement IDisposable.
/// </summary>
public void Dispose()
{
Dispose(true);
// This object will be cleaned up by the Dispose method.
// Therefore, you should call GC.SupressFinalize to
// take this object off the finalization queue
// and prevent finalization code for this object
// from executing a second time.
GC.SuppressFinalize(this);
}
/// <summary>
/// Dispose(bool disposing) executes in two distinct scenarios.
/// If disposing equals true, the method has been called directly
/// or indirectly by a user's code. Managed and unmanaged resources
/// can be disposed.
/// If disposing equals false, the method has been called by the
/// runtime from inside the finalizer and you should not reference
/// other objects. Only unmanaged resources can be disposed.
/// </summary>
/// <param name="disposing">disposing flag</param>
private void Dispose(bool disposing)
{
// Check to see if Dispose has already been called.
if(!this.disposed)
{
// If disposing equals true, dispose all managed
// and unmanaged resources.
if(disposing)
{
// Dispose managed resources.
_binaryFileData = null;
}
}
disposed = true;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,286 @@
using System;
using System.Collections;
using System.IO;
namespace HtmlHelp.ChmDecoding
{
/// <summary>
/// The class <c>CHMIdxhdr</c> implements t properties which have been read from the #IDXHDR file.
/// </summary>
internal sealed class CHMIdxhdr : IDisposable
{
/// <summary>
/// Internal flag specifying if the object is going to be disposed
/// </summary>
private bool disposed = false;
/// <summary>
/// Internal member storing the binary file data
/// </summary>
private byte[] _binaryFileData = null;
/// <summary>
/// Internal member storing the number of topic nodes including the contents and index files
/// </summary>
private int _numberOfTopicNodes = 0;
/// <summary>
/// Internal member storing the offset in the #STRINGS file of the ImageList param of the "text/site properties" object of the sitemap contents
/// </summary>
private int _imageListOffset = 0;
/// <summary>
/// True if the value of the ImageType param of the "text/site properties" object of the sitemap contents is "Folder".
/// </summary>
private bool _imageTypeFolder = false;
/// <summary>
/// Internal member storing the background value
/// </summary>
private int _background = 0;
/// <summary>
/// Internal member storing the foreground value
/// </summary>
private int _foreground = 0;
/// <summary>
/// Internal member storing the offset in the #STRINGS file of the Font param of the "text/site properties" object of the sitemap contents
/// </summary>
private int _fontOffset = 0;
/// <summary>
/// Internal member storing the offset in the #STRINGS file of the FrameName param of the "text/site properties" object of the sitemap contents
/// </summary>
private int _frameNameOffset = 0;
/// <summary>
/// Internal member storing the offset in the #STRINGS file of the WindowName param of the "text/site properties" object of the sitemap contents
/// </summary>
private int _windowNameOffset = 0;
/// <summary>
/// Internal member storing the number of merged files
/// </summary>
private int _numberOfMergedFiles = 0;
/// <summary>
/// Internal member storing the offset in the #STRINGS file of the merged file names
/// </summary>
private ArrayList _mergedFileOffsets = new ArrayList();
/// <summary>
/// Internal member storing the associated chmfile object
/// </summary>
private CHMFile _associatedFile = null;
/// <summary>
/// Constructor of the class
/// </summary>
/// <param name="binaryFileData">binary file data of the #IDXHDR file</param>
/// <param name="associatedFile">associated CHMFile instance</param>
public CHMIdxhdr(byte[] binaryFileData, CHMFile associatedFile)
{
_binaryFileData = binaryFileData;
_associatedFile = associatedFile;
DecodeData();
}
/// <summary>
/// Decodes the binary file data and fills the internal properties
/// </summary>
/// <returns>true if succeeded</returns>
private bool DecodeData()
{
bool bRet = true;
MemoryStream memStream = new MemoryStream(_binaryFileData);
BinaryReader binReader = new BinaryReader(memStream);
int nTemp = 0;
// 4 character T#SM
binReader.ReadBytes(4);
// unknown timestamp DWORD
nTemp = binReader.ReadInt32();
// unknown 1
nTemp = binReader.ReadInt32();
// number of topic nodes including the contents & index files
_numberOfTopicNodes = binReader.ReadInt32();
// unknown DWORD
nTemp = binReader.ReadInt32();
// offset in the strings file
_imageListOffset = binReader.ReadInt32();
if( _imageListOffset == 0)
_imageListOffset = -1; // 0/-1 = none
// unknown DWORD
nTemp = binReader.ReadInt32();
// 1 if the value of the ImageType param of the "text/site properties" object of the sitemap contents is "Folder".
nTemp = binReader.ReadInt32();
_imageTypeFolder = (nTemp == 1);
// offset in the strings file
_background = binReader.ReadInt32();
// offset in the strings file
_foreground = binReader.ReadInt32();
// offset in the strings file
_fontOffset = binReader.ReadInt32();
// window styles DWORD
nTemp = binReader.ReadInt32();
// window styles DWORD
nTemp = binReader.ReadInt32();
// unknown DWORD
nTemp = binReader.ReadInt32();
// offset in the strings file
_frameNameOffset = binReader.ReadInt32();
if( _frameNameOffset == 0)
_frameNameOffset = -1; // 0/-1 = none
// offset in the strings file
_windowNameOffset = binReader.ReadInt32();
if( _windowNameOffset == 0)
_windowNameOffset = -1; // 0/-1 = none
// informations types DWORD
nTemp = binReader.ReadInt32();
// unknown DWORD
nTemp = binReader.ReadInt32();
// number of merged files in the merged file list DWORD
_numberOfMergedFiles = binReader.ReadInt32();
nTemp = binReader.ReadInt32();
for(int i = 0; i < _numberOfMergedFiles; i++)
{
// DWORD offset value of merged file
nTemp = binReader.ReadInt32();
if(nTemp > 0)
_mergedFileOffsets.Add(nTemp);
}
return bRet;
}
/// <summary>
/// Gets the number of topic nodes including the contents and index files
/// </summary>
public int NumberOfTopicNodes
{
get { return _numberOfTopicNodes; }
}
/// <summary>
/// Gets the offset in the #STRINGS file of the ImageList
/// param of the "text/site properties" object of the sitemap contents
/// </summary>
public int ImageListOffset
{
get { return _imageListOffset; }
}
/// <summary>
/// True if the value of the ImageType param of the
/// "text/site properties" object of the sitemap contents is "Folder".
/// </summary>
/// <remarks>If this is set to true, the help will display folders instead of books</remarks>
public bool ImageTypeFolder
{
get { return _imageTypeFolder; }
}
/// <summary>
/// Gets the background setting
/// </summary>
public int Background
{
get { return _background; }
}
/// <summary>
/// Gets the foreground setting
/// </summary>
public int Foreground
{
get { return _foreground; }
}
/// <summary>
/// Gets the offset in the #STRINGS file of the Font
/// param of the "text/site properties" object of the sitemap contents
/// </summary>
public int WindowNameOffset
{
get { return _fontOffset; }
}
/// <summary>
/// Gets the offset in the #STRINGS file of the FrameName
/// param of the "text/site properties" object of the sitemap contents
/// </summary>
public int FrameNameOffset
{
get { return _frameNameOffset; }
}
/// <summary>
/// Gets the offset in the #STRINGS file of the WindowName
/// param of the "text/site properties" object of the sitemap contents
/// </summary>
public int FontOffset
{
get { return _windowNameOffset; }
}
/// <summary>
/// Gets an array list of offset numbers in the #STRINGS file of the
/// merged file names.
/// </summary>
public ArrayList MergedFileOffsets
{
get { return _mergedFileOffsets; }
}
/// <summary>
/// Implement IDisposable.
/// </summary>
public void Dispose()
{
Dispose(true);
// This object will be cleaned up by the Dispose method.
// Therefore, you should call GC.SupressFinalize to
// take this object off the finalization queue
// and prevent finalization code for this object
// from executing a second time.
GC.SuppressFinalize(this);
}
/// <summary>
/// Dispose(bool disposing) executes in two distinct scenarios.
/// If disposing equals true, the method has been called directly
/// or indirectly by a user's code. Managed and unmanaged resources
/// can be disposed.
/// If disposing equals false, the method has been called by the
/// runtime from inside the finalizer and you should not reference
/// other objects. Only unmanaged resources can be disposed.
/// </summary>
/// <param name="disposing">disposing flag</param>
private void Dispose(bool disposing)
{
// Check to see if Dispose has already been called.
if(!this.disposed)
{
// If disposing equals true, dispose all managed
// and unmanaged resources.
if(disposing)
{
// Dispose managed resources.
_binaryFileData = null;
_mergedFileOffsets = null;
}
}
disposed = true;
}
}
}

View File

@@ -0,0 +1,256 @@
using System;
using System.IO;
using System.Collections;
using System.Collections.Specialized;
namespace HtmlHelp.ChmDecoding
{
/// <summary>
/// The class <c>CHMStrings</c> implements a string collection read from the #STRINGS file
/// </summary>
internal sealed class CHMStrings : IDisposable
{
/// <summary>
/// Constant specifying the size of the string blocks
/// </summary>
private const int STRING_BLOCK_SIZE = 4096;
/// <summary>
/// Internal flag specifying if the object is going to be disposed
/// </summary>
private bool disposed = false;
/// <summary>
/// Internal member storing the binary file data
/// </summary>
private byte[] _binaryFileData = null;
/// <summary>
/// Internal member storing the string dictionary
/// </summary>
private Hashtable _stringDictionary = new Hashtable();
/// <summary>
/// Internal member storing the associated chmfile object
/// </summary>
private CHMFile _associatedFile = null;
/// <summary>
/// Constructor of the class
/// </summary>
/// <param name="binaryFileData">binary file data of the #STRINGS file</param>
/// <param name="associatedFile">associated chm file</param>
public CHMStrings(byte[] binaryFileData, CHMFile associatedFile)
{
_binaryFileData = binaryFileData;
_associatedFile = associatedFile;
DecodeData();
}
/// <summary>
/// Standard constructor
/// </summary>
internal CHMStrings()
{
}
#region Data dumping
/// <summary>
/// Dump the class data to a binary writer
/// </summary>
/// <param name="writer">writer to write the data</param>
internal void Dump(ref BinaryWriter writer)
{
writer.Write( _stringDictionary.Count );
if (_stringDictionary.Count != 0)
{
IDictionaryEnumerator iDictionaryEnumerator = _stringDictionary.GetEnumerator();
while (iDictionaryEnumerator.MoveNext())
{
DictionaryEntry dictionaryEntry = (DictionaryEntry)iDictionaryEnumerator.Current;
writer.Write( Int32.Parse(dictionaryEntry.Key.ToString()) );
writer.Write( dictionaryEntry.Value.ToString() );
}
}
}
/// <summary>
/// Reads the object data from a dump store
/// </summary>
/// <param name="reader">reader to read the data</param>
internal void ReadDump(ref BinaryReader reader)
{
int nCnt = reader.ReadInt32();
for(int i=0; i<nCnt;i++)
{
int nKey = reader.ReadInt32();
string sValue = reader.ReadString();
_stringDictionary[nKey.ToString()] = sValue;
}
}
/// <summary>
/// Sets the associated CHMFile instance
/// </summary>
/// <param name="associatedFile">instance to set</param>
internal void SetCHMFile(CHMFile associatedFile)
{
_associatedFile = associatedFile;
}
#endregion
/// <summary>
/// Decodes the binary file data and fills the internal properties
/// </summary>
/// <returns>true if succeeded</returns>
private bool DecodeData()
{
bool bRet = true;
MemoryStream memStream = new MemoryStream(_binaryFileData);
BinaryReader binReader = new BinaryReader(memStream);
//binReader.ReadByte(); // file starts with a NULL character for 0-based offset indexing
int nStringOffset = 0;
int nSubsetOffset = 0;
while( (memStream.Position < memStream.Length) && (bRet) )
{
nStringOffset = (int)memStream.Position;
byte [] stringBlock = binReader.ReadBytes(STRING_BLOCK_SIZE);
bRet &= DecodeBlock(stringBlock, ref nStringOffset, ref nSubsetOffset);
}
return bRet;
}
/// <summary>
/// Decodes a string block
/// </summary>
/// <param name="stringBlock">byte array which represents the string block</param>
/// <param name="nStringOffset">current string offset number</param>
/// <param name="nSubsetOffset">reference to a subset variable</param>
/// <returns>true if succeeded</returns>
/// <remarks>If a string crosses the end of a block then it will be cut off
/// without a NT and repeated in full, with a NT, at the start of the next block.
/// For eg "To customize the appearance of a contents file" might become
/// "To customize the (block ending)To customize the appearance of a contents file"
/// when there are 17 bytes left at the end of the block. </remarks>
private bool DecodeBlock( byte[] stringBlock, ref int nStringOffset, ref int nSubsetOffset)
{
bool bRet = true;
MemoryStream memStream = new MemoryStream(stringBlock);
BinaryReader binReader = new BinaryReader(memStream);
while( (memStream.Position < memStream.Length) && (bRet) )
{
bool bFoundTerminator = false;
int nCurOffset = nStringOffset + (int)memStream.Position;
string sTemp = BinaryReaderHelp.ExtractString(ref binReader, ref bFoundTerminator, 0, true, _associatedFile.TextEncoding);
if(nSubsetOffset != 0)
{
_stringDictionary[nSubsetOffset.ToString()] = sTemp.ToString();
}
else
{
_stringDictionary[nCurOffset.ToString()] = sTemp.ToString();
}
if( bFoundTerminator )
{
nSubsetOffset = 0;
}
else
{
nSubsetOffset = nCurOffset;
}
}
return bRet;
}
/// <summary>
/// Indexer which returns the string at a given offset
/// </summary>
public string this[int offset]
{
get
{
if(offset == -1)
return String.Empty;
string sTemp = (string)_stringDictionary[ offset.ToString() ];
if(sTemp == null)
return String.Empty;
return sTemp;
}
}
/// <summary>
/// Indexer which returns the string at a given offset
/// </summary>
public string this[string offset]
{
get
{
if(offset == "-1")
return String.Empty;
string sTemp = (string)_stringDictionary[ offset ];
if(sTemp == null)
return String.Empty;
return sTemp;
}
}
/// <summary>
/// Implement IDisposable.
/// </summary>
public void Dispose()
{
Dispose(true);
// This object will be cleaned up by the Dispose method.
// Therefore, you should call GC.SupressFinalize to
// take this object off the finalization queue
// and prevent finalization code for this object
// from executing a second time.
GC.SuppressFinalize(this);
}
/// <summary>
/// Dispose(bool disposing) executes in two distinct scenarios.
/// If disposing equals true, the method has been called directly
/// or indirectly by a user's code. Managed and unmanaged resources
/// can be disposed.
/// If disposing equals false, the method has been called by the
/// runtime from inside the finalizer and you should not reference
/// other objects. Only unmanaged resources can be disposed.
/// </summary>
/// <param name="disposing">disposing flag</param>
private void Dispose(bool disposing)
{
// Check to see if Dispose has already been called.
if(!this.disposed)
{
// If disposing equals true, dispose all managed
// and unmanaged resources.
if(disposing)
{
// Dispose managed resources.
_binaryFileData = null;
_stringDictionary = null;
}
}
disposed = true;
}
}
}

View File

@@ -0,0 +1,821 @@
using System;
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Globalization;
namespace HtmlHelp.ChmDecoding
{
/// <summary>
/// The class <c>CHMSystem</c> reads the #SYSTEM file of the chm and stores its settings
/// </summary>
internal sealed class CHMSystem : IDisposable
{
/// <summary>
/// Internal flag specifying if the object is going to be disposed
/// </summary>
private bool disposed = false;
/// <summary>
/// Internal member storing the binary file data
/// </summary>
private byte[] _binaryFileData = null;
/// <summary>
/// Internal member storing the file version
/// </summary>
private int _fileVersion = 0;
/// <summary>
/// Internal member storing the contents file path
/// </summary>
private string _contentsFile = "";
/// <summary>
/// Internal member storing the index file path
/// </summary>
private string _indexFile = "";
/// <summary>
/// Internal member storing the default help topic
/// </summary>
private string _defaultTopic = "";
/// <summary>
/// Internal member storing the help-window title
/// </summary>
private string _title = "";
/// <summary>
/// Internal flag if dbcs is on
/// </summary>
private bool _dbcs = false;
/// <summary>
/// Internal flag if fulltext search is enabled
/// </summary>
private bool _fullTextSearch = false;
/// <summary>
/// Internal flag if KLinks are in the file
/// </summary>
private bool _hasKLinks = false;
/// <summary>
/// Internal flag if ALinks are in the file
/// </summary>
private bool _hasALinks = false;
/// <summary>
/// Internal member storing the name of the default window
/// </summary>
private string _defaultWindow = "";
/// <summary>
/// Internal member storing the filename of the compiled file
/// </summary>
private string _compileFile = "";
/// <summary>
/// Internal flag storing the offset value of the binary index
/// </summary>
private uint _binaryIndexURLTableID = 0;
/// <summary>
/// Inernal member storing the compiler version this file was compiled
/// </summary>
private string _compilerVersion = "";
/// <summary>
/// Internal flag storing the offset value of the binary TOC
/// </summary>
private uint _binaryTOCURLTableID = 0;
/// <summary>
/// Internal member storing the associated chmfile object
/// </summary>
private CHMFile _associatedFile = null;
/// <summary>
/// Internal member storing the default fontface, size, charset
/// </summary>
private string _defaultFont = "";
/// <summary>
/// Internal member storing the culture info of the file
/// </summary>
private CultureInfo _culture;
/// <summary>
/// Constructor of the class
/// </summary>
/// <param name="binaryFileData">binary file data of the #SYSTEM file</param>
/// <param name="associatedFile">associated chm file</param>
public CHMSystem(byte[] binaryFileData, CHMFile associatedFile)
{
_binaryFileData = binaryFileData;
_associatedFile = associatedFile;
DecodeData();
if(_culture == null)
{
// Set the text encoder of the chm file to the read charset/codepage
_associatedFile.TextEncoding = Encoding.GetEncoding( this.CodePage );
}
}
/// <summary>
/// Decodes the binary file data and fills the internal properties
/// </summary>
/// <returns>true if succeeded</returns>
private bool DecodeData()
{
bool bRet = true;
MemoryStream memStream = new MemoryStream(_binaryFileData);
BinaryReader binReader = new BinaryReader(memStream);
// First entry = DWORD for version number
_fileVersion = (int) binReader.ReadInt32();
while( (memStream.Position < memStream.Length) && (bRet) )
{
bRet &= DecodeEntry(ref binReader);
}
return bRet;
}
/// <summary>
/// Decodes an #system file entry
/// </summary>
/// <param name="binReader">binary reader reference</param>
/// <returns>true if succeeded</returns>
private bool DecodeEntry(ref BinaryReader binReader)
{
bool bRet = true;
int code = (int) binReader.ReadInt16(); // entry code, WORD
int length = (int) binReader.ReadInt16(); // length of entry
switch(code)
{
case 0:
{
_contentsFile = BinaryReaderHelp.ExtractString(ref binReader,length, 0, true, _associatedFile.TextEncoding);
};break;
case 1:
{
_indexFile = BinaryReaderHelp.ExtractString(ref binReader,length, 0, true, _associatedFile.TextEncoding);
};break;
case 2:
{
_defaultTopic = BinaryReaderHelp.ExtractString(ref binReader,length, 0, true, _associatedFile.TextEncoding);
};break;
case 3:
{
_title = BinaryReaderHelp.ExtractString(ref binReader,length, 0, true, _associatedFile.TextEncoding);
};break;
case 4:
{
int nTemp = 0;
nTemp = binReader.ReadInt32(); // read DWORD LCID
_culture = new CultureInfo(nTemp);
if(_culture != null)
_associatedFile.TextEncoding = Encoding.GetEncoding(_culture.TextInfo.ANSICodePage);
nTemp = binReader.ReadInt32(); // read DWORD DBCS
_dbcs = (nTemp == 1);
nTemp = binReader.ReadInt32(); // read DWORD Fulltext search
_fullTextSearch = (nTemp == 1);
nTemp = binReader.ReadInt32(); // read DWORD has klinks
_hasKLinks = (nTemp != 0);
nTemp = binReader.ReadInt32(); // read DWORD has alinks
_hasALinks = (nTemp != 0);
// read the rest of code 4 (not important for us)
byte[] temp = new byte[length-(5*4)];
temp = binReader.ReadBytes(length-(5*4));
};break;
case 5:
{
_defaultWindow = BinaryReaderHelp.ExtractString(ref binReader,length, 0, true, _associatedFile.TextEncoding);
};break;
case 6:
{
_compileFile = BinaryReaderHelp.ExtractString(ref binReader,length, 0, true, _associatedFile.TextEncoding);
};break;
case 7:
{
if(_fileVersion > 2)
{
_binaryIndexURLTableID = (uint) binReader.ReadInt32();
}
else
{
byte[] read = binReader.ReadBytes(length);
int i=read.Length;
}
};break;
case 8:
{
// abbreviation (not interresting for us)
byte[] read = binReader.ReadBytes(length);
int i=read.Length;
};break;
case 9:
{
_compilerVersion = BinaryReaderHelp.ExtractString(ref binReader,length, 0, true, _associatedFile.TextEncoding);
};break;
case 10:
{
// timestamp of the file (not interresting for us)
byte[] read = binReader.ReadBytes(length);
int i=read.Length;
};break;
case 11:
{
if(_fileVersion > 2)
{
_binaryTOCURLTableID = (uint) binReader.ReadInt32();
}
else
{
byte[] read = binReader.ReadBytes(length);
int i=read.Length;
}
};break;
case 12:
{
// number of information bytes
byte[] read = binReader.ReadBytes(length);
int i=read.Length;
};break;
case 13:
{
// copy of file #idxhdr
byte[] read = binReader.ReadBytes(length);
int i=read.Length;
};break;
case 14:
{
// custom tabs for HH viewer
byte[] read = binReader.ReadBytes(length);
int i=read.Length;
};break;
case 15:
{
// a checksum
byte[] read = binReader.ReadBytes(length);
int i=read.Length;
};break;
case 16:
{
// Default Font=string,number,number
// The string is the name of the font, the first number is the
// point size & the last number is the character set used by the font.
// For acceptable values see *_CHARSET defines in wingdi.h from the
// Windows SDK or the same file in MinGW or Wine.
// Most of the time you will only want to use 0, which is the value for ANSI,
// which is the subset of ASCII used by Windows.
_defaultFont = BinaryReaderHelp.ExtractString(ref binReader,length, 0, true, _associatedFile.TextEncoding);
};break;
default:
{
byte[] temp = new byte[length];
temp = binReader.ReadBytes(length);
//bRet = false;
int i=temp.Length;
};break;
}
return bRet;
}
/// <summary>
/// Reads all HHC files and checks which one has the global object tag.
/// This hhc file will be returned as master hhc
/// </summary>
/// <param name="hhcTopics">list of topics containing the extension hhc</param>
/// <param name="TopicItemArrayList">true if the arraylist contains topic items</param>
/// <returns>the filename of the found master toc</returns>
private string GetMasterHHC(ArrayList hhcTopics, bool TopicItemArrayList)
{
string sRet = "";
if( (hhcTopics!=null) && (hhcTopics.Count > 0) )
{
if( TopicItemArrayList )
{
if(hhcTopics.Count == 1)
{
sRet = ((TopicEntry)hhcTopics[0]).Locale;
}
else
{
foreach(TopicEntry curEntry in hhcTopics)
{
CHMStream.CHMStream iw=null;
MemoryStream fileObject=null;
if( _associatedFile.CurrentStorageWrapper == null)
{
iw=new CHMStream.CHMStream();
iw.OpenCHM(_associatedFile.ChmFilePath);
}
else
{
iw = _associatedFile.CurrentStorageWrapper;
}
fileObject = iw.OpenStream(curEntry.Locale);
if( fileObject != null)
{
string fileString =_associatedFile.TextEncoding.GetString(fileObject.ToArray(),0,(int)fileObject.Length);
fileObject.Close();
if( HHCParser.HasGlobalObjectTag(fileString, _associatedFile) )
{
sRet = curEntry.Locale;
break;
}
}
}
}
}
else
{
if(hhcTopics.Count == 1)
{
sRet = ((string)hhcTopics[0]);
}
else
{
foreach(string curEntry in hhcTopics)
{
CHMStream.CHMStream iw=null;
MemoryStream fileObject=null;
if( _associatedFile.CurrentStorageWrapper == null)
{
iw=new CHMStream.CHMStream();
iw.OpenCHM(_associatedFile.ChmFilePath);
}
else
{
iw = _associatedFile.CurrentStorageWrapper;
}
fileObject = iw.OpenStream(curEntry);
if( fileObject != null)
{
string fileString =_associatedFile.TextEncoding.GetString(fileObject.ToArray(),0,(int)fileObject.Length);
fileObject.Close();
if( HHCParser.HasGlobalObjectTag(fileString, _associatedFile) )
{
sRet = curEntry;
break;
}
}
}
}
}
}
return sRet;
}
/// <summary>
/// Gets the file version of the chm file.
/// 2 for Compatibility=1.0, 3 for Compatibility=1.1
/// </summary>
public int FileVersion
{
get { return _fileVersion; }
}
/// <summary>
/// Gets the contents file name
/// </summary>
public string ContentsFile
{
get
{
if( BinaryTOC ) // if the file contains a binary TOC
{
// make sure the CHMFile instance exists and has loaded the file #URLTBL
if( (_associatedFile != null) && (_associatedFile.UrltblFile != null ) )
{
// Get an url-table entry by its unique id
UrlTableEntry entry = _associatedFile.UrltblFile.GetByUniqueID( this.BinaryTOCURLTableID );
if(entry != null)
{
// entry found, return the url ( = filename )
return entry.URL;
}
}
}
else
{
if(_contentsFile.Length <= 0)
{
string sCheck = "Table of Contents.hhc"; // default HHP contents filename
if( (_associatedFile != null) && (_associatedFile.TopicsFile != null ) )
{
TopicEntry te = _associatedFile.TopicsFile.GetByLocale( sCheck );
if( te == null)
{
sCheck = "toc.hhc"; // default HHP contents filename
te = _associatedFile.TopicsFile.GetByLocale( sCheck );
if( te == null)
{
sCheck = CompileFile + ".hhc";
te = _associatedFile.TopicsFile.GetByLocale( sCheck );
if( te == null)
{
ArrayList arrExt = _associatedFile.TopicsFile.GetByExtension("hhc");
if( arrExt == null )
{
arrExt = _associatedFile.EnumFilesByExtension("hhc");
if( arrExt == null )
{
Debug.WriteLine("CHMSystem.ContentsFile - Failed, contents file not found !");
}
else
{
if(arrExt.Count > 1)
{
sCheck = GetMasterHHC(arrExt, false);
_contentsFile = sCheck;
}
else
{
_contentsFile = ((string)arrExt[0]);
sCheck = _contentsFile;
}
}
}
else
{
if(arrExt.Count > 1)
{
sCheck = GetMasterHHC(arrExt, true);
_contentsFile = sCheck;
}
else
{
_contentsFile = ((TopicEntry)arrExt[0]).Locale;
sCheck = _contentsFile;
}
}
}
else
{
_contentsFile = sCheck;
}
}
else
{
_contentsFile = sCheck;
}
}
else
{
_contentsFile = sCheck;
}
}
return sCheck;
}
}
return _contentsFile;
}
}
/// <summary>
/// Gets the index file name
/// </summary>
public string IndexFile
{
get
{
if( BinaryIndex ) // if the file contains a binary index
{
// make sure the CHMFile instance exists and has loaded the file #URLTBL
if( (_associatedFile != null) && (_associatedFile.UrltblFile != null ) )
{
// Get an url-table entry by its unique id
UrlTableEntry entry = _associatedFile.UrltblFile.GetByUniqueID( this.BinaryIndexURLTableID );
if(entry != null)
{
// entry found, return the url ( = filename )
return entry.URL;
}
}
}
else
{
if(_indexFile.Length <= 0)
{
string sCheck = "Index.hhk"; // default HHP index filename
if( (_associatedFile != null) && (_associatedFile.TopicsFile != null ) )
{
TopicEntry te = _associatedFile.TopicsFile.GetByLocale( sCheck );
if( te == null)
{
sCheck = CompileFile + ".hhk";
te = _associatedFile.TopicsFile.GetByLocale( sCheck );
if( te == null)
{
ArrayList arrExt = _associatedFile.TopicsFile.GetByExtension("hhk");
if( arrExt == null )
{
Debug.WriteLine("CHMSystem.IndexFile - Failed, index file not found !");
}
else
{
_indexFile = ((TopicEntry)arrExt[0]).Locale;
sCheck = _indexFile;
}
}
else
{
_indexFile = sCheck;
}
}
else
{
_indexFile = sCheck;
}
}
return sCheck;
}
}
return _indexFile;
}
}
/// <summary>
/// Sets the default topic of this file
/// </summary>
/// <param name="local">new local value of the topic</param>
internal void SetDefaultTopic(string local)
{
_defaultTopic = local;
}
/// <summary>
/// Gets the default help topic
/// </summary>
public string DefaultTopic
{
get { return _defaultTopic; }
}
/// <summary>
/// Gets the title of the help window
/// </summary>
public string Title
{
get { return _title; }
}
/// <summary>
/// Gets the flag if DBCS is in use
/// </summary>
public bool DBCS
{
get { return _dbcs; }
}
/// <summary>
/// Gets the flag if full-text-search is available
/// </summary>
public bool FullTextSearch
{
get { return _fullTextSearch; }
}
/// <summary>
/// Gets the flag if the file has ALinks
/// </summary>
public bool HasALinks
{
get { return _hasALinks; }
}
/// <summary>
/// Gets the flag if the file has KLinks
/// </summary>
public bool HasKLinks
{
get { return _hasKLinks; }
}
/// <summary>
/// Gets the default window name
/// </summary>
public string DefaultWindow
{
get { return _defaultWindow; }
}
/// <summary>
/// Gets the file name of the compile file
/// </summary>
public string CompileFile
{
get { return _compileFile; }
}
/// <summary>
/// Gets the id of the binary index in the url table
/// </summary>
public uint BinaryIndexURLTableID
{
get { return _binaryIndexURLTableID; }
}
/// <summary>
/// Gets the flag if the chm has a binary index file
/// </summary>
public bool BinaryIndex
{
get { return (_binaryIndexURLTableID>0); }
}
/// <summary>
/// Gets the flag if the chm has a binary index file
/// </summary>
public string CompilerVersion
{
get { return _compilerVersion; }
}
/// <summary>
/// Gets the id of the binary toc in the url table
/// </summary>
public uint BinaryTOCURLTableID
{
get { return _binaryTOCURLTableID; }
}
/// <summary>
/// Gets the flag if the chm has a binary toc file
/// </summary>
public bool BinaryTOC
{
get { return (_binaryTOCURLTableID>0); }
}
/// <summary>
/// Gets the font face of the read font property.
/// Empty string for default font.
/// </summary>
public string FontFace
{
get
{
if( _defaultFont.Length > 0)
{
string [] fontSplit = _defaultFont.Split( new char[]{','});
if(fontSplit.Length > 0)
return fontSplit[0].Trim();
}
return "";
}
}
/// <summary>
/// Gets the font size of the read font property.
/// 0 for default font size
/// </summary>
public double FontSize
{
get
{
if( _defaultFont.Length > 0)
{
string [] fontSplit = _defaultFont.Split( new char[]{','});
if(fontSplit.Length > 1)
return double.Parse(fontSplit[1].Trim());
}
return 0.0;
}
}
/// <summary>
/// Gets the character set of the read font property
/// 1 for default
/// </summary>
public int CharacterSet
{
get
{
if( _defaultFont.Length > 0)
{
string [] fontSplit = _defaultFont.Split( new char[]{','});
if(fontSplit.Length > 2)
return Int32.Parse(fontSplit[2].Trim());
}
return 0;
}
}
/// <summary>
/// Gets the codepage depending on the read font property
/// </summary>
public int CodePage
{
get
{
// if we've read a LCID from the system file
// ignore the font-property settings and return
// the codepage generated from the culture info
if(_culture != null)
{
return _culture.TextInfo.ANSICodePage;
}
int nRet = 1252; // default codepage windows-1252
int nCSet = CharacterSet;
switch(nCSet)
{
case 0x00: nRet = 1252;break; // ANSI_CHARSET
case 0xCC: nRet = 1251;break; // RUSSIAN_CHARSET
case 0xEE: nRet = 1250;break; // EE_CHARSET
case 0xA1: nRet = 1253;break; // GREEK_CHARSET
case 0xA2: nRet = 1254;break; // TURKISH_CHARSET
case 0xBA: nRet = 1257;break; // BALTIC_CHARSET
case 0xB1: nRet = 1255;break; // HEBREW_CHARSET
case 0xB2: nRet = 1256;break; // ARABIC_CHARSET
case 0x80: nRet = 932;break; // SHIFTJIS_CHARSET
case 0x81: nRet = 949;break; // HANGEUL_CHARSET
case 0x86: nRet = 936;break; // GB2313_CHARSET
case 0x88: nRet = 950;break; // CHINESEBIG5_CHARSET
}
return nRet;
}
}
/// <summary>
/// Gets the assiciated culture info
/// </summary>
public CultureInfo Culture
{
get { return _culture; }
}
/// <summary>
/// Implement IDisposable.
/// </summary>
public void Dispose()
{
Dispose(true);
// This object will be cleaned up by the Dispose method.
// Therefore, you should call GC.SupressFinalize to
// take this object off the finalization queue
// and prevent finalization code for this object
// from executing a second time.
GC.SuppressFinalize(this);
}
/// <summary>
/// Dispose(bool disposing) executes in two distinct scenarios.
/// If disposing equals true, the method has been called directly
/// or indirectly by a user's code. Managed and unmanaged resources
/// can be disposed.
/// If disposing equals false, the method has been called by the
/// runtime from inside the finalizer and you should not reference
/// other objects. Only unmanaged resources can be disposed.
/// </summary>
/// <param name="disposing">disposing flag</param>
private void Dispose(bool disposing)
{
// Check to see if Dispose has already been called.
if(!this.disposed)
{
// If disposing equals true, dispose all managed
// and unmanaged resources.
if(disposing)
{
// Dispose managed resources.
_binaryFileData = null;
}
}
disposed = true;
}
}
}

View File

@@ -0,0 +1,288 @@
using System;
using System.IO;
using System.Collections;
namespace HtmlHelp.ChmDecoding
{
/// <summary>
/// The class <c>CHMTocidx</c> implements functions to decode the #TOCIDX internal file.
/// </summary>
internal sealed class CHMTocidx : IDisposable
{
/// <summary>
/// Constant specifying the size of the data blocks
/// </summary>
private const int BLOCK_SIZE = 0x1000;
/// <summary>
/// Internal flag specifying if the object is going to be disposed
/// </summary>
private bool disposed = false;
/// <summary>
/// Internal member storing the binary file data
/// </summary>
private byte[] _binaryFileData = null;
/// <summary>
/// Internal memebr storing the offset to the 20/28 byte structs
/// </summary>
private int _offset2028 = 0;
/// <summary>
/// Internal member storing the offset to the 16 byte structs
/// </summary>
private int _offset16structs = 0;
/// <summary>
/// Internal member storing the number of 16 byte structs
/// </summary>
private int _numberOf16structs = 0;
/// <summary>
/// Internal member storing the offset to the topic list
/// </summary>
private int _offsetOftopics = 0;
/// <summary>
/// Internal member storing the toc
/// </summary>
private ArrayList _toc = new ArrayList();
/// <summary>
/// Internal member for offset seeking
/// </summary>
private Hashtable _offsetTable = new Hashtable();
/// <summary>
/// Internal member storing the associated chmfile object
/// </summary>
private CHMFile _associatedFile = null;
/// <summary>
/// Constructor of the class
/// </summary>
/// <param name="binaryFileData">binary file data of the #TOCIDX file</param>
/// <param name="associatedFile">associated chm file</param>
public CHMTocidx(byte[] binaryFileData, CHMFile associatedFile)
{
_binaryFileData = binaryFileData;
_associatedFile = associatedFile;
DecodeData();
// clear internal binary data after extraction
_binaryFileData = null;
}
/// <summary>
/// Decodes the binary file data and fills the internal properties
/// </summary>
/// <returns>true if succeeded</returns>
private bool DecodeData()
{
_toc = new ArrayList();
_offsetTable = new Hashtable();
bool bRet = true;
MemoryStream memStream = new MemoryStream(_binaryFileData);
BinaryReader binReader = new BinaryReader(memStream);
int nCurOffset = 0;
_offset2028 = binReader.ReadInt32();
_offset16structs = binReader.ReadInt32();
_numberOf16structs = binReader.ReadInt32();
_offsetOftopics = binReader.ReadInt32();
binReader.BaseStream.Seek( _offset2028, SeekOrigin.Begin );
if( RecursivelyBuildTree(ref binReader, _offset2028, _toc, null) )
{
binReader.BaseStream.Seek( _offset16structs, SeekOrigin.Begin );
nCurOffset = (int)binReader.BaseStream.Position;
for(int i=0; i < _numberOf16structs; i++)
{
int tocOffset = binReader.ReadInt32();
int sqNr = binReader.ReadInt32();
int topOffset = binReader.ReadInt32();
int hhctopicIdx = binReader.ReadInt32();
nCurOffset = (int)binReader.BaseStream.Position;
int topicIdx = -1;
// if the topic offset is within the range of the stream
// and is >= the offset of the first topic dword
if((topOffset < (binReader.BaseStream.Length - 4)) && (topOffset >= _offsetOftopics))
{
// read the index of the topic for this item
binReader.BaseStream.Seek( topOffset, SeekOrigin.Begin);
topicIdx = binReader.ReadInt32();
binReader.BaseStream.Seek( nCurOffset, SeekOrigin.Begin);
TOCItem item = (TOCItem)_offsetTable[tocOffset.ToString()];
if( item != null)
{
if(( topicIdx < _associatedFile.TopicsFile.TopicTable.Count)&&(topicIdx>=0))
{
TopicEntry te = (TopicEntry) (_associatedFile.TopicsFile.TopicTable[topicIdx]);
if( (te != null) && (item.TopicOffset < 0) )
{
item.TopicOffset = te.EntryOffset;
}
}
}
}
}
}
return bRet;
}
/// <summary>
/// Recursively reads the binary toc tree from the file
/// </summary>
/// <param name="binReader">reference to binary reader</param>
/// <param name="NodeOffset">offset of the first node in the current level</param>
/// <param name="level">arraylist of TOCItems for the current level</param>
/// <param name="parentItem">parent item for the item</param>
/// <returns>Returns true if succeeded</returns>
private bool RecursivelyBuildTree(ref BinaryReader binReader, int NodeOffset, ArrayList level, TOCItem parentItem)
{
bool bRet = true;
int nextOffset=0;
int nReadOffset = (int)binReader.BaseStream.Position;
binReader.BaseStream.Seek(NodeOffset, SeekOrigin.Begin);
do
{
int nCurOffset = (int)binReader.BaseStream.Position;
int unkn1 = binReader.ReadInt16(); // unknown
int unkn2 = binReader.ReadInt16(); // unknown
int flag = binReader.ReadInt32();
int nFolderAdd = 0;
if((_associatedFile != null) && (_associatedFile.ImageTypeFolder))
{
// get the value which should be added, to display folders instead of books
if(HtmlHelpSystem.UseHH2TreePics)
nFolderAdd = 8;
else
nFolderAdd = 4;
}
int nFolderImgIdx = (HtmlHelpSystem.UseHH2TreePics ? (TOCItem.STD_FOLDER_HH2+nFolderAdd) : (TOCItem.STD_FOLDER_HH1+nFolderAdd));
int nFileImgIdx = (HtmlHelpSystem.UseHH2TreePics ? TOCItem.STD_FILE_HH2 : TOCItem.STD_FILE_HH1);
int stdImage = ((flag & 0x4)!=0) ? nFolderImgIdx : nFileImgIdx;
int stringOffset = binReader.ReadInt32();
int ParentOffset = binReader.ReadInt32();
nextOffset = binReader.ReadInt32();
int firstChildOffset = 0;
int unkn3=0;
if( (flag&0x4)!=0 )
{
firstChildOffset = binReader.ReadInt32();
unkn3 = binReader.ReadInt32(); // unknown
}
TOCItem newItem = new TOCItem();
newItem.ImageIndex = stdImage;
newItem.Offset = nCurOffset;
newItem.OffsetNext = nextOffset;
newItem.AssociatedFile = _associatedFile;
newItem.TocMode = DataMode.Binary;
newItem.Parent = parentItem;
if( (flag&0x08) == 0)
{
// toc item doesn't have a local value (=> stringOffset = offset of strings file)
newItem.Name = _associatedFile.StringsFile[stringOffset];
}
else
{
// this item has a topic entry (=> stringOffset = index of topic entry)
if((stringOffset < _associatedFile.TopicsFile.TopicTable.Count) && (stringOffset >= 0))
{
TopicEntry te = (TopicEntry) (_associatedFile.TopicsFile.TopicTable[stringOffset]);
if(te != null)
{
newItem.TopicOffset = te.EntryOffset;
}
}
}
_offsetTable[nCurOffset.ToString()] = newItem;
// if this item has children (firstChildOffset > 0)
if( firstChildOffset > 0)
{
bRet &= RecursivelyBuildTree(ref binReader, firstChildOffset, newItem.Children, newItem);
}
level.Add( newItem );
if(nCurOffset != nextOffset)
binReader.BaseStream.Seek(nextOffset, SeekOrigin.Begin);
}while(nextOffset != 0);
binReader.BaseStream.Seek(nReadOffset, SeekOrigin.Begin);
return bRet;
}
/// <summary>
/// Gets the internal read toc
/// </summary>
internal ArrayList TOC
{
get { return _toc; }
}
/// <summary>
/// Implement IDisposable.
/// </summary>
public void Dispose()
{
Dispose(true);
// This object will be cleaned up by the Dispose method.
// Therefore, you should call GC.SupressFinalize to
// take this object off the finalization queue
// and prevent finalization code for this object
// from executing a second time.
GC.SuppressFinalize(this);
}
/// <summary>
/// Dispose(bool disposing) executes in two distinct scenarios.
/// If disposing equals true, the method has been called directly
/// or indirectly by a user's code. Managed and unmanaged resources
/// can be disposed.
/// If disposing equals false, the method has been called by the
/// runtime from inside the finalizer and you should not reference
/// other objects. Only unmanaged resources can be disposed.
/// </summary>
/// <param name="disposing">disposing flag</param>
private void Dispose(bool disposing)
{
// Check to see if Dispose has already been called.
if(!this.disposed)
{
// If disposing equals true, dispose all managed
// and unmanaged resources.
if(disposing)
{
// Dispose managed resources.
_binaryFileData = null;
_toc = null;
_offsetTable = null;
}
}
disposed = true;
}
}
}

View File

@@ -0,0 +1,235 @@
using System;
using System.IO;
using System.Collections;
using System.Collections.Specialized;
namespace HtmlHelp.ChmDecoding
{
/// <summary>
/// The class <c>CHMTopics</c> implements functionality to decode the #TOPICS internal file
/// </summary>
internal sealed class CHMTopics : IDisposable
{
/// <summary>
/// Internal flag specifying if the object is going to be disposed
/// </summary>
private bool disposed = false;
/// <summary>
/// Internal member storing the binary file data
/// </summary>
private byte[] _binaryFileData = null;
/// <summary>
/// Internal member storing the associated chmfile object
/// </summary>
private CHMFile _associatedFile = null;
/// <summary>
/// Internal member storing the topic list
/// </summary>
private ArrayList _topicTable = new ArrayList();
/// <summary>
/// Constructor of the class
/// </summary>
/// <param name="binaryFileData">binary file data of the #TOPICS file</param>
/// <param name="associatedFile">associated chm file</param>
public CHMTopics(byte[] binaryFileData, CHMFile associatedFile)
{
_binaryFileData = binaryFileData;
_associatedFile = associatedFile;
DecodeData();
// clear internal binary data after extraction
_binaryFileData = null;
}
/// <summary>
/// Standard constructor
/// </summary>
internal CHMTopics()
{
}
#region Data dumping
/// <summary>
/// Dump the class data to a binary writer
/// </summary>
/// <param name="writer">writer to write the data</param>
internal void Dump(ref BinaryWriter writer)
{
writer.Write( _topicTable.Count );
foreach(TopicEntry curItem in _topicTable)
{
curItem.Dump(ref writer);
}
}
/// <summary>
/// Reads the object data from a dump store
/// </summary>
/// <param name="reader">reader to read the data</param>
internal void ReadDump(ref BinaryReader reader)
{
int i=0;
int nCnt = reader.ReadInt32();
for(i=0; i<nCnt;i++)
{
TopicEntry newItem = new TopicEntry();
newItem.SetCHMFile(_associatedFile);
newItem.ReadDump(ref reader);
_topicTable.Add(newItem);
}
}
/// <summary>
/// Sets the associated CHMFile instance
/// </summary>
/// <param name="associatedFile">instance to set</param>
internal void SetCHMFile(CHMFile associatedFile)
{
_associatedFile = associatedFile;
foreach(TopicEntry curEntry in _topicTable)
{
curEntry.SetCHMFile(associatedFile);
}
}
#endregion
/// <summary>
/// Decodes the binary file data and fills the internal properties
/// </summary>
/// <returns>true if succeeded</returns>
private bool DecodeData()
{
bool bRet = true;
MemoryStream memStream = new MemoryStream(_binaryFileData);
BinaryReader binReader = new BinaryReader(memStream);
int nCurOffset = 0;
while( (memStream.Position < memStream.Length) && (bRet) )
{
int entryOffset = nCurOffset;
int tocIdx = binReader.ReadInt32();
int titleOffset = binReader.ReadInt32();
int urltablOffset = binReader.ReadInt32();
int visibilityMode = binReader.ReadInt16();
int unknownMode = binReader.ReadInt16();
TopicEntry newEntry = new TopicEntry(entryOffset, tocIdx, titleOffset, urltablOffset, visibilityMode, unknownMode, _associatedFile);
_topicTable.Add( newEntry );
nCurOffset = (int)memStream.Position;
}
return bRet;
}
/// <summary>
/// Gets the arraylist containing all topic entries.
/// </summary>
public ArrayList TopicTable
{
get
{
return _topicTable;
}
}
/// <summary>
/// Gets the topic entry of a given offset
/// </summary>
public TopicEntry this[int offset]
{
get
{
foreach(TopicEntry curEntry in _topicTable)
if(curEntry.EntryOffset == offset)
return curEntry;
return null;
}
}
/// <summary>
/// Searches a topic by the locale name
/// </summary>
/// <param name="locale">locale name to search</param>
/// <returns>The topicentry instance if found, otherwise null</returns>
public TopicEntry GetByLocale(string locale)
{
foreach(TopicEntry curEntry in TopicTable)
{
if(curEntry.Locale.ToLower() == locale.ToLower())
return curEntry;
}
return null;
}
/// <summary>
/// Searches the topics for all files with a given file extension
/// </summary>
/// <param name="fileExtension">extension to search</param>
/// <returns>An arraylist of TopicEntry instances or null if no topic was found</returns>
public ArrayList GetByExtension(string fileExtension)
{
ArrayList arrRet = new ArrayList();
foreach(TopicEntry curEntry in TopicTable)
{
if(curEntry.Locale.ToLower().EndsWith(fileExtension.ToLower()))
arrRet.Add(curEntry);
}
if(arrRet.Count > 0)
return arrRet;
return null;
}
/// <summary>
/// Implement IDisposable.
/// </summary>
public void Dispose()
{
Dispose(true);
// This object will be cleaned up by the Dispose method.
// Therefore, you should call GC.SupressFinalize to
// take this object off the finalization queue
// and prevent finalization code for this object
// from executing a second time.
GC.SuppressFinalize(this);
}
/// <summary>
/// Dispose(bool disposing) executes in two distinct scenarios.
/// If disposing equals true, the method has been called directly
/// or indirectly by a user's code. Managed and unmanaged resources
/// can be disposed.
/// If disposing equals false, the method has been called by the
/// runtime from inside the finalizer and you should not reference
/// other objects. Only unmanaged resources can be disposed.
/// </summary>
/// <param name="disposing">disposing flag</param>
private void Dispose(bool disposing)
{
// Check to see if Dispose has already been called.
if(!this.disposed)
{
// If disposing equals true, dispose all managed
// and unmanaged resources.
if(disposing)
{
// Dispose managed resources.
_binaryFileData = null;
_topicTable=null;
}
}
disposed = true;
}
}
}

View File

@@ -0,0 +1,308 @@
using System;
using System.IO;
using System.Collections;
using System.Collections.Specialized;
namespace HtmlHelp.ChmDecoding
{
/// <summary>
/// The class <c>CHMUrlstr</c> implements a string collection storing the URL strings of the help file
/// </summary>
internal sealed class CHMUrlstr : IDisposable
{
/// <summary>
/// Constant specifying the size of the string blocks
/// </summary>
private const int BLOCK_SIZE = 0x1000;
/// <summary>
/// Internal flag specifying if the object is going to be disposed
/// </summary>
private bool disposed = false;
/// <summary>
/// Internal member storing the binary file data
/// </summary>
private byte[] _binaryFileData = null;
/// <summary>
/// Internal member storing the url dictionary
/// </summary>
private Hashtable _urlDictionary = new Hashtable();
/// <summary>
/// Internal member storing the framename dictionary
/// </summary>
private Hashtable _framenameDictionary = new Hashtable();
/// <summary>
/// Internal member storing the associated chmfile object
/// </summary>
private CHMFile _associatedFile = null;
/// <summary>
/// Constructor of the class
/// </summary>
/// <param name="binaryFileData">binary file data of the #URLSTR file</param>
/// <param name="associatedFile">associated chm file</param>
public CHMUrlstr(byte[] binaryFileData, CHMFile associatedFile)
{
_binaryFileData = binaryFileData;
_associatedFile = associatedFile;
DecodeData();
// clear internal binary data after extraction
_binaryFileData = null;
}
/// <summary>
/// Standard constructor
/// </summary>
internal CHMUrlstr()
{
}
#region Data dumping
/// <summary>
/// Dump the class data to a binary writer
/// </summary>
/// <param name="writer">writer to write the data</param>
internal void Dump(ref BinaryWriter writer)
{
writer.Write( _urlDictionary.Count );
if (_urlDictionary.Count != 0)
{
IDictionaryEnumerator iDictionaryEnumerator = _urlDictionary.GetEnumerator();
while (iDictionaryEnumerator.MoveNext())
{
DictionaryEntry dictionaryEntry = (DictionaryEntry)iDictionaryEnumerator.Current;
writer.Write( Int32.Parse(dictionaryEntry.Key.ToString()) );
writer.Write( dictionaryEntry.Value.ToString() );
}
}
writer.Write( _framenameDictionary.Count );
if (_framenameDictionary.Count != 0)
{
IDictionaryEnumerator iDictionaryEnumerator = _framenameDictionary.GetEnumerator();
while (iDictionaryEnumerator.MoveNext())
{
DictionaryEntry dictionaryEntry = (DictionaryEntry)iDictionaryEnumerator.Current;
writer.Write( Int32.Parse(dictionaryEntry.Key.ToString()) );
writer.Write( dictionaryEntry.Value.ToString() );
}
}
}
/// <summary>
/// Reads the object data from a dump store
/// </summary>
/// <param name="reader">reader to read the data</param>
internal void ReadDump(ref BinaryReader reader)
{
int i=0;
int nCnt = reader.ReadInt32();
for(i=0; i<nCnt;i++)
{
int nKey = reader.ReadInt32();
string sValue = reader.ReadString();
_urlDictionary[nKey.ToString()] = sValue;
}
nCnt = reader.ReadInt32();
for(i=0; i<nCnt;i++)
{
int nKey = reader.ReadInt32();
string sValue = reader.ReadString();
_framenameDictionary[nKey.ToString()] = sValue;
}
}
/// <summary>
/// Sets the associated CHMFile instance
/// </summary>
/// <param name="associatedFile">instance to set</param>
internal void SetCHMFile(CHMFile associatedFile)
{
_associatedFile = associatedFile;
}
#endregion
/// <summary>
/// Decodes the binary file data and fills the internal properties
/// </summary>
/// <returns>true if succeeded</returns>
private bool DecodeData()
{
bool bRet = true;
MemoryStream memStream = new MemoryStream(_binaryFileData);
BinaryReader binReader = new BinaryReader(memStream);
int nCurOffset = 0;
while( (memStream.Position < memStream.Length) && (bRet) )
{
nCurOffset = (int)memStream.Position;
byte [] dataBlock = binReader.ReadBytes(BLOCK_SIZE);
bRet &= DecodeBlock(dataBlock, ref nCurOffset);
}
return bRet;
}
/// <summary>
/// Decodes a block of url-string data
/// </summary>
/// <param name="dataBlock">block of data</param>
/// <param name="nOffset">current file offset</param>
/// <returns>true if succeeded</returns>
private bool DecodeBlock( byte[] dataBlock, ref int nOffset )
{
bool bRet = true;
int blockOffset = nOffset;
MemoryStream memStream = new MemoryStream(dataBlock);
BinaryReader binReader = new BinaryReader(memStream);
if(nOffset==0)
binReader.ReadByte(); // first block starts with an unknown byte
while( (memStream.Position < (memStream.Length-8)) && (bRet) )
{
int entryOffset = blockOffset + (int)memStream.Position;
int urlOffset = binReader.ReadInt32();
int frameOffset = binReader.ReadInt32();
// There is one way to tell where the end of the URL/FrameName
// pairs occurs: Repeat the following: read 2 DWORDs and if both
// are less than the current offset then this is the start of the Local
// strings else skip two NT strings.
// if(( (urlOffset < (entryOffset+8)) && (frameOffset < (entryOffset+8)) ))
// {
// //TODO: add correct string reading if an offset has been found
// /*
// int curOffset = (int)memStream.Position;
//
// memStream.Seek( (long)(blockOffset-urlOffset), SeekOrigin.Begin);
// string sTemp = CHMReader.ExtractString(ref binReader, 0, true);
//
// memStream.Seek( (long)(blockOffset-frameOffset), SeekOrigin.Begin);
// sTemp = CHMReader.ExtractString(ref binReader, 0, true);
//
// memStream.Seek((long)curOffset, SeekOrigin.Begin);
// */
//
//
// int curOffs = (int)memStream.Position;
// BinaryReaderHelp.ExtractString(ref binReader, 0, true, _associatedFile.TextEncoding);
// nOffset += (int)memStream.Position - curOffs;
//
// curOffs = (int)memStream.Position;
// BinaryReaderHelp.ExtractString(ref binReader, 0, true, _associatedFile.TextEncoding);
// nOffset += (int)memStream.Position - curOffs;
// }
// else
{
bool bFoundTerminator = false;
string sTemp = BinaryReaderHelp.ExtractString(ref binReader, ref bFoundTerminator, 0, true, _associatedFile.TextEncoding);
if(sTemp == "")
{
//nOffset = nOffset + 1 + (int)memStream.Length - (int)memStream.Position;
memStream.Seek(memStream.Length-1, SeekOrigin.Begin);
}
else
{
_urlDictionary[entryOffset.ToString()] = sTemp.ToString();
_framenameDictionary[ entryOffset.ToString() ] = sTemp.ToString() ;
}
}
}
return bRet;
}
/// <summary>
/// Gets the url at a given offset
/// </summary>
/// <param name="offset">offset of url</param>
/// <returns>the url at the given offset</returns>
public string GetURLatOffset(int offset)
{
if(offset == -1)
return String.Empty;
string sTemp = (string)_urlDictionary[ offset.ToString() ];
if(sTemp == null)
return String.Empty;
return sTemp;
}
/// <summary>
/// Gets the framename at a given offset
/// </summary>
/// <param name="offset">offset of the framename</param>
/// <returns>the frame name at the given offset</returns>
public string GetFrameNameatOffset(int offset)
{
if(offset == -1)
return String.Empty;
string sTemp = (string)_framenameDictionary[ offset.ToString() ];
if(sTemp == null)
return String.Empty;
return sTemp;
}
/// <summary>
/// Implement IDisposable.
/// </summary>
public void Dispose()
{
Dispose(true);
// This object will be cleaned up by the Dispose method.
// Therefore, you should call GC.SupressFinalize to
// take this object off the finalization queue
// and prevent finalization code for this object
// from executing a second time.
GC.SuppressFinalize(this);
}
/// <summary>
/// Dispose(bool disposing) executes in two distinct scenarios.
/// If disposing equals true, the method has been called directly
/// or indirectly by a user's code. Managed and unmanaged resources
/// can be disposed.
/// If disposing equals false, the method has been called by the
/// runtime from inside the finalizer and you should not reference
/// other objects. Only unmanaged resources can be disposed.
/// </summary>
/// <param name="disposing">disposing flag</param>
private void Dispose(bool disposing)
{
// Check to see if Dispose has already been called.
if(!this.disposed)
{
// If disposing equals true, dispose all managed
// and unmanaged resources.
if(disposing)
{
// Dispose managed resources.
_binaryFileData = null;
_urlDictionary = null;
_framenameDictionary = null;
}
}
disposed = true;
}
}
}

View File

@@ -0,0 +1,245 @@
using System;
using System.IO;
using System.Collections;
namespace HtmlHelp.ChmDecoding
{
/// <summary>
/// The class <c>CHMUrltable</c> implements methods to decode the #URLTBL internal file.
/// </summary>
internal sealed class CHMUrltable : IDisposable
{
/// <summary>
/// Constant specifying the size of the data blocks
/// </summary>
private const int BLOCK_SIZE = 0x1000;
/// <summary>
/// Constant specifying the number of records per block
/// </summary>
private const int RECORDS_PER_BLOCK = 341;
/// <summary>
/// Internal flag specifying if the object is going to be disposed
/// </summary>
private bool disposed = false;
/// <summary>
/// Internal member storing the binary file data
/// </summary>
private byte[] _binaryFileData = null;
/// <summary>
/// Internal member storing the url table
/// </summary>
private ArrayList _urlTable = new ArrayList();
/// <summary>
/// Internal member storing the associated chmfile object
/// </summary>
private CHMFile _associatedFile = null;
/// <summary>
/// Constructor of the class
/// </summary>
/// <param name="binaryFileData">binary file data of the #URLTBL file</param>
/// <param name="associatedFile">associated chm file</param>
public CHMUrltable(byte[] binaryFileData, CHMFile associatedFile)
{
_binaryFileData = binaryFileData;
_associatedFile = associatedFile;
DecodeData();
// clear internal binary data after extraction
_binaryFileData = null;
}
/// <summary>
/// Standard constructor
/// </summary>
internal CHMUrltable()
{
}
#region Data dumping
/// <summary>
/// Dump the class data to a binary writer
/// </summary>
/// <param name="writer">writer to write the data</param>
internal void Dump(ref BinaryWriter writer)
{
writer.Write( _urlTable.Count );
foreach(UrlTableEntry curItem in _urlTable)
{
curItem.Dump(ref writer);
}
}
/// <summary>
/// Reads the object data from a dump store
/// </summary>
/// <param name="reader">reader to read the data</param>
internal void ReadDump(ref BinaryReader reader)
{
int i=0;
int nCnt = reader.ReadInt32();
for(i=0; i<nCnt;i++)
{
UrlTableEntry newItem = new UrlTableEntry();
newItem.SetCHMFile(_associatedFile);
newItem.ReadDump(ref reader);
_urlTable.Add(newItem);
}
}
/// <summary>
/// Sets the associated CHMFile instance
/// </summary>
/// <param name="associatedFile">instance to set</param>
internal void SetCHMFile(CHMFile associatedFile)
{
_associatedFile = associatedFile;
foreach(UrlTableEntry curEntry in _urlTable)
{
curEntry.SetCHMFile(associatedFile);
}
}
#endregion
/// <summary>
/// Decodes the binary file data and fills the internal properties
/// </summary>
/// <returns>true if succeeded</returns>
private bool DecodeData()
{
bool bRet = true;
MemoryStream memStream = new MemoryStream(_binaryFileData);
BinaryReader binReader = new BinaryReader(memStream);
int nCurOffset = 0;
while( (memStream.Position < memStream.Length) && (bRet) )
{
nCurOffset = (int)memStream.Position;
byte [] dataBlock = binReader.ReadBytes(BLOCK_SIZE);
bRet &= DecodeBlock(dataBlock, ref nCurOffset);
}
return bRet;
}
/// <summary>
/// Decodes a block of url-string data
/// </summary>
/// <param name="dataBlock">block of data</param>
/// <param name="nOffset">current file offset</param>
/// <returns>true if succeeded</returns>
private bool DecodeBlock( byte[] dataBlock, ref int nOffset )
{
bool bRet = true;
int blockOffset = nOffset;
MemoryStream memStream = new MemoryStream(dataBlock);
BinaryReader binReader = new BinaryReader(memStream);
for(int i=0; i < RECORDS_PER_BLOCK; i++)
{
int recordOffset = blockOffset + (int)memStream.Position;
uint nuniqueID = (uint) binReader.ReadInt32(); // unknown dword
int ntopicsIdx = binReader.ReadInt32();
int urlstrOffset = binReader.ReadInt32();
UrlTableEntry newEntry = new UrlTableEntry(nuniqueID, recordOffset, ntopicsIdx, urlstrOffset, _associatedFile);
_urlTable.Add(newEntry);
if( memStream.Position >= memStream.Length)
break;
}
if(dataBlock.Length == BLOCK_SIZE)
binReader.ReadInt32();
return bRet;
}
/// <summary>
/// Gets the arraylist containing all urltable entries.
/// </summary>
public ArrayList UrlTable
{
get
{
return _urlTable;
}
}
/// <summary>
/// Gets the urltable entry of a given offset
/// </summary>
public UrlTableEntry this[int offset]
{
get
{
foreach(UrlTableEntry curEntry in _urlTable)
if(curEntry.EntryOffset == offset)
return curEntry;
return null;
}
}
/// <summary>
/// Gets the urltable entry of a given uniqueID
/// </summary>
public UrlTableEntry GetByUniqueID(uint uniqueID)
{
foreach(UrlTableEntry curEntry in UrlTable)
{
if(curEntry.UniqueID == uniqueID)
return curEntry;
}
return null;
}
/// <summary>
/// Implement IDisposable.
/// </summary>
public void Dispose()
{
Dispose(true);
// This object will be cleaned up by the Dispose method.
// Therefore, you should call GC.SupressFinalize to
// take this object off the finalization queue
// and prevent finalization code for this object
// from executing a second time.
GC.SuppressFinalize(this);
}
/// <summary>
/// Dispose(bool disposing) executes in two distinct scenarios.
/// If disposing equals true, the method has been called directly
/// or indirectly by a user's code. Managed and unmanaged resources
/// can be disposed.
/// If disposing equals false, the method has been called by the
/// runtime from inside the finalizer and you should not reference
/// other objects. Only unmanaged resources can be disposed.
/// </summary>
/// <param name="disposing">disposing flag</param>
private void Dispose(bool disposing)
{
// Check to see if Dispose has already been called.
if(!this.disposed)
{
// If disposing equals true, dispose all managed
// and unmanaged resources.
if(disposing)
{
// Dispose managed resources.
_binaryFileData = null;
_urlTable = null;
}
}
disposed = true;
}
}
}

View File

@@ -0,0 +1,395 @@
using System;
using System.IO;
using System.Text;
using System.Diagnostics;
using System.Collections.Specialized;
using ICSharpCode.SharpZipLib;
using ICSharpCode.SharpZipLib.Zip;
using ICSharpCode.SharpZipLib.Zip.Compression;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
using HtmlHelp;
// using HtmlHelp.Storage;
namespace HtmlHelp.ChmDecoding
{
/// <summary>
/// Enumeration for specifying the dumping compression
/// </summary>
public enum DumpCompression
{
/// <summary>
/// None - no data compression will be used.
/// Fastest but most memory intensive
/// </summary>
None = 0,
/// <summary>
/// Minimum - a minimum data compression will be used.
/// Fast but not much data reduction
/// </summary>
Minimum = 1,
/// <summary>
/// Medium - a medium data compression will be used.
/// Slower but medium data reduction
/// </summary>
Medium = 2,
/// <summary>
/// Maximum - a maximum data compression will be used.
/// Slowest but maximum data reduction
/// </summary>
Maximum = 3
}
/// <summary>
/// Flags which specify which data should be dumped
/// </summary>
[FlagsAttribute()]
public enum DumpingFlags
{
/// <summary>
/// DumpTextTOC - if this flag is set, text-based TOCs (sitemap format) will be dumped
/// </summary>
DumpTextTOC = 1,
/// <summary>
/// DumpBinaryTOC - if this flag is set, binary TOCs will be dumped
/// </summary>
DumpBinaryTOC = 2,
/// <summary>
/// DumpTextIndex - if this flag is set, the text-based index (sitemap format) will be dumped
/// </summary>
DumpTextIndex = 4,
/// <summary>
/// DumpBinaryIndex - if this flag is set, the binary index will be dumped
/// </summary>
DumpBinaryIndex = 8,
/// <summary>
/// DumpStrings - if this flag is set, the internal #STRINGS file will be dumped
/// </summary>
DumpStrings = 16,
/// <summary>
/// DumpUrlStr - if this flag is set, the internal #URLSTR file will be dumped
/// </summary>
DumpUrlStr = 32,
/// <summary>
/// DumpUrlTbl - if this flag is set, the internal #URLTBL file will be dumped
/// </summary>
DumpUrlTbl = 64,
/// <summary>
/// DumpTopics - if this flag is set, the internal #TOPICS file will be dumped
/// </summary>
DumpTopics = 128,
/// <summary>
/// DumpFullText - if this flag is set, the internal $FIftiMain file will be dumped
/// </summary>
DumpFullText = 256
}
/// <summary>
/// The class <c>DumpingInfo</c> implements information properties for the CHMFile class
/// if and how data dumping should be used.
/// </summary>
public sealed class DumpingInfo
{
public bool m_bAllowSaveDump=true;
private readonly static BitVector32.Section DumpFlags = BitVector32.CreateSection(512);
private const string _dumpHeader = "HtmlHelpSystem dump file 1.0";
private string _outputDir = ""; // emtpy string means, same directory as chm file
private DumpCompression _compressionLevel = DumpCompression.Maximum;
private CHMFile _chmFile = null;
private DeflaterOutputStream _outputStream = null;
private InflaterInputStream _inputStream = null;
private BinaryWriter _writer = null;
private BinaryReader _reader = null;
private BitVector32 _flags;
/// <summary>
/// Constructor of the class
/// </summary>
/// <param name="flags">Combine flag values to specify which data should be dumped.</param>
/// <param name="outputDir">output directory. emtpy string means,
/// same directory as chm file (only if destination = ExternalFile)</param>
/// <param name="compressionLevel">compression which should be used</param>
public DumpingInfo(DumpingFlags flags, string outputDir, DumpCompression compressionLevel)
{
_flags = new BitVector32(0);
int i = _flags[DumpFlags];
_flags[DumpFlags] = i | (int)flags;
_outputDir = outputDir;
_compressionLevel = compressionLevel;
}
/// <summary>
/// Gets the flag if text-based TOCs will be written to the dumping file
/// </summary>
public bool DumpTextTOC
{
get { return ((_flags[DumpFlags] & (int)DumpingFlags.DumpTextTOC) != 0); }
}
/// <summary>
/// Gets the flag if binary TOCs will be written to the dumping file
/// </summary>
public bool DumpBinaryTOC
{
get { return ((_flags[DumpFlags] & (int)DumpingFlags.DumpBinaryTOC) != 0); }
}
/// <summary>
/// Gets the flag if the text-based index will be written to the dumping file
/// </summary>
public bool DumpTextIndex
{
get { return ((_flags[DumpFlags] & (int)DumpingFlags.DumpTextIndex) != 0); }
}
/// <summary>
/// Gets the flag if the binary index will be written to the dumping file
/// </summary>
public bool DumpBinaryIndex
{
get { return ((_flags[DumpFlags] & (int)DumpingFlags.DumpBinaryIndex) != 0); }
}
/// <summary>
/// Gets the flag if the #STRINGS file will be written to the dumping file
/// </summary>
public bool DumpStrings
{
get { return ((_flags[DumpFlags] & (int)DumpingFlags.DumpStrings) != 0); }
}
/// <summary>
/// Gets the flag if the #URLSTR file will be written to the dumping file
/// </summary>
public bool DumpUrlStr
{
get { return ((_flags[DumpFlags] & (int)DumpingFlags.DumpUrlStr) != 0); }
}
/// <summary>
/// Gets the flag if the #URLTBL file will be written to the dumping file
/// </summary>
public bool DumpUrlTbl
{
get { return ((_flags[DumpFlags] & (int)DumpingFlags.DumpUrlTbl) != 0); }
}
/// <summary>
/// Gets the flag if the #TOPICS file will be written to the dumping file
/// </summary>
public bool DumpTopics
{
get { return ((_flags[DumpFlags] & (int)DumpingFlags.DumpTopics) != 0); }
}
/// <summary>
/// Gets the flag if the $FIftiMain file will be written to the dumping file
/// </summary>
public bool DumpFullText
{
get { return ((_flags[DumpFlags] & (int)DumpingFlags.DumpFullText) != 0); }
}
/// <summary>
/// Gets the dump output directory.
/// </summary>
/// <value>emtpy string means, same directory as chm file</value>
/// <remarks>If Destination is set to DumpingOutput.InternalFile this property will be ignored</remarks>
public string OutputDir
{
get { return _outputDir; }
}
/// <summary>
/// The compression level used.
/// </summary>
public DumpCompression CompressionLevel
{
get { return _compressionLevel; }
}
/// <summary>
/// Gets/Sets the CHMFile instance associated with this object
/// </summary>
internal CHMFile ChmFile
{
get { return _chmFile; }
set { _chmFile = value; }
}
/// <summary>
/// Translates the compression level to the deflater constants
/// </summary>
private int CompLvl
{
get
{
switch(CompressionLevel)
{
case DumpCompression.None: return Deflater.NO_COMPRESSION;
case DumpCompression.Minimum: return Deflater.BEST_SPEED;
case DumpCompression.Medium: return Deflater.DEFAULT_COMPRESSION;
case DumpCompression.Maximum: return Deflater.BEST_COMPRESSION;
}
return Deflater.BEST_COMPRESSION;
}
}
/// <summary>
/// Checks if a dump exists
/// </summary>
internal bool DumpExists
{
get
{
if(_flags[DumpFlags] == 0)
return false;
// we have a reader or writer to the dump so it must exist
if( (_reader != null) || (_writer != null) )
return true;
string sDmpFile = _chmFile.ChmFilePath;
sDmpFile=sDmpFile.ToLower().Replace(".chm",".CHB");
return File.Exists(sDmpFile);
}
}
/// <summary>
/// Gets a binary writer instance which allows you to write to the dump
/// </summary>
internal BinaryWriter Writer
{
get
{
if (m_bAllowSaveDump==false)
return null;
if(_flags[DumpFlags] == 0)
throw new InvalidOperationException("Nothing to dump. No flags have been set !");
if(_reader != null)
throw new InvalidOperationException("Can't write and read at the same time !");
if(_chmFile == null)
throw new InvalidOperationException("Only usable with an associated CHMFile instance !");
if(_writer==null)
{
string sDmpFile = _chmFile.ChmFilePath;
sDmpFile=sDmpFile.ToLower().Replace(".chm",".CHB");
StreamWriter stream = new StreamWriter(sDmpFile, false, _chmFile.TextEncoding);
// write header info uncompressed
BinaryWriter _hwriter = new BinaryWriter(stream.BaseStream);
_hwriter.Write(_dumpHeader);
_hwriter.Write((int)CompressionLevel);
if(_compressionLevel == DumpCompression.None)
{
_writer = new BinaryWriter(stream.BaseStream);
}
else
{
_outputStream = new DeflaterOutputStream(stream.BaseStream, new Deflater(CompLvl));
_writer = new BinaryWriter(_outputStream);
}
}
return _writer;
}
}
/// <summary>
/// Gets a binary reader which allows you to read from the dump
/// </summary>
internal BinaryReader Reader
{
get
{
if(_writer != null)
throw new InvalidOperationException("Can't write and read at the same time !");
if(_chmFile == null)
throw new InvalidOperationException("Only usable with an associated CHMFile instance !");
if(_reader==null)
{
string sDmpFile = _chmFile.ChmFilePath;
sDmpFile=sDmpFile.ToLower().Replace(".chm",".CHB");
StreamReader stream = new StreamReader(sDmpFile, _chmFile.TextEncoding);
BinaryReader _hReader = new BinaryReader(stream.BaseStream);
string sH = _hReader.ReadString();
if(sH != _dumpHeader)
{
_hReader.Close();
Debug.WriteLine("Unexpected dump-file header !");
throw new FormatException("DumpingInfo.Reader - Unexpected dump-file header !");
}
_compressionLevel = (DumpCompression)_hReader.ReadInt32();
// if(_compressionLevel != (DumpCompression)_hReader.ReadInt32())
// {
// _hReader.Close();
// return null;
// }
if(_compressionLevel == DumpCompression.None)
{
_reader = new BinaryReader(stream.BaseStream);
}
else
{
_inputStream = new InflaterInputStream(stream.BaseStream, new Inflater());
_reader = new BinaryReader(_inputStream);
}
}
return _reader;
}
}
/// <summary>
/// Saves data and closes the dump
/// </summary>
/// <returns>true if succeed</returns>
internal bool SaveData()
{
if (m_bAllowSaveDump==false)
return true;
if(_writer != null)
{
if(_writer!=null)
_writer.Close();
_outputStream = null;
_writer = null;
}
if(_reader != null)
{
if(_reader!=null)
_reader.Close();
_inputStream = null;
_reader = null;
}
return true;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,593 @@
using System;
using System.Collections;
using System.Text;
using System.Text.RegularExpressions;
namespace HtmlHelp.ChmDecoding
{
/// <summary>
/// The class <c>HHCParser</c> implements a parser for HHC contents files.
/// </summary>
internal sealed class HHCParser
{
/// <summary>
/// regular expressions for replacing the sitemap boundary tags
/// </summary>
private static string RE_ULOpening = @"\<ul\>"; // will be replaced by a '(' for nested parsing
private static string RE_ULClosing = @"\</ul\>"; // will be replaced by a ')' for nested parsing
/// <summary>
/// Matching ul-tags
/// </summary>
private static string RE_ULBoundaries = @"\<ul\>(?<innerText>.*)\</ul\>";
/// <summary>
/// Matching the nested tree structure.
/// </summary>
private static string RE_NestedBoundaries = @"\( (?> [^()]+ | \( (?<DEPTH>) | \) (?<-DEPTH>) )* (?(DEPTH)(?!)) \)";
/// <summary>
/// Matching object-tags
/// </summary>
private static string RE_ObjectBoundaries = @"\<object(?<innerText>.*?)\</object\>";
/// <summary>
/// Matching param tags
/// </summary>
private static string RE_ParamBoundaries = @"\<param(?<innerText>.*?)\>";
/// <summary>
/// Extracting tag attributes
/// </summary>
private const string RE_QuoteAttributes = @"( |\t)*(?<attributeName>[\-a-zA-Z0-9]*)( |\t)*=( |\t)*(?<attributeTD>[\""\'])?(?<attributeValue>.*?(?(attributeTD)\k<attributeTD>|([\s>]|.$)))";
/// <summary>
/// private regular expressionobjects
/// </summary>
private static Regex ulRE;
private static Regex NestedRE;
private static Regex ObjectRE;
private static Regex ParamRE;
private static Regex AttributesRE;
/// <summary>
/// Internal member storing the list of TOCItems which are holding merge links
/// </summary>
private static ArrayList _mergeItems = null;
/// <summary>
/// Internal member storing the last read regular topic item.
/// This is used to handle "Merge" entries and add them as child to this instance.
/// </summary>
private static TOCItem _lastTopicItem = null;
/// <summary>
/// Parses a HHC file and returns an ArrayList with the table of contents (TOC) tree
/// </summary>
/// <param name="hhcFile">string content of the hhc file</param>
/// <param name="chmFile">CHMFile instance</param>
/// <returns>Returns an ArrayList with the table of contents (TOC) tree</returns>
public static ArrayList ParseHHC(string hhcFile, CHMFile chmFile)
{
_lastTopicItem = null;
_mergeItems = null; // clear merged item list
ArrayList tocList = new ArrayList();
ulRE = new Regex(RE_ULBoundaries, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
NestedRE = new Regex(RE_NestedBoundaries, RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
ObjectRE = new Regex(RE_ObjectBoundaries, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
ParamRE = new Regex(RE_ParamBoundaries, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
AttributesRE = new Regex(RE_QuoteAttributes, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
int innerTextIdx = ulRE.GroupNumberFromName("innerText");
if( ulRE.IsMatch(hhcFile, 0) )
{
Match m = ulRE.Match(hhcFile, 0);
int nFirstUL = 0;
nFirstUL = hhcFile.ToLower().IndexOf("<ul>");
if(nFirstUL == -1)
nFirstUL = hhcFile.ToLower().IndexOf("<il>");
if( ObjectRE.IsMatch(hhcFile, 0) ) // first object block contains information types and categories
{
Match mO = ObjectRE.Match(hhcFile, 0);
int iOTxt = ObjectRE.GroupNumberFromName("innerText");
string globalText = mO.Groups[iOTxt].Value;
if( mO.Groups[iOTxt].Index <= nFirstUL)
ParseGlobalSettings( globalText, chmFile );
}
// parse toc tree
string innerText = m.Groups["innerText"].Value;
innerText = innerText.Replace("(", "&#040;");
innerText = innerText.Replace(")", "&#041;");
innerText = Regex.Replace(innerText, RE_ULOpening, "(", RegexOptions.IgnoreCase);
innerText = Regex.Replace(innerText, RE_ULClosing, ")", RegexOptions.IgnoreCase);
ParseTree( innerText, null, tocList, chmFile );
}
return tocList;
}
/// <summary>
/// Checks if the hhc file contains a global object tag.
/// </summary>
/// <param name="hhcFile">string content of the hhc file</param>
/// <param name="chmFile">chm file</param>
/// <returns>true if the hhc content contains a global object tag</returns>
public static bool HasGlobalObjectTag(string hhcFile, CHMFile chmFile)
{
bool bRet = false;
ulRE = new Regex(RE_ULBoundaries, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
ObjectRE = new Regex(RE_ObjectBoundaries, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
int innerTextIdx = ulRE.GroupNumberFromName("innerText");
if( ulRE.IsMatch(hhcFile, 0) )
{
Match m = ulRE.Match(hhcFile, 0);
int nFirstUL = 0;
nFirstUL = hhcFile.ToLower().IndexOf("<ul>");
if(nFirstUL == -1)
nFirstUL = hhcFile.ToLower().IndexOf("<il>");
if( ObjectRE.IsMatch(hhcFile, 0) ) // first object block contains information types and categories
{
Match mO = ObjectRE.Match(hhcFile, 0);
int iOTxt = ObjectRE.GroupNumberFromName("innerText");
string globalText = mO.Groups[iOTxt].Value;
if( mO.Groups[iOTxt].Index <= nFirstUL)
bRet = true;
}
}
return bRet;
}
/// <summary>
/// Gets true if the previously done parsing found merge-links
/// </summary>
public static bool HasMergeLinks
{
get
{
if(_mergeItems==null)
return false;
return _mergeItems.Count > 0;
}
}
/// <summary>
/// Gets all TOCItem references which are holding merge-links
/// </summary>
public static ArrayList MergeItems
{
get { return _mergeItems; }
}
/// <summary>
/// Recursively parses a sitemap tree
/// </summary>
/// <param name="text">content text</param>
/// <param name="parent">Parent for all read items</param>
/// <param name="arrNodes">arraylist which receives the extracted nodes</param>
/// <param name="chmFile">CHMFile instance</param>
private static void ParseTree( string text, TOCItem parent, ArrayList arrNodes, CHMFile chmFile )
{
string strPreItems="", strPostItems="";
string innerText = "";
int nIndex = 0;
while( NestedRE.IsMatch(text, nIndex) )
{
Match m = NestedRE.Match(text, nIndex);
innerText = m.Value.Substring( 1, m.Length-2);
strPreItems = text.Substring(nIndex,m.Index-nIndex);
ParseItems(strPreItems, parent, arrNodes, chmFile);
if((arrNodes.Count>0) && (innerText.Length > 0) )
{
TOCItem p = ((TOCItem)(arrNodes[arrNodes.Count-1]));
ParseTree( innerText, p, p.Children, chmFile );
}
nIndex = m.Index+m.Length;
}
if( nIndex == 0)
{
strPostItems = text.Substring(nIndex, text.Length-nIndex);
ParseItems(strPostItems, parent, arrNodes, chmFile);
}
else if( nIndex < text.Length-1)
{
strPostItems = text.Substring(nIndex, text.Length-nIndex);
ParseTree(strPostItems, parent, arrNodes, chmFile);
}
}
/// <summary>
/// Parses tree nodes from the text
/// </summary>
/// <param name="itemstext">text containing the items</param>
/// <param name="parent">Parent for all read items</param>
/// <param name="arrNodes">arraylist where the nodes should be added</param>
/// <param name="chmFile">CHMFile instance</param>
private static void ParseItems( string itemstext, TOCItem parent, ArrayList arrNodes, CHMFile chmFile)
{
int innerTextIdx = ObjectRE.GroupNumberFromName("innerText");
int innerPTextIdx = ParamRE.GroupNumberFromName("innerText");
// get group-name indexes
int nameIndex = AttributesRE.GroupNumberFromName("attributeName");
int valueIndex = AttributesRE.GroupNumberFromName("attributeValue");
int tdIndex = AttributesRE.GroupNumberFromName("attributeTD");
int nObjStartIndex = 0;
while( ObjectRE.IsMatch(itemstext, nObjStartIndex) )
{
Match m = ObjectRE.Match(itemstext, nObjStartIndex);
string innerText = m.Groups[innerTextIdx].Value;
TOCItem tocItem = new TOCItem();
tocItem.TocMode = DataMode.TextBased;
tocItem.AssociatedFile = chmFile;
tocItem.Parent = parent;
// read parameters
int nParamIndex = 0;
while( ParamRE.IsMatch(innerText, nParamIndex) )
{
Match mP = ParamRE.Match(innerText, nParamIndex);
string innerP = mP.Groups[innerPTextIdx].Value;
string paramName = "";
string paramValue = "";
int nAttrIdx = 0;
while( AttributesRE.IsMatch( innerP, nAttrIdx ) )
{
Match mA = AttributesRE.Match(innerP, nAttrIdx);
string attributeName = mA.Groups[nameIndex].Value;
string attributeValue = mA.Groups[valueIndex].Value;
string attributeTD = mA.Groups[tdIndex].Value;
if(attributeTD.Length > 0)
{
// delete the trailing textqualifier
if( attributeValue.Length > 0)
{
int ltqi = attributeValue.LastIndexOf( attributeTD );
if(ltqi >= 0)
{
attributeValue = attributeValue.Substring(0,ltqi);
}
}
}
if( attributeName.ToLower() == "name")
{
paramName = HttpUtility.HtmlDecode(attributeValue); // for unicode encoded values
}
if( attributeName.ToLower() == "value")
{
paramValue = HttpUtility.HtmlDecode(attributeValue); // for unicode encoded values
// delete trailing /
while((paramValue.Length>0)&&(paramValue[paramValue.Length-1] == '/'))
paramValue = paramValue.Substring(0,paramValue.Length-1);
}
nAttrIdx = mA.Index+mA.Length;
}
tocItem.Params[paramName] = paramValue;
switch(paramName.ToLower())
{
case "name":
{
tocItem.Name = paramValue;
};break;
case "local":
{
tocItem.Local = paramValue.Replace("../", "").Replace("./", "");
};break;
case "imagenumber":
{
tocItem.ImageIndex = Int32.Parse(paramValue);
tocItem.ImageIndex-=1;
int nFolderAdd = 0;
if((chmFile != null) && (chmFile.ImageTypeFolder))
{
// get the value which should be added, to display folders instead of books
if(HtmlHelpSystem.UseHH2TreePics)
nFolderAdd = 8;
else
nFolderAdd = 4;
}
if(tocItem.ImageIndex%2 != 0)
{
if(tocItem.ImageIndex==1)
tocItem.ImageIndex=0;
}
if(HtmlHelpSystem.UseHH2TreePics)
if( tocItem.ImageIndex == 0)
tocItem.ImageIndex = TOCItem.STD_FOLDER_HH2+nFolderAdd;
};break;
case "merge": // this item contains topics or a full TOC from a merged CHM
{
tocItem.MergeLink = paramValue;
// "register" this item as merge-link
if(_mergeItems==null)
_mergeItems=new ArrayList();
_mergeItems.Add(tocItem);
};break;
case "type": // information type assignment for item
{
tocItem.InfoTypeStrings.Add( paramValue );
};break;
}
nParamIndex = mP.Index+mP.Length;
}
tocItem.ChmFile = chmFile.ChmFilePath;
if(tocItem.MergeLink.Length > 0)
{
if(_lastTopicItem != null)
{
tocItem.Parent = _lastTopicItem;
_lastTopicItem.Children.Add(tocItem);
}
else
arrNodes.Add( tocItem );
}
else
{
_lastTopicItem = tocItem;
arrNodes.Add( tocItem );
}
nObjStartIndex = m.Index+m.Length;
}
}
/// <summary>
/// Parses the very first &lt;OBJECT&gt; tag in the sitemap file and extracts
/// information types and categories.
/// </summary>
/// <param name="sText">text of the object tag</param>
/// <param name="chmFile">CHMFile instance</param>
private static void ParseGlobalSettings(string sText, CHMFile chmFile)
{
int innerPTextIdx = ParamRE.GroupNumberFromName("innerText");
// get group-name indexes
int nameIndex = AttributesRE.GroupNumberFromName("attributeName");
int valueIndex = AttributesRE.GroupNumberFromName("attributeValue");
int tdIndex = AttributesRE.GroupNumberFromName("attributeTD");
// read parameters
int nParamIndex = 0;
// 0... unknown
// 1... inclusinve info type name
// 2... exclusive info type name
// 3... hidden info type name
// 4... category name
// 5... incl infotype name for category
// 6... excl infotype name for category
// 7... hidden infotype name for category
int prevItem = 0;
string sName = "";
string sDescription = "";
string curCategory = "";
while( ParamRE.IsMatch(sText, nParamIndex) )
{
Match mP = ParamRE.Match(sText, nParamIndex);
string innerP = mP.Groups[innerPTextIdx].Value;
string paramName = "";
string paramValue = "";
int nAttrIdx = 0;
while( AttributesRE.IsMatch( innerP, nAttrIdx ) )
{
Match mA = AttributesRE.Match(innerP, nAttrIdx);
string attributeName = mA.Groups[nameIndex].Value;
string attributeValue = mA.Groups[valueIndex].Value;
string attributeTD = mA.Groups[tdIndex].Value;
if(attributeTD.Length > 0)
{
// delete the trailing textqualifier
if( attributeValue.Length > 0)
{
int ltqi = attributeValue.LastIndexOf( attributeTD );
if(ltqi >= 0)
{
attributeValue = attributeValue.Substring(0,ltqi);
}
}
}
if( attributeName.ToLower() == "name")
{
paramName = HttpUtility.HtmlDecode(attributeValue); // for unicode encoded values
}
if( attributeName.ToLower() == "value")
{
paramValue = HttpUtility.HtmlDecode(attributeValue); // for unicode encoded values
// delete trailing /
while((paramValue.Length>0)&&(paramValue[paramValue.Length-1] == '/'))
paramValue = paramValue.Substring(0,paramValue.Length-1);
}
nAttrIdx = mA.Index+mA.Length;
}
switch(paramName.ToLower())
{
case "savetype": // inclusive information type name
{
prevItem = 1;
sName = paramValue;
};break;
case "savetypedesc": // description of information type
{
InformationTypeMode mode = InformationTypeMode.Inclusive;
sDescription = paramValue;
if( prevItem == 1)
mode = InformationTypeMode.Inclusive;
if( prevItem == 2)
mode = InformationTypeMode.Exclusive;
if( prevItem == 3)
mode = InformationTypeMode.Hidden;
if( chmFile.GetInformationType( sName ) == null)
{
// check if the HtmlHelpSystem already holds such an information type
if( chmFile.SystemInstance.GetInformationType( sName ) == null)
{
// info type not found yet
InformationType newType = new InformationType(sName, sDescription, mode);
chmFile.InformationTypes.Add(newType);
}
else
{
InformationType sysType = chmFile.SystemInstance.GetInformationType( sName );
chmFile.InformationTypes.Add( sysType );
}
}
prevItem = 0;
};break;
case "saveexclusive": // exclusive information type name
{
prevItem = 2;
sName = paramValue;
};break;
case "savehidden": // hidden information type name
{
prevItem = 3;
sName = paramValue;
};break;
case "category": // category name
{
prevItem = 4;
sName = paramValue;
curCategory = sName;
};break;
case "categorydesc": // category description
{
sDescription = paramValue;
if( chmFile.GetCategory( sName ) == null)
{
// check if the HtmlHelpSystem already holds such a category
if( chmFile.SystemInstance.GetCategory( sName ) == null)
{
// add category
Category newCat = new Category(sName, sDescription);
chmFile.Categories.Add(newCat);
}
else
{
Category sysCat = chmFile.SystemInstance.GetCategory( sName );
chmFile.Categories.Add( sysCat );
}
}
prevItem = 0;
};break;
case "type": // inclusive information type which is member of the previously read category
{
prevItem = 5;
sName = paramValue;
};break;
case "typedesc": // description of type for category
{
sDescription = paramValue;
Category cat = chmFile.GetCategory( curCategory );
if( cat != null)
{
// category found
InformationType infoType = chmFile.GetInformationType( sName );
if( infoType != null)
{
if( !cat.ContainsInformationType(infoType))
{
infoType.SetCategoryFlag(true);
cat.AddInformationType(infoType);
}
}
}
prevItem = 0;
};break;
case "typeexclusive": // exclusive information type which is member of the previously read category
{
prevItem = 6;
sName = paramValue;
};break;
case "typehidden": // hidden information type which is member of the previously read category
{
prevItem = 7;
sName = paramValue;
};break;
default:
{
prevItem = 0;
sName = "";
sDescription = "";
};break;
}
nParamIndex = mP.Index+mP.Length;
}
}
}
}

View File

@@ -0,0 +1,220 @@
using System;
using System.Collections;
using System.Text;
using System.Text.RegularExpressions;
namespace HtmlHelp.ChmDecoding
{
/// <summary>
/// The class <c>HHCParser</c> implements a parser for HHC contents files.
/// </summary>
// internal sealed class HHCParser : IHHCParser
public class HHCParser2
{
static private string m_text1="";
static private string m_text2="";
static private int m_CurrentPos=0;
/// <summary>
/// Parses a HHC file and returns an ArrayList with the table of contents (TOC) tree
/// </summary>
/// <param name="hhcFile">string content of the hhc file</param>
/// <param name="chmFile">CHMFile instance</param>
/// <returns>Returns an ArrayList with the table of contents (TOC) tree</returns>
public static ArrayList ParseHHC(string hhcFile, CHMFile chmFile)
{
DateTime StartTime=DateTime.Now;
ArrayList tocList = new ArrayList();
m_text2=hhcFile;
m_text1=hhcFile.ToLower();
int idx=m_text1.IndexOf("<ul>");
if (idx==-1)
return null;
m_CurrentPos=idx+4;
ParamRE = new Regex(RE_ParamBoundaries, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
AttributesRE = new Regex(RE_QuoteAttributes, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
ParseTree(tocList,chmFile);
DateTime EndTime=DateTime.Now;
TimeSpan Diff=EndTime-StartTime;
string x=Diff.ToString();
return tocList;
}
/// <summary>
/// Recursively parses a sitemap tree
/// </summary>
/// <param name="text">content text</param>
/// <param name="arrNodes">arraylist which receives the extracted nodes</param>
/// <param name="chmFile">CHMFile instance</param>
static private void ParseTree( ArrayList arrNodes, CHMFile chmFile )
{
bool bProcessing=true;
do
{
bProcessing=false;
// Indent
int idxa=m_text1.IndexOf("<ul>",m_CurrentPos);
int idxb=m_text1.IndexOf("<li>",m_CurrentPos);
int idxc=m_text1.IndexOf("</ul>",m_CurrentPos);
if ((idxa<idxb) && (idxa<idxc) && (idxa>-1))
{
bProcessing=true;
m_CurrentPos=idxa+4;
if (arrNodes.Count<1)
{
ParseTree(arrNodes,chmFile);
}
else
{
ParseTree(((TOCItem)(arrNodes[arrNodes.Count-1])).Children,chmFile);
}
continue;
}
// new item
if ((idxb<idxa) && (idxb<idxc) && (idxb>-1))
{
bProcessing=true;
m_CurrentPos=idxb+4;
int idx2=m_text1.IndexOf("<object",m_CurrentPos);
if (idx2!=-1)
{
int idx3=m_text1.IndexOf("</object>",idx2+7);
if (idx3!=-1)
{
string text=m_text2.Substring(idx2,idx3-idx2);
m_CurrentPos=idx3+9;
// Parse items in text.
TOCItem tocItem=ParseItems(text, chmFile);
if (tocItem!=null)
{
arrNodes.Add(tocItem);
}
}
}
}
// Undent
if ((idxc<idxa) && (idxc<idxb) && (idxc>-1))
{
m_CurrentPos=idxc+5;
bProcessing=true;
return;
}
}
while (bProcessing);
}
private static string RE_ParamBoundaries = @"\<param(?<innerText>.*?)\>";
private const string RE_QuoteAttributes = @"( |\t)*(?<attributeName>[\-a-zA-Z0-9]*)( |\t)*=( |\t)*(?<attributeTD>[\""\'])?(?<attributeValue>.*?(?(attributeTD)\k<attributeTD>|([\s>]|.$)))";
private static Regex ParamRE;
private static Regex AttributesRE;
/// <summary>
/// Parses tree nodes from the text
/// </summary>
/// <param name="itemstext">text containing the items</param>
/// <param name="arrNodes">arraylist where the nodes should be added</param>
/// <param name="chmFile">CHMFile instance</param>
private static TOCItem ParseItems( string itemstext, CHMFile chmFile)
{
int innerPTextIdx = ParamRE.GroupNumberFromName("innerText");
// get group-name indexes
int nameIndex = AttributesRE.GroupNumberFromName("attributeName");
int valueIndex = AttributesRE.GroupNumberFromName("attributeValue");
int tdIndex = AttributesRE.GroupNumberFromName("attributeTD");
TOCItem tocItem = new TOCItem();
// read parameters
int nParamIndex = 0;
while( ParamRE.IsMatch(itemstext, nParamIndex) )
{
Match mP = ParamRE.Match(itemstext, nParamIndex);
string innerP = mP.Groups[innerPTextIdx].Value;
string paramName = "";
string paramValue = "";
int nAttrIdx = 0;
while( AttributesRE.IsMatch( innerP, nAttrIdx ) )
{
Match mA = AttributesRE.Match(innerP, nAttrIdx);
string attributeName = mA.Groups[nameIndex].Value;
string attributeValue = mA.Groups[valueIndex].Value;
string attributeTD = mA.Groups[tdIndex].Value;
if(attributeTD.Length > 0)
{
// delete the trailing textqualifier
if( attributeValue.Length > 0)
{
int ltqi = attributeValue.LastIndexOf( attributeTD );
if(ltqi >= 0)
{
attributeValue = attributeValue.Substring(0,ltqi);
}
}
}
if( attributeName.ToLower() == "name")
{
paramName = attributeValue;
}
if( attributeName.ToLower() == "value")
{
paramValue = attributeValue;
}
nAttrIdx = mA.Index+mA.Length;
}
tocItem.Params[paramName] = paramValue;
switch(paramName.ToLower())
{
case "name":
{
tocItem.Name = paramValue;
};break;
case "local":
{
tocItem.Local = paramValue;
};break;
case "imagenumber":
{
tocItem.ImageIndex = Int32.Parse(paramValue);
if( tocItem.ImageIndex == 2)
tocItem.ImageIndex = TOCItem.STD_FOLDER_HH1;
};break;
}
nParamIndex = mP.Index+mP.Length;
}
tocItem.ChmFile = chmFile.ChmFilePath;
return tocItem;
}
}
}

View File

@@ -0,0 +1,550 @@
using System;
using System.IO;
using System.Collections;
using System.Text;
using System.Text.RegularExpressions;
namespace HtmlHelp.ChmDecoding
{
/// <summary>
/// The class <c>HHKParser</c> implements a parser for HHK contents files.
/// </summary>
internal sealed class HHKParser
{
/// <summary>
/// regular expressions for replacing the sitemap boundary tags
/// </summary>
private static string RE_ULOpening = @"\<ul\>"; // will be replaced by a '(' for nested parsing
private static string RE_ULClosing = @"\</ul\>"; // will be replaced by a ')' for nested parsing
/// <summary>
/// Matching ul-tags
/// </summary>
private static string RE_ULBoundaries = @"\<ul\>(?<innerText>.*)\</ul\>";
/// <summary>
/// Matching the nested tree structure.
/// </summary>
private static string RE_NestedBoundaries = @"\( (?> [^()]+ | \( (?<DEPTH>) | \) (?<-DEPTH>) )* (?(DEPTH)(?!)) \)";
/// <summary>
/// Matching object-tags
/// </summary>
private static string RE_ObjectBoundaries = @"\<object(?<innerText>.*?)\</object\>";
/// <summary>
/// Matching param tags
/// </summary>
private static string RE_ParamBoundaries = @"\<param(?<innerText>.*?)\>";
/// <summary>
/// Extracting tag attributes
/// </summary>
private const string RE_QuoteAttributes = @"( |\t)*(?<attributeName>[\-a-zA-Z0-9]*)( |\t)*=( |\t)*(?<attributeTD>[\""\'])?(?<attributeValue>.*?(?(attributeTD)\k<attributeTD>|([\s>]|.$)))";
/// <summary>
/// private regular expressionobjects
/// </summary>
private static Regex ulRE;
private static Regex NestedRE;
private static Regex ObjectRE;
private static Regex ParamRE;
private static Regex AttributesRE;
/// <summary>
/// Parses a HHK file and returns an ArrayList with the index tree
/// </summary>
/// <param name="hhkFile">string content of the hhk file</param>
/// <param name="chmFile">CHMFile instance</param>
/// <returns>Returns an ArrayList with the index tree</returns>
public static ArrayList ParseHHK(string hhkFile, CHMFile chmFile)
{
ArrayList indexList = new ArrayList();
ulRE = new Regex(RE_ULBoundaries, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
NestedRE = new Regex(RE_NestedBoundaries, RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
ObjectRE = new Regex(RE_ObjectBoundaries, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
ParamRE = new Regex(RE_ParamBoundaries, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
AttributesRE = new Regex(RE_QuoteAttributes, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
int innerTextIdx = ulRE.GroupNumberFromName("innerText");
if( ulRE.IsMatch(hhkFile, 0) )
{
Match m = ulRE.Match(hhkFile, 0);
if( ObjectRE.IsMatch(hhkFile, 0) ) // first object block contains information types and categories
{
Match mO = ObjectRE.Match(hhkFile, 0);
int iOTxt = ObjectRE.GroupNumberFromName("innerText");
string globalText = mO.Groups[iOTxt].Value;
ParseGlobalSettings( globalText, chmFile );
}
string innerText = m.Groups["innerText"].Value;
innerText = innerText.Replace("(", "&#040;");
innerText = innerText.Replace(")", "&#041;");
innerText = Regex.Replace(innerText, RE_ULOpening, "(", RegexOptions.IgnoreCase);
innerText = Regex.Replace(innerText, RE_ULClosing, ")", RegexOptions.IgnoreCase);
ParseTree( innerText, null, indexList, chmFile );
}
return indexList;
}
/// <summary>
/// Recursively parses a sitemap tree
/// </summary>
/// <param name="text">content text</param>
/// <param name="parent">Parent for all read items</param>
/// <param name="arrNodes">arraylist which receives the extracted nodes</param>
/// <param name="chmFile">CHMFile instance</param>
private static void ParseTree( string text, IndexItem parent, ArrayList arrNodes, CHMFile chmFile )
{
string strPreItems="", strPostItems="";
string innerText = "";
int nIndex = 0;
while( NestedRE.IsMatch(text, nIndex) )
{
Match m = NestedRE.Match(text, nIndex);
innerText = m.Value.Substring( 1, m.Length-2);
strPreItems = text.Substring(nIndex,m.Index-nIndex);
ParseItems(strPreItems, parent, arrNodes, chmFile);
if((arrNodes.Count>0) && (innerText.Length > 0) )
{
IndexItem p = ((IndexItem)(arrNodes[arrNodes.Count-1]));
ParseTree( innerText, p, arrNodes, chmFile );
}
nIndex = m.Index+m.Length;
}
if( nIndex == 0)
{
strPostItems = text.Substring(nIndex, text.Length-nIndex);
ParseItems(strPostItems, parent, arrNodes, chmFile);
}
else if( nIndex < text.Length-1)
{
strPostItems = text.Substring(nIndex, text.Length-nIndex);
ParseTree(strPostItems, parent, arrNodes, chmFile);
}
}
/// <summary>
/// Parses nodes from the text
/// </summary>
/// <param name="itemstext">text containing the items</param>
/// <param name="parentItem">parent index item</param>
/// <param name="arrNodes">arraylist where the nodes should be added</param>
/// <param name="chmFile">CHMFile instance</param>
private static void ParseItems( string itemstext, IndexItem parentItem, ArrayList arrNodes, CHMFile chmFile)
{
int innerTextIdx = ObjectRE.GroupNumberFromName("innerText");
int innerPTextIdx = ParamRE.GroupNumberFromName("innerText");
// get group-name indexes
int nameIndex = AttributesRE.GroupNumberFromName("attributeName");
int valueIndex = AttributesRE.GroupNumberFromName("attributeValue");
int tdIndex = AttributesRE.GroupNumberFromName("attributeTD");
int nObjStartIndex = 0;
int nLastObjStartIndex = 0;
string sKeyword = "";
while( ObjectRE.IsMatch(itemstext, nObjStartIndex) )
{
Match m = ObjectRE.Match(itemstext, nObjStartIndex);
string innerText = m.Groups[innerTextIdx].Value;
IndexItem idxItem = new IndexItem();
// read parameters
int nParamIndex = 0;
int nNameCnt = 0;
string paramTitle = "";
string paramLocal = "";
bool bAdded = false;
while( ParamRE.IsMatch(innerText, nParamIndex) )
{
Match mP = ParamRE.Match(innerText, nParamIndex);
string innerP = mP.Groups[innerPTextIdx].Value;
string paramName = "";
string paramValue = "";
int nAttrIdx = 0;
//sKeyword = "";
while( AttributesRE.IsMatch( innerP, nAttrIdx ) )
{
Match mA = AttributesRE.Match(innerP, nAttrIdx);
string attributeName = mA.Groups[nameIndex].Value;
string attributeValue = mA.Groups[valueIndex].Value;
string attributeTD = mA.Groups[tdIndex].Value;
if(attributeTD.Length > 0)
{
// delete the trailing textqualifier
if( attributeValue.Length > 0)
{
int ltqi = attributeValue.LastIndexOf( attributeTD );
if(ltqi >= 0)
{
attributeValue = attributeValue.Substring(0,ltqi);
}
}
}
if( attributeName.ToLower() == "name")
{
paramName = HttpUtility.HtmlDecode(attributeValue); // for unicode encoded values
nNameCnt++;
}
if( attributeName.ToLower() == "value")
{
paramValue = HttpUtility.HtmlDecode(attributeValue); // for unicode encoded values
// delete trailing /
while((paramValue.Length>0)&&(paramValue[paramValue.Length-1] == '/'))
paramValue = paramValue.Substring(0,paramValue.Length-1);
}
nAttrIdx = mA.Index+mA.Length;
}
if( nNameCnt == 1) // first "Name" param = keyword
{
sKeyword = "";
if(parentItem != null)
sKeyword = parentItem.KeyWordPath + ",";
string sOldKW = sKeyword;
sKeyword += paramValue;
IndexItem idxFind = FindByKeyword(arrNodes, sKeyword);
if(idxFind != null)
{
idxItem = idxFind;
}
else
{
if( sKeyword.Split(new char[] {','}).Length > 1 )
{
idxItem.CharIndex = sKeyword.Length - paramValue.Length;
}
else
{
sKeyword = paramValue;
sOldKW = sKeyword;
idxItem.CharIndex = 0;
}
idxItem.KeyWordPath = sKeyword;
idxItem.Indent = sKeyword.Split(new char[] {','}).Length - 1;
idxItem.IsSeeAlso = false;
sKeyword = sOldKW;
}
}
else
{
if( (nNameCnt > 2) && (paramName.ToLower()=="name") )
{
bAdded = true;
IndexTopic idxTopic = new IndexTopic(paramTitle, paramLocal, chmFile.CompileFile, chmFile.ChmFilePath);
idxItem.Topics.Add( idxTopic );
paramTitle = "";
paramLocal = "";
}
switch(paramName.ToLower())
{
case "name":
//case "keyword":
{
paramTitle = paramValue;
};break;
case "local":
{
paramLocal = paramValue.Replace("../", "").Replace("./", "");
};break;
case "type": // information type assignment for item
{
idxItem.InfoTypeStrings.Add( paramValue );
};break;
case "see also":
{
idxItem.AddSeeAlso(paramValue);
idxItem.IsSeeAlso = true;
bAdded = true;
};break;
}
}
nParamIndex = mP.Index+mP.Length;
}
if(!bAdded)
{
bAdded=false;
IndexTopic idxTopic = new IndexTopic(paramTitle, paramLocal, chmFile.CompileFile, chmFile.ChmFilePath);
idxItem.Topics.Add( idxTopic );
paramTitle = "";
paramLocal = "";
}
idxItem.ChmFile = chmFile;
arrNodes.Add( idxItem );
nLastObjStartIndex = nObjStartIndex;
nObjStartIndex = m.Index+m.Length;
}
}
/// <summary>
/// Searches an index-keyword in the index list
/// </summary>
/// <param name="indexList">index list to search</param>
/// <param name="Keyword">keyword to find</param>
/// <returns>Returns an <see cref="IndexItem">IndexItem</see> instance if found, otherwise null.</returns>
private static IndexItem FindByKeyword(ArrayList indexList, string Keyword)
{
foreach(IndexItem curItem in indexList)
{
if( curItem.KeyWordPath == Keyword)
return curItem;
}
return null;
}
/// <summary>
/// Parses the very first &lt;OBJECT&gt; tag in the sitemap file and extracts
/// information types and categories.
/// </summary>
/// <param name="sText">text of the object tag</param>
/// <param name="chmFile">CHMFile instance</param>
private static void ParseGlobalSettings(string sText, CHMFile chmFile)
{
int innerPTextIdx = ParamRE.GroupNumberFromName("innerText");
// get group-name indexes
int nameIndex = AttributesRE.GroupNumberFromName("attributeName");
int valueIndex = AttributesRE.GroupNumberFromName("attributeValue");
int tdIndex = AttributesRE.GroupNumberFromName("attributeTD");
// read parameters
int nParamIndex = 0;
// 0... unknown
// 1... inclusinve info type name
// 2... exclusive info type name
// 3... hidden info type name
// 4... category name
// 5... incl infotype name for category
// 6... excl infotype name for category
// 7... hidden infotype name for category
int prevItem = 0;
string sName = "";
string sDescription = "";
string curCategory = "";
while( ParamRE.IsMatch(sText, nParamIndex) )
{
Match mP = ParamRE.Match(sText, nParamIndex);
string innerP = mP.Groups[innerPTextIdx].Value;
string paramName = "";
string paramValue = "";
int nAttrIdx = 0;
while( AttributesRE.IsMatch( innerP, nAttrIdx ) )
{
Match mA = AttributesRE.Match(innerP, nAttrIdx);
string attributeName = mA.Groups[nameIndex].Value;
string attributeValue = mA.Groups[valueIndex].Value;
string attributeTD = mA.Groups[tdIndex].Value;
if(attributeTD.Length > 0)
{
// delete the trailing textqualifier
if( attributeValue.Length > 0)
{
int ltqi = attributeValue.LastIndexOf( attributeTD );
if(ltqi >= 0)
{
attributeValue = attributeValue.Substring(0,ltqi);
}
}
}
if( attributeName.ToLower() == "name")
{
paramName = HttpUtility.HtmlDecode(attributeValue); // for unicode encoded values
}
if( attributeName.ToLower() == "value")
{
paramValue = HttpUtility.HtmlDecode(attributeValue); // for unicode encoded values
// delete trailing /
while((paramValue.Length>0)&&(paramValue[paramValue.Length-1] == '/'))
paramValue = paramValue.Substring(0,paramValue.Length-1);
}
nAttrIdx = mA.Index+mA.Length;
}
switch(paramName.ToLower())
{
case "savetype": // inclusive information type name
{
prevItem = 1;
sName = paramValue;
};break;
case "savetypedesc": // description of information type
{
InformationTypeMode mode = InformationTypeMode.Inclusive;
sDescription = paramValue;
if( prevItem == 1)
mode = InformationTypeMode.Inclusive;
if( prevItem == 2)
mode = InformationTypeMode.Exclusive;
if( prevItem == 3)
mode = InformationTypeMode.Hidden;
if( chmFile.GetInformationType( sName ) == null)
{
// check if the HtmlHelpSystem already holds such an information type
if( chmFile.SystemInstance.GetInformationType( sName ) == null)
{
// info type not found yet
InformationType newType = new InformationType(sName, sDescription, mode);
chmFile.InformationTypes.Add(newType);
}
else
{
InformationType sysType = chmFile.SystemInstance.GetInformationType( sName );
chmFile.InformationTypes.Add( sysType );
}
}
prevItem = 0;
};break;
case "saveexclusive": // exclusive information type name
{
prevItem = 2;
sName = paramValue;
};break;
case "savehidden": // hidden information type name
{
prevItem = 3;
sName = paramValue;
};break;
case "category": // category name
{
prevItem = 4;
sName = paramValue;
curCategory = sName;
};break;
case "categorydesc": // category description
{
sDescription = paramValue;
if( chmFile.GetCategory( sName ) == null)
{
// check if the HtmlHelpSystem already holds such a category
if( chmFile.SystemInstance.GetCategory( sName ) == null)
{
// add category
Category newCat = new Category(sName, sDescription);
chmFile.Categories.Add(newCat);
}
else
{
Category sysCat = chmFile.SystemInstance.GetCategory( sName );
chmFile.Categories.Add( sysCat );
}
}
prevItem = 0;
};break;
case "type": // inclusive information type which is member of the previously read category
{
prevItem = 5;
sName = paramValue;
};break;
case "typedesc": // description of type for category
{
sDescription = paramValue;
Category cat = chmFile.GetCategory( curCategory );
if( cat != null)
{
// category found
InformationType infoType = chmFile.GetInformationType( sName );
if( infoType != null)
{
if( !cat.ContainsInformationType(infoType))
{
infoType.SetCategoryFlag(true);
cat.AddInformationType(infoType);
}
}
}
prevItem = 0;
};break;
case "typeexclusive": // exclusive information type which is member of the previously read category
{
prevItem = 6;
sName = paramValue;
};break;
case "typehidden": // hidden information type which is member of the previously read category
{
prevItem = 7;
sName = paramValue;
};break;
default:
{
prevItem = 0;
sName = "";
sDescription = "";
};break;
}
nParamIndex = mP.Index+mP.Length;
}
}
}
}

View File

@@ -0,0 +1,245 @@
using System;
using System.IO;
namespace HtmlHelp.ChmDecoding
{
/// <summary>
/// The class <c>TopicEntry</c> stores the data for one topic entry
/// </summary>
internal sealed class TopicEntry
{
/// <summary>
/// Internal member storing the offset of this topic entry
/// </summary>
private int _entryOffset = 0;
/// <summary>
/// Internal member storing the index of the binary toc
/// </summary>
private int _tocidxOffset = 0;
/// <summary>
/// Internal member storing the string offset of the title
/// </summary>
private int _titleOffset = 0;
/// <summary>
/// Internal member storuing the urltable offset
/// </summary>
private int _urltableOffset = 0;
/// <summary>
/// Internal member storing the visibility mode
/// </summary>
private int _visibilityMode = 0;
/// <summary>
/// Internal member storing an unknown mode
/// </summary>
private int _unknownMode = 0;
/// <summary>
/// Internal member storing the associated chmfile object
/// </summary>
private CHMFile _associatedFile = null;
/// <summary>
/// Constructor of the class
/// </summary>
/// <param name="entryOffset">offset of this entry</param>
/// <param name="tocidxOffset">offset in the binary toc index</param>
/// <param name="titleOffset">offset of the title (in the #STRINGS file)</param>
/// <param name="urltableOffset">offset in the urltable containing the urlstr offset for the url</param>
/// <param name="visibilityMode">visibility mode 2 indicates not in contents, 6 indicates that it is in the contents, 0/4 something else (unknown)</param>
/// <param name="unknownMode">0, 2, 4, 8, 10, 12, 16, 32 (unknown)</param>
public TopicEntry(int entryOffset, int tocidxOffset, int titleOffset, int urltableOffset, int visibilityMode, int unknownMode) :this(entryOffset, tocidxOffset, titleOffset, urltableOffset, visibilityMode, unknownMode, null)
{
}
/// <summary>
/// Constructor of the class
/// </summary>
/// <param name="entryOffset">offset of this entry</param>
/// <param name="tocidxOffset">offset in the binary toc index</param>
/// <param name="titleOffset">offset of the title (in the #STRINGS file)</param>
/// <param name="urltableOffset">offset in the urltable containing the urlstr offset for the url</param>
/// <param name="visibilityMode">visibility mode 2 indicates not in contents, 6 indicates that it is in the contents, 0/4 something else (unknown)</param>
/// <param name="unknownMode">0, 2, 4, 8, 10, 12, 16, 32 (unknown)</param>
/// <param name="associatedFile">associated chmfile object</param>
internal TopicEntry(int entryOffset, int tocidxOffset, int titleOffset, int urltableOffset, int visibilityMode, int unknownMode, CHMFile associatedFile)
{
_entryOffset = entryOffset;
_tocidxOffset = tocidxOffset;
_titleOffset = titleOffset;
_urltableOffset = urltableOffset;
_visibilityMode = visibilityMode;
_unknownMode = unknownMode;
_associatedFile = associatedFile;
}
/// <summary>
/// Standard constructor
/// </summary>
internal TopicEntry()
{
}
#region Data dumping
/// <summary>
/// Dump the class data to a binary writer
/// </summary>
/// <param name="writer">writer to write the data</param>
internal void Dump(ref BinaryWriter writer)
{
writer.Write( _entryOffset );
writer.Write( _tocidxOffset );
writer.Write( _titleOffset );
writer.Write( _urltableOffset );
writer.Write( _visibilityMode );
writer.Write( _unknownMode );
}
/// <summary>
/// Reads the object data from a dump store
/// </summary>
/// <param name="reader">reader to read the data</param>
internal void ReadDump(ref BinaryReader reader)
{
_entryOffset = reader.ReadInt32();
_tocidxOffset = reader.ReadInt32();
_titleOffset = reader.ReadInt32();
_urltableOffset = reader.ReadInt32();
_visibilityMode = reader.ReadInt32();
_unknownMode = reader.ReadInt32();
}
/// <summary>
/// Sets the associated CHMFile instance
/// </summary>
/// <param name="associatedFile">instance to set</param>
internal void SetCHMFile(CHMFile associatedFile)
{
_associatedFile = associatedFile;
}
#endregion
/// <summary>
/// Gets the associated chm file
/// </summary>
internal CHMFile ChmFile
{
get { return _associatedFile; }
}
/// <summary>
/// Gets the offset of this entry
/// </summary>
internal int EntryOffset
{
get { return _entryOffset; }
}
/// <summary>
/// Gets the tocidx offset
/// </summary>
internal int TOCIdxOffset
{
get { return _tocidxOffset; }
}
/// <summary>
/// Gets the title offset of the #STRINGS file
/// </summary>
internal int TitleOffset
{
get { return _titleOffset; }
}
/// <summary>
/// Gets the urltable offset
/// </summary>
internal int UrlTableOffset
{
get { return _urltableOffset; }
}
/// <summary>
/// Gets the title of the topic entry
/// </summary>
public string Title
{
get
{
if( _associatedFile == null)
return String.Empty;
if( _associatedFile.StringsFile == null)
return String.Empty;
string sTemp = (string)_associatedFile.StringsFile[ _titleOffset ];
if(sTemp == null)
return String.Empty;
return sTemp;
}
}
/// <summary>
/// Gets the url of the topic
/// </summary>
public string Locale
{
get
{
if( _associatedFile == null)
return String.Empty;
if( _associatedFile.UrltblFile == null)
return String.Empty;
UrlTableEntry utEntry = (UrlTableEntry)_associatedFile.UrltblFile[ _urltableOffset ];
if(utEntry == null)
return String.Empty;
if(utEntry.URL == "")
return String.Empty;
return utEntry.URL;
}
}
/// <summary>
/// Gets the URL of this topic
/// </summary>
public string URL
{
get
{
if(Locale.Length <= 0)
return "about:blank";
if( (Locale.ToLower().IndexOf("http://") >= 0) ||
(Locale.ToLower().IndexOf("https://") >= 0) ||
(Locale.ToLower().IndexOf("mailto:") >= 0) ||
(Locale.ToLower().IndexOf("ftp://") >= 0) ||
(Locale.ToLower().IndexOf("ms-its:") >= 0))
return Locale;
return HtmlHelpSystem.UrlPrefix + _associatedFile.ChmFilePath + "::/" + Locale;
}
}
/// <summary>
/// Gets the visibility mode
/// </summary>
public int VisibilityMode
{
get { return _visibilityMode; }
}
/// <summary>
/// Gets the unknown mode
/// </summary>
public int UknownMode
{
get { return _unknownMode; }
}
}
}

View File

@@ -0,0 +1,175 @@
using System;
using System.IO;
namespace HtmlHelp.ChmDecoding
{
/// <summary>
/// The class <c>UrlTableEntry</c> stores data for an URL-Table entry
/// </summary>
internal sealed class UrlTableEntry
{
/// <summary>
/// Internal member storing the offset of this entry
/// </summary>
private int _entryOffset = 0;
/// <summary>
/// Internal member storing a unique id
/// </summary>
private uint _uniqueID = 0;
/// <summary>
/// Internal member storing the topics index
/// </summary>
private int _topicsIndex = 0;
/// <summary>
/// Internal member storing the offset in the urlstr table
/// </summary>
private int _urlStrOffset = 0;
/// <summary>
/// Internal member storing the associated chmfile object
/// </summary>
private CHMFile _associatedFile = null;
/// <summary>
/// Constructor of the class
/// </summary>
/// <param name="uniqueID">unique id</param>
/// <param name="entryOffset">offset of the entry</param>
/// <param name="topicIndex">topic index</param>
/// <param name="urlstrOffset">urlstr offset for filename</param>
public UrlTableEntry(uint uniqueID, int entryOffset, int topicIndex, int urlstrOffset) : this(uniqueID, entryOffset, topicIndex, urlstrOffset, null)
{
}
/// <summary>
/// Constructor of the class
/// </summary>
/// <param name="uniqueID">unique id</param>
/// <param name="entryOffset">offset of the entry</param>
/// <param name="topicIndex">topic index</param>
/// <param name="urlstrOffset">urlstr offset for filename</param>
/// <param name="associatedFile">associated chm file</param>
internal UrlTableEntry(uint uniqueID, int entryOffset, int topicIndex, int urlstrOffset, CHMFile associatedFile)
{
_uniqueID = uniqueID;
_entryOffset = entryOffset;
_topicsIndex = topicIndex;
_urlStrOffset = urlstrOffset;
_associatedFile = associatedFile;
}
/// <summary>
/// Standard constructor
/// </summary>
internal UrlTableEntry()
{
}
#region Data dumping
/// <summary>
/// Dump the class data to a binary writer
/// </summary>
/// <param name="writer">writer to write the data</param>
internal void Dump(ref BinaryWriter writer)
{
writer.Write( _urlStrOffset );
writer.Write( _entryOffset );
writer.Write( _topicsIndex );
writer.Write( _urlStrOffset );
}
/// <summary>
/// Reads the object data from a dump store
/// </summary>
/// <param name="reader">reader to read the data</param>
internal void ReadDump(ref BinaryReader reader)
{
_urlStrOffset = reader.ReadInt32();
_entryOffset = reader.ReadInt32();
_topicsIndex = reader.ReadInt32();
_urlStrOffset = reader.ReadInt32();
}
/// <summary>
/// Sets the associated CHMFile instance
/// </summary>
/// <param name="associatedFile">instance to set</param>
internal void SetCHMFile(CHMFile associatedFile)
{
_associatedFile = associatedFile;
}
#endregion
/// <summary>
/// Gets the unique id of the entry
/// </summary>
internal uint UniqueID
{
get {return _uniqueID; }
}
/// <summary>
/// Gets the offset of the entry
/// </summary>
internal int EntryOffset
{
get {return _entryOffset; }
}
/// <summary>
/// Gets the topics index
/// </summary>
internal int TopicIndex
{
get {return _topicsIndex; }
}
/// <summary>
/// Gets the urlstr offset
/// </summary>
internal int UrlstrOffset
{
get { return _urlStrOffset; }
}
/// <summary>
/// Gets the url of the entry
/// </summary>
public string URL
{
get
{
if(_associatedFile == null)
return String.Empty;
if(_associatedFile.UrlstrFile == null)
return String.Empty;
string sTemp = (string)_associatedFile.UrlstrFile.GetURLatOffset( _urlStrOffset );
if( sTemp == null)
return String.Empty;
return sTemp;
}
}
/// <summary>
/// Gets the associated topic for this url entry
/// </summary>
internal TopicEntry Topic
{
get
{
if(_associatedFile == null)
return null;
if(_associatedFile.TopicsFile == null)
return null;
TopicEntry tentry = _associatedFile.TopicsFile[ _topicsIndex*16 ];
return tentry;
}
}
}
}

View File

@@ -0,0 +1,19 @@
using System;
namespace HtmlHelp.ChmDecoding
{
/// <summary>
/// Enumeration for specifying the extraction mode of an toc or index item.
/// </summary>
public enum DataMode
{
/// <summary>
/// TextBased - this item comes from a text-based sitemap file
/// </summary>
TextBased = 0,
/// <summary>
/// Binary - this item was extracted out of a binary stream
/// </summary>
Binary = 1
}
}

View File

@@ -0,0 +1,16 @@
<Combine fileversion="1.0" name="CHMLibrary" description="">
<StartMode startupentry="CHMLibrary" single="True">
<Execute entry="CHMLibrary" type="None" />
</StartMode>
<Entries>
<Entry filename=".\.\CHMLibrary.prjx" />
</Entries>
<Configurations active="Debug">
<Configuration name="Release">
<Entry name="CHMLibrary" configurationname="Debug" build="False" />
</Configuration>
<Configuration name="Debug">
<Entry name="CHMLibrary" configurationname="Debug" build="False" />
</Configuration>
</Configurations>
</Combine>

View File

@@ -0,0 +1,58 @@
<Project name="CHMLibrary" standardNamespace="CHMLibrary" description="" newfilesearch="None" enableviewstate="True" version="1.1" projecttype="C#">
<Contents>
<File name=".\AssemblyInfo.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\Category.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\ChmFileInfo.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\Default.build" subtype="Code" buildaction="Nothing" dependson="" data="" />
<File name=".\HtmlHelpSystem.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\HttpUtility.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\Index.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\IndexItem.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\IndexTopic.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\InformationType.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\TableOfContents.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\TOCItem.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\Storage" subtype="Directory" buildaction="Compile" dependson="" data="" />
<File name=".\Storage\CHMStream.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding" subtype="Directory" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\BinaryReaderHelp.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\CHMBtree.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\CHMFile.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\CHMIdxhdr.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\CHMStrings.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\CHMSystem.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\CHMTocidx.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\CHMTopics.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\CHMUrlstr.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\CHMUrltable.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\DumpingInfo.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\enumerations.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\FullTextEngine.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\HHCParser2.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\HHCParser.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\HHKParser.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\TopicEntry.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\CHMDecoding\UrlTableEntry.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
</Contents>
<References>
<Reference type="Project" refto="Compression" localcopy="True" />
</References>
<DeploymentInformation target="" script="" strategy="File" />
<Configuration runwithwarnings="True" name="Debug">
<CodeGeneration runtime="MsNet" compiler="Csc" compilerversion="" warninglevel="4" nowarn="" includedebuginformation="True" optimize="False" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Library" definesymbols="" generatexmldocumentation="False" win32Icon="" noconfig="False" nostdlib="False" />
<Execution commandlineparameters="" consolepause="False" />
<Output directory="..\bin\Debug" assembly="CHMLibrary" executeScript="" executeBeforeBuild="" executeAfterBuild="" executeBeforeBuildArguments="" executeAfterBuildArguments="" />
</Configuration>
<Configurations active="Debug">
<Configuration runwithwarnings="True" name="Debug">
<CodeGeneration runtime="MsNet" compiler="Csc" compilerversion="" warninglevel="4" nowarn="" includedebuginformation="True" optimize="False" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Library" definesymbols="" generatexmldocumentation="False" win32Icon="" noconfig="False" nostdlib="False" />
<Execution commandlineparameters="" consolepause="False" />
<Output directory="..\bin\Debug" assembly="CHMLibrary" executeScript="" executeBeforeBuild="" executeAfterBuild="" executeBeforeBuildArguments="" executeAfterBuildArguments="" />
</Configuration>
<Configuration runwithwarnings="True" name="Release">
<CodeGeneration runtime="MsNet" compiler="Csc" compilerversion="" warninglevel="4" nowarn="" includedebuginformation="False" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" mainclass="" target="Library" definesymbols="" generatexmldocumentation="False" win32Icon="" noconfig="False" nostdlib="False" />
<Execution commandlineparameters="" consolepause="False" />
<Output directory="..\bin\Release" assembly="CHMLibrary" executeScript="" executeBeforeBuild="" executeAfterBuild="" executeBeforeBuildArguments="" executeAfterBuildArguments="" />
</Configuration>
</Configurations>
</Project>

View File

@@ -0,0 +1,201 @@
using System;
using System.Collections;
using System.IO;
using HtmlHelp.ChmDecoding;
namespace HtmlHelp
{
/// <summary>
/// The class <c>Category</c> implements methods/properties for handling an information category
/// </summary>
/// <remarks>Note: Information types and categories allow users to filter help contents.
/// They are only supported if using sitemap TOC and/or sitemap Index.</remarks>
public class Category
{
private string _name = "";
private string _description = "";
private ArrayList _infoTypes = null;
private int _referenceCount = 1;
/// <summary>
/// Standard constructor
/// </summary>
public Category() : this("","")
{
}
/// <summary>
/// Standard constructor
/// </summary>
/// <param name="name">name of the category</param>
/// <param name="description">description</param>
public Category(string name, string description) : this(name, description, new ArrayList())
{
}
/// <summary>
/// Standard constructor
/// </summary>
/// <param name="name">name of the category</param>
/// <param name="description">description</param>
/// <param name="linkedInformationTypes">Arraylist of InformationType instances which applies to this category</param>
public Category(string name, string description, ArrayList linkedInformationTypes)
{
_name = name;
_description = description;
_infoTypes = linkedInformationTypes;
}
#region Data dumping
/// <summary>
/// Dump the class data to a binary writer
/// </summary>
/// <param name="writer">writer to write the data</param>
internal void Dump(ref BinaryWriter writer)
{
writer.Write( _name );
writer.Write( _description );
writer.Write( _infoTypes.Count );
for(int i=0; i<_infoTypes.Count;i++)
{
InformationType curType = _infoTypes[i] as InformationType;
writer.Write( curType.Name );
}
}
/// <summary>
/// Reads the object data from a dump store
/// </summary>
/// <param name="reader">reader to read the data</param>
/// <param name="chmFile">current CHMFile instance which reads from dump</param>
internal void ReadDump(ref BinaryReader reader, CHMFile chmFile)
{
_name = reader.ReadString();
_description = reader.ReadString();
int nCnt = reader.ReadInt32();
for(int i=0; i<nCnt; i++)
{
string sITName = reader.ReadString();
InformationType linkedType = chmFile.GetInformationType( sITName );
if(linkedType != null)
{
linkedType.SetCategoryFlag(true);
_infoTypes.Add(linkedType);
}
}
}
#endregion
/// <summary>
/// Merges the lineked information types from cat into this instance
/// </summary>
/// <param name="cat">category instance</param>
internal void MergeInfoTypes(Category cat)
{
if(cat!=null)
{
if(cat.InformationTypes.Count > 0)
{
for(int i=0;i<cat.InformationTypes.Count;i++)
{
InformationType curType = cat.InformationTypes[i] as InformationType;
if(!ContainsInformationType(curType.Name))
{
curType.SetCategoryFlag(true);
_infoTypes.Add(curType);
}
}
}
}
}
/// <summary>
/// Gets/Sets the reference count of this information type instance
/// </summary>
internal int ReferenceCount
{
get { return _referenceCount; }
set { _referenceCount = value; }
}
/// <summary>
/// Gets/Sets the name of the information type
/// </summary>
public string Name
{
get { return _name; }
set { _name = value; }
}
/// <summary>
/// Gets/Sets the description of the information type
/// </summary>
public string Description
{
get { return _description; }
set { _name = value; }
}
/// <summary>
/// Gets an ArrayList with the linked Information types
/// </summary>
public ArrayList InformationTypes
{
get { return _infoTypes; }
}
/// <summary>
/// Adds a new information type to the category
/// </summary>
/// <param name="type"></param>
public void AddInformationType(InformationType type)
{
_infoTypes.Add(type);
}
/// <summary>
/// Removes an information type from the category
/// </summary>
/// <param name="type"></param>
public void RemoveInformationType(InformationType type)
{
_infoTypes.Remove(type);
}
/// <summary>
/// Checks if the category contains an information type
/// </summary>
/// <param name="type">information type instance to check</param>
/// <returns>Return true if the information type is part of this category</returns>
public bool ContainsInformationType(InformationType type)
{
return _infoTypes.Contains(type);
}
/// <summary>
/// Checks if the category contains an information type
/// </summary>
/// <param name="name">name of the information type</param>
/// <returns>Return true if the information type is part of this category</returns>
public bool ContainsInformationType(string name)
{
for(int i=0;i<_infoTypes.Count;i++)
{
InformationType curType = _infoTypes[i] as InformationType;
if(curType.Name == name)
return true;
}
return false;
}
}
}

View File

@@ -0,0 +1,478 @@
using System;
using System.Collections;
using System.Text;
using System.IO;
using System.Globalization;
using System.Diagnostics;
using System.ComponentModel;
using HtmlHelp.ChmDecoding;
// using HtmlHelp.Storage;
namespace HtmlHelp
{
/// <summary>
/// The class <c>ChmFileInfo</c> only extracts system information from a CHM file.
/// It doesn't build the index and table of contents.
/// </summary>
public class ChmFileInfo
{
/// <summary>
/// Internal member storing the full filename
/// </summary>
private string _chmFileName = "";
/// <summary>
/// Internal member storing the associated chmfile object
/// </summary>
private CHMFile _associatedFile = null;
/// <summary>
/// Constructor for extrating the file information of the provided file.
/// The constructor opens the chm-file and reads its system data.
/// </summary>
/// <param name="chmFile">full file name which information should be extracted</param>
public ChmFileInfo(string chmFile)
{
if(!File.Exists(chmFile))
throw new ArgumentException("Chm file must exist on disk !", "chmFileName");
if( ! chmFile.ToLower().EndsWith(".chm") )
throw new ArgumentException("HtmlHelp file must have the extension .chm !", "chmFile");
_chmFileName = chmFile;
_associatedFile = new CHMFile(null, chmFile, true); // only load system data of chm
}
/// <summary>
/// Internal constructor used in the class <see cref="HtmlHelp.ChmDecoding.CHMFile">CHMFile</see>.
/// </summary>
/// <param name="associatedFile">associated chm file</param>
internal ChmFileInfo(CHMFile associatedFile)
{
_associatedFile = associatedFile;
if( _associatedFile == null)
throw new ArgumentException("Associated CHMFile instance must not be null !", "associatedFile");
}
#region default info properties
/// <summary>
/// Gets the full filename of the chm file
/// </summary>
public string ChmFileName
{
get
{
return _associatedFile.ChmFilePath;
}
}
/// <summary>
/// Gets a <see cref="System.IO.FileInfo">FileInfo</see> instance for the chm file.
/// </summary>
public FileInfo FileInfo
{
get { return new FileInfo(_associatedFile.ChmFilePath); }
}
#endregion
#region #SYSTEM properties
/// <summary>
/// Gets the file version of the chm file.
/// 2 for Compatibility=1.0, 3 for Compatibility=1.1
/// </summary>
public int FileVersion
{
get
{
if(_associatedFile != null)
return _associatedFile.FileVersion;
return 0;
}
}
/// <summary>
/// Gets the contents file name
/// </summary>
public string ContentsFile
{
get
{
if(_associatedFile != null)
return _associatedFile.ContentsFile;
return "";
}
}
/// <summary>
/// Gets the index file name
/// </summary>
public string IndexFile
{
get
{
if(_associatedFile != null)
return _associatedFile.IndexFile;
return "";
}
}
/// <summary>
/// Gets the default help topic
/// </summary>
public string DefaultTopic
{
get
{
if(_associatedFile != null)
return _associatedFile.DefaultTopic;
return "";
}
}
/// <summary>
/// Gets the title of the help window
/// </summary>
public string HelpWindowTitle
{
get
{
if(_associatedFile != null)
return _associatedFile.HelpWindowTitle;
return "";
}
}
/// <summary>
/// Gets the flag if DBCS is in use
/// </summary>
public bool DBCS
{
get
{
if(_associatedFile != null)
return _associatedFile.DBCS;
return false;
}
}
/// <summary>
/// Gets the flag if full-text-search is available
/// </summary>
public bool FullTextSearch
{
get
{
if(_associatedFile != null)
return _associatedFile.FullTextSearch;
return false;
}
}
/// <summary>
/// Gets the flag if the file has ALinks
/// </summary>
public bool HasALinks
{
get
{
if(_associatedFile != null)
return _associatedFile.HasALinks;
return false;
}
}
/// <summary>
/// Gets the flag if the file has KLinks
/// </summary>
public bool HasKLinks
{
get
{
if(_associatedFile != null)
return _associatedFile.HasKLinks;
return false;
}
}
/// <summary>
/// Gets the default window name
/// </summary>
public string DefaultWindow
{
get
{
if(_associatedFile != null)
return _associatedFile.DefaultWindow;
return "";
}
}
/// <summary>
/// Gets the file name of the compile file
/// </summary>
public string CompileFile
{
get
{
if(_associatedFile != null)
return _associatedFile.CompileFile;
return "";
}
}
/// <summary>
/// Gets the flag if the chm has a binary index file
/// </summary>
public bool BinaryIndex
{
get
{
if(_associatedFile != null)
return _associatedFile.BinaryIndex;
return false;
}
}
/// <summary>
/// Gets the flag if the chm has a binary index file
/// </summary>
public string CompilerVersion
{
get
{
if(_associatedFile != null)
return _associatedFile.CompilerVersion;
return "";
}
}
/// <summary>
/// Gets the flag if the chm has a binary toc file
/// </summary>
public bool BinaryTOC
{
get
{
if(_associatedFile != null)
return _associatedFile.BinaryTOC;
return false;
}
}
/// <summary>
/// Gets the font face of the read font property.
/// Empty string for default font.
/// </summary>
public string FontFace
{
get
{
if(_associatedFile != null)
return _associatedFile.FontFace;
return "";
}
}
/// <summary>
/// Gets the font size of the read font property.
/// 0 for default font size
/// </summary>
public double FontSize
{
get
{
if(_associatedFile != null)
return _associatedFile.FontSize;
return 0.0;
}
}
/// <summary>
/// Gets the character set of the read font property
/// 1 for default
/// </summary>
public int CharacterSet
{
get
{
if(_associatedFile != null)
return _associatedFile.CharacterSet;
return 1;
}
}
/// <summary>
/// Gets the codepage depending on the read font property
/// </summary>
public int CodePage
{
get
{
if(_associatedFile != null)
return _associatedFile.CodePage;
return 0;
}
}
/// <summary>
/// Gets the assiciated culture info
/// </summary>
public CultureInfo Culture
{
get
{
if(_associatedFile != null)
return _associatedFile.Culture;
return CultureInfo.CurrentCulture;
}
}
#endregion
#region #IDXHDR properties
/// <summary>
/// Gets the number of topic nodes including the contents and index files
/// </summary>
public int NumberOfTopicNodes
{
get
{
if(_associatedFile != null)
return _associatedFile.NumberOfTopicNodes;
return 0;
}
}
/// <summary>
/// Gets the ImageList string specyfied in the #IDXHDR file.
/// </summary>
/// <remarks>This property uses the #STRINGS file to extract the string at a given offset.</remarks>
public string ImageList
{
get
{
if(_associatedFile != null)
return _associatedFile.ImageList;
return "";
}
}
/// <summary>
/// Gets the background setting
/// </summary>
public int Background
{
get
{
if(_associatedFile != null)
return _associatedFile.Background;
return 0;
}
}
/// <summary>
/// Gets the foreground setting
/// </summary>
public int Foreground
{
get
{
if(_associatedFile != null)
return _associatedFile.Foreground;
return 0;
}
}
/// <summary>
/// Gets the FrameName string specyfied in the #IDXHDR file.
/// </summary>
/// <remarks>This property uses the #STRINGS file to extract the string at a given offset.</remarks>
public string FrameName
{
get
{
if(_associatedFile != null)
return _associatedFile.FrameName;
return "";
}
}
/// <summary>
/// Gets the WindowName string specyfied in the #IDXHDR file.
/// </summary>
/// <remarks>This property uses the #STRINGS file to extract the string at a given offset.</remarks>
public string WindowName
{
get
{
if(_associatedFile != null)
return _associatedFile.WindowName;
return "";
}
}
/// <summary>
/// Gets a string array containing the merged file names
/// </summary>
public string[] MergedFiles
{
get
{
if(_associatedFile != null)
return _associatedFile.MergedFiles;
return new string[0];
}
}
#endregion
}
}

View File

@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<project name="CHMLibrary" default="build">
<property name="output.dir" value="..\bin" />
<target name="build" description="Build component">
<mkdir dir="${output.dir}" />
<csc target="library"
output="${output.dir}\CHMLibrary.dll"
optimize="true"
debug="true"
doc="${output.dir}\CHMLibrary.xml"
warninglevel="0">
<sources>
<include name="**/*.cs" />
</sources>
<references>
<include name="${output.dir}\Compression.dll" />
</references>
</csc>
</target>
</project>

View File

@@ -0,0 +1,894 @@
using System;
using System.IO;
using System.Collections;
using System.Data;
using HtmlHelp.ChmDecoding;
namespace HtmlHelp
{
/// <summary>
/// The class <c>HtmlHelpSystem</c> implements the main object for reading chm files
/// </summary>
public sealed class HtmlHelpSystem
{
/// <summary>
/// Private shared instance of current HtmlHelpSystem class
/// </summary>
private static HtmlHelpSystem _current=null;
/// <summary>
/// Internal member storing the attached files
/// </summary>
private ArrayList _chmFiles = new ArrayList();
/// <summary>
/// Internal member storing a merged table of contents
/// </summary>
private TableOfContents _toc = new TableOfContents();
/// <summary>
/// Internal member storing a merged index
/// </summary>
private Index _index = new Index();
/// <summary>
/// URL prefix for specifying a chm destination
/// </summary>
private static string _urlPrefix = "ms-its:";
/// <summary>
/// Internal flag specifying if the system should use the tree-images list
/// from HtmlHelp2. If false the standard CHM-Viewer pics will be used.
/// </summary>
private static bool _useHH2TreePics = false;
/// <summary>
/// Internal member storing the read information types
/// </summary>
private ArrayList _informationTypes = new ArrayList();
/// <summary>
/// Internal member storing the read categories
/// </summary>
private ArrayList _categories = new ArrayList();
/// <summary>
/// Gets/Sets the url prefix for specifying a chm destination
/// </summary>
public static string UrlPrefix
{
get { return _urlPrefix; }
set { _urlPrefix = value; }
}
public CHMStream.CHMStream BaseStream
{
get
{
CHMFile chm=(CHMFile)_chmFiles[0];
return chm.BaseStream;
}
}
/// <summary>
/// Gets/Sets the flag specifying if the system should use the tree-images list
/// from HtmlHelp2. If false the standard CHM-Viewer pics will be used.
/// </summary>
public static bool UseHH2TreePics
{
get { return _useHH2TreePics; }
set { _useHH2TreePics = value; }
}
/// <summary>
/// Gets the current HtmlHelpSystem instance
/// </summary>
public static HtmlHelpSystem Current
{
get
{
return _current;
}
}
/// <summary>
/// Standard constructor
/// </summary>
public HtmlHelpSystem() : this("")
{
}
/// <summary>
/// Constructor of the reader class
/// </summary>
/// <param name="chmFile">chm file to attach with the reader</param>
public HtmlHelpSystem(string chmFile)
{
_current = this;
OpenFile(chmFile);
}
/// <summary>
/// Opens a chm file and creates
/// </summary>
/// <param name="chmFile">full file path of the chm file to open</param>
/// <remarks>If you call this method, all existing merged files will be cleared.</remarks>
public void OpenFile(string chmFile)
{
OpenFile(chmFile, null);
}
/// <summary>
/// Opens a chm file and creates
/// </summary>
/// <param name="chmFile">full file path of the chm file to open</param>
/// <param name="dmpInfo">dumping info</param>
/// <remarks>If you call this method, all existing merged files will be cleared.</remarks>
public void OpenFile(string chmFile, DumpingInfo dmpInfo)
{
if( File.Exists(chmFile ) )
{
_chmFiles.Clear();
_toc.Clear();
_index.Clear();
_informationTypes.Clear();
_categories.Clear();
CHMFile newFile = new CHMFile(this, chmFile, dmpInfo);
_toc = new TableOfContents( newFile.TOC );
_index = new Index( newFile.IndexKLinks, newFile.IndexALinks );
_chmFiles.Add(newFile);
// add all infotypes and categories of the read file to this system instance
MergeFileInfoTypesCategories(newFile);
// check if the file has a merged files list
if( newFile.MergedFiles.Length > 0 )
{
// extract the path of the chm file (usually merged files are in the same path)
FileInfo fi = new FileInfo(chmFile);
string sPath = fi.DirectoryName;
for(int i=0; i<newFile.MergedFiles.Length; i++)
{
string sFile = newFile.MergedFiles[i];
if(sFile.Length > 0)
{
if(sFile[1] != ':') // no full path setting
{
sFile = Path.Combine(sPath, sFile);
}
MergeFile(sFile, dmpInfo, true);
}
}
// if (newFile.MergLinks.Count>0)
// RecalculateMergeLinks(newFile);
RemoveMergeLinks(); // clear all merge-links which have no target !
}
}
}
/// <summary>
/// Merges a chm file to the current help contents
/// </summary>
/// <param name="chmFile">full file path of the chm file to merge</param>
public void MergeFile(string chmFile)
{
MergeFile(chmFile, null);
}
/// <summary>
/// Merges a chm file to the current help contents
/// </summary>
/// <param name="chmFile">full file path of the chm file to merge</param>
/// <param name="dmpInfo">dumping info</param>
public void MergeFile(string chmFile, DumpingInfo dmpInfo)
{
MergeFile(chmFile, dmpInfo, false);
}
/// <summary>
/// Merges a chm file to the current help contents
/// </summary>
/// <param name="chmFile">full file path of the chm file to merge</param>
/// <param name="dmpInfo">dumping info</param>
/// <param name="mergedFileList">true if the merge is done because a merged file list
/// was found in the previously loaded CHM.</param>
internal void MergeFile(string chmFile, DumpingInfo dmpInfo, bool mergedFileList)
{
if( File.Exists(chmFile ) )
{
if( _chmFiles.Count == 1)
{
// if we open the first file, we directly point into the toc and index of this file.
// So that we don't merge the new toc's indexe's into the first file, we have to
// clone the internal arraylists first to a new instance of the toc/index holder classes.
ArrayList atoc = _toc.TOC;
ArrayList alinks = _index.ALinks;
ArrayList klinks = _index.KLinks;
_toc = new TableOfContents();
_index = new Index();
_toc.MergeToC( atoc );
_index.MergeIndex( alinks, IndexType.AssiciativeLinks );
_index.MergeIndex( klinks, IndexType.KeywordLinks );
}
CHMFile newFile = new CHMFile(this, chmFile, dmpInfo);
if(mergedFileList) // if we've called this method due to a merged file list merge
{
RecalculateMergeLinks(newFile);
_toc.MergeToC( newFile.TOC, _chmFiles );
_index.MergeIndex( newFile.IndexALinks, IndexType.AssiciativeLinks );
_index.MergeIndex( newFile.IndexKLinks, IndexType.KeywordLinks );
_chmFiles.Add(newFile);
// add all infotypes and categories of the read file to this system instance
MergeFileInfoTypesCategories(newFile);
}
else
{
_toc.MergeToC( newFile.TOC, _chmFiles );
_index.MergeIndex( newFile.IndexALinks, IndexType.AssiciativeLinks );
_index.MergeIndex( newFile.IndexKLinks, IndexType.KeywordLinks );
_chmFiles.Add(newFile);
// add all infotypes and categories of the read file to this system instance
MergeFileInfoTypesCategories(newFile);
// check if the file has a merged files list
if( newFile.MergedFiles.Length > 0 )
{
// extract the path of the chm file (usually merged files are in the same path)
FileInfo fi = new FileInfo(chmFile);
string sPath = fi.DirectoryName;
for(int i=0; i<newFile.MergedFiles.Length; i++)
{
string sFile = newFile.MergedFiles[i];
if(sFile.Length > 0)
{
if(sFile[1] != ':') // no full path setting
{
sFile = Path.Combine(sPath, sFile);
}
MergeFile(sFile, dmpInfo, true);
}
}
RemoveMergeLinks(); // clear all merge-links which have no target !
}
}
}
}
/// <summary>
/// Checks all Merg-links read till now. Checks if the merg-link points to the
/// file <c>currentFile</c>. If yes the link will be replaced by the contents of the
/// merged file.
/// </summary>
/// <param name="currentFile">Current CHMFile instance</param>
internal void RecalculateMergeLinks(CHMFile currentFile)
{
foreach(CHMFile curFile in _chmFiles)
{
if( curFile.MergLinks.Count > 0)
{
for(int i=0; i<curFile.MergLinks.Count; i++)
{
TOCItem curItem = curFile.MergLinks[i] as TOCItem;
string sMerge = curItem.MergeLink;
string [] sSplit = sMerge.Split( new char[]{':'} );
string sFName = "";
string sTarget = "";
if( sSplit.Length > 3) // merge info contains path name
{
sFName = sSplit[0] + ":" + sSplit[1];
sTarget = sSplit[3];
}
else if( sSplit.Length == 3)// merge info contains only file name
{
FileInfo fi = new FileInfo(currentFile.ChmFilePath);
string sPath = fi.DirectoryName;
string sFile = sSplit[0];
if(sFile.Length > 0)
{
if(sFile[1] != ':') // no full path setting
{
sFile = Path.Combine(sPath, sFile);
}
}
sFName = sFile;
sTarget = sSplit[2];
}
ArrayList arrToc = null;
if( (sFName.Length>0) && (sTarget.Length>0) )
{
// if this link points into the current file
if( sFName.ToLower() == currentFile.ChmFilePath.ToLower() )
{
if(sTarget.ToLower().IndexOf(".hhc") >= 0)
{
string sfCheck = sTarget;
// remove prefixing ./
while( (sfCheck[0]=='.') || (sfCheck[0]=='/') )
{
sfCheck = sfCheck.Substring(1);
}
if( currentFile.ContentsFile.ToLower() != sfCheck )
{
arrToc = currentFile.ParseHHC( sTarget );
if( arrToc.Count > 0)
{
}
}
else
{
arrToc = currentFile.TOC;
}
// target points to a complete TOC
int nCnt = 0;
foreach(TOCItem chkItem in arrToc)
{
if(nCnt == 0)
{
curItem.AssociatedFile = currentFile;
curItem.Children = chkItem.Children;
curItem.ChmFile = currentFile.ChmFilePath;
curItem.ImageIndex = chkItem.ImageIndex;
curItem.Local = chkItem.Local;
curItem.MergeLink = chkItem.MergeLink;
curItem.Name = chkItem.Name;
curItem.TocMode = chkItem.TocMode;
curItem.TopicOffset = chkItem.TopicOffset;
MarkChildrenAdded(chkItem.Children, curFile.MergLinks);
}
else
{
ArrayList checkList = null;
if(curItem.Parent != null)
checkList = curItem.Parent.Children;
else
checkList = curFile.TOC;
int nIdx = checkList.IndexOf(curItem);
if((nIdx+nCnt)>checkList.Count)
checkList.Add(chkItem);
else
checkList.Insert(nIdx+nCnt, chkItem);
curFile.MergLinks.Add(chkItem);
MarkChildrenAdded(chkItem.Children, curFile.MergLinks);
}
nCnt++;
}
}
else
{
// target points to a single topic
TOCItem chkItem = currentFile.GetTOCItemByLocal(sTarget);
if(chkItem != null)
{
curItem.AssociatedFile = currentFile;
curItem.Children = chkItem.Children;
curItem.ChmFile = currentFile.ChmFilePath;
curItem.ImageIndex = chkItem.ImageIndex;
curItem.Local = chkItem.Local;
curItem.MergeLink = chkItem.MergeLink;
curItem.Name = chkItem.Name;
curItem.TocMode = chkItem.TocMode;
curItem.TopicOffset = chkItem.TopicOffset;
curFile.MergLinks.Add(chkItem);
MarkChildrenAdded(chkItem.Children, curFile.MergLinks);
}
}
}
}
}
}
}
}
/// <summary>
/// Adds sub-items of an TOC-entry to the merg-linked list.
/// This will mark this item as "added" during the extra merge run
/// of the HtmlHelpSystem class.
/// </summary>
/// <param name="tocs">TOCItem list</param>
/// <param name="merged">Arraylist which holds the merged-items</param>
internal void MarkChildrenAdded(ArrayList tocs, ArrayList merged)
{
foreach(TOCItem curItem in tocs)
{
if(!merged.Contains(curItem))
{
merged.Add(curItem);
MarkChildrenAdded(curItem.Children, merged);
}
}
}
/// <summary>
/// Removes merge-links from the toc of files which were not loaded
/// </summary>
internal void RemoveMergeLinks()
{
foreach(CHMFile curFile in _chmFiles)
{
if( curFile.MergLinks.Count > 0)
{
while(curFile.MergLinks.Count > 0)
{
TOCItem curItem = curFile.MergLinks[0] as TOCItem;
if(curItem.MergeLink.Length > 0)
curFile.RemoveTOCItem(curItem);
curFile.MergLinks.RemoveAt(0);
}
}
}
}
/// <summary>
/// Merges the information types and categories read by the CHMFile instance
/// into the system instance
/// </summary>
/// <param name="chmFile">file instance</param>
private void MergeFileInfoTypesCategories(CHMFile chmFile)
{
if(chmFile.HasInformationTypes)
{
for(int i=0; i<chmFile.InformationTypes.Count;i++)
{
InformationType curType = chmFile.InformationTypes[i] as InformationType;
InformationType sysType = GetInformationType( curType.Name );
if( sysType == null)
_informationTypes.Add(curType);
else
curType.ReferenceCount++;
}
}
if(chmFile.HasCategories)
{
for(int i=0; i<chmFile.Categories.Count;i++)
{
Category curCat = chmFile.Categories[i] as Category;
Category sysCat = GetCategory( curCat.Name );
if(sysCat == null)
_categories.Add(curCat);
else
curCat.ReferenceCount++;
}
}
}
/// <summary>
/// Removes the information types and categories read by the CHMFile instance
/// </summary>
/// <param name="chmFile">file instance</param>
private void RemoveFileInfoTypesCategories(CHMFile chmFile)
{
if(chmFile.HasInformationTypes)
{
for(int i=0; i<chmFile.InformationTypes.Count;i++)
{
InformationType curType = chmFile.InformationTypes[i] as InformationType;
InformationType sysType = GetInformationType( curType.Name );
if(sysType != null)
{
sysType.ReferenceCount--;
if(sysType.ReferenceCount<=0)
_informationTypes.Remove(sysType);
}
}
}
if(chmFile.HasCategories)
{
for(int i=0; i<chmFile.Categories.Count;i++)
{
Category curCat = chmFile.Categories[i] as Category;
Category sysCat = GetCategory( curCat.Name );
if(sysCat != null)
{
sysCat.ReferenceCount--;
if(sysCat.ReferenceCount<=0)
_categories.Remove(sysCat);
}
}
}
}
/// <summary>
/// Removes a chm file from the internal file collection
/// </summary>
/// <param name="chmFile">full file path of the chm file to remove</param>
public void RemoveFile(string chmFile)
{
int nIdx = -1;
CHMFile removeInstance=null;
foreach(CHMFile curFile in _chmFiles)
{
nIdx++;
if( curFile.ChmFilePath.ToLower() == chmFile.ToLower() )
{
removeInstance = curFile;
break;
}
}
if(nIdx >= 0)
{
_toc.Clear(); // forces a rebuild of the merged toc
_index.Clear(); // force a rebuild of the merged index
RemoveFileInfoTypesCategories(removeInstance);
_chmFiles.RemoveAt(nIdx);
}
}
/// <summary>
/// Closes all files and destroys TOC/index
/// </summary>
public void CloseAllFiles()
{
for(int i=0; i < _chmFiles.Count; i++)
{
CHMFile curFile = _chmFiles[i] as CHMFile;
_chmFiles.RemoveAt(i);
curFile.Dispose();
i--;
}
_chmFiles.Clear();
_toc.Clear();
_index.Clear();
_informationTypes.Clear();
_categories.Clear();
}
/// <summary>
/// Gets an array of loaded chm files.
/// </summary>
public CHMFile[] FileList
{
get
{
CHMFile[] ret = new CHMFile[ _chmFiles.Count ];
for(int i=0;i<_chmFiles.Count;i++)
ret[i] = (CHMFile)_chmFiles[i];
return ret;
}
}
/// <summary>
/// Returns true if the HtmlHelpSystem instance contains 1 or more information types
/// </summary>
public bool HasInformationTypes
{
get { return (_informationTypes.Count>0); }
}
/// <summary>
/// Returns true if the HtmlHelpSystem instance contains 1 or more categories
/// </summary>
public bool HasCategories
{
get { return (_categories.Count>0); }
}
/// <summary>
/// Gets an ArrayList of <see cref="InformationType">InformationType</see> items
/// </summary>
public ArrayList InformationTypes
{
get { return _informationTypes; }
}
/// <summary>
/// Gets an ArrayList of <see cref="Category">Category</see> items
/// </summary>
public ArrayList Categories
{
get { return _categories; }
}
/// <summary>
/// Gets the information type specified by its name
/// </summary>
/// <param name="name">name of the information type to receive</param>
/// <returns>Returns the Instance for the name or null if not found</returns>
public InformationType GetInformationType(string name)
{
if(HasInformationTypes)
{
for(int i=0; i<_informationTypes.Count;i++)
{
InformationType iT = _informationTypes[i] as InformationType;
if(iT.Name == name)
return iT;
}
}
return null;
}
/// <summary>
/// Gets the category specifiyd by its name
/// </summary>
/// <param name="name">name of the category</param>
/// <returns>Returns the Instance for the name or null if not found</returns>
public Category GetCategory(string name)
{
if(HasCategories)
{
for(int i=0; i<_categories.Count;i++)
{
Category cat = _categories[i] as Category;
if(cat.Name == name)
return cat;
}
}
return null;
}
/// <summary>
/// Gets the default topic
/// </summary>
public string DefaultTopic
{
get
{
if( _chmFiles.Count > 0 )
{
foreach(CHMFile curFile in _chmFiles)
{
if( curFile.DefaultTopic.Length > 0)
{
return curFile.FormURL( curFile.DefaultTopic );
}
}
}
return "about:blank";
}
}
/// <summary>
/// Gets a merged table of contents of all opened chm files
/// </summary>
public TableOfContents TableOfContents
{
get
{
if( _chmFiles.Count > 0 )
{
if( _toc.Count() <= 0)
{
// merge toc of files
foreach(CHMFile curFile in _chmFiles)
{
_toc.MergeToC( curFile.TOC );
}
}
}
return _toc;
}
}
/// <summary>
/// Gets a merged index of all opened chm files
/// </summary>
public Index Index
{
get
{
if( _chmFiles.Count > 0 )
{
if( (_index.Count(IndexType.KeywordLinks)+_index.Count(IndexType.AssiciativeLinks)) <= 0)
{
// merge index files
foreach(CHMFile curFile in _chmFiles)
{
_index.MergeIndex( curFile.IndexKLinks, IndexType.KeywordLinks);
_index.MergeIndex( curFile.IndexALinks, IndexType.AssiciativeLinks);
}
}
}
return _index;
}
}
/// <summary>
/// Gets a flag if the current instance offers a table of contents
/// </summary>
public bool HasTableOfContents
{
get
{
return (TableOfContents.Count() > 0);
}
}
/// <summary>
/// Gets a flag if the current instance offers an index
/// </summary>
public bool HasIndex
{
get
{
return (HasALinks || HasKLinks);
}
}
/// <summary>
/// Gets a flag if the index holds klinks
/// </summary>
public bool HasKLinks
{
get
{
return (_index.Count(IndexType.KeywordLinks) > 0);
}
}
/// <summary>
/// Gets a flag if the index holds alinks
/// </summary>
public bool HasALinks
{
get
{
return (_index.Count(IndexType.AssiciativeLinks) > 0);
}
}
/// <summary>
/// Gets a flag if the current instance supports fulltext searching
/// </summary>
public bool FullTextSearch
{
get
{
bool bRet = false;
foreach(CHMFile curFile in _chmFiles)
{
bRet |= curFile.FullTextSearch;
}
return bRet;
}
}
/// <summary>
/// Performs a full-text search over the chm files
/// </summary>
/// <param name="words">words to search</param>
/// <param name="partialMatches">true if partial word should be matched also
/// ( if this is true a search of 'support' will match 'supports', otherwise not )</param>
/// <param name="titleOnly">true if titles only</param>
/// <returns>A DataTable containing the search hits</returns>
public DataTable PerformSearch(string words, bool partialMatches, bool titleOnly)
{
return PerformSearch(words, -1, partialMatches, titleOnly);
}
/// <summary>
/// Performs a full-text search over the chm files
/// </summary>
/// <param name="words">words to search</param>
/// <param name="MaxResults">maximal number of hits to return</param>
/// <param name="partialMatches">true if partial word should be matched also
/// ( if this is true a search of 'support' will match 'supports', otherwise not )</param>
/// <param name="titleOnly">true if titles only</param>
/// <returns>A DataTable containing the search hits</returns>
public DataTable PerformSearch(string words, int MaxResults, bool partialMatches, bool titleOnly)
{
if( ! FullTextSearch )
return null;
DataTable dtResult = null;
int nCnt = 0;
foreach(CHMFile curFile in _chmFiles)
{
if(nCnt == 0)
{
if(curFile.FullTextSearchEngine.CanSearch)
{
if(curFile.FullTextSearchEngine.Search(words, MaxResults, partialMatches, titleOnly))
{
dtResult = curFile.FullTextSearchEngine.Hits;
dtResult.DefaultView.Sort = "Rating DESC";
}
}
}
else
{
if(curFile.FullTextSearchEngine.CanSearch)
{
if(curFile.FullTextSearchEngine.Search(words, MaxResults, partialMatches, titleOnly))
{
DataTable table = curFile.FullTextSearchEngine.Hits;
// append rows from 2nd file
foreach(DataRow curRow in table.Rows)
{
dtResult.ImportRow( curRow );
}
dtResult.DefaultView.Sort = "Rating DESC";
// adjust max hits
if(MaxResults >= 0)
{
if(dtResult.DefaultView.Count > MaxResults)
{
for(int i=MaxResults-1; i<dtResult.DefaultView.Count-1;i++)
{
if(dtResult.DefaultView[i].Row.RowState != DataRowState.Deleted)
{
dtResult.DefaultView[i].Row.Delete();
dtResult.DefaultView[i].Row.AcceptChanges();
i--;
}
}
dtResult.AcceptChanges();
dtResult.DefaultView.Sort = "Rating DESC";
}
}
}
}
}
nCnt++;
}
return dtResult;
}
}
}

View File

@@ -0,0 +1,855 @@
//
// System.Web.HttpUtility
//
// Authors:
// Patrik Torstensson (Patrik.Torstensson@labs2.com)
// Wictor Wil<69>n (decode/encode functions) (wictor@ibizkit.se)
// Tim Coleman (tim@timcoleman.com)
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
using System.Globalization;
using System.IO;
using System.Text;
// using System.Web.Util;
namespace HtmlHelp.ChmDecoding
{
public sealed class HttpUtility {
#region Fields
const string _hex = "0123456789ABCDEF";
const string _chars = "<>;:.?=&@*+%/\\";
static Hashtable entities;
static object lock_ = new object ();
#endregion // Fields
static Hashtable Entities {
get {
lock (lock_) {
if (entities == null)
InitEntities ();
return entities;
}
}
}
#region Constructors
static void InitEntities ()
{
// Build the hash table of HTML entity references. This list comes
// from the HTML 4.01 W3C recommendation.
entities = new Hashtable ();
entities.Add ("nbsp", '\u00A0');
entities.Add ("iexcl", '\u00A1');
entities.Add ("cent", '\u00A2');
entities.Add ("pound", '\u00A3');
entities.Add ("curren", '\u00A4');
entities.Add ("yen", '\u00A5');
entities.Add ("brvbar", '\u00A6');
entities.Add ("sect", '\u00A7');
entities.Add ("uml", '\u00A8');
entities.Add ("copy", '\u00A9');
entities.Add ("ordf", '\u00AA');
entities.Add ("laquo", '\u00AB');
entities.Add ("not", '\u00AC');
entities.Add ("shy", '\u00AD');
entities.Add ("reg", '\u00AE');
entities.Add ("macr", '\u00AF');
entities.Add ("deg", '\u00B0');
entities.Add ("plusmn", '\u00B1');
entities.Add ("sup2", '\u00B2');
entities.Add ("sup3", '\u00B3');
entities.Add ("acute", '\u00B4');
entities.Add ("micro", '\u00B5');
entities.Add ("para", '\u00B6');
entities.Add ("middot", '\u00B7');
entities.Add ("cedil", '\u00B8');
entities.Add ("sup1", '\u00B9');
entities.Add ("ordm", '\u00BA');
entities.Add ("raquo", '\u00BB');
entities.Add ("frac14", '\u00BC');
entities.Add ("frac12", '\u00BD');
entities.Add ("frac34", '\u00BE');
entities.Add ("iquest", '\u00BF');
entities.Add ("Agrave", '\u00C0');
entities.Add ("Aacute", '\u00C1');
entities.Add ("Acirc", '\u00C2');
entities.Add ("Atilde", '\u00C3');
entities.Add ("Auml", '\u00C4');
entities.Add ("Aring", '\u00C5');
entities.Add ("AElig", '\u00C6');
entities.Add ("Ccedil", '\u00C7');
entities.Add ("Egrave", '\u00C8');
entities.Add ("Eacute", '\u00C9');
entities.Add ("Ecirc", '\u00CA');
entities.Add ("Euml", '\u00CB');
entities.Add ("Igrave", '\u00CC');
entities.Add ("Iacute", '\u00CD');
entities.Add ("Icirc", '\u00CE');
entities.Add ("Iuml", '\u00CF');
entities.Add ("ETH", '\u00D0');
entities.Add ("Ntilde", '\u00D1');
entities.Add ("Ograve", '\u00D2');
entities.Add ("Oacute", '\u00D3');
entities.Add ("Ocirc", '\u00D4');
entities.Add ("Otilde", '\u00D5');
entities.Add ("Ouml", '\u00D6');
entities.Add ("times", '\u00D7');
entities.Add ("Oslash", '\u00D8');
entities.Add ("Ugrave", '\u00D9');
entities.Add ("Uacute", '\u00DA');
entities.Add ("Ucirc", '\u00DB');
entities.Add ("Uuml", '\u00DC');
entities.Add ("Yacute", '\u00DD');
entities.Add ("THORN", '\u00DE');
entities.Add ("szlig", '\u00DF');
entities.Add ("agrave", '\u00E0');
entities.Add ("aacute", '\u00E1');
entities.Add ("acirc", '\u00E2');
entities.Add ("atilde", '\u00E3');
entities.Add ("auml", '\u00E4');
entities.Add ("aring", '\u00E5');
entities.Add ("aelig", '\u00E6');
entities.Add ("ccedil", '\u00E7');
entities.Add ("egrave", '\u00E8');
entities.Add ("eacute", '\u00E9');
entities.Add ("ecirc", '\u00EA');
entities.Add ("euml", '\u00EB');
entities.Add ("igrave", '\u00EC');
entities.Add ("iacute", '\u00ED');
entities.Add ("icirc", '\u00EE');
entities.Add ("iuml", '\u00EF');
entities.Add ("eth", '\u00F0');
entities.Add ("ntilde", '\u00F1');
entities.Add ("ograve", '\u00F2');
entities.Add ("oacute", '\u00F3');
entities.Add ("ocirc", '\u00F4');
entities.Add ("otilde", '\u00F5');
entities.Add ("ouml", '\u00F6');
entities.Add ("divide", '\u00F7');
entities.Add ("oslash", '\u00F8');
entities.Add ("ugrave", '\u00F9');
entities.Add ("uacute", '\u00FA');
entities.Add ("ucirc", '\u00FB');
entities.Add ("uuml", '\u00FC');
entities.Add ("yacute", '\u00FD');
entities.Add ("thorn", '\u00FE');
entities.Add ("yuml", '\u00FF');
entities.Add ("fnof", '\u0192');
entities.Add ("Alpha", '\u0391');
entities.Add ("Beta", '\u0392');
entities.Add ("Gamma", '\u0393');
entities.Add ("Delta", '\u0394');
entities.Add ("Epsilon", '\u0395');
entities.Add ("Zeta", '\u0396');
entities.Add ("Eta", '\u0397');
entities.Add ("Theta", '\u0398');
entities.Add ("Iota", '\u0399');
entities.Add ("Kappa", '\u039A');
entities.Add ("Lambda", '\u039B');
entities.Add ("Mu", '\u039C');
entities.Add ("Nu", '\u039D');
entities.Add ("Xi", '\u039E');
entities.Add ("Omicron", '\u039F');
entities.Add ("Pi", '\u03A0');
entities.Add ("Rho", '\u03A1');
entities.Add ("Sigma", '\u03A3');
entities.Add ("Tau", '\u03A4');
entities.Add ("Upsilon", '\u03A5');
entities.Add ("Phi", '\u03A6');
entities.Add ("Chi", '\u03A7');
entities.Add ("Psi", '\u03A8');
entities.Add ("Omega", '\u03A9');
entities.Add ("alpha", '\u03B1');
entities.Add ("beta", '\u03B2');
entities.Add ("gamma", '\u03B3');
entities.Add ("delta", '\u03B4');
entities.Add ("epsilon", '\u03B5');
entities.Add ("zeta", '\u03B6');
entities.Add ("eta", '\u03B7');
entities.Add ("theta", '\u03B8');
entities.Add ("iota", '\u03B9');
entities.Add ("kappa", '\u03BA');
entities.Add ("lambda", '\u03BB');
entities.Add ("mu", '\u03BC');
entities.Add ("nu", '\u03BD');
entities.Add ("xi", '\u03BE');
entities.Add ("omicron", '\u03BF');
entities.Add ("pi", '\u03C0');
entities.Add ("rho", '\u03C1');
entities.Add ("sigmaf", '\u03C2');
entities.Add ("sigma", '\u03C3');
entities.Add ("tau", '\u03C4');
entities.Add ("upsilon", '\u03C5');
entities.Add ("phi", '\u03C6');
entities.Add ("chi", '\u03C7');
entities.Add ("psi", '\u03C8');
entities.Add ("omega", '\u03C9');
entities.Add ("thetasym", '\u03D1');
entities.Add ("upsih", '\u03D2');
entities.Add ("piv", '\u03D6');
entities.Add ("bull", '\u2022');
entities.Add ("hellip", '\u2026');
entities.Add ("prime", '\u2032');
entities.Add ("Prime", '\u2033');
entities.Add ("oline", '\u203E');
entities.Add ("frasl", '\u2044');
entities.Add ("weierp", '\u2118');
entities.Add ("image", '\u2111');
entities.Add ("real", '\u211C');
entities.Add ("trade", '\u2122');
entities.Add ("alefsym", '\u2135');
entities.Add ("larr", '\u2190');
entities.Add ("uarr", '\u2191');
entities.Add ("rarr", '\u2192');
entities.Add ("darr", '\u2193');
entities.Add ("harr", '\u2194');
entities.Add ("crarr", '\u21B5');
entities.Add ("lArr", '\u21D0');
entities.Add ("uArr", '\u21D1');
entities.Add ("rArr", '\u21D2');
entities.Add ("dArr", '\u21D3');
entities.Add ("hArr", '\u21D4');
entities.Add ("forall", '\u2200');
entities.Add ("part", '\u2202');
entities.Add ("exist", '\u2203');
entities.Add ("empty", '\u2205');
entities.Add ("nabla", '\u2207');
entities.Add ("isin", '\u2208');
entities.Add ("notin", '\u2209');
entities.Add ("ni", '\u220B');
entities.Add ("prod", '\u220F');
entities.Add ("sum", '\u2211');
entities.Add ("minus", '\u2212');
entities.Add ("lowast", '\u2217');
entities.Add ("radic", '\u221A');
entities.Add ("prop", '\u221D');
entities.Add ("infin", '\u221E');
entities.Add ("ang", '\u2220');
entities.Add ("and", '\u2227');
entities.Add ("or", '\u2228');
entities.Add ("cap", '\u2229');
entities.Add ("cup", '\u222A');
entities.Add ("int", '\u222B');
entities.Add ("there4", '\u2234');
entities.Add ("sim", '\u223C');
entities.Add ("cong", '\u2245');
entities.Add ("asymp", '\u2248');
entities.Add ("ne", '\u2260');
entities.Add ("equiv", '\u2261');
entities.Add ("le", '\u2264');
entities.Add ("ge", '\u2265');
entities.Add ("sub", '\u2282');
entities.Add ("sup", '\u2283');
entities.Add ("nsub", '\u2284');
entities.Add ("sube", '\u2286');
entities.Add ("supe", '\u2287');
entities.Add ("oplus", '\u2295');
entities.Add ("otimes", '\u2297');
entities.Add ("perp", '\u22A5');
entities.Add ("sdot", '\u22C5');
entities.Add ("lceil", '\u2308');
entities.Add ("rceil", '\u2309');
entities.Add ("lfloor", '\u230A');
entities.Add ("rfloor", '\u230B');
entities.Add ("lang", '\u2329');
entities.Add ("rang", '\u232A');
entities.Add ("loz", '\u25CA');
entities.Add ("spades", '\u2660');
entities.Add ("clubs", '\u2663');
entities.Add ("hearts", '\u2665');
entities.Add ("diams", '\u2666');
entities.Add ("quot", '\u0022');
entities.Add ("amp", '\u0026');
entities.Add ("lt", '\u003C');
entities.Add ("gt", '\u003E');
entities.Add ("OElig", '\u0152');
entities.Add ("oelig", '\u0153');
entities.Add ("Scaron", '\u0160');
entities.Add ("scaron", '\u0161');
entities.Add ("Yuml", '\u0178');
entities.Add ("circ", '\u02C6');
entities.Add ("tilde", '\u02DC');
entities.Add ("ensp", '\u2002');
entities.Add ("emsp", '\u2003');
entities.Add ("thinsp", '\u2009');
entities.Add ("zwnj", '\u200C');
entities.Add ("zwj", '\u200D');
entities.Add ("lrm", '\u200E');
entities.Add ("rlm", '\u200F');
entities.Add ("ndash", '\u2013');
entities.Add ("mdash", '\u2014');
entities.Add ("lsquo", '\u2018');
entities.Add ("rsquo", '\u2019');
entities.Add ("sbquo", '\u201A');
entities.Add ("ldquo", '\u201C');
entities.Add ("rdquo", '\u201D');
entities.Add ("bdquo", '\u201E');
entities.Add ("dagger", '\u2020');
entities.Add ("Dagger", '\u2021');
entities.Add ("permil", '\u2030');
entities.Add ("lsaquo", '\u2039');
entities.Add ("rsaquo", '\u203A');
entities.Add ("euro", '\u20AC');
}
public HttpUtility ()
{
}
#endregion // Constructors
#region Methods
public static void HtmlAttributeEncode (string s, TextWriter output)
{
output.Write(HtmlAttributeEncode(s));
}
public static string HtmlAttributeEncode (string s)
{
if (null == s)
return null;
if (s.IndexOf ('&') == -1 && s.IndexOf ('"') == -1)
return s;
StringBuilder output = new StringBuilder ();
foreach (char c in s)
switch (c) {
case '&' :
output.Append ("&amp;");
break;
case '"' :
output.Append ("&quot;");
break;
default:
output.Append (c);
break;
}
return output.ToString();
}
public static string UrlDecode (string str)
{
return UrlDecode(str, Encoding.UTF8);
}
private static char [] GetChars (MemoryStream b, Encoding e)
{
return e.GetChars (b.GetBuffer (), 0, (int) b.Length);
}
public static string UrlDecode (string s, Encoding e)
{
if (null == s)
return null;
if (s.IndexOf ('%') == -1 && s.IndexOf ('+') == -1)
return s;
if (e == null)
e = Encoding.UTF8;
StringBuilder output = new StringBuilder ();
long len = s.Length;
NumberStyles hexa = NumberStyles.HexNumber;
MemoryStream bytes = new MemoryStream ();
for (int i = 0; i < len; i++) {
if (s [i] == '%' && i + 2 < len) {
if (s [i + 1] == 'u' && i + 5 < len) {
if (bytes.Length > 0) {
output.Append (GetChars (bytes, e));
bytes.SetLength (0);
}
output.Append ((char) Int32.Parse (s.Substring (i + 2, 4), hexa));
i += 5;
} else {
bytes.WriteByte ((byte) Int32.Parse (s.Substring (i + 1, 2), hexa));
i += 2;
}
continue;
}
if (bytes.Length > 0) {
output.Append (GetChars (bytes, e));
bytes.SetLength (0);
}
if (s [i] == '+') {
output.Append (' ');
} else {
output.Append (s [i]);
}
}
if (bytes.Length > 0) {
output.Append (GetChars (bytes, e));
}
bytes = null;
return output.ToString ();
}
public static string UrlDecode (byte [] bytes, Encoding e)
{
if (bytes == null)
return null;
return UrlDecode (bytes, 0, bytes.Length, e);
}
private static int GetInt (byte b)
{
char c = Char.ToUpper ((char) b);
if (c >= '0' && c <= '9')
return c - '0';
if (c < 'A' || c > 'F')
return 0;
return (c - 'A' + 10);
}
private static char GetChar (byte [] bytes, int offset, int length)
{
int value = 0;
int end = length + offset;
for (int i = offset; i < end; i++)
value = (value << 4) + GetInt (bytes [offset]);
return (char) value;
}
public static string UrlDecode (byte [] bytes, int offset, int count, Encoding e)
{
if (bytes == null || count == 0)
return null;
if (bytes == null)
throw new ArgumentNullException ("bytes");
if (offset < 0 || offset > bytes.Length)
throw new ArgumentOutOfRangeException ("offset");
if (count < 0 || offset + count > bytes.Length)
throw new ArgumentOutOfRangeException ("count");
StringBuilder output = new StringBuilder ();
MemoryStream acc = new MemoryStream ();
int end = count + offset;
for (int i = offset; i < end; i++) {
if (bytes [i] == '%' && i + 2 < count) {
if (bytes [i + 1] == (byte) 'u' && i + 5 < end) {
if (acc.Length > 0) {
output.Append (GetChars (acc, e));
acc.SetLength (0);
}
output.Append (GetChar (bytes, offset + 2, 4));
i += 5;
} else {
acc.WriteByte ((byte) GetChar (bytes, offset + 1, 2));
i += 2;
}
continue;
}
if (acc.Length > 0) {
output.Append (GetChars (acc, e));
acc.SetLength (0);
}
if (bytes [i] == '+') {
output.Append (' ');
} else {
output.Append ((char) bytes [i]);
}
}
if (acc.Length > 0) {
output.Append (GetChars (acc, e));
}
acc = null;
return output.ToString ();
}
public static byte [] UrlDecodeToBytes (byte [] bytes)
{
if (bytes == null)
return null;
return UrlDecodeToBytes (bytes, 0, bytes.Length);
}
public static byte [] UrlDecodeToBytes (string str)
{
return UrlDecodeToBytes (str, Encoding.UTF8);
}
public static byte [] UrlDecodeToBytes (string str, Encoding e)
{
if (str == null)
return null;
if (e == null)
throw new ArgumentNullException ("e");
return UrlDecodeToBytes (e.GetBytes (str));
}
public static byte [] UrlDecodeToBytes (byte [] bytes, int offset, int count)
{
if (bytes == null)
return null;
int len = bytes.Length;
if (offset < 0 || offset >= len)
throw new ArgumentOutOfRangeException("offset");
if (count < 0 || offset > len - count)
throw new ArgumentOutOfRangeException("count");
MemoryStream result = new MemoryStream ();
int end = offset + count;
for (int i = offset; i < end; i++){
char c = (char) bytes [i];
if (c == '+')
c = ' ';
else if (c == '%' && i < end - 2) {
c = GetChar (bytes, i, 2);
i += 2;
}
result.WriteByte ((byte) c);
}
return result.ToArray ();
}
public static string UrlEncode(string str)
{
return UrlEncode(str, Encoding.UTF8);
}
public static string UrlEncode (string s, Encoding Enc)
{
if (s == null)
return null;
if (s == "")
return "";
byte [] bytes = Enc.GetBytes (s);
byte [] b =UrlEncodeToBytes (bytes, 0, bytes.Length);
return Encoding.ASCII.GetString (b,0,b.Length);
}
public static string UrlEncode (byte [] bytes)
{
if (bytes == null)
return null;
if (bytes.Length == 0)
return "";
byte []b=UrlEncodeToBytes(bytes, 0, bytes.Length);
return Encoding.ASCII.GetString (b,0,b.Length);
}
public static string UrlEncode (byte [] bytes, int offset, int count)
{
if (bytes == null)
return null;
if (bytes.Length == 0)
return "";
byte []b=UrlEncodeToBytes(bytes, offset, count);
return Encoding.ASCII.GetString (b,0,b.Length);
}
public static byte [] UrlEncodeToBytes (string str)
{
return UrlEncodeToBytes (str, Encoding.UTF8);
}
public static byte [] UrlEncodeToBytes (string str, Encoding e)
{
if (str == null)
return null;
if (str == "")
return new byte [0];
byte [] bytes = e.GetBytes (str);
return UrlEncodeToBytes (bytes, 0, bytes.Length);
}
public static byte [] UrlEncodeToBytes (byte [] bytes)
{
if (bytes == null)
return null;
if (bytes.Length == 0)
return new byte [0];
return UrlEncodeToBytes (bytes, 0, bytes.Length);
}
static char [] hexChars = "0123456789abcdef".ToCharArray ();
public static byte [] UrlEncodeToBytes (byte [] bytes, int offset, int count)
{
if (bytes == null)
return null;
int len = bytes.Length;
if (len == 0)
return new byte [0];
if (offset < 0 || offset >= len)
throw new ArgumentOutOfRangeException("offset");
if (count < 0 || count > len - offset)
throw new ArgumentOutOfRangeException("count");
MemoryStream result = new MemoryStream ();
int end = offset + count;
for (int i = offset; i < end; i++) {
char c = (char) bytes [i];
if ((c == ' ') || (c < '0' && c != '-' && c != '.') ||
(c < 'A' && c > '9') ||
(c > 'Z' && c < 'a' && c != '_') ||
(c > 'z')) {
result.WriteByte ((byte) '%');
int idx = ((int) c) >> 4;
result.WriteByte ((byte) hexChars [idx]);
idx = ((int) c) & 0x0F;
result.WriteByte ((byte) hexChars [idx]);
} else {
result.WriteByte ((byte) c);
}
}
return result.ToArray ();
}
public static string UrlEncodeUnicode (string str)
{
if (str == null)
return null;
StringBuilder result = new StringBuilder ();
int end = str.Length;
for (int i = 0; i < end; i++) {
int idx;
char c = str [i];
if (c > 255) {
result.Append ("%u");
idx = ((int) c) >> 24;
result.Append (hexChars [idx]);
idx = (((int) c) >> 16) & 0x0F;
result.Append (hexChars [idx]);
idx = (((int) c) >> 8) & 0x0F;
result.Append (hexChars [idx]);
idx = ((int) c) & 0x0F;
result.Append (hexChars [idx]);
continue;
}
if ((c == ' ') || (c < '0' && c != '-' && c != '.') ||
(c < 'A' && c > '9') ||
(c > 'Z' && c < 'a' && c != '_') ||
(c > 'z')) {
result.Append ('%');
idx = ((int) c) >> 4;
result.Append (hexChars [idx]);
idx = ((int) c) & 0x0F;
result.Append (hexChars [idx]);
continue;
}
result.Append (c);
}
return result.ToString ();
}
public static byte [] UrlEncodeUnicodeToBytes (string str)
{
if (str == null)
return null;
if (str == "")
return new byte [0];
return Encoding.ASCII.GetBytes (UrlEncodeUnicode (str));
}
/// <summary>
/// Decodes an HTML-encoded string and returns the decoded string.
/// </summary>
/// <param name="s">The HTML string to decode. </param>
/// <returns>The decoded text.</returns>
public static string HtmlDecode (string s)
{
if (s == null)
throw new ArgumentNullException ("s");
if (s.IndexOf ('&') == -1)
return s;
bool insideEntity = false; // used to indicate that we are in a potential entity
string entity = String.Empty;
StringBuilder output = new StringBuilder ();
int len = s.Length;
for (int i = 0; i < len; i++) {
char c = s [i];
switch (c) {
case '&' :
output.Append (entity);
entity = "&";
insideEntity = true;
break;
case ';' :
if (!insideEntity) {
output.Append (c);
break;
}
entity += c;
int length = entity.Length;
if (length >= 2 && entity[1] == '#' && entity[2] != ';')
entity = ((char) Int32.Parse (entity.Substring (2, entity.Length - 3))).ToString();
else if (length > 1 && Entities.ContainsKey (entity.Substring (1, entity.Length - 2)))
entity = Entities [entity.Substring (1, entity.Length - 2)].ToString ();
output.Append (entity);
entity = String.Empty;
insideEntity = false;
break;
default :
if (insideEntity)
entity += c;
else
output.Append (c);
break;
}
}
output.Append (entity);
return output.ToString ();
}
/// <summary>
/// Decodes an HTML-encoded string and sends the resulting output to a TextWriter output stream.
/// </summary>
/// <param name="s">The HTML string to decode</param>
/// <param name="output">The TextWriter output stream containing the decoded string. </param>
public static void HtmlDecode(string s, TextWriter output)
{
if (s != null)
output.Write (HtmlDecode (s));
}
/// <summary>
/// HTML-encodes a string and returns the encoded string.
/// </summary>
/// <param name="s">The text string to encode. </param>
/// <returns>The HTML-encoded text.</returns>
public static string HtmlEncode (string s)
{
if (s == null)
return null;
StringBuilder output = new StringBuilder ();
foreach (char c in s)
switch (c) {
case '&' :
output.Append ("&amp;");
break;
case '>' :
output.Append ("&gt;");
break;
case '<' :
output.Append ("&lt;");
break;
case '"' :
output.Append ("&quot;");
break;
default:
if ((int) c > 128) {
output.Append ("&#");
output.Append (((int) c).ToString ());
output.Append (";");
}
else
output.Append (c);
break;
}
return output.ToString ();
}
/// <summary>
/// HTML-encodes a string and sends the resulting output to a TextWriter output stream.
/// </summary>
/// <param name="s">The string to encode. </param>
/// <param name="output">The TextWriter output stream containing the encoded string. </param>
public static void HtmlEncode(string s, TextWriter output)
{
if (s != null)
output.Write (HtmlEncode (s));
}
#if NET_1_1
public string UrlPathEncode (string s)
{
if (s == null)
return null;
int idx = s.IndexOf ("?");
string s2 = null;
if (idx != -1) {
s2 = s.Substring (0, idx-1);
s2 = UrlEncode (s2) + s.Substring (idx);
} else {
s2 = UrlEncode (s);
}
return s2;
}
#endif
#endregion // Methods
}
}

View File

@@ -0,0 +1,322 @@
using System;
using System.Diagnostics;
using System.Collections;
using HtmlHelp.ChmDecoding;
namespace HtmlHelp
{
/// <summary>
/// Enumeration for specifying the index type
/// </summary>
public enum IndexType
{
/// <summary>
/// Keyword links should be used
/// </summary>
KeywordLinks = 0,
/// <summary>
/// Associative links should be used
/// </summary>
AssiciativeLinks = 1
}
/// <summary>
/// The class <c>Index</c> holds the (keyword links) KLinks and (associative links) ALinks of the htmlhelp
/// system. It implements methods for easy index-based searching.
/// </summary>
public class Index
{
private ArrayList _kLinks = new ArrayList();
private ArrayList _aLinks = new ArrayList();
/// <summary>
/// Standard constructor
/// </summary>
public Index()
{
}
/// <summary>
/// Constructor of the class
/// </summary>
/// <param name="kLinks">arraylist with keyword links</param>
/// <param name="aLinks">arraylist with associative links</param>
public Index(ArrayList kLinks, ArrayList aLinks)
{
_kLinks= kLinks;
_aLinks = aLinks;
}
/// <summary>
/// Clears the current toc
/// </summary>
public void Clear()
{
if(_aLinks != null)
_aLinks.Clear();
if(_kLinks != null)
_kLinks.Clear();
}
/// <summary>
/// Gets the number of index items for a specific type
/// </summary>
/// <param name="typeOfIndex">type of index</param>
/// <returns>Returns the number of index items for a specific type</returns>
public int Count(IndexType typeOfIndex)
{
ArrayList _index = null;
switch( typeOfIndex )
{
case IndexType.AssiciativeLinks: _index = _aLinks; break;
case IndexType.KeywordLinks: _index = _kLinks; break;
}
if(_index != null)
return _index.Count;
return 0;
}
/// <summary>
/// Gets the internal index list of keyword links
/// </summary>
public ArrayList KLinks
{
get
{
if(_kLinks==null)
_kLinks = new ArrayList();
return _kLinks;
}
}
/// <summary>
/// Gets the internal index list of associative links
/// </summary>
public ArrayList ALinks
{
get
{
if(_aLinks==null)
_aLinks = new ArrayList();
return _aLinks;
}
}
/// <summary>
/// Merges the the index list <c>arrIndex</c> into the current one
/// </summary>
/// <param name="arrIndex">indexlist which should be merged with the current one</param>
/// <param name="typeOfIndex">type of index to merge</param>
public void MergeIndex( ArrayList arrIndex, IndexType typeOfIndex )
{
ArrayList _index = null;
switch(typeOfIndex)
{
case IndexType.AssiciativeLinks: _index = _aLinks;break;
case IndexType.KeywordLinks: _index = _kLinks;break;
}
foreach(IndexItem curItem in arrIndex)
{
//IndexItem searchItem = ContainsIndex(_index, curItem.KeyWordPath);
int insertIndex=0;
IndexItem searchItem = BinSearch(0, _index.Count-1, _index, curItem.KeyWordPath, false, false, ref insertIndex);
if(searchItem != null)
{
// extend the keywords topics
foreach(IndexTopic curEntry in curItem.Topics)
{
searchItem.Topics.Add( curEntry );
}
}
else
{
// add the item to the global collection
//_index.Add( curItem );
if(insertIndex > _index.Count)
_index.Add(curItem);
else
_index.Insert(insertIndex, curItem);
}
}
}
/// <summary>
/// Searches an index entry using recursive binary search algo (divide and conquer).
/// </summary>
/// <param name="nStart">start index for searching</param>
/// <param name="nEnd">end index for searching</param>
/// <param name="arrIndex">arraylist containing sorted IndexItem entries</param>
/// <param name="keywordPath">keyword path to search</param>
/// <param name="searchKeyword">true if the keywordPath will only contain the keyword not the complete path</param>
/// <param name="caseInsensitive">True if case should be ignored</param>
/// <param name="insertIndex">out reference. will receive the index where the item with the
/// keywordPath should be inserted if not found (receives -1 if the item was found)</param>
/// <returns>Returns an IndexItem instance if found, otherwise null
/// (use insertIndex for inserting the new item in a sorted order)</returns>
private IndexItem BinSearch(int nStart, int nEnd, ArrayList arrIndex, string keywordPath,
bool searchKeyword, bool caseInsensitive, ref int insertIndex)
{
if( arrIndex.Count <= 0 )
{
insertIndex=0;
return null;
}
if(caseInsensitive)
keywordPath = keywordPath.ToLower();
if( (nEnd - nStart) > 1)
{
int nCheck = nStart + (nEnd-nStart)/2;
IndexItem iC = arrIndex[nCheck] as IndexItem;
string sCompare = iC.KeyWordPath;
if(searchKeyword)
sCompare = iC.KeyWord;
if(caseInsensitive)
sCompare = sCompare.ToLower();
if( sCompare == keywordPath )
{
insertIndex=-1;
return iC;
}
if( keywordPath.CompareTo(sCompare) < 0 )
{
return BinSearch(nStart, nCheck-1, arrIndex, keywordPath, searchKeyword, caseInsensitive, ref insertIndex);
}
if( keywordPath.CompareTo(sCompare) > 0 )
{
return BinSearch(nCheck+1, nEnd, arrIndex, keywordPath, searchKeyword, caseInsensitive, ref insertIndex);
}
}
else if(nEnd-nStart == 1)
{
IndexItem i1 = arrIndex[nStart] as IndexItem;
IndexItem i2 = arrIndex[nEnd] as IndexItem;
string sCompare1 = i1.KeyWordPath;
if(searchKeyword)
sCompare1 = i1.KeyWord;
if(caseInsensitive)
sCompare1 = sCompare1.ToLower();
string sCompare2 = i2.KeyWordPath;
if(searchKeyword)
sCompare2 = i2.KeyWord;
if(caseInsensitive)
sCompare2 = sCompare2.ToLower();
if( sCompare1 == keywordPath)
{
insertIndex = -1;
return i1;
}
if( sCompare2 == keywordPath)
{
insertIndex = -1;
return i2;
}
if( sCompare1.CompareTo(keywordPath) > 0)
{
insertIndex = nStart;
return null;
}
else if( sCompare2.CompareTo(keywordPath) > 0)
{
insertIndex = nEnd;
return null;
}
else
{
insertIndex = nEnd+1;
}
}
IndexItem itm = arrIndex[nEnd] as IndexItem;
string sCompareI = itm.KeyWordPath;
if(searchKeyword)
sCompareI = itm.KeyWord;
if(caseInsensitive)
sCompareI = sCompareI.ToLower();
if( sCompareI.CompareTo(keywordPath) > 0)
{
insertIndex = nStart;
return null;
}
else if( sCompareI.CompareTo(keywordPath) < 0)
{
insertIndex = nEnd+1;
return null;
}
else
{
insertIndex = -1;
return arrIndex[nEnd] as IndexItem;
}
}
/// <summary>
/// Checks if a keyword exists in a index collection
/// </summary>
/// <param name="arrIndex">index to search (arraylist of IndexItems)</param>
/// <param name="keywordPath">keywordpath to search</param>
/// <returns>Returns the found IndexItem, otherwise null</returns>
private IndexItem ContainsIndex(ArrayList arrIndex, string keywordPath)
{
foreach(IndexItem curItem in arrIndex)
{
if(curItem.KeyWordPath == keywordPath)
return curItem;
}
return null;
}
/// <summary>
/// Searches the alinks- or klinks-index for a specific keyword/associative
/// </summary>
/// <param name="search">keyword/associative to search</param>
/// <param name="typeOfIndex">type of index to search</param>
/// <returns>Returns an ArrayList which contains IndexTopic items or null if nothing was found</returns>
public IndexItem SearchIndex(string search, IndexType typeOfIndex)
{
ArrayList _index = null;
switch( typeOfIndex )
{
case IndexType.AssiciativeLinks: _index = _aLinks;break;
case IndexType.KeywordLinks: _index = _kLinks;break;
}
int insertIdx=0;
IndexItem foundItem = BinSearch(0, _index.Count, _index, search, true, true, ref insertIdx);
return foundItem;
}
}
}

View File

@@ -0,0 +1,396 @@
using System;
using System.IO;
using System.Text;
using System.Collections;
using HtmlHelp.ChmDecoding;
namespace HtmlHelp
{
/// <summary>
/// The class <c>IndexItem</c> implements an help-index item
/// </summary>
public sealed class IndexItem : IComparable
{
/// <summary>
/// Internal member storing the keyword
/// </summary>
private string _keyWord = "";
/// <summary>
/// Internal member storing all associated information type strings
/// </summary>
private ArrayList _infoTypeStrings = new ArrayList();
/// <summary>
/// Internal member storing the flag if this is a see-also keyword
/// </summary>
private bool _isSeeAlso = false;
/// <summary>
/// Internal member storing the indent of the keyword
/// </summary>
private int _indent = 0;
/// <summary>
/// Internal member storing the last index of the keyword in the seperated list
/// </summary>
private int _charIndex = 0;
/// <summary>
/// Internal member storing the entry index
/// </summary>
private int _entryIndex = 0;
/// <summary>
/// Internal member storing an array of see-also values
/// </summary>
private string[] _seeAlso = new string[0];
/// <summary>
/// Internal member storing an array of topic offsets
/// </summary>
private int[] _nTopics = new int[0];
/// <summary>
/// Internal member storing the topics
/// </summary>
private ArrayList _Topics = null;
/// <summary>
/// Associated CHMFile instance
/// </summary>
private CHMFile _chmFile = null;
/// <summary>
/// Internal flag specifying the chm file path
/// </summary>
private string _chmFileName = "";
/// <summary>
/// Constructor of the class
/// </summary>
/// <param name="chmFile">associated CHMFile instance</param>
/// <param name="keyWord">keyword</param>
/// <param name="isSeeAlso">true if it is a see-also keyword</param>
/// <param name="indent">indent of the entry</param>
/// <param name="charIndex">char index of the last keyword in the separated list</param>
/// <param name="entryIndex">index of the entry</param>
/// <param name="seeAlsoValues">string array with see-also values</param>
/// <param name="topicOffsets">integer array with topic offsets</param>
internal IndexItem(CHMFile chmFile, string keyWord, bool isSeeAlso, int indent, int charIndex, int entryIndex, string[] seeAlsoValues, int[] topicOffsets)
{
_chmFile = chmFile;
_chmFileName = _chmFile.ChmFilePath;
_keyWord = keyWord;
_isSeeAlso = isSeeAlso;
_indent = indent;
_charIndex = charIndex;
_entryIndex = entryIndex;
_seeAlso = seeAlsoValues;
_nTopics = topicOffsets;
}
/// <summary>
/// Standard constructor
/// </summary>
public IndexItem()
{
}
#region Data dumping
/// <summary>
/// Dump the class data to a binary writer
/// </summary>
/// <param name="writer">writer to write the data</param>
/// <param name="writeFileName">true if the chm filename should be written</param>
internal void Dump(ref BinaryWriter writer, bool writeFileName)
{
int i=0;
writer.Write(_keyWord);
writer.Write(_isSeeAlso);
writer.Write(_indent);
if(writeFileName)
writer.Write(_chmFileName);
writer.Write(_infoTypeStrings.Count);
for(i=0; i<_infoTypeStrings.Count; i++)
writer.Write( (_infoTypeStrings[i]).ToString() );
writer.Write(_seeAlso.Length);
for(i=0; i<_seeAlso.Length; i++)
{
if(_seeAlso[i] == null)
writer.Write("");
else
writer.Write( _seeAlso[i] );
}
writer.Write(Topics.Count);
for(i=0; i<Topics.Count; i++)
{
IndexTopic topic = ((IndexTopic)(Topics[i]));
topic.Dump(ref writer);
}
}
/// <summary>
/// Dump the class data to a binary writer
/// </summary>
/// <param name="writer">writer to write the data</param>
internal void Dump(ref BinaryWriter writer)
{
Dump(ref writer, false);
}
/// <summary>
/// Reads the object data from a dump store
/// </summary>
/// <param name="reader">reader to read the data</param>
/// <param name="filesList">filelist from helpsystem</param>
internal bool ReadDump(ref BinaryReader reader, ArrayList filesList)
{
int i=0;
_keyWord = reader.ReadString();
_isSeeAlso = reader.ReadBoolean();
_indent = reader.ReadInt32();
_chmFileName = reader.ReadString();
foreach(CHMFile curFile in filesList)
{
if(curFile.ChmFilePath == _chmFileName)
{
_chmFile = curFile;
break;
}
}
if(_chmFile==null)
return false;
int nCnt = reader.ReadInt32();
for(i=0; i<nCnt; i++)
{
string sIT = reader.ReadString();
_infoTypeStrings.Add(sIT);
}
nCnt = reader.ReadInt32();
_seeAlso = new string[nCnt];
for(i=0; i<nCnt; i++)
{
_seeAlso[i] = reader.ReadString();
}
nCnt = reader.ReadInt32();
for(i=0; i<nCnt; i++)
{
IndexTopic topic = new IndexTopic("","","","");
topic.SetChmInfo( _chmFile.CompileFile, _chmFile.ChmFilePath);
topic.AssociatedFile = _chmFile;
topic.ReadDump(ref reader);
Topics.Add(topic);
}
return true;
}
/// <summary>
/// Reads the object data from a dump store
/// </summary>
/// <param name="reader">reader to read the data</param>
internal void ReadDump(ref BinaryReader reader)
{
int i=0;
_keyWord = reader.ReadString();
_isSeeAlso = reader.ReadBoolean();
_indent = reader.ReadInt32();
int nCnt = reader.ReadInt32();
for(i=0; i<nCnt; i++)
{
string sIT = reader.ReadString();
_infoTypeStrings.Add(sIT);
}
nCnt = reader.ReadInt32();
_seeAlso = new string[nCnt];
for(i=0; i<nCnt; i++)
{
_seeAlso[i] = reader.ReadString();
}
nCnt = reader.ReadInt32();
for(i=0; i<nCnt; i++)
{
IndexTopic topic = new IndexTopic("","","","");
topic.AssociatedFile = _chmFile;
topic.SetChmInfo( _chmFile.CompileFile, _chmFile.ChmFilePath);
topic.ReadDump(ref reader);
Topics.Add(topic);
}
}
#endregion
/// <summary>
/// Implements the compareto method which allows sorting.
/// </summary>
/// <param name="obj">object to compare to</param>
/// <returns>See <see cref="System.IComparable">IComparable.CompareTo()</see></returns>
public int CompareTo(object obj)
{
if( obj.GetType() == this.GetType() )
{
IndexItem cmp = (IndexItem)obj;
return this.KeyWordPath.CompareTo( cmp.KeyWordPath );
}
return 0;
}
/// <summary>
/// Gets/Sets the associated CHMFile instance
/// </summary>
internal CHMFile ChmFile
{
get { return _chmFile; }
set { _chmFile = value; }
}
/// <summary>
/// Gets the ArrayList which holds all information types/categories this item is associated
/// </summary>
internal ArrayList InfoTypeStrings
{
get { return _infoTypeStrings; }
}
/// <summary>
/// Adds a see-also string to the index item and marks it as see also item
/// </summary>
/// <param name="seeAlsoString">see also string to add</param>
internal void AddSeeAlso(string seeAlsoString)
{
string[] seeAlso = new string[ _seeAlso.Length +1 ];
for(int i=0; i<_seeAlso.Length; i++)
seeAlso[i] = _seeAlso[i];
seeAlso[_seeAlso.Length] = seeAlsoString;
_seeAlso = seeAlso;
_isSeeAlso = true;
}
/// <summary>
/// Gets/Sets the full keyword-path of this item ( ", " separated list)
/// </summary>
public string KeyWordPath
{
get { return _keyWord; }
set { _keyWord = value; }
}
/// <summary>
/// Gets the keyword of this item
/// </summary>
public string KeyWord
{
get
{
return _keyWord.Substring(_charIndex, _keyWord.Length-_charIndex);
}
}
/// <summary>
/// Gets the keyword of this item with prefixing indent spaces
/// </summary>
public string IndentKeyWord
{
get
{
string sKW = this.KeyWord;
StringBuilder sb = new StringBuilder("",this.Indent*3 + sKW.Length);
for(int i=0; i<this.Indent; i++)
sb.Append(" ");
sb.Append(sKW);
return sb.ToString();
}
}
/// <summary>
/// Gets/Sets the see-also flag of this item
/// </summary>
public bool IsSeeAlso
{
get { return _isSeeAlso; }
set { _isSeeAlso = value; }
}
/// <summary>
/// Gets/Sets the listbox indent for this item
/// </summary>
public int Indent
{
get { return _indent; }
set { _indent = value; }
}
/// <summary>
/// Gets/Sets the character index of an indent keyword
/// </summary>
public int CharIndex
{
get { return _charIndex; }
set { _charIndex = value; }
}
/// <summary>
/// Gets the see-also values of this item
/// </summary>
public string[] SeeAlso
{
get { return _seeAlso; }
}
/// <summary>
/// Gets an array with the associated topics
/// </summary>
public ArrayList Topics
{
get
{
if( _Topics == null )
{
if(IsSeeAlso)
{
_Topics = new ArrayList();
}
else
{
if( (_chmFile != null) && (_chmFile.TopicsFile != null) )
{
_Topics = new ArrayList();
for(int i=0; i<_nTopics.Length; i++)
{
IndexTopic newTopic = IndexTopic.FromTopicEntry((TopicEntry)_chmFile.TopicsFile.TopicTable[ _nTopics[i] ]);
newTopic.AssociatedFile = _chmFile;
_Topics.Add( newTopic );
}
}
else
{
_Topics = new ArrayList();
}
}
}
return _Topics;
}
}
}
}

View File

@@ -0,0 +1,216 @@
using System;
using System.IO;
using HtmlHelp.ChmDecoding;
namespace HtmlHelp
{
/// <summary>
/// The class <c>IndexTopic</c> implements an entry for the <see cref="IndexItem">IndexItem</see> topics list.
/// </summary>
public sealed class IndexTopic
{
private DataMode _topicMode = DataMode.TextBased;
private string _title="";
private string _local="";
private string _compileFile = "";
private string _chmPath = "";
private int _topicOffset = -1;
private CHMFile _associatedFile = null;
/// <summary>
/// Creates a new instance of the class based on an existing TopicEntry
/// </summary>
/// <param name="entry"></param>
internal static IndexTopic FromTopicEntry(TopicEntry entry)
{
return new IndexTopic(entry.EntryOffset, entry.ChmFile);
//return new IndexTopic( entry.Title, entry.Locale, entry.ChmFile.CompileFile, entry.ChmFile.ChmFilePath);
}
/// <summary>
/// Creates a new instance of the class (binary extraction mode)
/// </summary>
/// <param name="topicOffset">offset of the topic entry</param>
/// <param name="associatedFile">associated CHMFile instance</param>
internal IndexTopic(int topicOffset, CHMFile associatedFile)
{
_topicMode = DataMode.Binary;
_topicOffset = topicOffset;
_associatedFile = associatedFile;
}
/// <summary>
/// Constructor of the class
/// </summary>
/// <param name="Title">topic title</param>
/// <param name="local">topic local (content filename)</param>
/// <param name="compilefile">name of the chm file (location of topic)</param>
/// <param name="chmpath">path of the chm file</param>
public IndexTopic(string Title, string local, string compilefile, string chmpath)
{
_topicMode = DataMode.TextBased;
_title = Title;
_local = local;
_compileFile = compilefile;
_chmPath = chmpath;
}
#region Data dumping
/// <summary>
/// Dump the class data to a binary writer
/// </summary>
/// <param name="writer">writer to write the data</param>
internal void Dump(ref BinaryWriter writer)
{
writer.Write((int)_topicMode);
if(_topicMode==DataMode.TextBased)
{
writer.Write(_title);
writer.Write(_local);
}
else
{
writer.Write(_topicOffset);
}
}
/// <summary>
/// Reads the object data from a dump store
/// </summary>
/// <param name="reader">reader to read the data</param>
internal void ReadDump(ref BinaryReader reader)
{
_topicMode = (DataMode)reader.ReadInt32();
if(_topicMode==DataMode.TextBased)
{
_title = reader.ReadString();
_local = reader.ReadString();
}
else
{
_topicOffset = reader.ReadInt32();
}
}
#endregion
/// <summary>
/// Internally used to set the chm-finos when reading from dump store
/// </summary>
/// <param name="compilefile"></param>
/// <param name="chmpath"></param>
internal void SetChmInfo(string compilefile, string chmpath)
{
_compileFile = compilefile;
_chmPath = chmpath;
}
/// <summary>
/// Gets/Sets the associated CHMFile instance
/// </summary>
internal CHMFile AssociatedFile
{
get { return _associatedFile; }
set { _associatedFile = value; }
}
/// <summary>
/// Gets the topic title
/// </summary>
public string Title
{
get
{
if((_topicMode == DataMode.Binary )&&(_associatedFile!=null))
{
if( _topicOffset >= 0)
{
TopicEntry te = (TopicEntry) (_associatedFile.TopicsFile[_topicOffset]);
if(te != null)
{
return te.Title;
}
}
}
return _title;
}
}
/// <summary>
/// Gets the local (content filename)
/// </summary>
public string Local
{
get
{
if((_topicMode == DataMode.Binary )&&(_associatedFile!=null))
{
if( _topicOffset >= 0)
{
TopicEntry te = (TopicEntry) (_associatedFile.TopicsFile[_topicOffset]);
if(te != null)
{
return te.Locale;
}
}
}
return _local;
}
}
/// <summary>
/// Gets the compile file (location)
/// </summary>
public string CompileFile
{
get
{
if(_associatedFile != null)
return _associatedFile.CompileFile;
return _compileFile;
}
}
/// <summary>
/// Gets the chm file path
/// </summary>
public string ChmFilePath
{
get
{
if(_associatedFile != null)
return _associatedFile.ChmFilePath;
return _chmPath;
}
}
/// <summary>
/// Gets the url
/// </summary>
public string URL
{
get
{
string sL = Local;
if(sL.Length<=0)
return "";//"about:blank";
if( (sL.ToLower().IndexOf("http://") >= 0) ||
(sL.ToLower().IndexOf("https://") >= 0) ||
(sL.ToLower().IndexOf("mailto:") >= 0) ||
(sL.ToLower().IndexOf("ftp://") >= 0) ||
(sL.ToLower().IndexOf("ms-its:") >= 0))
return sL;
return HtmlHelpSystem.UrlPrefix + ChmFilePath + "::/" + sL;
}
}
}
}

View File

@@ -0,0 +1,146 @@
using System;
using System.IO;
namespace HtmlHelp
{
/// <summary>
/// Enumeration for specifying the mode of the information type
/// </summary>
public enum InformationTypeMode
{
/// <summary>
/// Inclusive information type. The user will be allowed to select from one or more information types.
/// </summary>
Inclusive = 0,
/// <summary>
/// Exclusive information type. The user will be allowed to choose only one information type within each category
/// </summary>
Exclusive = 1,
/// <summary>
/// Hidden information type. The user cannot see this information types (only for API calls).
/// </summary>
Hidden = 2
}
/// <summary>
/// The class <c>InformationType</c> implements a methods/properties for an information type.
/// </summary>
/// <remarks>Note: Information types and categories allow users to filter help contents.
/// They are only supported if using sitemap TOC and/or sitemap Index.</remarks>
public class InformationType
{
private string _name = "";
private string _description = "";
private InformationTypeMode _typeMode = InformationTypeMode.Inclusive;
private bool _isInCategory = false;
private int _referenceCount = 1;
/// <summary>
/// Standard constructor
/// </summary>
/// <remarks>the mode is set to InformationTypeMode.Inclusive by default</remarks>
public InformationType() : this("","")
{
}
/// <summary>
/// Standard constructor
/// </summary>
/// <param name="name">name of the information type</param>
/// <param name="description">description</param>
/// <remarks>the mode is set to InformationTypeMode.Inclusive by default</remarks>
public InformationType(string name, string description) : this(name, description, InformationTypeMode.Inclusive)
{
}
/// <summary>
/// Standard constructor
/// </summary>
/// <param name="name">name of the information type</param>
/// <param name="description">description</param>
/// <param name="mode">mode of the information type</param>
public InformationType(string name, string description, InformationTypeMode mode)
{
_name = name;
_description = description;
_typeMode = mode;
}
#region Data dumping
/// <summary>
/// Dump the class data to a binary writer
/// </summary>
/// <param name="writer">writer to write the data</param>
internal void Dump(ref BinaryWriter writer)
{
writer.Write( (int)_typeMode );
writer.Write( _name );
writer.Write( _description );
}
/// <summary>
/// Reads the object data from a dump store
/// </summary>
/// <param name="reader">reader to read the data</param>
internal void ReadDump(ref BinaryReader reader)
{
_typeMode = (InformationTypeMode)reader.ReadInt32();
_name = reader.ReadString();
_description = reader.ReadString();
}
#endregion
/// <summary>
/// Sets the flag if this information type is nested in at least one category
/// </summary>
/// <param name="newValue">true or false</param>
internal void SetCategoryFlag(bool newValue)
{
_isInCategory = newValue;
}
/// <summary>
/// Gets/Sets the reference count of this information type instance
/// </summary>
internal int ReferenceCount
{
get { return _referenceCount; }
set { _referenceCount = value; }
}
/// <summary>
/// Gets true if this information type is nested in at least one category
/// </summary>
public bool IsInCategory
{
get { return _isInCategory; }
}
/// <summary>
/// Gets/Sets the name of the information type
/// </summary>
public string Name
{
get { return _name; }
set { _name = value; }
}
/// <summary>
/// Gets/Sets the description of the information type
/// </summary>
public string Description
{
get { return _description; }
set { _name = value; }
}
/// <summary>
/// Gets/Sets the mode of the information type
/// </summary>
public InformationTypeMode Mode
{
get { return _typeMode; }
set { _typeMode = value; }
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,494 @@
using System;
using System.IO;
using System.Collections;
using System.Windows.Forms;
using HtmlHelp.ChmDecoding;
namespace HtmlHelp
{
/// <summary>
/// The class <c>TOCItem</c> implements a toc-entry item
/// </summary>
public sealed class TOCItem
{
/// <summary>
/// Constant for standard folder (closed) image index (HH2 image list)
/// </summary>
public const int STD_FOLDER_HH2 = 4;
/// <summary>
/// Constant for standard folder (opened) image index (HH2 image list)
/// </summary>
public const int STD_FOLDER_OPEN_HH2 = 6;
/// <summary>
/// Constant for standard file image index (HH2 image list)
/// </summary>
public const int STD_FILE_HH2 = 16;
/// <summary>
/// Constant for standard folder (closed) image index (HH1 image list)
/// </summary>
public const int STD_FOLDER_HH1 = 0;
/// <summary>
/// Constant for standard folder (opened) image index (HH1 image list)
/// </summary>
public const int STD_FOLDER_OPEN_HH1 = 1;
/// <summary>
/// Constant for standard file image index (HH1 image list)
/// </summary>
public const int STD_FILE_HH1 = 10;
/// <summary>
/// Internal flag specifying the data extraction mode used for this item
/// </summary>
private DataMode _tocMode = DataMode.TextBased;
/// <summary>
/// Internal member storing the offset (only used in binary tocs)
/// </summary>
private int _offset = 0;
/// <summary>
/// Internal member storing the offset of the next item(only used in binary tocs)
/// </summary>
private int _offsetNext = 0;
/// <summary>
/// Internal member storing a merge link.
/// If the target file is in the merged files list of the CHM,
/// this item will be replaced with the target TOC or Topic, if not it will
/// be removed from TOC.
/// </summary>
private string _mergeLink = "";
/// <summary>
/// Internal member storing the toc name
/// </summary>
private string _name = "";
/// <summary>
/// Internal member storing the toc loca (content file)
/// </summary>
private string _local = "";
/// <summary>
/// Internal member storing all associated information type strings
/// </summary>
private ArrayList _infoTypeStrings = new ArrayList();
/// <summary>
/// Internal member storing the associated chm file
/// </summary>
private string _chmFile = "";
/// <summary>
/// Internal member storing the image index
/// </summary>
private int _imageIndex = -1;
/// <summary>
/// Internal member storing the offset of the associated topic entry (for binary tocs)
/// </summary>
private int _topicOffset = -1;
/// <summary>
/// Internal member storing the toc children
/// </summary>
private ArrayList _children = new ArrayList();
/// <summary>
/// Internal member storing the parameter collection
/// </summary>
private Hashtable _otherParams = new Hashtable();
/// <summary>
/// Internal member storing the associated chmfile object
/// </summary>
private CHMFile _associatedFile = null;
/// <summary>
/// Parent item
/// </summary>
private TOCItem _parent=null;
/// <summary>
/// Holds a pointer to the next item in the TOC
/// </summary>
public TOCItem Next=null;
/// <summary>
/// Holds a pointer to the previous item in the TOC
/// </summary>
public TOCItem Prev=null;
/// <summary>
/// Holds a pointer to the TreeNode where this TOC Item is used
/// </summary>
public System.Windows.Forms.TreeNode treeNode=null;
/// <summary>
/// Constructor of the class used during text-based data extraction
/// </summary>
/// <param name="name">name of the item</param>
/// <param name="local">local content file</param>
/// <param name="ImageIndex">image index</param>
/// <param name="chmFile">associated chm file</param>
public TOCItem(string name, string local, int ImageIndex, string chmFile)
{
_tocMode = DataMode.TextBased;
_name = name;
_local = local;
_imageIndex = ImageIndex;
_chmFile = chmFile;
}
/// <summary>
/// Constructor of the class used during binary data extraction
/// </summary>
/// <param name="topicOffset">offset of the associated topic entry</param>
/// <param name="ImageIndex">image index to use</param>
/// <param name="associatedFile">associated chm file</param>
public TOCItem(int topicOffset, int ImageIndex, CHMFile associatedFile)
{
_tocMode = DataMode.Binary;
_associatedFile = associatedFile;
_chmFile = associatedFile.ChmFilePath;
_topicOffset = topicOffset;
_imageIndex = ImageIndex;
}
/// <summary>
/// Standard constructor
/// </summary>
public TOCItem()
{
}
#region Data dumping
/// <summary>
/// Dump the class data to a binary writer
/// </summary>
/// <param name="writer">writer to write the data</param>
/// <param name="writeFilename">true if the chmfile name should be written</param>
internal void Dump(ref BinaryWriter writer, bool writeFilename)
{
writer.Write((int)_tocMode);
writer.Write(_topicOffset);
writer.Write(_name);
if((_tocMode == DataMode.TextBased)||(_topicOffset<0))
{
writer.Write(_local);
}
writer.Write(_imageIndex);
writer.Write(_mergeLink);
if(writeFilename)
writer.Write(_chmFile);
writer.Write(_infoTypeStrings.Count);
for(int i=0; i<_infoTypeStrings.Count; i++)
writer.Write( (_infoTypeStrings[i]).ToString() );
writer.Write(_children.Count);
for(int i=0; i<_children.Count; i++)
{
TOCItem child = ((TOCItem)(_children[i]));
child.Dump(ref writer, writeFilename);
}
}
/// <summary>
/// Dump the class data to a binary writer
/// </summary>
/// <param name="writer">writer to write the data</param>
internal void Dump(ref BinaryWriter writer)
{
Dump(ref writer, false);
}
/// <summary>
/// Reads the object data from a dump store
/// </summary>
/// <param name="reader">reader to read the data</param>
/// <param name="readFilename">true if the chmfile name should be read</param>
internal void ReadDump(ref BinaryReader reader, bool readFilename)
{
int i=0;
_tocMode = (DataMode)reader.ReadInt32();
_topicOffset = reader.ReadInt32();
_name = reader.ReadString();
if((_tocMode == DataMode.TextBased)||(_topicOffset<0))
{
_local = reader.ReadString();
}
_imageIndex = reader.ReadInt32();
_mergeLink = reader.ReadString();
if(readFilename)
_chmFile = reader.ReadString();
int nCnt = reader.ReadInt32();
for(i=0; i<nCnt; i++)
{
string sIT = reader.ReadString();
_infoTypeStrings.Add(sIT);
}
nCnt = reader.ReadInt32();
if(_associatedFile != null)
_chmFile = _associatedFile.ChmFilePath;
for(i=0; i<nCnt; i++)
{
TOCItem child = new TOCItem();
child.AssociatedFile = _associatedFile;
child.ReadDump(ref reader, readFilename);
if(_associatedFile != null)
child.ChmFile = _associatedFile.ChmFilePath;
else if(!readFilename)
child.ChmFile = _chmFile;
child.Parent = this;
_children.Add(child);
if(child.MergeLink.Length > 0)
_associatedFile.MergLinks.Add(child);
}
}
/// <summary>
/// Reads the object data from a dump store
/// </summary>
/// <param name="reader">reader to read the data</param>
internal void ReadDump(ref BinaryReader reader)
{
ReadDump(ref reader, false);
}
#endregion
/// <summary>
/// Gets/Sets the data extraction mode with which this item was created.
/// </summary>
internal DataMode TocMode
{
get { return _tocMode; }
set { _tocMode = value; }
}
/// <summary>
/// Gets/Sets the offset of the associated topic entry
/// </summary>
internal int TopicOffset
{
get { return _topicOffset; }
set { _topicOffset = value; }
}
/// <summary>
/// Gets/Sets the associated CHMFile instance
/// </summary>
internal CHMFile AssociatedFile
{
get { return _associatedFile; }
set
{
_associatedFile = value;
}
}
/// <summary>
/// Gets/Sets the offset of the item.
/// </summary>
/// <remarks>Only used in binary tocs</remarks>
internal int Offset
{
get { return _offset; }
set { _offset = value; }
}
/// <summary>
/// Gets/Sets the offset of the next item.
/// </summary>
/// <remarks>Only used in binary tocs</remarks>
internal int OffsetNext
{
get { return _offsetNext; }
set { _offsetNext = value; }
}
/// <summary>
/// Gets the ArrayList which holds all information types/categories this item is associated
/// </summary>
internal ArrayList InfoTypeStrings
{
get { return _infoTypeStrings; }
}
/// <summary>
/// Gets/Sets the parent of this item
/// </summary>
public TOCItem Parent
{
get { return _parent; }
set { _parent = value; }
}
/// <summary>
/// Gets/Sets the mergelink for this item.
/// <b>You should not set the mergedlink by your own !</b>
/// This is only for loading merged CHMs.
/// </summary>
public string MergeLink
{
get { return _mergeLink; }
set { _mergeLink = value; }
}
/// <summary>
/// Gets/Sets the name of the item
/// </summary>
public string Name
{
get
{
if(_mergeLink.Length > 0)
return "";
if(_name.Length <= 0)
{
if((_tocMode == DataMode.Binary )&&(_associatedFile!=null))
{
if( _topicOffset >= 0)
{
TopicEntry te = (TopicEntry) (_associatedFile.TopicsFile[_topicOffset]);
if(te != null)
{
return te.Title;
}
}
}
}
return _name;
}
set
{
_name = value;
}
}
/// <summary>
/// Gets/Sets the local of the item
/// </summary>
public string Local
{
get
{
if(_mergeLink.Length > 0)
return "";
if(_local.Length <= 0)
{
if((_tocMode == DataMode.Binary )&&(_associatedFile!=null))
{
if( _topicOffset >= 0)
{
TopicEntry te = (TopicEntry) (_associatedFile.TopicsFile[_topicOffset]);
if(te != null)
{
return te.Locale;
}
}
}
}
return _local;
}
set { _local = value; }
}
/// <summary>
/// Gets/Sets the chm file
/// </summary>
public string ChmFile
{
get
{
if(_associatedFile!=null)
return _associatedFile.ChmFilePath;
return _chmFile;
}
set { _chmFile = value; }
}
/// <summary>
/// Gets the url for the webbrowser for this file
/// </summary>
public string Url
{
get
{
string sL = Local;
if( (sL.ToLower().IndexOf("http://") >= 0) ||
(sL.ToLower().IndexOf("https://") >= 0) ||
(sL.ToLower().IndexOf("mailto:") >= 0) ||
(sL.ToLower().IndexOf("ftp://") >= 0) ||
(sL.ToLower().IndexOf("ms-its:") >= 0))
return sL;
return HtmlHelpSystem.UrlPrefix + ChmFile + "::/" + sL;
}
}
/// <summary>
/// Gets/Sets the image index of the item
/// </summary>
/// <remarks>Set this to -1 for a default icon</remarks>
public int ImageIndex
{
get
{
if( _imageIndex == -1)
{
int nFolderAdd = 0;
if((_associatedFile != null) && (_associatedFile.ImageTypeFolder))
{
// get the value which should be added, to display folders instead of books
if(HtmlHelpSystem.UseHH2TreePics)
nFolderAdd = 8;
else
nFolderAdd = 4;
}
if( _children.Count > 0)
return (HtmlHelpSystem.UseHH2TreePics ? (STD_FOLDER_HH2+nFolderAdd) : (STD_FOLDER_HH1+nFolderAdd));
return (HtmlHelpSystem.UseHH2TreePics ? STD_FILE_HH2 : STD_FILE_HH1);
}
return _imageIndex;
}
set { _imageIndex = value; }
}
/// <summary>
/// Gets/Sets the children of this item.
/// </summary>
/// <remarks>Each entry in the ArrayList is of type TOCItem</remarks>
public ArrayList Children
{
get { return _children; }
set { _children = value; }
}
/// <summary>
/// Gets the internal hashtable storing all params
/// </summary>
public Hashtable Params
{
get { return _otherParams; }
}
}
}

View File

@@ -0,0 +1,198 @@
using System;
using System.Diagnostics;
using System.Collections;
using HtmlHelp.ChmDecoding;
namespace HtmlHelp
{
/// <summary>
/// The class <c>TableOfContents</c> holds the TOC of the htmlhelp system class.
/// </summary>
public class TableOfContents
{
private ArrayList _toc = new ArrayList();
/// <summary>
/// Standard constructor
/// </summary>
public TableOfContents()
{
}
/// <summary>
/// Constructor of the class
/// </summary>
/// <param name="toc"></param>
public TableOfContents(ArrayList toc)
{
_toc = toc;
}
/// <summary>
/// Gets the internal stored table of contents
/// </summary>
public ArrayList TOC
{
get { return _toc; }
}
/// <summary>
/// Clears the current toc
/// </summary>
public void Clear()
{
if(_toc!=null)
_toc.Clear();
}
/// <summary>
/// Gets the number of topics in the toc
/// </summary>
/// <returns>Returns the number of topics in the toc</returns>
public int Count()
{
if(_toc!=null)
return _toc.Count;
else
return 0;
}
/// <summary>
/// Merges the <c>arrToC</c> list to the one in this instance
/// </summary>
/// <param name="arrToC">the toc list which should be merged with the current one</param>
internal void MergeToC( ArrayList arrToC )
{
if(_toc==null)
_toc = new ArrayList();
MergeToC(_toc, arrToC, null);
}
/// <summary>
/// Merges the <c>arrToC</c> list to the one in this instance (called if merged files
/// were found in a CHM)
/// </summary>
/// <param name="arrToC">the toc list which should be merged with the current one</param>
/// <param name="openFiles">An arraylist of CHMFile instances.</param>
internal void MergeToC( ArrayList arrToC, ArrayList openFiles )
{
if(_toc==null)
_toc = new ArrayList();
MergeToC(_toc, arrToC, openFiles);
}
/// <summary>
/// Internal method for recursive toc merging
/// </summary>
/// <param name="globalLevel">level of global toc</param>
/// <param name="localLevel">level of local toc</param>
/// <param name="openFiles">An arraylist of CHMFile instances.</param>
private void MergeToC( ArrayList globalLevel, ArrayList localLevel, ArrayList openFiles )
{
foreach( TOCItem curItem in localLevel)
{
// if it is a part of the merged-links, we have to do nothing,
// because the method HtmlHelpSystem.RecalculateMergeLinks() has already
// placed this item at its correct position.
if(!IsMergedItem(curItem.Name, curItem.Local, openFiles))
{
TOCItem globalItem = ContainsToC(globalLevel, curItem.Name);
if(globalItem == null)
{
// the global toc doesn't have a topic with this name
// so we need to add the complete toc node to the global toc
globalLevel.Add( curItem );
}
else
{
// the global toc contains the current topic
// advance to the next level
if( (globalItem.Local.Length <= 0) && (curItem.Local.Length > 0) )
{
// set the associated url
globalItem.Local = curItem.Local;
globalItem.ChmFile = curItem.ChmFile;
}
MergeToC(globalItem.Children, curItem.Children);
}
}
}
}
/// <summary>
/// Checks if the item is part of the merged-links
/// </summary>
/// <param name="name">name of the topic</param>
/// <param name="local">local of the topic</param>
/// <param name="openFiles">An arraylist of CHMFile instances.</param>
/// <returns>Returns true if this item is part of the merged-links</returns>
private bool IsMergedItem(string name, string local, ArrayList openFiles)
{
if(openFiles==null)
return false;
foreach(CHMFile curFile in openFiles)
{
foreach(TOCItem curItem in curFile.MergLinks)
if( (curItem.Name == name) && (curItem.Local == local) )
return true;
}
return false;
}
/// <summary>
/// Checks if a topicname exists in a SINGLE toc level
/// </summary>
/// <param name="arrToC">toc list</param>
/// <param name="Topic">topic to search</param>
/// <returns>Returns the topic item if found, otherwise null</returns>
private TOCItem ContainsToC(ArrayList arrToC, string Topic)
{
foreach(TOCItem curItem in arrToC)
{
if(curItem.Name == Topic)
return curItem;
}
return null;
}
/// <summary>
/// Searches the table of contents for a special topic
/// </summary>
/// <param name="topic">topic to search</param>
/// <returns>Returns an instance of TOCItem if found, otherwise null</returns>
public TOCItem SearchTopic(string topic)
{
return SearchTopic(topic, _toc);
}
/// <summary>
/// Internal recursive tree search
/// </summary>
/// <param name="topic">topic to search</param>
/// <param name="searchIn">tree level list to look in</param>
/// <returns>Returns an instance of TOCItem if found, otherwise null</returns>
private TOCItem SearchTopic(string topic, ArrayList searchIn)
{
foreach(TOCItem curItem in searchIn)
{
if(curItem.Name.ToLower() == topic.ToLower() )
return curItem;
if(curItem.Children.Count>0)
{
TOCItem nf = SearchTopic(topic, curItem.Children);
if(nf != null)
return nf;
}
}
return null;
}
}
}

View File

@@ -0,0 +1,32 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("1.0.*")]
// The following attributes specify the key for the sign of your assembly. See the
// .NET Framework documentation for more information about signing.
// This is not required, if you don't want signing let these attributes like they're.
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]

View File

@@ -0,0 +1,200 @@
// Adler32.cs - Computes Adler32 data checksum of a data stream
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
using System;
namespace ICSharpCode.SharpZipLib.Checksums
{
/// <summary>
/// Computes Adler32 checksum for a stream of data. An Adler32
/// checksum is not as reliable as a CRC32 checksum, but a lot faster to
/// compute.
///
/// The specification for Adler32 may be found in RFC 1950.
/// ZLIB Compressed Data Format Specification version 3.3)
///
///
/// From that document:
///
/// "ADLER32 (Adler-32 checksum)
/// This contains a checksum value of the uncompressed data
/// (excluding any dictionary data) computed according to Adler-32
/// algorithm. This algorithm is a 32-bit extension and improvement
/// of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073
/// standard.
///
/// Adler-32 is composed of two sums accumulated per byte: s1 is
/// the sum of all bytes, s2 is the sum of all s1 values. Both sums
/// are done modulo 65521. s1 is initialized to 1, s2 to zero. The
/// Adler-32 checksum is stored as s2*65536 + s1 in most-
/// significant-byte first (network) order."
///
/// "8.2. The Adler-32 algorithm
///
/// The Adler-32 algorithm is much faster than the CRC32 algorithm yet
/// still provides an extremely low probability of undetected errors.
///
/// The modulo on unsigned long accumulators can be delayed for 5552
/// bytes, so the modulo operation time is negligible. If the bytes
/// are a, b, c, the second sum is 3a + 2b + c + 3, and so is position
/// and order sensitive, unlike the first sum, which is just a
/// checksum. That 65521 is prime is important to avoid a possible
/// large class of two-byte errors that leave the check unchanged.
/// (The Fletcher checksum uses 255, which is not prime and which also
/// makes the Fletcher check insensitive to single byte changes 0 -
/// 255.)
///
/// The sum s1 is initialized to 1 instead of zero to make the length
/// of the sequence part of s2, so that the length does not have to be
/// checked separately. (Any sequence of zeroes has a Fletcher
/// checksum of zero.)"
/// </summary>
/// <see cref="ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream"/>
/// <see cref="ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream"/>
public sealed class Adler32 : IChecksum
{
/// <summary>
/// largest prime smaller than 65536
/// </summary>
readonly static uint BASE = 65521;
uint checksum;
/// <summary>
/// Returns the Adler32 data checksum computed so far.
/// </summary>
public long Value {
get {
return checksum;
}
}
/// <summary>
/// Creates a new instance of the <code>Adler32</code> class.
/// The checksum starts off with a value of 1.
/// </summary>
public Adler32()
{
Reset();
}
/// <summary>
/// Resets the Adler32 checksum to the initial value.
/// </summary>
public void Reset()
{
checksum = 1; //Initialize to 1
}
/// <summary>
/// Updates the checksum with the byte b.
/// </summary>
/// <param name="bval">
/// the data value to add. The high byte of the int is ignored.
/// </param>
public void Update(int bval)
{
//We could make a length 1 byte array and call update again, but I
//would rather not have that overhead
uint s1 = checksum & 0xFFFF;
uint s2 = checksum >> 16;
s1 = (s1 + ((uint)bval & 0xFF)) % BASE;
s2 = (s1 + s2) % BASE;
checksum = (s2 << 16) + s1;
}
/// <summary>
/// Updates the checksum with the bytes taken from the array.
/// </summary>
/// <param name="buffer">
/// buffer an array of bytes
/// </param>
public void Update(byte[] buffer)
{
Update(buffer, 0, buffer.Length);
}
/// <summary>
/// Updates the checksum with the bytes taken from the array.
/// </summary>
/// <param name="buf">
/// an array of bytes
/// </param>
/// <param name="off">
/// the start of the data used for this update
/// </param>
/// <param name="len">
/// the number of bytes to use for this update
/// </param>
public void Update(byte[] buf, int off, int len)
{
if (buf == null) {
throw new ArgumentNullException("buf");
}
if (off < 0 || len < 0 || off + len > buf.Length) {
throw new ArgumentOutOfRangeException();
}
//(By Per Bothner)
uint s1 = checksum & 0xFFFF;
uint s2 = checksum >> 16;
while (len > 0) {
// We can defer the modulo operation:
// s1 maximally grows from 65521 to 65521 + 255 * 3800
// s2 maximally grows by 3800 * median(s1) = 2090079800 < 2^31
int n = 3800;
if (n > len) {
n = len;
}
len -= n;
while (--n >= 0) {
s1 = s1 + (uint)(buf[off++] & 0xFF);
s2 = s2 + s1;
}
s1 %= BASE;
s2 %= BASE;
}
checksum = (s2 << 16) | s1;
}
}
}

View File

@@ -0,0 +1,211 @@
// CRC32.cs - Computes CRC32 data checksum of a data stream
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
using System;
namespace ICSharpCode.SharpZipLib.Checksums
{
/// <summary>
/// Generate a table for a byte-wise 32-bit CRC calculation on the polynomial:
/// x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
///
/// Polynomials over GF(2) are represented in binary, one bit per coefficient,
/// with the lowest powers in the most significant bit. Then adding polynomials
/// is just exclusive-or, and multiplying a polynomial by x is a right shift by
/// one. If we call the above polynomial p, and represent a byte as the
/// polynomial q, also with the lowest power in the most significant bit (so the
/// byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
/// where a mod b means the remainder after dividing a by b.
///
/// This calculation is done using the shift-register method of multiplying and
/// taking the remainder. The register is initialized to zero, and for each
/// incoming bit, x^32 is added mod p to the register if the bit is a one (where
/// x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
/// x (which is shifting right by one and adding x^32 mod p if the bit shifted
/// out is a one). We start with the highest power (least significant bit) of
/// q and repeat for all eight bits of q.
///
/// The table is simply the CRC of all possible eight bit values. This is all
/// the information needed to generate CRC's on data a byte at a time for all
/// combinations of CRC register values and incoming bytes.
/// </summary>
public sealed class Crc32 : IChecksum
{
readonly static uint CrcSeed = 0xFFFFFFFF;
readonly static uint[] CrcTable = new uint[] {
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419,
0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4,
0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07,
0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856,
0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9,
0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4,
0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3,
0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A,
0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599,
0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190,
0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F,
0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E,
0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED,
0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950,
0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3,
0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A,
0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5,
0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010,
0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17,
0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6,
0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615,
0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344,
0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB,
0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A,
0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1,
0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C,
0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF,
0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE,
0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31,
0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C,
0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B,
0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242,
0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1,
0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278,
0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7,
0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66,
0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605,
0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8,
0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B,
0x2D02EF8D
};
internal static uint ComputeCrc32(uint oldCrc, byte bval)
{
return (uint)(Crc32.CrcTable[(oldCrc ^ bval) & 0xFF] ^ (oldCrc >> 8));
}
/// <summary>
/// The crc data checksum so far.
/// </summary>
uint crc = 0;
/// <summary>
/// Returns the CRC32 data checksum computed so far.
/// </summary>
public long Value {
get {
return (long)crc;
}
set {
crc = (uint)value;
}
}
/// <summary>
/// Resets the CRC32 data checksum as if no update was ever called.
/// </summary>
public void Reset()
{
crc = 0;
}
/// <summary>
/// Updates the checksum with the int bval.
/// </summary>
/// <param name = "bval">
/// the byte is taken as the lower 8 bits of bval
/// </param>
public void Update(int bval)
{
crc ^= CrcSeed;
crc = CrcTable[(crc ^ bval) & 0xFF] ^ (crc >> 8);
crc ^= CrcSeed;
}
/// <summary>
/// Updates the checksum with the bytes taken from the array.
/// </summary>
/// <param name="buffer">
/// buffer an array of bytes
/// </param>
public void Update(byte[] buffer)
{
Update(buffer, 0, buffer.Length);
}
/// <summary>
/// Adds the byte array to the data checksum.
/// </summary>
/// <param name = "buf">
/// the buffer which contains the data
/// </param>
/// <param name = "off">
/// the offset in the buffer where the data starts
/// </param>
/// <param name = "len">
/// the length of the data
/// </param>
public void Update(byte[] buf, int off, int len)
{
if (buf == null) {
throw new ArgumentNullException("buf");
}
if (off < 0 || len < 0 || off + len > buf.Length) {
throw new ArgumentOutOfRangeException();
}
crc ^= CrcSeed;
while (--len >= 0) {
crc = CrcTable[(crc ^ buf[off++]) & 0xFF] ^ (crc >> 8);
}
crc ^= CrcSeed;
}
}
}

View File

@@ -0,0 +1,93 @@
// IChecksum.cs - Interface to compute a data checksum
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
namespace ICSharpCode.SharpZipLib.Checksums
{
/// <summary>
/// Interface to compute a data checksum used by checked input/output streams.
/// A data checksum can be updated by one byte or with a byte array. After each
/// update the value of the current checksum can be returned by calling
/// <code>getValue</code>. The complete checksum object can also be reset
/// so it can be used again with new data.
/// </summary>
public interface IChecksum
{
/// <summary>
/// Returns the data checksum computed so far.
/// </summary>
long Value
{
get;
}
/// <summary>
/// Resets the data checksum as if no update was ever called.
/// </summary>
void Reset();
/// <summary>
/// Adds one byte to the data checksum.
/// </summary>
/// <param name = "bval">
/// the data value to add. The high byte of the int is ignored.
/// </param>
void Update(int bval);
/// <summary>
/// Updates the data checksum with the bytes taken from the array.
/// </summary>
/// <param name="buffer">
/// buffer an array of bytes
/// </param>
void Update(byte[] buffer);
/// <summary>
/// Adds the byte array to the data checksum.
/// </summary>
/// <param name = "buf">
/// the buffer which contains the data
/// </param>
/// <param name = "off">
/// the offset in the buffer where the data starts
/// </param>
/// <param name = "len">
/// the length of the data
/// </param>
void Update(byte[] buf, int off, int len);
}
}

View File

@@ -0,0 +1,159 @@
// StrangeCRC.cs - computes a crc used in the bziplib ... I don't think that
// this is the 'standard' crc, please correct me, if I'm wrong
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
using System;
namespace ICSharpCode.SharpZipLib.Checksums
{
public class StrangeCRC : IChecksum
{
readonly static uint[] crc32Table = {
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9,
0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011,
0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,
0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039,
0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5,
0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81,
0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49,
0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1,
0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,
0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae,
0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16,
0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca,
0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde,
0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,
0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066,
0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e,
0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692,
0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6,
0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,
0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e,
0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686,
0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,
0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637,
0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f,
0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47,
0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b,
0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff,
0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,
0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7,
0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f,
0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7,
0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b,
0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f,
0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640,
0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c,
0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8,
0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,
0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30,
0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088,
0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,
0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0,
0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c,
0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18,
0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0,
0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,
0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
};
int globalCrc;
public StrangeCRC()
{
Reset();
}
public void Reset()
{
globalCrc = -1;
}
public long Value {
get {
return ~globalCrc;
}
}
public void Update(int inCh)
{
int temp = (globalCrc >> 24) ^ inCh;
if (temp < 0) {
temp = 256 + temp;
}
globalCrc = (int)((globalCrc << 8) ^ crc32Table[temp]);
}
public void Update(byte[] buf)
{
Update(buf, 0, buf.Length);
}
public void Update(byte[] buf, int off, int len)
{
if (buf == null) {
throw new ArgumentNullException("buf");
}
if (off < 0 || len < 0 || off + len > buf.Length) {
throw new ArgumentOutOfRangeException();
}
for (int i = 0; i < len; ++i) {
Update(buf[off++]);
}
}
}
}

View File

@@ -0,0 +1,16 @@
<Combine fileversion="1.0" name="Compression" description="">
<StartMode startupentry="Compression" single="True">
<Execute entry="Compression" type="None" />
</StartMode>
<Entries>
<Entry filename=".\.\Compression.prjx" />
</Entries>
<Configurations active="Debug">
<Configuration name="Release">
<Entry name="Compression" configurationname="Debug" build="False" />
</Configuration>
<Configuration name="Debug">
<Entry name="Compression" configurationname="Debug" build="False" />
</Configuration>
</Configurations>
</Combine>

View File

@@ -0,0 +1,45 @@
<Project name="Compression" standardNamespace="Compression" description="" newfilesearch="None" enableviewstate="True" version="1.1" projecttype="C#">
<Contents>
<File name=".\AssemblyInfo.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\ZipException.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\Deflater.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\DeflaterConstants.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\DeflaterEngine.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\DeflaterHuffman.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\DeflaterPending.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\Inflater.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\InflaterDynHeader.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\InflaterHuffmanTree.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\PendingBuffer.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\Checksums" subtype="Directory" buildaction="Compile" dependson="" data="" />
<File name=".\Checksums\StrangeCRC.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\Checksums\Adler32.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\Checksums\CRC32.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\Checksums\IChecksum.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\Streams" subtype="Directory" buildaction="Compile" dependson="" data="" />
<File name=".\Streams\StreamManipulator.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\Streams\DeflaterOutputStream.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\Streams\InflaterInputStream.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\Streams\OutputWindow.cs" subtype="Code" buildaction="Compile" dependson="" data="" />
<File name=".\Default.build" subtype="Code" buildaction="Nothing" dependson="" data="" />
</Contents>
<References />
<DeploymentInformation target="" script="" strategy="File" />
<Configuration runwithwarnings="True" name="Debug">
<CodeGeneration runtime="MsNet" compiler="Csc" compilerversion="" warninglevel="4" nowarn="" includedebuginformation="True" optimize="False" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Library" definesymbols="" generatexmldocumentation="False" win32Icon="" noconfig="False" nostdlib="False" />
<Execution commandlineparameters="" consolepause="False" />
<Output directory="..\bin\Debug" assembly="Compression" executeScript="" executeBeforeBuild="" executeAfterBuild="" executeBeforeBuildArguments="" executeAfterBuildArguments="" />
</Configuration>
<Configurations active="Debug">
<Configuration runwithwarnings="True" name="Debug">
<CodeGeneration runtime="MsNet" compiler="Csc" compilerversion="" warninglevel="4" nowarn="" includedebuginformation="True" optimize="False" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" target="Library" definesymbols="" generatexmldocumentation="False" win32Icon="" noconfig="False" nostdlib="False" />
<Execution commandlineparameters="" consolepause="False" />
<Output directory="..\bin\Debug" assembly="Compression" executeScript="" executeBeforeBuild="" executeAfterBuild="" executeBeforeBuildArguments="" executeAfterBuildArguments="" />
</Configuration>
<Configuration runwithwarnings="True" name="Release">
<CodeGeneration runtime="MsNet" compiler="Csc" compilerversion="" warninglevel="4" nowarn="" includedebuginformation="False" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" mainclass="" target="Library" definesymbols="" generatexmldocumentation="False" win32Icon="" noconfig="False" nostdlib="False" />
<Execution commandlineparameters="" consolepause="False" />
<Output directory="..\bin\Release" assembly="Compression" executeScript="" executeBeforeBuild="" executeAfterBuild="" executeBeforeBuildArguments="" executeAfterBuildArguments="" />
</Configuration>
</Configurations>
</Project>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<project name="Compression" default="build">
<property name="output.dir" value="..\bin" />
<target name="build" description="Build component">
<mkdir dir="${output.dir}" />
<csc target="library"
output="${output.dir}\Compression.dll"
optimize="true"
debug="true"
doc="${output.dir}\Compression.xml"
warninglevel="0">
<sources>
<include name="**/*.cs" />
</sources>
</csc>
</target>
</project>

View File

@@ -0,0 +1,542 @@
// Deflater.cs
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
using System;
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
/// <summary>
/// This is the Deflater class. The deflater class compresses input
/// with the deflate algorithm described in RFC 1951. It has several
/// compression levels and three different strategies described below.
///
/// This class is <i>not</i> thread safe. This is inherent in the API, due
/// to the split of deflate and setInput.
///
/// author of the original java version : Jochen Hoenicke
/// </summary>
public class Deflater
{
/// <summary>
/// The best and slowest compression level. This tries to find very
/// long and distant string repetitions.
/// </summary>
public static int BEST_COMPRESSION = 9;
/// <summary>
/// The worst but fastest compression level.
/// </summary>
public static int BEST_SPEED = 1;
/// <summary>
/// The default compression level.
/// </summary>
public static int DEFAULT_COMPRESSION = -1;
/// <summary>
/// This level won't compress at all but output uncompressed blocks.
/// </summary>
public static int NO_COMPRESSION = 0;
/// <summary>
/// The compression method. This is the only method supported so far.
/// There is no need to use this constant at all.
/// </summary>
public static int DEFLATED = 8;
/*
* The Deflater can do the following state transitions:
*
* (1) -> INIT_STATE ----> INIT_FINISHING_STATE ---.
* / | (2) (5) |
* / v (5) |
* (3)| SETDICT_STATE ---> SETDICT_FINISHING_STATE |(3)
* \ | (3) | ,-------'
* | | | (3) /
* v v (5) v v
* (1) -> BUSY_STATE ----> FINISHING_STATE
* | (6)
* v
* FINISHED_STATE
* \_____________________________________/
* | (7)
* v
* CLOSED_STATE
*
* (1) If we should produce a header we start in INIT_STATE, otherwise
* we start in BUSY_STATE.
* (2) A dictionary may be set only when we are in INIT_STATE, then
* we change the state as indicated.
* (3) Whether a dictionary is set or not, on the first call of deflate
* we change to BUSY_STATE.
* (4) -- intentionally left blank -- :)
* (5) FINISHING_STATE is entered, when flush() is called to indicate that
* there is no more INPUT. There are also states indicating, that
* the header wasn't written yet.
* (6) FINISHED_STATE is entered, when everything has been flushed to the
* internal pending output buffer.
* (7) At any time (7)
*
*/
private static int IS_SETDICT = 0x01;
private static int IS_FLUSHING = 0x04;
private static int IS_FINISHING = 0x08;
private static int INIT_STATE = 0x00;
private static int SETDICT_STATE = 0x01;
// private static int INIT_FINISHING_STATE = 0x08;
// private static int SETDICT_FINISHING_STATE = 0x09;
private static int BUSY_STATE = 0x10;
private static int FLUSHING_STATE = 0x14;
private static int FINISHING_STATE = 0x1c;
private static int FINISHED_STATE = 0x1e;
private static int CLOSED_STATE = 0x7f;
/// <summary>
/// Compression level.
/// </summary>
private int level;
/// <summary>
/// should we include a header.
/// </summary>
private bool noHeader;
// /// <summary>
// /// Compression strategy.
// /// </summary>
// private int strategy;
/// <summary>
/// The current state.
/// </summary>
private int state;
/// <summary>
/// The total bytes of output written.
/// </summary>
private int totalOut;
/// <summary>
/// The pending output.
/// </summary>
private DeflaterPending pending;
/// <summary>
/// The deflater engine.
/// </summary>
private DeflaterEngine engine;
/// <summary>
/// Creates a new deflater with default compression level.
/// </summary>
public Deflater() : this(DEFAULT_COMPRESSION, false)
{
}
/// <summary>
/// Creates a new deflater with given compression level.
/// </summary>
/// <param name="lvl">
/// the compression level, a value between NO_COMPRESSION
/// and BEST_COMPRESSION, or DEFAULT_COMPRESSION.
/// </param>
/// <exception cref="System.ArgumentOutOfRangeException">if lvl is out of range.</exception>
public Deflater(int lvl) : this(lvl, false)
{
}
/// <summary>
/// Creates a new deflater with given compression level.
/// </summary>
/// <param name="lvl">
/// the compression level, a value between NO_COMPRESSION
/// and BEST_COMPRESSION.
/// </param>
/// <param name="nowrap">
/// true, if we should suppress the deflate header at the
/// beginning and the adler checksum at the end of the output. This is
/// useful for the GZIP format.
/// </param>
/// <exception cref="System.ArgumentOutOfRangeException">if lvl is out of range.</exception>
public Deflater(int lvl, bool nowrap)
{
if (lvl == DEFAULT_COMPRESSION) {
lvl = 6;
} else if (lvl < NO_COMPRESSION || lvl > BEST_COMPRESSION) {
throw new ArgumentOutOfRangeException("lvl");
}
pending = new DeflaterPending();
engine = new DeflaterEngine(pending);
this.noHeader = nowrap;
SetStrategy(DeflateStrategy.Default);
SetLevel(lvl);
Reset();
}
/// <summary>
/// Resets the deflater. The deflater acts afterwards as if it was
/// just created with the same compression level and strategy as it
/// had before.
/// </summary>
public void Reset()
{
state = (noHeader ? BUSY_STATE : INIT_STATE);
totalOut = 0;
pending.Reset();
engine.Reset();
}
/// <summary>
/// Gets the current adler checksum of the data that was processed so far.
/// </summary>
public int Adler {
get {
return engine.Adler;
}
}
/// <summary>
/// Gets the number of input bytes processed so far.
/// </summary>
public int TotalIn {
get {
return engine.TotalIn;
}
}
/// <summary>
/// Gets the number of output bytes so far.
/// </summary>
public int TotalOut {
get {
return totalOut;
}
}
/// <summary>
/// Flushes the current input block. Further calls to deflate() will
/// produce enough output to inflate everything in the current input
/// block. This is not part of Sun's JDK so I have made it package
/// private. It is used by DeflaterOutputStream to implement
/// flush().
/// </summary>
public void Flush()
{
state |= IS_FLUSHING;
}
/// <summary>
/// Finishes the deflater with the current input block. It is an error
/// to give more input after this method was called. This method must
/// be called to force all bytes to be flushed.
/// </summary>
public void Finish()
{
state |= IS_FLUSHING | IS_FINISHING;
}
/// <summary>
/// Returns true if the stream was finished and no more output bytes
/// are available.
/// </summary>
public bool IsFinished {
get {
return state == FINISHED_STATE && pending.IsFlushed;
}
}
/// <summary>
/// Returns true, if the input buffer is empty.
/// You should then call setInput().
/// NOTE: This method can also return true when the stream
/// was finished.
/// </summary>
public bool IsNeedingInput {
get {
return engine.NeedsInput();
}
}
/// <summary>
/// Sets the data which should be compressed next. This should be only
/// called when needsInput indicates that more input is needed.
/// If you call setInput when needsInput() returns false, the
/// previous input that is still pending will be thrown away.
/// The given byte array should not be changed, before needsInput() returns
/// true again.
/// This call is equivalent to <code>setInput(input, 0, input.length)</code>.
/// </summary>
/// <param name="input">
/// the buffer containing the input data.
/// </param>
/// <exception cref="System.InvalidOperationException">
/// if the buffer was finished() or ended().
/// </exception>
public void SetInput(byte[] input)
{
SetInput(input, 0, input.Length);
}
/// <summary>
/// Sets the data which should be compressed next. This should be
/// only called when needsInput indicates that more input is needed.
/// The given byte array should not be changed, before needsInput() returns
/// true again.
/// </summary>
/// <param name="input">
/// the buffer containing the input data.
/// </param>
/// <param name="off">
/// the start of the data.
/// </param>
/// <param name="len">
/// the length of the data.
/// </param>
/// <exception cref="System.InvalidOperationException">
/// if the buffer was finished() or ended() or if previous input is still pending.
/// </exception>
public void SetInput(byte[] input, int off, int len)
{
if ((state & IS_FINISHING) != 0) {
throw new InvalidOperationException("finish()/end() already called");
}
engine.SetInput(input, off, len);
}
/// <summary>
/// Sets the compression level. There is no guarantee of the exact
/// position of the change, but if you call this when needsInput is
/// true the change of compression level will occur somewhere near
/// before the end of the so far given input.
/// </summary>
/// <param name="lvl">
/// the new compression level.
/// </param>
public void SetLevel(int lvl)
{
if (lvl == DEFAULT_COMPRESSION) {
lvl = 6;
} else if (lvl < NO_COMPRESSION || lvl > BEST_COMPRESSION) {
throw new ArgumentOutOfRangeException("lvl");
}
if (level != lvl) {
level = lvl;
engine.SetLevel(lvl);
}
}
/// <summary>
/// Sets the compression strategy. Strategy is one of
/// DEFAULT_STRATEGY, HUFFMAN_ONLY and FILTERED. For the exact
/// position where the strategy is changed, the same as for
/// setLevel() applies.
/// </summary>
/// <param name="stgy">
/// the new compression strategy.
/// </param>
public void SetStrategy(DeflateStrategy stgy)
{
engine.Strategy = stgy;
}
/// <summary>
/// Deflates the current input block to the given array. It returns
/// the number of bytes compressed, or 0 if either
/// needsInput() or finished() returns true or length is zero.
/// </summary>
/// <param name="output">
/// the buffer where to write the compressed data.
/// </param>
public int Deflate(byte[] output)
{
return Deflate(output, 0, output.Length);
}
/// <summary>
/// Deflates the current input block to the given array. It returns
/// the number of bytes compressed, or 0 if either
/// needsInput() or finished() returns true or length is zero.
/// </summary>
/// <param name="output">
/// the buffer where to write the compressed data.
/// </param>
/// <param name="offset">
/// the offset into the output array.
/// </param>
/// <param name="length">
/// the maximum number of bytes that may be written.
/// </param>
/// <exception cref="System.InvalidOperationException">
/// if end() was called.
/// </exception>
/// <exception cref="System.ArgumentOutOfRangeException">
/// if offset and/or length don't match the array length.
/// </exception>
public int Deflate(byte[] output, int offset, int length)
{
int origLength = length;
if (state == CLOSED_STATE) {
throw new InvalidOperationException("Deflater closed");
}
if (state < BUSY_STATE) {
/* output header */
int header = (DEFLATED +
((DeflaterConstants.MAX_WBITS - 8) << 4)) << 8;
int level_flags = (level - 1) >> 1;
if (level_flags < 0 || level_flags > 3) {
level_flags = 3;
}
header |= level_flags << 6;
if ((state & IS_SETDICT) != 0) {
/* Dictionary was set */
header |= DeflaterConstants.PRESET_DICT;
}
header += 31 - (header % 31);
pending.WriteShortMSB(header);
if ((state & IS_SETDICT) != 0) {
int chksum = engine.Adler;
engine.ResetAdler();
pending.WriteShortMSB(chksum >> 16);
pending.WriteShortMSB(chksum & 0xffff);
}
state = BUSY_STATE | (state & (IS_FLUSHING | IS_FINISHING));
}
for (;;) {
int count = pending.Flush(output, offset, length);
offset += count;
totalOut += count;
length -= count;
if (length == 0 || state == FINISHED_STATE) {
break;
}
if (!engine.Deflate((state & IS_FLUSHING) != 0, (state & IS_FINISHING) != 0)) {
if (state == BUSY_STATE) {
/* We need more input now */
return origLength - length;
} else if (state == FLUSHING_STATE) {
if (level != NO_COMPRESSION) {
/* We have to supply some lookahead. 8 bit lookahead
* are needed by the zlib inflater, and we must fill
* the next byte, so that all bits are flushed.
*/
int neededbits = 8 + ((-pending.BitCount) & 7);
while (neededbits > 0) {
/* write a static tree block consisting solely of
* an EOF:
*/
pending.WriteBits(2, 10);
neededbits -= 10;
}
}
state = BUSY_STATE;
} else if (state == FINISHING_STATE) {
pending.AlignToByte();
/* We have completed the stream */
if (!noHeader) {
int adler = engine.Adler;
pending.WriteShortMSB(adler >> 16);
pending.WriteShortMSB(adler & 0xffff);
}
state = FINISHED_STATE;
}
}
}
return origLength - length;
}
/// <summary>
/// Sets the dictionary which should be used in the deflate process.
/// This call is equivalent to <code>setDictionary(dict, 0, dict.Length)</code>.
/// </summary>
/// <param name="dict">
/// the dictionary.
/// </param>
/// <exception cref="System.InvalidOperationException">
/// if setInput () or deflate () were already called or another dictionary was already set.
/// </exception>
public void SetDictionary(byte[] dict)
{
SetDictionary(dict, 0, dict.Length);
}
/// <summary>
/// Sets the dictionary which should be used in the deflate process.
/// The dictionary should be a byte array containing strings that are
/// likely to occur in the data which should be compressed. The
/// dictionary is not stored in the compressed output, only a
/// checksum. To decompress the output you need to supply the same
/// dictionary again.
/// </summary>
/// <param name="dict">
/// the dictionary.
/// </param>
/// <param name="offset">
/// an offset into the dictionary.
/// </param>
/// <param name="length">
/// the length of the dictionary.
/// </param>
/// <exception cref="System.InvalidOperationException">
/// if setInput () or deflate () were already called or another dictionary was already set.
/// </exception>
public void SetDictionary(byte[] dict, int offset, int length)
{
if (state != INIT_STATE) {
throw new InvalidOperationException();
}
state = SETDICT_STATE;
engine.SetDictionary(dict, offset, length);
}
}
}

View File

@@ -0,0 +1,85 @@
// DeflaterConstants.cs
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
using System;
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
/// <summary>
/// This class contains constants used for the deflater.
/// </summary>
public class DeflaterConstants
{
public const bool DEBUGGING = false;
public const int STORED_BLOCK = 0;
public const int STATIC_TREES = 1;
public const int DYN_TREES = 2;
public const int PRESET_DICT = 0x20;
public const int DEFAULT_MEM_LEVEL = 8;
public const int MAX_MATCH = 258;
public const int MIN_MATCH = 3;
public const int MAX_WBITS = 15;
public const int WSIZE = 1 << MAX_WBITS;
public const int WMASK = WSIZE - 1;
public const int HASH_BITS = DEFAULT_MEM_LEVEL + 7;
public const int HASH_SIZE = 1 << HASH_BITS;
public const int HASH_MASK = HASH_SIZE - 1;
public const int HASH_SHIFT = (HASH_BITS + MIN_MATCH - 1) / MIN_MATCH;
public const int MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1;
public const int MAX_DIST = WSIZE - MIN_LOOKAHEAD;
public const int PENDING_BUF_SIZE = 1 << (DEFAULT_MEM_LEVEL + 8);
public static int MAX_BLOCK_SIZE = Math.Min(65535, PENDING_BUF_SIZE-5);
public const int DEFLATE_STORED = 0;
public const int DEFLATE_FAST = 1;
public const int DEFLATE_SLOW = 2;
public static int[] GOOD_LENGTH = { 0, 4, 4, 4, 4, 8, 8, 8, 32, 32 };
public static int[] MAX_LAZY = { 0, 4, 5, 6, 4,16, 16, 32, 128, 258 };
public static int[] NICE_LENGTH = { 0, 8,16,32,16,32,128,128, 258, 258 };
public static int[] MAX_CHAIN = { 0, 4, 8,32,16,32,128,256,1024,4096 };
public static int[] COMPR_FUNC = { 0, 1, 1, 1, 1, 2, 2, 2, 2, 2 };
}
}

View File

@@ -0,0 +1,653 @@
// DeflaterEngine.cs
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
using System;
using ICSharpCode.SharpZipLib.Checksums;
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
public enum DeflateStrategy
{
// The default strategy.
Default = 0,
// This strategy will only allow longer string repetitions. It is
// useful for random data with a small character set.
Filtered = 1,
// This strategy will not look for string repetitions at all. It
// only encodes with Huffman trees (which means, that more common
// characters get a smaller encoding.
HuffmanOnly = 2
}
public class DeflaterEngine : DeflaterConstants
{
static int TOO_FAR = 4096;
int ins_h;
// private byte[] buffer;
short[] head;
short[] prev;
int matchStart, matchLen;
bool prevAvailable;
int blockStart;
int strstart, lookahead;
byte[] window;
DeflateStrategy strategy;
int max_chain, max_lazy, niceLength, goodLength;
/// <summary>
/// The current compression function.
/// </summary>
int comprFunc;
/// <summary>
/// The input data for compression.
/// </summary>
byte[] inputBuf;
/// <summary>
/// The total bytes of input read.
/// </summary>
int totalIn;
/// <summary>
/// The offset into inputBuf, where input data starts.
/// </summary>
int inputOff;
/// <summary>
/// The end offset of the input data.
/// </summary>
int inputEnd;
DeflaterPending pending;
DeflaterHuffman huffman;
/// <summary>
/// The adler checksum
/// </summary>
Adler32 adler;
public DeflaterEngine(DeflaterPending pending)
{
this.pending = pending;
huffman = new DeflaterHuffman(pending);
adler = new Adler32();
window = new byte[2 * WSIZE];
head = new short[HASH_SIZE];
prev = new short[WSIZE];
/* We start at index 1, to avoid a implementation deficiency, that
* we cannot build a repeat pattern at index 0.
*/
blockStart = strstart = 1;
}
public void Reset()
{
huffman.Reset();
adler.Reset();
blockStart = strstart = 1;
lookahead = 0;
totalIn = 0;
prevAvailable = false;
matchLen = MIN_MATCH - 1;
for (int i = 0; i < HASH_SIZE; i++) {
head[i] = 0;
}
for (int i = 0; i < WSIZE; i++) {
prev[i] = 0;
}
}
public void ResetAdler()
{
adler.Reset();
}
public int Adler {
get {
return (int)adler.Value;
}
}
public int TotalIn {
get {
return totalIn;
}
}
public DeflateStrategy Strategy {
get {
return strategy;
}
set {
strategy = value;
}
}
public void SetLevel(int lvl)
{
goodLength = DeflaterConstants.GOOD_LENGTH[lvl];
max_lazy = DeflaterConstants.MAX_LAZY[lvl];
niceLength = DeflaterConstants.NICE_LENGTH[lvl];
max_chain = DeflaterConstants.MAX_CHAIN[lvl];
if (DeflaterConstants.COMPR_FUNC[lvl] != comprFunc) {
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("Change from "+comprFunc +" to "
// + DeflaterConstants.COMPR_FUNC[lvl]);
// }
switch (comprFunc) {
case DEFLATE_STORED:
if (strstart > blockStart) {
huffman.FlushStoredBlock(window, blockStart,
strstart - blockStart, false);
blockStart = strstart;
}
UpdateHash();
break;
case DEFLATE_FAST:
if (strstart > blockStart) {
huffman.FlushBlock(window, blockStart, strstart - blockStart,
false);
blockStart = strstart;
}
break;
case DEFLATE_SLOW:
if (prevAvailable) {
huffman.TallyLit(window[strstart-1] & 0xff);
}
if (strstart > blockStart) {
huffman.FlushBlock(window, blockStart, strstart - blockStart, false);
blockStart = strstart;
}
prevAvailable = false;
matchLen = MIN_MATCH - 1;
break;
}
comprFunc = COMPR_FUNC[lvl];
}
}
void UpdateHash()
{
// if (DEBUGGING) {
// //Console.WriteLine("updateHash: "+strstart);
// }
ins_h = (window[strstart] << HASH_SHIFT) ^ window[strstart + 1];
}
int InsertString()
{
short match;
int hash = ((ins_h << HASH_SHIFT) ^ window[strstart + (MIN_MATCH -1)]) & HASH_MASK;
// if (DEBUGGING) {
// if (hash != (((window[strstart] << (2*HASH_SHIFT)) ^
// (window[strstart + 1] << HASH_SHIFT) ^
// (window[strstart + 2])) & HASH_MASK)) {
// throw new Exception("hash inconsistent: "+hash+"/"
// +window[strstart]+","
// +window[strstart+1]+","
// +window[strstart+2]+","+HASH_SHIFT);
// }
// }
prev[strstart & WMASK] = match = head[hash];
head[hash] = (short)strstart;
ins_h = hash;
return match & 0xffff;
}
void SlideWindow()
{
Array.Copy(window, WSIZE, window, 0, WSIZE);
matchStart -= WSIZE;
strstart -= WSIZE;
blockStart -= WSIZE;
/* Slide the hash table (could be avoided with 32 bit values
* at the expense of memory usage).
*/
for (int i = 0; i < HASH_SIZE; ++i) {
int m = head[i] & 0xffff;
head[i] = (short)(m >= WSIZE ? (m - WSIZE) : 0);
}
/* Slide the prev table. */
for (int i = 0; i < WSIZE; i++) {
int m = prev[i] & 0xffff;
prev[i] = (short)(m >= WSIZE ? (m - WSIZE) : 0);
}
}
public void FillWindow()
{
/* If the window is almost full and there is insufficient lookahead,
* move the upper half to the lower one to make room in the upper half.
*/
if (strstart >= WSIZE + MAX_DIST) {
SlideWindow();
}
/* If there is not enough lookahead, but still some input left,
* read in the input
*/
while (lookahead < DeflaterConstants.MIN_LOOKAHEAD && inputOff < inputEnd) {
int more = 2 * WSIZE - lookahead - strstart;
if (more > inputEnd - inputOff) {
more = inputEnd - inputOff;
}
System.Array.Copy(inputBuf, inputOff, window, strstart + lookahead, more);
adler.Update(inputBuf, inputOff, more);
inputOff += more;
totalIn += more;
lookahead += more;
}
if (lookahead >= MIN_MATCH) {
UpdateHash();
}
}
bool FindLongestMatch(int curMatch)
{
int chainLength = this.max_chain;
int niceLength = this.niceLength;
short[] prev = this.prev;
int scan = this.strstart;
int match;
int best_end = this.strstart + matchLen;
int best_len = Math.Max(matchLen, MIN_MATCH - 1);
int limit = Math.Max(strstart - MAX_DIST, 0);
int strend = strstart + MAX_MATCH - 1;
byte scan_end1 = window[best_end - 1];
byte scan_end = window[best_end];
/* Do not waste too much time if we already have a good match: */
if (best_len >= this.goodLength) {
chainLength >>= 2;
}
/* Do not look for matches beyond the end of the input. This is necessary
* to make deflate deterministic.
*/
if (niceLength > lookahead) {
niceLength = lookahead;
}
if (DeflaterConstants.DEBUGGING && strstart > 2 * WSIZE - MIN_LOOKAHEAD) {
throw new InvalidOperationException("need lookahead");
}
do {
if (DeflaterConstants.DEBUGGING && curMatch >= strstart) {
throw new InvalidOperationException("future match");
}
if (window[curMatch + best_len] != scan_end ||
window[curMatch + best_len - 1] != scan_end1 ||
window[curMatch] != window[scan] ||
window[curMatch + 1] != window[scan + 1]) {
continue;
}
match = curMatch + 2;
scan += 2;
/* We check for insufficient lookahead only every 8th comparison;
* the 256th check will be made at strstart+258.
*/
while (window[++scan] == window[++match] &&
window[++scan] == window[++match] &&
window[++scan] == window[++match] &&
window[++scan] == window[++match] &&
window[++scan] == window[++match] &&
window[++scan] == window[++match] &&
window[++scan] == window[++match] &&
window[++scan] == window[++match] && scan < strend) ;
if (scan > best_end) {
// if (DeflaterConstants.DEBUGGING && ins_h == 0)
// System.err.println("Found match: "+curMatch+"-"+(scan-strstart));
matchStart = curMatch;
best_end = scan;
best_len = scan - strstart;
if (best_len >= niceLength) {
break;
}
scan_end1 = window[best_end - 1];
scan_end = window[best_end];
}
scan = strstart;
} while ((curMatch = (prev[curMatch & WMASK] & 0xffff)) > limit && --chainLength != 0);
matchLen = Math.Min(best_len, lookahead);
return matchLen >= MIN_MATCH;
}
public void SetDictionary(byte[] buffer, int offset, int length)
{
if (DeflaterConstants.DEBUGGING && strstart != 1) {
throw new InvalidOperationException("strstart not 1");
}
adler.Update(buffer, offset, length);
if (length < MIN_MATCH) {
return;
}
if (length > MAX_DIST) {
offset += length - MAX_DIST;
length = MAX_DIST;
}
System.Array.Copy(buffer, offset, window, strstart, length);
UpdateHash();
--length;
while (--length > 0) {
InsertString();
strstart++;
}
strstart += 2;
blockStart = strstart;
}
bool DeflateStored(bool flush, bool finish)
{
if (!flush && lookahead == 0) {
return false;
}
strstart += lookahead;
lookahead = 0;
int storedLen = strstart - blockStart;
if ((storedLen >= DeflaterConstants.MAX_BLOCK_SIZE) || /* Block is full */
(blockStart < WSIZE && storedLen >= MAX_DIST) || /* Block may move out of window */
flush) {
bool lastBlock = finish;
if (storedLen > DeflaterConstants.MAX_BLOCK_SIZE) {
storedLen = DeflaterConstants.MAX_BLOCK_SIZE;
lastBlock = false;
}
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("storedBlock["+storedLen+","+lastBlock+"]");
// }
huffman.FlushStoredBlock(window, blockStart, storedLen, lastBlock);
blockStart += storedLen;
return !lastBlock;
}
return true;
}
private bool DeflateFast(bool flush, bool finish)
{
if (lookahead < MIN_LOOKAHEAD && !flush) {
return false;
}
while (lookahead >= MIN_LOOKAHEAD || flush) {
if (lookahead == 0) {
/* We are flushing everything */
huffman.FlushBlock(window, blockStart, strstart - blockStart, finish);
blockStart = strstart;
return false;
}
if (strstart > 2 * WSIZE - MIN_LOOKAHEAD) {
/* slide window, as findLongestMatch need this.
* This should only happen when flushing and the window
* is almost full.
*/
SlideWindow();
}
int hashHead;
if (lookahead >= MIN_MATCH &&
(hashHead = InsertString()) != 0 &&
strategy != DeflateStrategy.HuffmanOnly &&
strstart - hashHead <= MAX_DIST &&
FindLongestMatch(hashHead)) {
/* longestMatch sets matchStart and matchLen */
// if (DeflaterConstants.DEBUGGING) {
// for (int i = 0 ; i < matchLen; i++) {
// if (window[strstart+i] != window[matchStart + i]) {
// throw new Exception();
// }
// }
// }
// -jr- Hak hak hak this stops problems with fast/low compression and index out of range
if (huffman.TallyDist(strstart - matchStart, matchLen)) {
bool lastBlock = finish && lookahead == 0;
huffman.FlushBlock(window, blockStart, strstart - blockStart, lastBlock);
blockStart = strstart;
}
lookahead -= matchLen;
if (matchLen <= max_lazy && lookahead >= MIN_MATCH) {
while (--matchLen > 0) {
++strstart;
InsertString();
}
++strstart;
} else {
strstart += matchLen;
if (lookahead >= MIN_MATCH - 1) {
UpdateHash();
}
}
matchLen = MIN_MATCH - 1;
continue;
} else {
/* No match found */
huffman.TallyLit(window[strstart] & 0xff);
++strstart;
--lookahead;
}
if (huffman.IsFull()) {
bool lastBlock = finish && lookahead == 0;
huffman.FlushBlock(window, blockStart, strstart - blockStart, lastBlock);
blockStart = strstart;
return !lastBlock;
}
}
return true;
}
bool DeflateSlow(bool flush, bool finish)
{
if (lookahead < MIN_LOOKAHEAD && !flush) {
return false;
}
while (lookahead >= MIN_LOOKAHEAD || flush) {
if (lookahead == 0) {
if (prevAvailable) {
huffman.TallyLit(window[strstart-1] & 0xff);
}
prevAvailable = false;
/* We are flushing everything */
if (DeflaterConstants.DEBUGGING && !flush) {
throw new Exception("Not flushing, but no lookahead");
}
huffman.FlushBlock(window, blockStart, strstart - blockStart,
finish);
blockStart = strstart;
return false;
}
if (strstart >= 2 * WSIZE - MIN_LOOKAHEAD) {
/* slide window, as findLongestMatch need this.
* This should only happen when flushing and the window
* is almost full.
*/
SlideWindow();
}
int prevMatch = matchStart;
int prevLen = matchLen;
if (lookahead >= MIN_MATCH) {
int hashHead = InsertString();
if (strategy != DeflateStrategy.HuffmanOnly && hashHead != 0 && strstart - hashHead <= MAX_DIST && FindLongestMatch(hashHead)) {
/* longestMatch sets matchStart and matchLen */
/* Discard match if too small and too far away */
if (matchLen <= 5 && (strategy == DeflateStrategy.Filtered || (matchLen == MIN_MATCH && strstart - matchStart > TOO_FAR))) {
matchLen = MIN_MATCH - 1;
}
}
}
/* previous match was better */
if (prevLen >= MIN_MATCH && matchLen <= prevLen) {
// if (DeflaterConstants.DEBUGGING) {
// for (int i = 0 ; i < matchLen; i++) {
// if (window[strstart-1+i] != window[prevMatch + i])
// throw new Exception();
// }
// }
huffman.TallyDist(strstart - 1 - prevMatch, prevLen);
prevLen -= 2;
do {
strstart++;
lookahead--;
if (lookahead >= MIN_MATCH) {
InsertString();
}
} while (--prevLen > 0);
strstart ++;
lookahead--;
prevAvailable = false;
matchLen = MIN_MATCH - 1;
} else {
if (prevAvailable) {
huffman.TallyLit(window[strstart-1] & 0xff);
}
prevAvailable = true;
strstart++;
lookahead--;
}
if (huffman.IsFull()) {
int len = strstart - blockStart;
if (prevAvailable) {
len--;
}
bool lastBlock = (finish && lookahead == 0 && !prevAvailable);
huffman.FlushBlock(window, blockStart, len, lastBlock);
blockStart += len;
return !lastBlock;
}
}
return true;
}
public bool Deflate(bool flush, bool finish)
{
bool progress;
do {
FillWindow();
bool canFlush = flush && inputOff == inputEnd;
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("window: ["+blockStart+","+strstart+","
// +lookahead+"], "+comprFunc+","+canFlush);
// }
switch (comprFunc) {
case DEFLATE_STORED:
progress = DeflateStored(canFlush, finish);
break;
case DEFLATE_FAST:
progress = DeflateFast(canFlush, finish);
break;
case DEFLATE_SLOW:
progress = DeflateSlow(canFlush, finish);
break;
default:
throw new InvalidOperationException("unknown comprFunc");
}
} while (pending.IsFlushed && progress); /* repeat while we have no pending output and progress was made */
return progress;
}
public void SetInput(byte[] buf, int off, int len)
{
if (inputOff < inputEnd) {
throw new InvalidOperationException("Old input was not completely processed");
}
int end = off + len;
/* We want to throw an ArrayIndexOutOfBoundsException early. The
* check is very tricky: it also handles integer wrap around.
*/
if (0 > off || off > end || end > buf.Length) {
throw new ArgumentOutOfRangeException();
}
inputBuf = buf;
inputOff = off;
inputEnd = end;
}
public bool NeedsInput()
{
return inputEnd == inputOff;
}
}
}

View File

@@ -0,0 +1,780 @@
// DeflaterHuffman.cs
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
using System;
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
/// <summary>
/// This is the DeflaterHuffman class.
///
/// This class is <i>not</i> thread safe. This is inherent in the API, due
/// to the split of deflate and setInput.
///
/// author of the original java version : Jochen Hoenicke
/// </summary>
public class DeflaterHuffman
{
private static int BUFSIZE = 1 << (DeflaterConstants.DEFAULT_MEM_LEVEL + 6);
private static int LITERAL_NUM = 286;
private static int DIST_NUM = 30;
private static int BITLEN_NUM = 19;
private static int REP_3_6 = 16;
private static int REP_3_10 = 17;
private static int REP_11_138 = 18;
private static int EOF_SYMBOL = 256;
private static int[] BL_ORDER = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 };
private static byte[] bit4Reverse = {
0,
8,
4,
12,
2,
10,
6,
14,
1,
9,
5,
13,
3,
11,
7,
15
};
public class Tree
{
public short[] freqs;
public byte[] length;
public int minNumCodes, numCodes;
short[] codes;
int[] bl_counts;
int maxLength;
DeflaterHuffman dh;
public Tree(DeflaterHuffman dh, int elems, int minCodes, int maxLength)
{
this.dh = dh;
this.minNumCodes = minCodes;
this.maxLength = maxLength;
freqs = new short[elems];
bl_counts = new int[maxLength];
}
public void Reset()
{
for (int i = 0; i < freqs.Length; i++) {
freqs[i] = 0;
}
codes = null;
length = null;
}
public void WriteSymbol(int code)
{
// if (DeflaterConstants.DEBUGGING) {
// freqs[code]--;
// // Console.Write("writeSymbol("+freqs.length+","+code+"): ");
// }
dh.pending.WriteBits(codes[code] & 0xffff, length[code]);
}
public void CheckEmpty()
{
bool empty = true;
for (int i = 0; i < freqs.Length; i++) {
if (freqs[i] != 0) {
//Console.WriteLine("freqs["+i+"] == "+freqs[i]);
empty = false;
}
}
if (!empty) {
throw new Exception();
}
//Console.WriteLine("checkEmpty suceeded!");
}
public void SetStaticCodes(short[] stCodes, byte[] stLength)
{
codes = stCodes;
length = stLength;
}
public void BuildCodes()
{
int numSymbols = freqs.Length;
int[] nextCode = new int[maxLength];
int code = 0;
codes = new short[freqs.Length];
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("buildCodes: "+freqs.Length);
// }
for (int bits = 0; bits < maxLength; bits++) {
nextCode[bits] = code;
code += bl_counts[bits] << (15 - bits);
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("bits: "+(bits+1)+" count: "+bl_counts[bits]
// +" nextCode: "+code); // HACK : Integer.toHexString(
// }
}
if (DeflaterConstants.DEBUGGING && code != 65536) {
throw new Exception("Inconsistent bl_counts!");
}
for (int i=0; i < numCodes; i++) {
int bits = length[i];
if (bits > 0) {
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("codes["+i+"] = rev(" + nextCode[bits-1]+")," // HACK : Integer.toHexString(
// +bits);
// }
codes[i] = BitReverse(nextCode[bits-1]);
nextCode[bits-1] += 1 << (16 - bits);
}
}
}
void BuildLength(int[] childs)
{
this.length = new byte [freqs.Length];
int numNodes = childs.Length / 2;
int numLeafs = (numNodes + 1) / 2;
int overflow = 0;
for (int i = 0; i < maxLength; i++) {
bl_counts[i] = 0;
}
/* First calculate optimal bit lengths */
int[] lengths = new int[numNodes];
lengths[numNodes-1] = 0;
for (int i = numNodes - 1; i >= 0; i--) {
if (childs[2*i+1] != -1) {
int bitLength = lengths[i] + 1;
if (bitLength > maxLength) {
bitLength = maxLength;
overflow++;
}
lengths[childs[2*i]] = lengths[childs[2*i+1]] = bitLength;
} else {
/* A leaf node */
int bitLength = lengths[i];
bl_counts[bitLength - 1]++;
this.length[childs[2*i]] = (byte) lengths[i];
}
}
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("Tree "+freqs.Length+" lengths:");
// for (int i=0; i < numLeafs; i++) {
// //Console.WriteLine("Node "+childs[2*i]+" freq: "+freqs[childs[2*i]]
// + " len: "+length[childs[2*i]]);
// }
// }
if (overflow == 0) {
return;
}
int incrBitLen = maxLength - 1;
do {
/* Find the first bit length which could increase: */
while (bl_counts[--incrBitLen] == 0)
;
/* Move this node one down and remove a corresponding
* amount of overflow nodes.
*/
do {
bl_counts[incrBitLen]--;
bl_counts[++incrBitLen]++;
overflow -= 1 << (maxLength - 1 - incrBitLen);
} while (overflow > 0 && incrBitLen < maxLength - 1);
} while (overflow > 0);
/* We may have overshot above. Move some nodes from maxLength to
* maxLength-1 in that case.
*/
bl_counts[maxLength-1] += overflow;
bl_counts[maxLength-2] -= overflow;
/* Now recompute all bit lengths, scanning in increasing
* frequency. It is simpler to reconstruct all lengths instead of
* fixing only the wrong ones. This idea is taken from 'ar'
* written by Haruhiko Okumura.
*
* The nodes were inserted with decreasing frequency into the childs
* array.
*/
int nodePtr = 2 * numLeafs;
for (int bits = maxLength; bits != 0; bits--) {
int n = bl_counts[bits-1];
while (n > 0) {
int childPtr = 2*childs[nodePtr++];
if (childs[childPtr + 1] == -1) {
/* We found another leaf */
length[childs[childPtr]] = (byte) bits;
n--;
}
}
}
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("*** After overflow elimination. ***");
// for (int i=0; i < numLeafs; i++) {
// //Console.WriteLine("Node "+childs[2*i]+" freq: "+freqs[childs[2*i]]
// + " len: "+length[childs[2*i]]);
// }
// }
}
public void BuildTree()
{
int numSymbols = freqs.Length;
/* heap is a priority queue, sorted by frequency, least frequent
* nodes first. The heap is a binary tree, with the property, that
* the parent node is smaller than both child nodes. This assures
* that the smallest node is the first parent.
*
* The binary tree is encoded in an array: 0 is root node and
* the nodes 2*n+1, 2*n+2 are the child nodes of node n.
*/
int[] heap = new int[numSymbols];
int heapLen = 0;
int maxCode = 0;
for (int n = 0; n < numSymbols; n++) {
int freq = freqs[n];
if (freq != 0) {
/* Insert n into heap */
int pos = heapLen++;
int ppos;
while (pos > 0 && freqs[heap[ppos = (pos - 1) / 2]] > freq) {
heap[pos] = heap[ppos];
pos = ppos;
}
heap[pos] = n;
maxCode = n;
}
}
/* We could encode a single literal with 0 bits but then we
* don't see the literals. Therefore we force at least two
* literals to avoid this case. We don't care about order in
* this case, both literals get a 1 bit code.
*/
while (heapLen < 2) {
int node = maxCode < 2 ? ++maxCode : 0;
heap[heapLen++] = node;
}
numCodes = Math.Max(maxCode + 1, minNumCodes);
int numLeafs = heapLen;
int[] childs = new int[4*heapLen - 2];
int[] values = new int[2*heapLen - 1];
int numNodes = numLeafs;
for (int i = 0; i < heapLen; i++) {
int node = heap[i];
childs[2*i] = node;
childs[2*i+1] = -1;
values[i] = freqs[node] << 8;
heap[i] = i;
}
/* Construct the Huffman tree by repeatedly combining the least two
* frequent nodes.
*/
do {
int first = heap[0];
int last = heap[--heapLen];
/* Propagate the hole to the leafs of the heap */
int ppos = 0;
int path = 1;
while (path < heapLen) {
if (path + 1 < heapLen && values[heap[path]] > values[heap[path+1]]) {
path++;
}
heap[ppos] = heap[path];
ppos = path;
path = path * 2 + 1;
}
/* Now propagate the last element down along path. Normally
* it shouldn't go too deep.
*/
int lastVal = values[last];
while ((path = ppos) > 0 && values[heap[ppos = (path - 1)/2]] > lastVal) {
heap[path] = heap[ppos];
}
heap[path] = last;
int second = heap[0];
/* Create a new node father of first and second */
last = numNodes++;
childs[2*last] = first;
childs[2*last+1] = second;
int mindepth = Math.Min(values[first] & 0xff, values[second] & 0xff);
values[last] = lastVal = values[first] + values[second] - mindepth + 1;
/* Again, propagate the hole to the leafs */
ppos = 0;
path = 1;
while (path < heapLen) {
if (path + 1 < heapLen && values[heap[path]] > values[heap[path+1]]) {
path++;
}
heap[ppos] = heap[path];
ppos = path;
path = ppos * 2 + 1;
}
/* Now propagate the new element down along path */
while ((path = ppos) > 0 && values[heap[ppos = (path - 1)/2]] > lastVal) {
heap[path] = heap[ppos];
}
heap[path] = last;
} while (heapLen > 1);
if (heap[0] != childs.Length / 2 - 1) {
throw new Exception("Weird!");
}
BuildLength(childs);
}
public int GetEncodedLength()
{
int len = 0;
for (int i = 0; i < freqs.Length; i++) {
len += freqs[i] * length[i];
}
return len;
}
public void CalcBLFreq(Tree blTree)
{
int max_count; /* max repeat count */
int min_count; /* min repeat count */
int count; /* repeat count of the current code */
int curlen = -1; /* length of current code */
int i = 0;
while (i < numCodes) {
count = 1;
int nextlen = length[i];
if (nextlen == 0) {
max_count = 138;
min_count = 3;
} else {
max_count = 6;
min_count = 3;
if (curlen != nextlen) {
blTree.freqs[nextlen]++;
count = 0;
}
}
curlen = nextlen;
i++;
while (i < numCodes && curlen == length[i]) {
i++;
if (++count >= max_count) {
break;
}
}
if (count < min_count) {
blTree.freqs[curlen] += (short)count;
} else if (curlen != 0) {
blTree.freqs[REP_3_6]++;
} else if (count <= 10) {
blTree.freqs[REP_3_10]++;
} else {
blTree.freqs[REP_11_138]++;
}
}
}
public void WriteTree(Tree blTree)
{
int max_count; /* max repeat count */
int min_count; /* min repeat count */
int count; /* repeat count of the current code */
int curlen = -1; /* length of current code */
int i = 0;
while (i < numCodes) {
count = 1;
int nextlen = length[i];
if (nextlen == 0) {
max_count = 138;
min_count = 3;
} else {
max_count = 6;
min_count = 3;
if (curlen != nextlen) {
blTree.WriteSymbol(nextlen);
count = 0;
}
}
curlen = nextlen;
i++;
while (i < numCodes && curlen == length[i]) {
i++;
if (++count >= max_count) {
break;
}
}
if (count < min_count) {
while (count-- > 0) {
blTree.WriteSymbol(curlen);
}
} else if (curlen != 0) {
blTree.WriteSymbol(REP_3_6);
dh.pending.WriteBits(count - 3, 2);
} else if (count <= 10) {
blTree.WriteSymbol(REP_3_10);
dh.pending.WriteBits(count - 3, 3);
} else {
blTree.WriteSymbol(REP_11_138);
dh.pending.WriteBits(count - 11, 7);
}
}
}
}
public DeflaterPending pending;
private Tree literalTree, distTree, blTree;
private short[] d_buf;
private byte[] l_buf;
private int last_lit;
private int extra_bits;
private static short[] staticLCodes;
private static byte[] staticLLength;
private static short[] staticDCodes;
private static byte[] staticDLength;
/// <summary>
/// Reverse the bits of a 16 bit value.
/// </summary>
public static short BitReverse(int value)
{
return (short) (bit4Reverse[value & 0xF] << 12 |
bit4Reverse[(value >> 4) & 0xF] << 8 |
bit4Reverse[(value >> 8) & 0xF] << 4 |
bit4Reverse[value >> 12]);
}
static DeflaterHuffman()
{
/* See RFC 1951 3.2.6 */
/* Literal codes */
staticLCodes = new short[LITERAL_NUM];
staticLLength = new byte[LITERAL_NUM];
int i = 0;
while (i < 144) {
staticLCodes[i] = BitReverse((0x030 + i) << 8);
staticLLength[i++] = 8;
}
while (i < 256) {
staticLCodes[i] = BitReverse((0x190 - 144 + i) << 7);
staticLLength[i++] = 9;
}
while (i < 280) {
staticLCodes[i] = BitReverse((0x000 - 256 + i) << 9);
staticLLength[i++] = 7;
}
while (i < LITERAL_NUM) {
staticLCodes[i] = BitReverse((0x0c0 - 280 + i) << 8);
staticLLength[i++] = 8;
}
/* Distant codes */
staticDCodes = new short[DIST_NUM];
staticDLength = new byte[DIST_NUM];
for (i = 0; i < DIST_NUM; i++) {
staticDCodes[i] = BitReverse(i << 11);
staticDLength[i] = 5;
}
}
public DeflaterHuffman(DeflaterPending pending)
{
this.pending = pending;
literalTree = new Tree(this, LITERAL_NUM, 257, 15);
distTree = new Tree(this, DIST_NUM, 1, 15);
blTree = new Tree(this, BITLEN_NUM, 4, 7);
d_buf = new short[BUFSIZE];
l_buf = new byte [BUFSIZE];
}
public void Reset()
{
last_lit = 0;
extra_bits = 0;
literalTree.Reset();
distTree.Reset();
blTree.Reset();
}
int Lcode(int len)
{
if (len == 255) {
return 285;
}
int code = 257;
while (len >= 8) {
code += 4;
len >>= 1;
}
return code + len;
}
int Dcode(int distance)
{
int code = 0;
while (distance >= 4) {
code += 2;
distance >>= 1;
}
return code + distance;
}
public void SendAllTrees(int blTreeCodes)
{
blTree.BuildCodes();
literalTree.BuildCodes();
distTree.BuildCodes();
pending.WriteBits(literalTree.numCodes - 257, 5);
pending.WriteBits(distTree.numCodes - 1, 5);
pending.WriteBits(blTreeCodes - 4, 4);
for (int rank = 0; rank < blTreeCodes; rank++) {
pending.WriteBits(blTree.length[BL_ORDER[rank]], 3);
}
literalTree.WriteTree(blTree);
distTree.WriteTree(blTree);
// if (DeflaterConstants.DEBUGGING) {
// blTree.CheckEmpty();
// }
}
public void CompressBlock()
{
for (int i = 0; i < last_lit; i++) {
int litlen = l_buf[i] & 0xff;
int dist = d_buf[i];
if (dist-- != 0) {
// if (DeflaterConstants.DEBUGGING) {
// Console.Write("["+(dist+1)+","+(litlen+3)+"]: ");
// }
int lc = Lcode(litlen);
literalTree.WriteSymbol(lc);
int bits = (lc - 261) / 4;
if (bits > 0 && bits <= 5) {
pending.WriteBits(litlen & ((1 << bits) - 1), bits);
}
int dc = Dcode(dist);
distTree.WriteSymbol(dc);
bits = dc / 2 - 1;
if (bits > 0) {
pending.WriteBits(dist & ((1 << bits) - 1), bits);
}
} else {
// if (DeflaterConstants.DEBUGGING) {
// if (litlen > 32 && litlen < 127) {
// Console.Write("("+(char)litlen+"): ");
// } else {
// Console.Write("{"+litlen+"}: ");
// }
// }
literalTree.WriteSymbol(litlen);
}
}
// if (DeflaterConstants.DEBUGGING) {
// Console.Write("EOF: ");
// }
literalTree.WriteSymbol(EOF_SYMBOL);
// if (DeflaterConstants.DEBUGGING) {
// literalTree.CheckEmpty();
// distTree.CheckEmpty();
// }
}
public void FlushStoredBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock)
{
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("Flushing stored block "+ storedLength);
// }
pending.WriteBits((DeflaterConstants.STORED_BLOCK << 1) + (lastBlock ? 1 : 0), 3);
pending.AlignToByte();
pending.WriteShort(storedLength);
pending.WriteShort(~storedLength);
pending.WriteBlock(stored, storedOffset, storedLength);
Reset();
}
public void FlushBlock(byte[] stored, int storedOffset, int storedLength, bool lastBlock)
{
literalTree.freqs[EOF_SYMBOL]++;
/* Build trees */
literalTree.BuildTree();
distTree.BuildTree();
/* Calculate bitlen frequency */
literalTree.CalcBLFreq(blTree);
distTree.CalcBLFreq(blTree);
/* Build bitlen tree */
blTree.BuildTree();
int blTreeCodes = 4;
for (int i = 18; i > blTreeCodes; i--) {
if (blTree.length[BL_ORDER[i]] > 0) {
blTreeCodes = i+1;
}
}
int opt_len = 14 + blTreeCodes * 3 + blTree.GetEncodedLength() +
literalTree.GetEncodedLength() + distTree.GetEncodedLength() +
extra_bits;
int static_len = extra_bits;
for (int i = 0; i < LITERAL_NUM; i++) {
static_len += literalTree.freqs[i] * staticLLength[i];
}
for (int i = 0; i < DIST_NUM; i++) {
static_len += distTree.freqs[i] * staticDLength[i];
}
if (opt_len >= static_len) {
/* Force static trees */
opt_len = static_len;
}
if (storedOffset >= 0 && storedLength+4 < opt_len >> 3) {
/* Store Block */
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("Storing, since " + storedLength + " < " + opt_len
// + " <= " + static_len);
// }
FlushStoredBlock(stored, storedOffset, storedLength, lastBlock);
} else if (opt_len == static_len) {
/* Encode with static tree */
pending.WriteBits((DeflaterConstants.STATIC_TREES << 1) + (lastBlock ? 1 : 0), 3);
literalTree.SetStaticCodes(staticLCodes, staticLLength);
distTree.SetStaticCodes(staticDCodes, staticDLength);
CompressBlock();
Reset();
} else {
/* Encode with dynamic tree */
pending.WriteBits((DeflaterConstants.DYN_TREES << 1) + (lastBlock ? 1 : 0), 3);
SendAllTrees(blTreeCodes);
CompressBlock();
Reset();
}
}
public bool IsFull()
{
// return last_lit + 16 >= BUFSIZE; // HACK: This was == 'last_lit == BUFSIZE', but errors occured with DeflateFast
return last_lit >= BUFSIZE; // -jr- This is the correct form!
}
public bool TallyLit(int lit)
{
// if (DeflaterConstants.DEBUGGING) {
// if (lit > 32 && lit < 127) {
// //Console.WriteLine("("+(char)lit+")");
// } else {
// //Console.WriteLine("{"+lit+"}");
// }
// }
d_buf[last_lit] = 0;
l_buf[last_lit++] = (byte)lit;
literalTree.freqs[lit]++;
return IsFull();
}
public bool TallyDist(int dist, int len)
{
// if (DeflaterConstants.DEBUGGING) {
// //Console.WriteLine("["+dist+","+len+"]");
// }
d_buf[last_lit] = (short)dist;
l_buf[last_lit++] = (byte)(len - 3);
int lc = Lcode(len - 3);
literalTree.freqs[lc]++;
if (lc >= 265 && lc < 285) {
extra_bits += (lc - 261) / 4;
}
int dc = Dcode(dist - 1);
distTree.freqs[dc]++;
if (dc >= 4) {
extra_bits += dc / 2 - 1;
}
return IsFull();
}
}
}

View File

@@ -0,0 +1,52 @@
// DeflaterPending.cs
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
/// <summary>
/// This class stores the pending output of the Deflater.
///
/// author of the original java version : Jochen Hoenicke
/// </summary>
public class DeflaterPending : PendingBuffer
{
public DeflaterPending() : base(DeflaterConstants.PENDING_BUF_SIZE)
{
}
}
}

View File

@@ -0,0 +1,782 @@
// Inflater.cs
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
using System;
using ICSharpCode.SharpZipLib.Checksums;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
/// <summary>
/// Inflater is used to decompress data that has been compressed according
/// to the "deflate" standard described in rfc1950.
///
/// The usage is as following. First you have to set some input with
/// <code>setInput()</code>, then inflate() it. If inflate doesn't
/// inflate any bytes there may be three reasons:
/// <ul>
/// <li>needsInput() returns true because the input buffer is empty.
/// You have to provide more input with <code>setInput()</code>.
/// NOTE: needsInput() also returns true when, the stream is finished.
/// </li>
/// <li>needsDictionary() returns true, you have to provide a preset
/// dictionary with <code>setDictionary()</code>.</li>
/// <li>finished() returns true, the inflater has finished.</li>
/// </ul>
/// Once the first output byte is produced, a dictionary will not be
/// needed at a later stage.
///
/// author of the original java version : John Leuner, Jochen Hoenicke
/// </summary>
public class Inflater
{
/// <summary>
/// Copy lengths for literal codes 257..285
/// </summary>
private static int[] CPLENS = {
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258
};
/// <summary>
/// Extra bits for literal codes 257..285
/// </summary>
private static int[] CPLEXT = {
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0
};
/// <summary>
/// Copy offsets for distance codes 0..29
/// </summary>
private static int[] CPDIST = {
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
8193, 12289, 16385, 24577
};
/// <summary>
/// Extra bits for distance codes
/// </summary>
private static int[] CPDEXT = {
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
12, 12, 13, 13
};
/// <summary>
/// This are the state in which the inflater can be.
/// </summary>
private const int DECODE_HEADER = 0;
private const int DECODE_DICT = 1;
private const int DECODE_BLOCKS = 2;
private const int DECODE_STORED_LEN1 = 3;
private const int DECODE_STORED_LEN2 = 4;
private const int DECODE_STORED = 5;
private const int DECODE_DYN_HEADER = 6;
private const int DECODE_HUFFMAN = 7;
private const int DECODE_HUFFMAN_LENBITS = 8;
private const int DECODE_HUFFMAN_DIST = 9;
private const int DECODE_HUFFMAN_DISTBITS = 10;
private const int DECODE_CHKSUM = 11;
private const int FINISHED = 12;
/// <summary>
/// This variable contains the current state.
/// </summary>
private int mode;
/// <summary>
/// The adler checksum of the dictionary or of the decompressed
/// stream, as it is written in the header resp. footer of the
/// compressed stream.
/// Only valid if mode is DECODE_DICT or DECODE_CHKSUM.
/// </summary>
private int readAdler;
/// <summary>
/// The number of bits needed to complete the current state. This
/// is valid, if mode is DECODE_DICT, DECODE_CHKSUM,
/// DECODE_HUFFMAN_LENBITS or DECODE_HUFFMAN_DISTBITS.
/// </summary>
private int neededBits;
private int repLength, repDist;
private int uncomprLen;
/// <summary>
/// True, if the last block flag was set in the last block of the
/// inflated stream. This means that the stream ends after the
/// current block.
/// </summary>
private bool isLastBlock;
/// <summary>
/// The total number of inflated bytes.
/// </summary>
private int totalOut;
/// <summary>
/// The total number of bytes set with setInput(). This is not the
/// value returned by getTotalIn(), since this also includes the
/// unprocessed input.
/// </summary>
private int totalIn;
/// <summary>
/// This variable stores the nowrap flag that was given to the constructor.
/// True means, that the inflated stream doesn't contain a header nor the
/// checksum in the footer.
/// </summary>
private bool nowrap;
private StreamManipulator input;
private OutputWindow outputWindow;
private InflaterDynHeader dynHeader;
private InflaterHuffmanTree litlenTree, distTree;
private Adler32 adler;
/// <summary>
/// Creates a new inflater.
/// </summary>
public Inflater() : this(false)
{
}
/// <summary>
/// Creates a new inflater.
/// </summary>
/// <param name="nowrap">
/// true if no header and checksum field appears in the
/// stream. This is used for GZIPed input. For compatibility with
/// Sun JDK you should provide one byte of input more than needed in
/// this case.
/// </param>
public Inflater(bool nowrap)
{
this.nowrap = nowrap;
this.adler = new Adler32();
input = new StreamManipulator();
outputWindow = new OutputWindow();
mode = nowrap ? DECODE_BLOCKS : DECODE_HEADER;
}
/// <summary>
/// Resets the inflater so that a new stream can be decompressed. All
/// pending input and output will be discarded.
/// </summary>
public void Reset()
{
mode = nowrap ? DECODE_BLOCKS : DECODE_HEADER;
totalIn = totalOut = 0;
input.Reset();
outputWindow.Reset();
dynHeader = null;
litlenTree = null;
distTree = null;
isLastBlock = false;
adler.Reset();
}
/// <summary>
/// Decodes the deflate header.
/// </summary>
/// <returns>
/// false if more input is needed.
/// </returns>
/// <exception cref="System.FormatException">
/// if header is invalid.
/// </exception>
private bool DecodeHeader()
{
int header = input.PeekBits(16);
if (header < 0) {
return false;
}
input.DropBits(16);
/* The header is written in "wrong" byte order */
header = ((header << 8) | (header >> 8)) & 0xffff;
if (header % 31 != 0) {
throw new FormatException("Header checksum illegal");
}
if ((header & 0x0f00) != (Deflater.DEFLATED << 8)) {
throw new FormatException("Compression Method unknown");
}
/* Maximum size of the backwards window in bits.
* We currently ignore this, but we could use it to make the
* inflater window more space efficient. On the other hand the
* full window (15 bits) is needed most times, anyway.
int max_wbits = ((header & 0x7000) >> 12) + 8;
*/
if ((header & 0x0020) == 0) { // Dictionary flag?
mode = DECODE_BLOCKS;
} else {
mode = DECODE_DICT;
neededBits = 32;
}
return true;
}
/// <summary>
/// Decodes the dictionary checksum after the deflate header.
/// </summary>
/// <returns>
/// false if more input is needed.
/// </returns>
private bool DecodeDict()
{
while (neededBits > 0) {
int dictByte = input.PeekBits(8);
if (dictByte < 0) {
return false;
}
input.DropBits(8);
readAdler = (readAdler << 8) | dictByte;
neededBits -= 8;
}
return false;
}
/// <summary>
/// Decodes the huffman encoded symbols in the input stream.
/// </summary>
/// <returns>
/// false if more input is needed, true if output window is
/// full or the current block ends.
/// </returns>
/// <exception cref="System.FormatException">
/// if deflated stream is invalid.
/// </exception>
private bool DecodeHuffman()
{
int free = outputWindow.GetFreeSpace();
while (free >= 258) {
int symbol;
switch (mode) {
case DECODE_HUFFMAN:
/* This is the inner loop so it is optimized a bit */
while (((symbol = litlenTree.GetSymbol(input)) & ~0xff) == 0) {
outputWindow.Write(symbol);
if (--free < 258) {
return true;
}
}
if (symbol < 257) {
if (symbol < 0) {
return false;
} else {
/* symbol == 256: end of block */
distTree = null;
litlenTree = null;
mode = DECODE_BLOCKS;
return true;
}
}
try {
repLength = CPLENS[symbol - 257];
neededBits = CPLEXT[symbol - 257];
} catch (Exception) {
throw new FormatException("Illegal rep length code");
}
goto case DECODE_HUFFMAN_LENBITS;/* fall through */
case DECODE_HUFFMAN_LENBITS:
if (neededBits > 0) {
mode = DECODE_HUFFMAN_LENBITS;
int i = input.PeekBits(neededBits);
if (i < 0) {
return false;
}
input.DropBits(neededBits);
repLength += i;
}
mode = DECODE_HUFFMAN_DIST;
goto case DECODE_HUFFMAN_DIST;/* fall through */
case DECODE_HUFFMAN_DIST:
symbol = distTree.GetSymbol(input);
if (symbol < 0) {
return false;
}
try {
repDist = CPDIST[symbol];
neededBits = CPDEXT[symbol];
} catch (Exception) {
throw new FormatException("Illegal rep dist code");
}
goto case DECODE_HUFFMAN_DISTBITS;/* fall through */
case DECODE_HUFFMAN_DISTBITS:
if (neededBits > 0) {
mode = DECODE_HUFFMAN_DISTBITS;
int i = input.PeekBits(neededBits);
if (i < 0) {
return false;
}
input.DropBits(neededBits);
repDist += i;
}
outputWindow.Repeat(repLength, repDist);
free -= repLength;
mode = DECODE_HUFFMAN;
break;
default:
throw new FormatException();
}
}
return true;
}
/// <summary>
/// Decodes the adler checksum after the deflate stream.
/// </summary>
/// <returns>
/// false if more input is needed.
/// </returns>
/// <exception cref="System.FormatException">
/// DataFormatException, if checksum doesn't match.
/// </exception>
private bool DecodeChksum()
{
while (neededBits > 0) {
int chkByte = input.PeekBits(8);
if (chkByte < 0) {
return false;
}
input.DropBits(8);
readAdler = (readAdler << 8) | chkByte;
neededBits -= 8;
}
if ((int) adler.Value != readAdler) {
throw new FormatException("Adler chksum doesn't match: " + (int)adler.Value + " vs. " + readAdler);
}
mode = FINISHED;
return false;
}
/// <summary>
/// Decodes the deflated stream.
/// </summary>
/// <returns>
/// false if more input is needed, or if finished.
/// </returns>
/// <exception cref="System.FormatException">
/// DataFormatException, if deflated stream is invalid.
/// </exception>
private bool Decode()
{
switch (mode) {
case DECODE_HEADER:
return DecodeHeader();
case DECODE_DICT:
return DecodeDict();
case DECODE_CHKSUM:
return DecodeChksum();
case DECODE_BLOCKS:
if (isLastBlock) {
if (nowrap) {
mode = FINISHED;
return false;
} else {
input.SkipToByteBoundary();
neededBits = 32;
mode = DECODE_CHKSUM;
return true;
}
}
int type = input.PeekBits(3);
if (type < 0) {
return false;
}
input.DropBits(3);
if ((type & 1) != 0) {
isLastBlock = true;
}
switch (type >> 1){
case DeflaterConstants.STORED_BLOCK:
input.SkipToByteBoundary();
mode = DECODE_STORED_LEN1;
break;
case DeflaterConstants.STATIC_TREES:
litlenTree = InflaterHuffmanTree.defLitLenTree;
distTree = InflaterHuffmanTree.defDistTree;
mode = DECODE_HUFFMAN;
break;
case DeflaterConstants.DYN_TREES:
dynHeader = new InflaterDynHeader();
mode = DECODE_DYN_HEADER;
break;
default:
throw new FormatException("Unknown block type "+type);
}
return true;
case DECODE_STORED_LEN1:
{
if ((uncomprLen = input.PeekBits(16)) < 0) {
return false;
}
input.DropBits(16);
mode = DECODE_STORED_LEN2;
}
goto case DECODE_STORED_LEN2; /* fall through */
case DECODE_STORED_LEN2:
{
int nlen = input.PeekBits(16);
if (nlen < 0) {
return false;
}
input.DropBits(16);
if (nlen != (uncomprLen ^ 0xffff)) {
throw new FormatException("broken uncompressed block");
}
mode = DECODE_STORED;
}
goto case DECODE_STORED;/* fall through */
case DECODE_STORED:
{
int more = outputWindow.CopyStored(input, uncomprLen);
uncomprLen -= more;
if (uncomprLen == 0) {
mode = DECODE_BLOCKS;
return true;
}
return !input.IsNeedingInput;
}
case DECODE_DYN_HEADER:
if (!dynHeader.Decode(input)) {
return false;
}
litlenTree = dynHeader.BuildLitLenTree();
distTree = dynHeader.BuildDistTree();
mode = DECODE_HUFFMAN;
goto case DECODE_HUFFMAN; /* fall through */
case DECODE_HUFFMAN:
case DECODE_HUFFMAN_LENBITS:
case DECODE_HUFFMAN_DIST:
case DECODE_HUFFMAN_DISTBITS:
return DecodeHuffman();
case FINISHED:
return false;
default:
throw new FormatException();
}
}
/// <summary>
/// Sets the preset dictionary. This should only be called, if
/// needsDictionary() returns true and it should set the same
/// dictionary, that was used for deflating. The getAdler()
/// function returns the checksum of the dictionary needed.
/// </summary>
/// <param name="buffer">
/// the dictionary.
/// </param>
/// <exception cref="System.InvalidOperationException">
/// if no dictionary is needed.
/// </exception>
/// <exception cref="System.ArgumentException">
/// if the dictionary checksum is wrong.
/// </exception>
public void SetDictionary(byte[] buffer)
{
SetDictionary(buffer, 0, buffer.Length);
}
/// <summary>
/// Sets the preset dictionary. This should only be called, if
/// needsDictionary() returns true and it should set the same
/// dictionary, that was used for deflating. The getAdler()
/// function returns the checksum of the dictionary needed.
/// </summary>
/// <param name="buffer">
/// the dictionary.
/// </param>
/// <param name="off">
/// the offset into buffer where the dictionary starts.
/// </param>
/// <param name="len">
/// the length of the dictionary.
/// </param>
/// <exception cref="System.InvalidOperationException">
/// if no dictionary is needed.
/// </exception>
/// <exception cref="System.ArgumentException">
/// if the dictionary checksum is wrong.
/// </exception>
/// <exception cref="System.ArgumentOutOfRangeException">
/// if the off and/or len are wrong.
/// </exception>
public void SetDictionary(byte[] buffer, int off, int len)
{
if (!IsNeedingDictionary) {
throw new InvalidOperationException();
}
adler.Update(buffer, off, len);
if ((int)adler.Value != readAdler) {
throw new ArgumentException("Wrong adler checksum");
}
adler.Reset();
outputWindow.CopyDict(buffer, off, len);
mode = DECODE_BLOCKS;
}
/// <summary>
/// Sets the input. This should only be called, if needsInput()
/// returns true.
/// </summary>
/// <param name="buf">
/// the input.
/// </param>
/// <exception cref="System.InvalidOperationException">
/// if no input is needed.
/// </exception>
public void SetInput(byte[] buf)
{
SetInput(buf, 0, buf.Length);
}
/// <summary>
/// Sets the input. This should only be called, if needsInput()
/// returns true.
/// </summary>
/// <param name="buf">
/// the input.
/// </param>
/// <param name="off">
/// the offset into buffer where the input starts.
/// </param>
/// <param name="len">
/// the length of the input.
/// </param>
/// <exception cref="System.InvalidOperationException">
/// if no input is needed.
/// </exception>
/// <exception cref="System.ArgumentOutOfRangeException">
/// if the off and/or len are wrong.
/// </exception>
public void SetInput(byte[] buf, int off, int len)
{
input.SetInput(buf, off, len);
totalIn += len;
}
/// <summary>
/// Inflates the compressed stream to the output buffer. If this
/// returns 0, you should check, whether needsDictionary(),
/// needsInput() or finished() returns true, to determine why no
/// further output is produced.
/// </summary>
/// <param name = "buf">
/// the output buffer.
/// </param>
/// <returns>
/// the number of bytes written to the buffer, 0 if no further
/// output can be produced.
/// </returns>
/// <exception cref="System.ArgumentOutOfRangeException">
/// if buf has length 0.
/// </exception>
/// <exception cref="System.FormatException">
/// if deflated stream is invalid.
/// </exception>
public int Inflate(byte[] buf)
{
return Inflate(buf, 0, buf.Length);
}
/// <summary>
/// Inflates the compressed stream to the output buffer. If this
/// returns 0, you should check, whether needsDictionary(),
/// needsInput() or finished() returns true, to determine why no
/// further output is produced.
/// </summary>
/// <param name = "buf">
/// the output buffer.
/// </param>
/// <param name = "off">
/// the offset into buffer where the output should start.
/// </param>
/// <param name = "len">
/// the maximum length of the output.
/// </param>
/// <returns>
/// the number of bytes written to the buffer, 0 if no further output can be produced.
/// </returns>
/// <exception cref="System.ArgumentOutOfRangeException">
/// if len is &lt;= 0.
/// </exception>
/// <exception cref="System.ArgumentOutOfRangeException">
/// if the off and/or len are wrong.
/// </exception>
/// <exception cref="System.FormatException">
/// if deflated stream is invalid.
/// </exception>
public int Inflate(byte[] buf, int off, int len)
{
if (len < 0) {
throw new ArgumentOutOfRangeException("len < 0");
}
// Special case: len may be zero
if (len == 0) {
if (IsFinished == false) {// -jr- 08-Nov-2003 INFLATE_BUG fix..
Decode();
}
return 0;
}
/* // Check for correct buff, off, len triple
if (off < 0 || off + len >= buf.Length) {
throw new ArgumentException("off/len outside buf bounds");
}*/
int count = 0;
int more;
do {
if (mode != DECODE_CHKSUM) {
/* Don't give away any output, if we are waiting for the
* checksum in the input stream.
*
* With this trick we have always:
* needsInput() and not finished()
* implies more output can be produced.
*/
more = outputWindow.CopyOutput(buf, off, len);
adler.Update(buf, off, more);
off += more;
count += more;
totalOut += more;
len -= more;
if (len == 0) {
return count;
}
}
} while (Decode() || (outputWindow.GetAvailable() > 0 && mode != DECODE_CHKSUM));
return count;
}
/// <summary>
/// Returns true, if the input buffer is empty.
/// You should then call setInput().
/// NOTE: This method also returns true when the stream is finished.
/// </summary>
public bool IsNeedingInput {
get {
return input.IsNeedingInput;
}
}
/// <summary>
/// Returns true, if a preset dictionary is needed to inflate the input.
/// </summary>
public bool IsNeedingDictionary {
get {
return mode == DECODE_DICT && neededBits == 0;
}
}
/// <summary>
/// Returns true, if the inflater has finished. This means, that no
/// input is needed and no output can be produced.
/// </summary>
public bool IsFinished {
get {
return mode == FINISHED && outputWindow.GetAvailable() == 0;
}
}
/// <summary>
/// Gets the adler checksum. This is either the checksum of all
/// uncompressed bytes returned by inflate(), or if needsDictionary()
/// returns true (and thus no output was yet produced) this is the
/// adler checksum of the expected dictionary.
/// </summary>
/// <returns>
/// the adler checksum.
/// </returns>
public int Adler {
get {
return IsNeedingDictionary ? readAdler : (int) adler.Value;
}
}
/// <summary>
/// Gets the total number of output bytes returned by inflate().
/// </summary>
/// <returns>
/// the total number of output bytes.
/// </returns>
public int TotalOut {
get {
return totalOut;
}
}
/// <summary>
/// Gets the total number of processed compressed input bytes.
/// </summary>
/// <returns>
/// the total number of bytes of processed input bytes.
/// </returns>
public int TotalIn {
get {
return totalIn - RemainingInput;
}
}
/// <summary>
/// Gets the number of unprocessed input. Useful, if the end of the
/// stream is reached and you want to further process the bytes after
/// the deflate stream.
/// </summary>
/// <returns>
/// the number of bytes of the input which were not processed.
/// </returns>
public int RemainingInput {
get {
return input.AvailableBytes;
}
}
}
}

View File

@@ -0,0 +1,207 @@
// InflaterDynHeader.cs
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
using System;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
class InflaterDynHeader
{
const int LNUM = 0;
const int DNUM = 1;
const int BLNUM = 2;
const int BLLENS = 3;
const int LENS = 4;
const int REPS = 5;
static readonly int[] repMin = { 3, 3, 11 };
static readonly int[] repBits = { 2, 3, 7 };
byte[] blLens;
byte[] litdistLens;
InflaterHuffmanTree blTree;
int mode;
int lnum, dnum, blnum, num;
int repSymbol;
byte lastLen;
int ptr;
static readonly int[] BL_ORDER =
{ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 };
public InflaterDynHeader()
{
}
public bool Decode(StreamManipulator input)
{
decode_loop:
for (;;) {
switch (mode) {
case LNUM:
lnum = input.PeekBits(5);
if (lnum < 0) {
return false;
}
lnum += 257;
input.DropBits(5);
// System.err.println("LNUM: "+lnum);
mode = DNUM;
goto case DNUM; // fall through
case DNUM:
dnum = input.PeekBits(5);
if (dnum < 0) {
return false;
}
dnum++;
input.DropBits(5);
// System.err.println("DNUM: "+dnum);
num = lnum+dnum;
litdistLens = new byte[num];
mode = BLNUM;
goto case BLNUM; // fall through
case BLNUM:
blnum = input.PeekBits(4);
if (blnum < 0) {
return false;
}
blnum += 4;
input.DropBits(4);
blLens = new byte[19];
ptr = 0;
// System.err.println("BLNUM: "+blnum);
mode = BLLENS;
goto case BLLENS; // fall through
case BLLENS:
while (ptr < blnum) {
int len = input.PeekBits(3);
if (len < 0) {
return false;
}
input.DropBits(3);
// System.err.println("blLens["+BL_ORDER[ptr]+"]: "+len);
blLens[BL_ORDER[ptr]] = (byte) len;
ptr++;
}
blTree = new InflaterHuffmanTree(blLens);
blLens = null;
ptr = 0;
mode = LENS;
goto case LENS; // fall through
case LENS:
{
int symbol;
while (((symbol = blTree.GetSymbol(input)) & ~15) == 0) {
/* Normal case: symbol in [0..15] */
// System.err.println("litdistLens["+ptr+"]: "+symbol);
litdistLens[ptr++] = lastLen = (byte)symbol;
if (ptr == num) {
/* Finished */
return true;
}
}
/* need more input ? */
if (symbol < 0) {
return false;
}
/* otherwise repeat code */
if (symbol >= 17) {
/* repeat zero */
// System.err.println("repeating zero");
lastLen = 0;
} else {
if (ptr == 0) {
throw new Exception();
}
}
repSymbol = symbol-16;
}
mode = REPS;
goto case REPS; // fall through
case REPS:
{
int bits = repBits[repSymbol];
int count = input.PeekBits(bits);
if (count < 0) {
return false;
}
input.DropBits(bits);
count += repMin[repSymbol];
// System.err.println("litdistLens repeated: "+count);
if (ptr + count > num) {
throw new Exception();
}
while (count-- > 0) {
litdistLens[ptr++] = lastLen;
}
if (ptr == num) {
/* Finished */
return true;
}
}
mode = LENS;
goto decode_loop;
}
}
}
public InflaterHuffmanTree BuildLitLenTree()
{
byte[] litlenLens = new byte[lnum];
Array.Copy(litdistLens, 0, litlenLens, 0, lnum);
return new InflaterHuffmanTree(litlenLens);
}
public InflaterHuffmanTree BuildDistTree()
{
byte[] distLens = new byte[dnum];
Array.Copy(litdistLens, lnum, distLens, 0, dnum);
return new InflaterHuffmanTree(distLens);
}
}
}

View File

@@ -0,0 +1,213 @@
// InflaterHuffmanTree.cs
// Copyright (C) 2001 Mike Krueger
//
// This file was translated from java, it was part of the GNU Classpath
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Linking this library statically or dynamically with other modules is
// making a combined work based on this library. Thus, the terms and
// conditions of the GNU General Public License cover the whole
// combination.
//
// As a special exception, the copyright holders of this library give you
// permission to link this library with independent modules to produce an
// executable, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting executable under
// terms of your choice, provided that you also meet, for each linked
// independent module, the terms and conditions of the license of that
// module. An independent module is a module which is not derived from
// or based on this library. If you modify this library, you may extend
// this exception to your version of the library, but you are not
// obligated to do so. If you do not wish to do so, delete this
// exception statement from your version.
using System;
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
namespace ICSharpCode.SharpZipLib.Zip.Compression
{
public class InflaterHuffmanTree
{
private static int MAX_BITLEN = 15;
private short[] tree;
public static InflaterHuffmanTree defLitLenTree, defDistTree;
static InflaterHuffmanTree()
{
try {
byte[] codeLengths = new byte[288];
int i = 0;
while (i < 144) {
codeLengths[i++] = 8;
}
while (i < 256) {
codeLengths[i++] = 9;
}
while (i < 280) {
codeLengths[i++] = 7;
}
while (i < 288) {
codeLengths[i++] = 8;
}
defLitLenTree = new InflaterHuffmanTree(codeLengths);
codeLengths = new byte[32];
i = 0;
while (i < 32) {
codeLengths[i++] = 5;
}
defDistTree = new InflaterHuffmanTree(codeLengths);
} catch (Exception) {
throw new ApplicationException("InflaterHuffmanTree: static tree length illegal");
}
}
/// <summary>
/// Constructs a Huffman tree from the array of code lengths.
/// </summary>
/// <param name = "codeLengths">
/// the array of code lengths
/// </param>
public InflaterHuffmanTree(byte[] codeLengths)
{
BuildTree(codeLengths);
}
private void BuildTree(byte[] codeLengths)
{
int[] blCount = new int[MAX_BITLEN + 1];
int[] nextCode = new int[MAX_BITLEN + 1];
for (int i = 0; i < codeLengths.Length; i++) {
int bits = codeLengths[i];
if (bits > 0) {
blCount[bits]++;
}
}
int code = 0;
int treeSize = 512;
for (int bits = 1; bits <= MAX_BITLEN; bits++) {
nextCode[bits] = code;
code += blCount[bits] << (16 - bits);
if (bits >= 10) {
/* We need an extra table for bit lengths >= 10. */
int start = nextCode[bits] & 0x1ff80;
int end = code & 0x1ff80;
treeSize += (end - start) >> (16 - bits);
}
}
/* -jr comment this out! doesnt work for dynamic trees and pkzip 2.04g
if (code != 65536)
{
throw new Exception("Code lengths don't add up properly.");
}
*/
/* Now create and fill the extra tables from longest to shortest
* bit len. This way the sub trees will be aligned.
*/
tree = new short[treeSize];
int treePtr = 512;
for (int bits = MAX_BITLEN; bits >= 10; bits--) {
int end = code & 0x1ff80;
code -= blCount[bits] << (16 - bits);
int start = code & 0x1ff80;
for (int i = start; i < end; i += 1 << 7) {
tree[DeflaterHuffman.BitReverse(i)] = (short) ((-treePtr << 4) | bits);
treePtr += 1 << (bits-9);
}
}
for (int i = 0; i < codeLengths.Length; i++) {
int bits = codeLengths[i];
if (bits == 0) {
continue;
}
code = nextCode[bits];
int revcode = DeflaterHuffman.BitReverse(code);
if (bits <= 9) {
do {
tree[revcode] = (short) ((i << 4) | bits);
revcode += 1 << bits;
} while (revcode < 512);
} else {
int subTree = tree[revcode & 511];
int treeLen = 1 << (subTree & 15);
subTree = -(subTree >> 4);
do {
tree[subTree | (revcode >> 9)] = (short) ((i << 4) | bits);
revcode += 1 << bits;
} while (revcode < treeLen);
}
nextCode[bits] = code + (1 << (16 - bits));
}
}
/// <summary>
/// Reads the next symbol from input. The symbol is encoded using the
/// huffman tree.
/// </summary>
/// <param name="input">
/// input the input source.
/// </param>
/// <returns>
/// the next symbol, or -1 if not enough input is available.
/// </returns>
public int GetSymbol(StreamManipulator input)
{
int lookahead, symbol;
if ((lookahead = input.PeekBits(9)) >= 0) {
if ((symbol = tree[lookahead]) >= 0) {
input.DropBits(symbol & 15);
return symbol >> 4;
}
int subtree = -(symbol >> 4);
int bitlen = symbol & 15;
if ((lookahead = input.PeekBits(bitlen)) >= 0) {
symbol = tree[subtree | (lookahead >> 9)];
input.DropBits(symbol & 15);
return symbol >> 4;
} else {
int bits = input.AvailableBits;
lookahead = input.PeekBits(bits);
symbol = tree[subtree | (lookahead >> 9)];
if ((symbol & 15) <= bits) {
input.DropBits(symbol & 15);
return symbol >> 4;
} else {
return -1;
}
}
} else {
int bits = input.AvailableBits;
lookahead = input.PeekBits(bits);
symbol = tree[lookahead];
if (symbol >= 0 && (symbol & 15) <= bits) {
input.DropBits(symbol & 15);
return symbol >> 4;
} else {
return -1;
}
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More