Compare commits

...

1921 Commits

Author SHA1 Message Date
Ged Murphy
e6864a290b revert cache manager rewrite branch
svn path=/branches/cache_manager_rewrite/; revision=21275
2006-03-09 21:03:00 +00:00
Hartmut Birr
8d5eccb2fc Delete the cache manager rewrite branch.
svn path=/branches/cache_manager_rewrite/; revision=21013
2006-01-24 23:10:17 +00:00
Filip Navara
7b70bdba4c Revert r19346.
svn path=/branches/cache_manager_rewrite/; revision=19347
2005-11-19 18:55:00 +00:00
Filip Navara
b9f6981637 Don't bail out for unparsable environment variables.
svn path=/branches/cache_manager_rewrite/; revision=19346
2005-11-19 18:53:38 +00:00
Filip Navara
f1dcd2ee53 Revert r19221.
svn path=/branches/cache_manager_rewrite/; revision=19222
2005-11-14 13:43:34 +00:00
Filip Navara
0482ffafc6 Add definition for vsprintfW.
svn path=/branches/cache_manager_rewrite/; revision=19221
2005-11-14 13:41:58 +00:00
Filip Navara
5722e5c62e Revert r19199.
svn path=/branches/cache_manager_rewrite/; revision=19201
2005-11-13 08:21:41 +00:00
Filip Navara
0033d548a4 Fix the clipping checks in TuiFillArea.
svn path=/branches/cache_manager_rewrite/; revision=19199
2005-11-13 08:19:13 +00:00
Hartmut Birr
05670022d2 Delete some files which weren't deleted by the merge.
svn path=/branches/cache_manager_rewrite/; revision=18729
2005-10-23 23:40:19 +00:00
Filip Navara
b6a10c7f2d Fix compilation.
svn path=/branches/cache_manager_rewrite/; revision=18724
2005-10-23 21:10:58 +00:00
Hartmut Birr
d288f06c13 - Merge r17753:18655 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=18659
2005-10-21 18:26:07 +00:00
Thomas Bluemel
87a380e34d forgot to commit this...
svn path=/trunk/; revision=18655
2005-10-21 14:04:40 +00:00
Thomas Bluemel
fcc17d749e added stubs for AccessCheckByTypeAndAuditAlarmA/W, AccessCheckByTypeResultListAndAuditAlarmA/W, AccessCheckByTypeResultListAndAuditAlarmByHandleA/W, GetAuditedPermissionsFromAclA and GetEffectiveRightsFromAclA
svn path=/trunk/; revision=18654
2005-10-21 13:45:48 +00:00
Andrew Munger
baa9fed721 When you move something in the tree that is on the bootcd, you must update bootdata/packages/reactos.dff. DHCP was missing from recent bootcds.
svn path=/trunk/; revision=18653
2005-10-21 13:20:19 +00:00
Andrew Munger
6bbd4e5cd3 New search icon.
svn path=/trunk/; revision=18652
2005-10-21 12:59:32 +00:00
Thomas Bluemel
661cb55a8a implemented ansi stubs: SetupGetInfFileListA and SetupDiGetINFClassA
svn path=/trunk/; revision=18651
2005-10-21 12:31:19 +00:00
Hervé Poussineau
46559fcbf2 Implement SetupDiGetDeviceInstallParamsW/SetupDiSetDeviceInstallParamsW
Set and use Flags and FlagsEx fields in SP_DEVINSTALL_PARAMS
Allow search of .inf files outside of ReactOS\Inf directory

svn path=/trunk/; revision=18650
2005-10-21 10:13:26 +00:00
Thomas Bluemel
b8a765d1ed minor fixes of included headers
svn path=/trunk/; revision=18649
2005-10-21 09:33:20 +00:00
Ged Murphy
6d032338d0 make more robust by calling GetSystemDirectory
svn path=/trunk/; revision=18648
2005-10-20 23:08:44 +00:00
Ged Murphy
eec7e9d35d insert solitaire into the start menu if it's been installed.
svn path=/trunk/; revision=18647
2005-10-20 22:11:33 +00:00
Christoph von Wittich
d181c34e7a fixed creation of *.vcproj files for object libraries
started implementing code which adds dependencies to *.sln file
fixed some warnings in cmd when compiling with msvc 2005

svn path=/trunk/; revision=18646
2005-10-20 21:55:55 +00:00
Ged Murphy
2a39898c1e setup 'Games' subfolder ready for Solitaire, etc.
svn path=/trunk/; revision=18645
2005-10-20 21:11:56 +00:00
Hervé Poussineau
6f1abc4b16 Add pciidex (controller driver) and pciide (miniport driver). They enumerate channels 0 and 1 on IDE controllers.
svn path=/trunk/; revision=18644
2005-10-20 19:33:16 +00:00
Christoph von Wittich
a1c14231d4 fixing OutputFile in *.vcproj files
svn path=/trunk/; revision=18643
2005-10-20 18:55:45 +00:00
Thomas Bluemel
582c386e46 improved error handling in RegRenameKey
svn path=/trunk/; revision=18642
2005-10-20 18:17:06 +00:00
Thomas Bluemel
7da9542b29 fixed uninitialized variable warning
svn path=/trunk/; revision=18641
2005-10-20 18:07:00 +00:00
Thomas Bluemel
973d0cfabc fix r18639 the right way: don't check a - possibly random - pointer supplied by the caller, also correctly clear the owner SID pointer
svn path=/trunk/; revision=18640
2005-10-20 17:59:00 +00:00
Andrew Munger
c36fc14394 One liner from Alex_Ionescu that fixes svn hanging during checkout or update.
svn path=/trunk/; revision=18639
2005-10-20 17:48:19 +00:00
Royce Mitchell III
179739c746 we do still need to generate dsw files for msvc6
svn path=/trunk/; revision=18638
2005-10-20 16:49:00 +00:00
Christoph von Wittich
ffbb6a9873 simplify MSVCBackend::Process code
svn path=/trunk/; revision=18637
2005-10-20 16:13:20 +00:00
Hervé Poussineau
7aa02a3b89 Revert r18628, as we don't have any RTL8139 driver in ReactOS repository
svn path=/trunk/; revision=18636
2005-10-20 16:04:35 +00:00
Thomas Bluemel
d462751f9a use the ansi entry point by default
svn path=/trunk/; revision=18635
2005-10-20 15:50:02 +00:00
Christoph von Wittich
0d623d28e1 fix compile problems with msvc6
svn path=/trunk/; revision=18634
2005-10-20 15:28:35 +00:00
Thomas Bluemel
f7dd935bcd add a 'unicode' property to modules (not yet supported by mingw, need to add a library for unicode builds some day)
svn path=/trunk/; revision=18633
2005-10-20 15:17:38 +00:00
Christoph von Wittich
068ceb8c0f add targets for creating MSVC project files to Makefile
fix bug in msvc backend: VS.NET project files are not destroyed anymore when creating VC6 project files

svn path=/trunk/; revision=18632
2005-10-20 15:04:55 +00:00
Christoph von Wittich
db95f67404 create only the project files specified on cmdline
svn path=/trunk/; revision=18631
2005-10-20 14:27:02 +00:00
Royce Mitchell III
613156caf8 msvc6+psdk fix
svn path=/trunk/; revision=18630
2005-10-20 14:10:23 +00:00
Royce Mitchell III
c4f10fc116 msvc6+PSDK fixes
svn path=/trunk/; revision=18629
2005-10-20 14:05:27 +00:00
Hervé Poussineau
1d8fc0ce9e Add more RTL8139 compatible cards.
svn path=/trunk/; revision=18628
2005-10-20 14:02:38 +00:00
Royce Mitchell III
f08e0f0692 fix msvc6 template warning
fix writing to uninitialized pointer

svn path=/trunk/; revision=18627
2005-10-20 13:59:37 +00:00
Christoph von Wittich
997e8fb48c create more correct solution files for different versions of MS Visual Studio
svn path=/trunk/; revision=18626
2005-10-20 12:42:09 +00:00
Christoph von Wittich
536b7cd7f7 forgot to commit rbuild.h
svn path=/trunk/; revision=18625
2005-10-20 11:46:56 +00:00
Christoph von Wittich
2104d4ade7 fix vcprojmaker to add the correct GUIDs
implemented Debug/Release configurations to make Alex happy

svn path=/trunk/; revision=18624
2005-10-20 11:21:23 +00:00
Christoph von Wittich
68bfd8c14e fix creation of shlwapi vcproject file
svn path=/trunk/; revision=18623
2005-10-20 09:43:49 +00:00
Christoph von Wittich
ee2234a457 fix for creating *.sln file
svn path=/trunk/; revision=18622
2005-10-20 08:46:55 +00:00
Christoph von Wittich
2eb4ba358b added new cmdline switch to rbuild: -vs{version}
to select the version of MS VS project files to generate

default is now 7.10 (VS 2003)

svn path=/trunk/; revision=18621
2005-10-20 06:40:58 +00:00
James Tabor
089e05b94d Testing MPlayerC.exe, start implementing GetMenuBarInfo. It looks simple enough.
svn path=/trunk/; revision=18620
2005-10-20 01:24:49 +00:00
Christoph von Wittich
0fcd5f187e fixed some warnings when compile with msvc 2005
svn path=/trunk/; revision=18619
2005-10-19 23:45:55 +00:00
Christoph von Wittich
d2627cecf5 fix poppack.h on wrong position
svn path=/trunk/; revision=18618
2005-10-19 23:44:16 +00:00
Christoph von Wittich
5e2eed7a02 remove winternl.h
(fix build)

svn path=/trunk/; revision=18617
2005-10-19 23:38:51 +00:00
Christoph von Wittich
b0e1d472a1 fix "./" include dir
svn path=/trunk/; revision=18616
2005-10-19 23:20:17 +00:00
Alex Ionescu
f2ec008f69 - Fix compile with msvc/psdk.
svn path=/trunk/; revision=18615
2005-10-19 23:08:12 +00:00
Alex Ionescu
986feb9eea - Fix build issues.
svn path=/trunk/; revision=18614
2005-10-19 22:51:21 +00:00
Christoph von Wittich
a9e2477672 remove winternl.h
svn path=/trunk/; revision=18613
2005-10-19 22:43:09 +00:00
Christoph von Wittich
cf2d8e0404 fix NtSecAPI.h
aclui now compiles without winternl.h

svn path=/trunk/; revision=18612
2005-10-19 22:42:32 +00:00
Christoph von Wittich
4cafe154cc fix compile with msvc
svn path=/trunk/; revision=18611
2005-10-19 21:46:30 +00:00
Magnus Olsen
778c4d292a update cmd todo text
svn path=/trunk/; revision=18610
2005-10-19 21:46:17 +00:00
Ged Murphy
ed11dc0a27 update xml file. dhcp has moved to /services
svn path=/trunk/; revision=18609
2005-10-19 21:26:25 +00:00
Ged Murphy
7ffc7be8a7 dhcp has moved to /services
svn path=/trunk/; revision=18608
2005-10-19 21:25:26 +00:00
Ged Murphy
38e275b6f7 move dhcp client from /subsys/system to /services
svn path=/trunk/; revision=18607
2005-10-19 21:22:28 +00:00
Magnus Olsen
4f2b8fba21 Fix the head so it compiles again.
do not define same DBG_** twice. 

svn path=/trunk/; revision=18606
2005-10-19 21:10:17 +00:00
Christoph von Wittich
27cc2b7d94 fix compile with msvc
svn path=/trunk/; revision=18605
2005-10-19 21:08:53 +00:00
Aleksey Bragin
79c52cf8f8 Translation to russian language + fixes in En.rc
svn path=/trunk/; revision=18604
2005-10-19 20:35:01 +00:00
Aleksey Bragin
d0804bb319 Fix a typo
svn path=/trunk/; revision=18603
2005-10-19 20:09:30 +00:00
Brandon Turner
cdf0011b1c add CRLF to fix build
svn path=/trunk/; revision=18602
2005-10-19 19:50:15 +00:00
Filip Navara
8f2b6df4bb Fix DbgPrint calls.
svn path=/trunk/; revision=18601
2005-10-19 19:33:15 +00:00
Christoph von Wittich
675b2d1098 fixed inconsistent newlines
svn path=/trunk/; revision=18600
2005-10-19 17:18:34 +00:00
Christoph von Wittich
58a71c4e3f added missing advapi32.lib
svn path=/trunk/; revision=18599
2005-10-19 17:05:58 +00:00
Alex Ionescu
8c002db0c2 - NDK fix: don't undef a million status codes, instead, have apps define WIN32_NO_STATUS.
- winnt.h: respect WIN32_NO_STATUS for DBG codes.
- rtl: change STDCALL to NTAPI
- everything else: add precompiled headers where missing, define WIN32_NO_STATUS.

svn path=/trunk/; revision=18598
2005-10-19 17:03:38 +00:00
Magnus Olsen
593300080a Change LANGUAGE LANG_JAPANESE, SUBLANG_NEUTRAL to LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
So it works in windows, and in Visualstudio

svn path=/trunk/; revision=18597
2005-10-19 17:02:15 +00:00
Magnus Olsen
6faa7273db Change LANGUAGE LANG_JAPANESE, SUBLANG_NEUTRAL to LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
So it works in windows, and in Visualstudio  

svn path=/trunk/; revision=18596
2005-10-19 16:53:08 +00:00
Christoph von Wittich
612361f0d7 add support for cpl applets
add hardcoded "." include path like already in msvcmaker.cpp

svn path=/trunk/; revision=18595
2005-10-19 16:08:34 +00:00
Christoph von Wittich
03bd1b5838 reformat rc files to make them more readable AND comile with msvc
change CALLBACK to APIENTRY like in windows

svn path=/trunk/; revision=18594
2005-10-19 16:05:12 +00:00
Christoph von Wittich
da36e335c1 reverted to 17089, we have to fix rbuild instead
svn path=/trunk/; revision=18593
2005-10-19 14:18:29 +00:00
Christoph von Wittich
d7d94ab421 fixed rc files to compile with ms rc
svn path=/trunk/; revision=18592
2005-10-19 14:09:23 +00:00
Christoph von Wittich
2531be20a0 fixed prototypes in cpl.h
svn path=/trunk/; revision=18591
2005-10-19 14:08:31 +00:00
Brandon Turner
e1ace3e194 after some long hard thought i decided to not use the broken cmd version of CommandLineToArgvW and start using the less broken ros api version. This doesnt matter all that much as cmd isnt compiled as unicode(yet).
svn path=/trunk/; revision=18590
2005-10-19 13:12:01 +00:00
Christoph von Wittich
9ff9863045 set eol-style:native
svn path=/trunk/; revision=18589
2005-10-19 02:53:03 +00:00
Christoph von Wittich
f49330a2f1 fixed some msvc compile issues
fixed duplicated IDs in rc files

svn path=/trunk/; revision=18588
2005-10-19 02:41:18 +00:00
Christoph von Wittich
0789731009 set eol-style:native
svn path=/trunk/; revision=18587
2005-10-19 02:21:19 +00:00
Christoph von Wittich
a019e28705 added missing advapi32.lib
svn path=/trunk/; revision=18586
2005-10-19 02:01:23 +00:00
Christoph von Wittich
457733ee7a add support for control panel applets
svn path=/trunk/; revision=18585
2005-10-19 01:59:25 +00:00
Christoph von Wittich
4370373447 fixed msvc compile problem
svn path=/trunk/; revision=18584
2005-10-19 00:56:49 +00:00
Christoph von Wittich
bbe3e0120a fixed some compile problems with msvc 2003/2005
svn path=/trunk/; revision=18583
2005-10-19 00:46:31 +00:00
Christoph von Wittich
149be15434 fixed compile problems with msvc 2003/2005
svn path=/trunk/; revision=18582
2005-10-19 00:19:25 +00:00
Christoph von Wittich
ffe3881148 added missing shell32.lib
svn path=/trunk/; revision=18581
2005-10-18 23:53:47 +00:00
Christoph von Wittich
ade25eb742 added missing shell32.lib
svn path=/trunk/; revision=18580
2005-10-18 23:48:37 +00:00
Christoph von Wittich
ec9c456d35 fix anonymous union problem
svn path=/trunk/; revision=18579
2005-10-18 23:43:51 +00:00
Christoph von Wittich
424070b190 fix compile with msvc
svn path=/trunk/; revision=18578
2005-10-18 23:34:34 +00:00
Christoph von Wittich
b9f4233bd2 revert 18576
fix rbuild instead

svn path=/trunk/; revision=18577
2005-10-18 23:25:46 +00:00
Christoph von Wittich
44c7db58f6 remove include/wine, this will fix compiling with msvc
svn path=/trunk/; revision=18576
2005-10-18 23:00:31 +00:00
Christoph von Wittich
3f6c66966e added missing user32.lib
svn path=/trunk/; revision=18575
2005-10-18 22:55:29 +00:00
Christoph von Wittich
fae230e486 add missing libs to xml file
svn path=/trunk/; revision=18574
2005-10-18 22:34:04 +00:00
Christoph von Wittich
ede418d57b fixed WINVER in calc.xml for compile with msvc
now it can be compiled with 0 errors, 0 warnings

svn path=/trunk/; revision=18573
2005-10-18 22:27:38 +00:00
Christoph von Wittich
0d333ca4de changed windres back to rc
fixed rc preprocessor defines in dsp file generation

svn path=/trunk/; revision=18572
2005-10-18 21:56:39 +00:00
Ged Murphy
88be8ed34a move the apps into the same position they are found in windows.
svn path=/trunk/; revision=18571
2005-10-18 21:41:45 +00:00
Aleksey Bragin
9710fe98ef German translations by FooDerGrosse, kevin_schnabel at gmx dot de (Bug 915)
(now I didn't forget anything)

svn path=/trunk/; revision=18570
2005-10-18 21:39:20 +00:00
Christoph von Wittich
b1e1f8bc26 fix taskmgr.rc to compile with ms rc
svn path=/trunk/; revision=18569
2005-10-18 21:39:15 +00:00
Aleksey Bragin
76ba3dcaf2 German translations by FooDerGrosse, kevin_schnabel at gmx dot de (Bug 915)
(fix)

svn path=/trunk/; revision=18568
2005-10-18 21:35:01 +00:00
Aleksey Bragin
27155bc285 German translations by FooDerGrosse, kevin_schnabel at gmx dot de (Bug 915)
(sorry forgot to svn add/commit one file)

svn path=/trunk/; revision=18567
2005-10-18 21:26:25 +00:00
Christoph von Wittich
a4a022cf82 set eol-style:native
svn path=/trunk/; revision=18566
2005-10-18 21:18:15 +00:00
Aleksey Bragin
f5aa212472 German translations by FooDerGrosse, kevin_schnabel at gmx dot de (Bug 915)
svn path=/trunk/; revision=18565
2005-10-18 21:12:09 +00:00
Ged Murphy
50a9b6e255 OK, all done messing about now.
I hope you all had as much fun as I did :p

svn path=/trunk/; revision=18564
2005-10-18 20:58:42 +00:00
Ged Murphy
96f6fcd6e5 update xml file to include tcpsvcs
svn path=/trunk/; revision=18563
2005-10-18 20:55:14 +00:00
Ged Murphy
9ed49dabde move tcpsvcs from the /apps directory to the /services directory
svn path=/trunk/; revision=18562
2005-10-18 20:53:43 +00:00
Ged Murphy
754a4d2b09 revert adding this folder. will move it in the correct manner
svn path=/trunk/; revision=18561
2005-10-18 20:50:11 +00:00
Ged Murphy
e4b3a2b6e0 revert deleting this folder to keep it's history.
will move it correctly next time :)

svn path=/trunk/; revision=18560
2005-10-18 20:47:21 +00:00
Ged Murphy
07f8595889 add tcpsvcs registry data
svn path=/trunk/; revision=18559
2005-10-18 20:24:01 +00:00
Ged Murphy
41f6aaf3f9 Add tcpsvcs to the services directory.
svn path=/trunk/; revision=18558
2005-10-18 20:17:20 +00:00
Ged Murphy
11aa08b141 update xml
svn path=/trunk/; revision=18557
2005-10-18 20:15:25 +00:00
Ged Murphy
899748a026 remove tcpsvcs from the apps directory
svn path=/trunk/; revision=18556
2005-10-18 20:14:53 +00:00
Christoph von Wittich
c85d6131ee add stdlib.h to fix compile issues with msvc
svn path=/trunk/; revision=18555
2005-10-18 19:48:50 +00:00
Ged Murphy
80f7d06cfd add new quotes file to /system32/drivers/etc
svn path=/trunk/; revision=18554
2005-10-18 17:07:45 +00:00
Ged Murphy
8cdf4ff3d5 - move quotes out of the rc file and read them from /system32/drivers/etc as per windows.
- clean up code a bit
- exit threads with a return val

svn path=/trunk/; revision=18553
2005-10-18 17:06:36 +00:00
Brandon Turner
5c00cee958 fix errors in "activate". Change activate, window, and msgbox commands from checking for __REACTOS__ to NT4_INTERNAL_COMMAND. they are turned off by default(uncomment line 23 to enable).
svn path=/trunk/; revision=18552
2005-10-18 13:32:32 +00:00
Brandon Turner
b8674b8084 remove more __REACTOS__ checks / unused code. I left WIN32_LEAN_AND_MEAN defined at all times. If this causes problems feel free to remove it.
svn path=/trunk/; revision=18551
2005-10-18 12:25:31 +00:00
Royce Mitchell III
547d458153 calc_buffer_display():
eliminate unnecessary copying ( and potential buffer overrun )
eliminate variable naming conflicts

svn path=/trunk/; revision=18550
2005-10-18 04:23:50 +00:00
Royce Mitchell III
67d9667289 msvc6 compilation fixes
fix buffer over(under?)flow in calc_sep()

svn path=/trunk/; revision=18549
2005-10-18 04:15:55 +00:00
Brandon Turner
a658088fed remove some more __REACTOS__ checks. We dont need our GetConsoleWindow and it was never used. The size of CMD_LENGTH is the same for both and at some point will not longer be used once we have all dynamic allocations.
svn path=/trunk/; revision=18548
2005-10-18 03:12:49 +00:00
Brandon Turner
287174554b Remove the check for __REACTOS__. FormatMessage works better and is implemented in ros.
svn path=/trunk/; revision=18547
2005-10-18 01:55:20 +00:00
Christoph von Wittich
31154f2d58 set eol-style:native
svn path=/trunk/; revision=18546
2005-10-18 00:01:16 +00:00
Christoph von Wittich
9d731530bd fixed compiling with msvc
svn path=/trunk/; revision=18545
2005-10-18 00:00:27 +00:00
Christoph von Wittich
25886dff5a fix some bugs in regedit
like alloca -> HeapAlloc + HeapFree

svn path=/trunk/; revision=18544
2005-10-17 23:38:24 +00:00
Hartmut Birr
0e6af26271 Merged r17748,17750,17752 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=18543
2005-10-17 22:40:24 +00:00
Hartmut Birr
3529df3b5a Merging over the usb changes didn't work. I must delete and copy the changes manually. Copying r17764 of the usb driver.
svn path=/branches/cache_manager_rewrite/; revision=18542
2005-10-17 22:27:49 +00:00
Hartmut Birr
18a783e2c8 Merging over the usb changes didn't work. I must delete and copy the changes manually.
svn path=/branches/cache_manager_rewrite/; revision=18541
2005-10-17 22:22:03 +00:00
Thomas Bluemel
18d6c8993b fix incorrect usage of alloca and a buffer overflow
svn path=/trunk/; revision=18540
2005-10-17 22:18:14 +00:00
Hartmut Birr
894ea6e844 Merging didn't remove this file. I don't know why.
svn path=/branches/cache_manager_rewrite/; revision=18539
2005-10-17 22:17:53 +00:00
Gé van Geldorp
2c226cd315 Forgot to change comment. Thanks to Royce3 for pointing it out.
svn path=/trunk/; revision=18538
2005-10-17 22:13:44 +00:00
Gé van Geldorp
b098d29e8c Patch by hardon. Properly handle 0 timeouts. Fixes bug 857.
svn path=/trunk/; revision=18536
2005-10-17 22:08:07 +00:00
Gé van Geldorp
606c64b199 Everything must come to an end, even the desktop window. Fixes bug 805.
svn path=/trunk/; revision=18534
2005-10-17 21:57:02 +00:00
Magnus Olsen
cb9fb3aeb7 New icons from our UI:mf
svn path=/trunk/; revision=18532
2005-10-17 21:47:17 +00:00
Gé van Geldorp
cf74899c6f Should have committed this along with r18529
svn path=/trunk/; revision=18531
2005-10-17 21:40:37 +00:00
Magnus Olsen
3d7512b7cd New icons from our UI:mf
svn path=/trunk/; revision=18530
2005-10-17 21:40:38 +00:00
Gé van Geldorp
e988d53026 Inform HAL about the switch to graphics mode as late as possible. Fixes bug 880.
svn path=/trunk/; revision=18529
2005-10-17 21:36:23 +00:00
Gunnar Dalsnes
35bd58021f -dont return NULL when realloc to 0 bytes (fixes one kernel32_winetest heap test)
-only allow realloc to new position if GMEM_MOVEABLE is passed (fixed mem)
-only allow realloc to new position if GMEM_MOVEABLE is passed OR mem is not locked (moveable mem)

svn path=/trunk/; revision=18528
2005-10-17 20:11:21 +00:00
Hartmut Birr
0bd803bd31 Merge r17394:17744 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=18527
2005-10-17 19:29:51 +00:00
Christoph von Wittich
59131bfc00 fixed rc files to compile with rc
svn path=/trunk/; revision=18526
2005-10-17 18:04:11 +00:00
Christoph von Wittich
61a1cafcf4 replaced rc with windres
svn path=/trunk/; revision=18525
2005-10-17 17:30:45 +00:00
Gé van Geldorp
16f6e946c5 First use "ptr", then set it to NULL
svn path=/trunk/; revision=18524
2005-10-17 16:59:31 +00:00
Christoph von Wittich
2960adb14b added missing translations for IDS_NEW_KEY and IDS_NEW_VALUE
svn path=/trunk/; revision=18523
2005-10-17 15:59:23 +00:00
Gé van Geldorp
4f71b06928 Fix installation after latest PnP changes. Fix by hpoussin
svn path=/trunk/; revision=18522
2005-10-17 15:52:50 +00:00
Christoph von Wittich
7d087d74d1 fixed buffer overflow
removed useless LocalUnlock
fixed memory leak

svn path=/trunk/; revision=18521
2005-10-17 15:17:54 +00:00
Christoph von Wittich
643679edee only define DPRINT macro if the compiler can handle __VA_ARGS__
reduces Warnings when compiling with MSVC

svn path=/trunk/; revision=18520
2005-10-17 13:57:40 +00:00
Martin Fuchs
0b5368c660 Fix for Bugzilla entry 904: activated the "not yet implemented" message for now, until SHFindFiles() will be implemented in shell32.dll
svn path=/trunk/; revision=18519
2005-10-17 13:14:04 +00:00
Martin Fuchs
48d2f86ba2 fix for Bugzilla entry 900 by mrnobo1024 at yahoo.com: don't destroy menus when switching between normal and scientific mode
svn path=/trunk/; revision=18518
2005-10-17 12:58:07 +00:00
Christoph von Wittich
5afb16c749 fixed "index out of range"
svn path=/trunk/; revision=18517
2005-10-17 12:44:16 +00:00
Martin Fuchs
47110fba6f fix a few taskbar context menu bugs including Bugzilla entry 720
svn path=/trunk/; revision=18516
2005-10-17 12:41:52 +00:00
Christoph von Wittich
d3618b8394 removed HeapFree because of unexpected behaviour
svn path=/trunk/; revision=18515
2005-10-17 12:23:19 +00:00
Martin Fuchs
112bfa79a1 remove some unused special handling code and comments
svn path=/trunk/; revision=18514
2005-10-17 12:07:49 +00:00
Christoph von Wittich
b0be32a4c4 fix compile with gcc
now it compiles with gcc && msvc

svn path=/trunk/; revision=18513
2005-10-17 12:04:26 +00:00
Hervé Poussineau
5afbfdd6e1 Add PCI_WHICHSPACE_CONFIG and PCI_WHICHSPACE_ROM constants
svn path=/trunk/; revision=18512
2005-10-17 12:02:31 +00:00
Christoph von Wittich
f9f5eb9f29 added missing HEAP_ZERO_MEMORY
added missing HeapFree

svn path=/trunk/; revision=18511
2005-10-17 11:49:36 +00:00
Christoph von Wittich
a1651b5787 fix regedit to compile with MSVC
svn path=/trunk/; revision=18510
2005-10-17 11:10:11 +00:00
Christoph von Wittich
da83fe4dcc fix some headers to compile with MSVC
svn path=/trunk/; revision=18509
2005-10-17 11:09:35 +00:00
Martin Fuchs
4d498c7390 - move shortcut comment texts into string resources
- add error handling
- create new "Accessories" folder in programs start menu

svn path=/trunk/; revision=18508
2005-10-17 11:03:30 +00:00
Christoph von Wittich
35113a023e destroy window handles when program terminates
svn path=/trunk/; revision=18507
2005-10-17 09:44:17 +00:00
Hervé Poussineau
39b4f74f8c Fix IoGetDeviceProperty, which should never return STATUS_BUFFER_OVERFLOW, but STATUS_BUFFER_TOO_SMALL
svn path=/trunk/; revision=18506
2005-10-17 08:41:00 +00:00
Christoph von Wittich
703d635153 set eol-style:native
svn path=/trunk/; revision=18505
2005-10-16 23:01:01 +00:00
Christoph von Wittich
dc37877edc started implementation of msconfig tool
svn path=/trunk/; revision=18504
2005-10-16 22:59:45 +00:00
Magnus Olsen
5cd92ce1f5 forget add Ja.rc to rundll32.rc
svn path=/trunk/; revision=18503
2005-10-16 18:29:08 +00:00
Magnus Olsen
1474352abe Update directx header and correct more info.
I belive the ddraw.h header are okay now 

svn path=/trunk/; revision=18502
2005-10-16 18:21:20 +00:00
Eric Kohl
07c9ed4a4d Fix typos and remove trailing whitespace.
svn path=/trunk/; revision=18501
2005-10-16 17:11:48 +00:00
Christoph von Wittich
3ad8d81bd4 fixed some typos
svn path=/trunk/; revision=18500
2005-10-16 16:21:59 +00:00
Eric Kohl
2812e11e34 Fix [out, size_is, unique] parameter issues.
svn path=/trunk/; revision=18499
2005-10-16 15:27:38 +00:00
Hartmut Birr
ecdd18cbd0 Invalidate the start value if start key doesn't exist.
svn path=/trunk/; revision=18498
2005-10-16 14:24:11 +00:00
Hervé Poussineau
197d4d0964 Sorry, most devices were reinstalled at each boot, as the calculated crc32 for the parent was changing.
Prevent this by using only the parent InstancePath instead of the whole DEVICE_NODE structure

svn path=/trunk/; revision=18497
2005-10-16 14:10:29 +00:00
Hartmut Birr
abb25bef4f Implemented SMART commands for ide devices.
svn path=/trunk/; revision=18496
2005-10-16 11:17:26 +00:00
Hervé Poussineau
c7baaf3eb2 Remove registry entries for class installers we don't have
svn path=/trunk/; revision=18495
2005-10-16 11:11:35 +00:00
Hartmut Birr
831aa04b24 - Do only read the pci config header. Some devices/drivers don't like it
if the complete pci config space is accessed (like my Tekram DC-390F SCSI controller).  
- Replaced some numeric values with nice named constants.


svn path=/trunk/; revision=18494
2005-10-16 11:08:01 +00:00
Hervé Poussineau
18df49d077 Implement SetupDiDestroyDriverInfoList
svn path=/trunk/; revision=18493
2005-10-16 10:46:22 +00:00
Eric Kohl
85acbb6eec - Add samsrv.dll stub.
- Install cfgmgr32.dll, lsasrv.dll and samsrv.dll.

svn path=/trunk/; revision=18492
2005-10-16 09:58:19 +00:00
Gunnar Dalsnes
fd7c8f26a8 fix buffer overflow
svn path=/trunk/; revision=18491
2005-10-16 01:29:08 +00:00
Gunnar Dalsnes
3e68f60244 fix two buffer overflows
svn path=/trunk/; revision=18490
2005-10-16 01:27:32 +00:00
Gunnar Dalsnes
21b0bdd718 fix buffer overflow
add error checking

svn path=/trunk/; revision=18489
2005-10-16 01:26:52 +00:00
Gunnar Dalsnes
819d130a5a RtlInitUnicodeString is only legal with nullterminated strings and also the string in initialized manually below...
svn path=/trunk/; revision=18488
2005-10-16 01:22:18 +00:00
Hartmut Birr
a17ada0615 Allocated buffers from non paged pool for all user buffers.
svn path=/trunk/; revision=18487
2005-10-15 21:41:48 +00:00
Christoph von Wittich
d991d613f5 * added a lot of stack-size information to *.def files
* added one more stub to secur32

svn path=/trunk/; revision=18486
2005-10-15 21:17:52 +00:00
Eric Kohl
94d46bd214 - CreateServiceW: Calculate the Dependency length.
- Implement NotifyBootConfigStatus.

svn path=/trunk/; revision=18485
2005-10-15 19:34:53 +00:00
Hartmut Birr
68b164341e Fixed the definition of PDEV_INSTALL_W.
svn path=/trunk/; revision=18484
2005-10-15 16:39:22 +00:00
Martin Fuchs
79ec345d3a Winefile:
- fix item background color for non-white windows background
- fix drive size output: wsprintf() -> _stprintf()
- declare COLOR_SELECTION_TXT

svn path=/trunk/; revision=18483
2005-10-15 16:37:34 +00:00
Hartmut Birr
00a4a8acbd Don't use alloca in a macro, which may be used in a loop. This does fix bug #805.
svn path=/trunk/; revision=18481
2005-10-15 13:22:13 +00:00
Magnus Olsen
36c303f191 Japanese translation by tsk email tsk_n@mail.goo.ne.jp
svn path=/trunk/; revision=18480
2005-10-15 12:40:30 +00:00
Magnus Olsen
45e5519258 Japanese translation by tsk email tsk_n@mail.goo.ne.jp
svn path=/trunk/; revision=18479
2005-10-15 12:26:40 +00:00
Magnus Olsen
f961f704ac Japanese translation by tsk email tsk_n@mail.goo.ne.jp
svn path=/trunk/; revision=18478
2005-10-15 12:21:12 +00:00
Magnus Olsen
005da60232 Spanish translation By HUMA2000
svn path=/trunk/; revision=18477
2005-10-15 11:52:41 +00:00
Magnus Olsen
af0c90f70c Japanese translation by tsk email tsk_n@mail.goo.ne.jp
svn path=/trunk/; revision=18476
2005-10-15 11:48:07 +00:00
Magnus Olsen
4f0c5db20f fix no end waring
svn path=/trunk/; revision=18475
2005-10-15 11:42:26 +00:00
Magnus Olsen
8727e532bf Japanese translation by tsk email tsk_n@mail.goo.ne.jp
svn path=/trunk/; revision=18474
2005-10-15 11:39:54 +00:00
Magnus Olsen
14b4fa9f73 Japanese translation by tsk email tsk_n@mail.goo.ne.jp
svn path=/trunk/; revision=18473
2005-10-15 11:10:25 +00:00
Magnus Olsen
73a78c480e Japanese translation by tsk email tsk_n@mail.goo.ne.jp
remove Si.rc it was not translate, it was on english. 



svn path=/trunk/; revision=18472
2005-10-15 11:08:44 +00:00
Magnus Olsen
b5ef43a91f Japanese translation by tsk email tsk_n@mail.goo.ne.jp
svn path=/trunk/; revision=18471
2005-10-15 10:47:53 +00:00
Christoph von Wittich
663998bfcd * set eol-style:native
svn path=/trunk/; revision=18470
2005-10-15 10:34:38 +00:00
Gé van Geldorp
00642f300e Make sure we don't hang forever when activating a window belonging to
another thread

svn path=/trunk/; revision=18468
2005-10-15 09:53:14 +00:00
Magnus Olsen
42ce928624 forget remove struct _SURFACEALIGNMENT for it have been move to right header dmemmgr.h
svn path=/trunk/; revision=18467
2005-10-15 09:10:57 +00:00
Magnus Olsen
d00889ce26 Fixing directx headers from wine, by adding alot of missing struct and some struct was wrong. start fixing the header ddkernel.h
svn path=/trunk/; revision=18466
2005-10-15 02:00:56 +00:00
Magnus Olsen
5196ff03b6 set eol-style : native
svn path=/trunk/; revision=18465
2005-10-15 00:12:49 +00:00
Magnus Olsen
df288c5836 Fixing directx headers from wine, by adding alot of missing struct and some struct was wrong. Complete the header dmemmgr.h it was missing and move stuff into that header.
svn path=/trunk/; revision=18464
2005-10-15 00:09:45 +00:00
Christoph von Wittich
ffaa12375e * add Security.dll (redirects all calls to secur32.dll)
svn path=/trunk/; revision=18463
2005-10-14 23:13:08 +00:00
Gé van Geldorp
3e063edcc7 Include kernelmode routines in stack backtrace
svn path=/trunk/; revision=18462
2005-10-14 22:56:23 +00:00
Christoph von Wittich
b1700953dd *add some more stubs for Virtual DOS Machine Debug (six still missing)
svn path=/trunk/; revision=18461
2005-10-14 22:31:06 +00:00
Hervé Poussineau
d1509ade59 Fix the HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Linkage\Export value. The GUID needs to be prepended by "Tcpip_"
svn path=/trunk/; revision=18460
2005-10-14 22:04:02 +00:00
Ged Murphy
901449fbf7 - Implement -r Calling route.exe for output
- Rewrote DisplayOutput so simulates the MS netstat tool better and is now readable
- Fix ShowTcpTable to show correct endpoints on default, and expand it a little so it's easier to follow
- expand ShowUdpTable in the same manner
- Cleaner formatting in GetPortName

svn path=/trunk/; revision=18459
2005-10-14 21:35:03 +00:00
Gé van Geldorp
30a546e327 Attach to correct process before messing around with its memory
svn path=/trunk/; revision=18458
2005-10-14 20:19:23 +00:00
Magnus Olsen
541ca90657 Fixing directx headers from wine, by adding alot of missing struct and some struct was wrong.
svn path=/trunk/; revision=18457
2005-10-14 20:03:18 +00:00
Thomas Bluemel
bf7b9d8bb2 Fixed the declarations of GetFileVersionInfoSizeA/W and GetFileVersionInfoA/W
svn path=/trunk/; revision=18456
2005-10-14 19:48:28 +00:00
Gé van Geldorp
7daa792a3e Only whitespace changes, no logic
svn path=/trunk/; revision=18455
2005-10-14 19:28:18 +00:00
Hervé Poussineau
2af4ba6dcb Add missing files to bootcd
svn path=/trunk/; revision=18454
2005-10-14 19:09:45 +00:00
Hervé Poussineau
219a9c8162 Remove entries that are created by netcfgx.dll
svn path=/trunk/; revision=18453
2005-10-14 18:38:51 +00:00
Hervé Poussineau
28613541ae Add netcfgx.dll
This .dll contains the class installer for the network cards

svn path=/trunk/; revision=18452
2005-10-14 18:37:10 +00:00
Gé van Geldorp
cf7b48d567 Goplat <mrnobo1024@yahoo.com>:
SetPixel should return the new color. Bug 909.

svn path=/trunk/; revision=18450
2005-10-14 18:32:38 +00:00
Hervé Poussineau
463b91a5b9 Transform pci.sys to a Plug-and-Play driver.
Simplify most of the PciCreateCompatible*String functions
Fix error handling in FdoQueryBusRelations
=> pci.sys now manages only 1 bus. It is still using HalGetBusDataByOffset/HalGetBusData which are deprecated, but it shouldn't be too hard to remove

svn path=/trunk/; revision=18449
2005-10-14 18:29:55 +00:00
Hervé Poussineau
72dd7eefe0 Big Plug-and-Play patch for ReactOS:
- Install drivers for devices at first boot
- Remove now useless entries in hivesys.inf
At the moment, driver installation only uses .inf files in ReactOS\Inf directory, and the needed files have to be in ReactOS\Inf or their final location (ReactOS\system32 or ReactOS\system32\drivers) + the user can't provide a custom driver
Plug-and-Plays devices are only USB controllers (OHCI and UHCI) and serial ports now.

svn path=/trunk/; revision=18448
2005-10-14 18:24:19 +00:00
Hervé Poussineau
f747f1de8c Step 2 for a PnP ReactOS: add some (little) hacks
svn path=/trunk/; revision=18447
2005-10-14 18:14:19 +00:00
Hervé Poussineau
8325af0b6a Process AddReg directive in main section to install
Simplify a call to SetupInstallFromInfSectionW
Fix a warning (thanks w3seek)

svn path=/trunk/; revision=18446
2005-10-14 18:09:17 +00:00
Hervé Poussineau
48b9916f22 Transform ReactOS to a Plug-and-Play system. Step 1: add some .inf files
svn path=/trunk/; revision=18445
2005-10-14 18:00:39 +00:00
Hervé Poussineau
6dc4621495 Implement SetupDiCreateDevRegKeyW and SetupDiOpenDevRegKey
Use them in SetupDiInstallDevice

svn path=/trunk/; revision=18444
2005-10-14 16:53:18 +00:00
Gé van Geldorp
a7f76e510d Fix tab/space mess
svn path=/trunk/; revision=18443
2005-10-14 13:39:27 +00:00
Hervé Poussineau
cce498f665 Don't always return STATUS_BUFFER_TOO_SMALL when an error occurs in ZwQueryValueKey.
The "if" was triggered because ValueInformation->DataLength is 0xcdcdcdcd at the return of the function

svn path=/trunk/; revision=18442
2005-10-14 13:04:11 +00:00
Gé van Geldorp
23e3fa1b76 Identify the process in ThreadExtraInfo
svn path=/trunk/; revision=18441
2005-10-14 13:00:18 +00:00
Gé van Geldorp
63f7f95cdd tsk <tsk_n@mail.goo.ne.jp>:
UsageMessage is a printf format string.

svn path=/trunk/; revision=18439
2005-10-14 09:44:12 +00:00
Gé van Geldorp
2ae151a7dc Don't install Winefile icon on desktop, it's already present in the start menu
svn path=/trunk/; revision=18437
2005-10-14 09:33:31 +00:00
Gé van Geldorp
f862f9f049 Mike <mikeonthecomputer@gmail.com>:
Add installation path for VMware 5.5. Fixes bug 907.

svn path=/trunk/; revision=18435
2005-10-14 08:03:14 +00:00
Magnus Olsen
8173b668de removed hard-coded comdlg filter from desk.cpl and it now searches for bmp;jpeg;png in windir patch by Christoph_vW see Bug 885
svn path=/trunk/; revision=18433
2005-10-13 19:13:47 +00:00
Aleksey Bragin
578f7922e1 cmd, taskmgr and userinit translations by FooDerGrosse <kevin_schnabel at gmx.de>
svn path=/trunk/; revision=18430
2005-10-13 17:34:25 +00:00
Gunnar Dalsnes
85d5b2ea3f make classes use session wide atom table. should fix bug 899
svn path=/trunk/; revision=18427
2005-10-13 12:44:58 +00:00
Hervé Poussineau
64cd53d0d2 Call specified class installer (if any) in SetupDiCallClassInstaller
Implement SetupDiOpenDeviceInterfaceA

svn path=/trunk/; revision=18426
2005-10-13 10:55:16 +00:00
Thomas Bluemel
1cb48e4fa8 properly reset the reference counter in ExReInitializeRundownProtection()
svn path=/trunk/; revision=18425
2005-10-13 10:29:04 +00:00
Gé van Geldorp
7b39c07e8a Use the pitch provided by FreeType. Fixes bug 894.
svn path=/trunk/; revision=18424
2005-10-13 08:15:52 +00:00
Hervé Poussineau
035526b30e Fix sublang IDs:
SUBLANG_ENGLISH_US for english, as we always try to load language LANG_ENGLISH/SUBLANG_ENGLISH_US
SUBLANG_NEUTRAL for the others, so all sublanguages can use the translation

svn path=/trunk/; revision=18423
2005-10-13 08:05:12 +00:00
Hervé Poussineau
43938afffe IopGetBusTypeGuidIndex: Fix an infinite loop
IopAssignDeviceResources: Allocate bus number resources

svn path=/trunk/; revision=18422
2005-10-13 07:43:25 +00:00
Gunnar Dalsnes
29b7b9b24a add comment about KeCancelTimer pitfall
svn path=/trunk/; revision=18419
2005-10-12 23:10:31 +00:00
Gé van Geldorp
697b562c6b Send window-bound timers to the correct message queue
svn path=/trunk/; revision=18418
2005-10-12 22:15:22 +00:00
Thomas Bluemel
342429fe3b set eol-style to native
svn path=/trunk/; revision=18417
2005-10-12 22:04:07 +00:00
Gunnar Dalsnes
016dd801d7 add stubs to make clamwin run. by Christoph_vW
stub GetNativeSystemInfo better to make cpuz get further. by Christoph_vW
stub IsWow64Process better. by me

svn path=/trunk/; revision=18416
2005-10-12 21:39:28 +00:00
Martin Fuchs
4fe5d38bfa zoomin:
- allow to cange zoom factor and display zoom factor
- add accelerator table

svn path=/trunk/; revision=18415
2005-10-12 20:20:18 +00:00
Thomas Bluemel
e7045161ac fixed difference in signedness warning
svn path=/trunk/; revision=18413
2005-10-12 18:56:44 +00:00
Hervé Poussineau
15afaf3715 In DevInstallW:
- Shut up debug messages
- First steps to display messages to the user (retrieve device description before and after device installation)
- Change to only one exit point

svn path=/trunk/; revision=18412
2005-10-12 16:54:34 +00:00
Gé van Geldorp
71552e4e2f Workaround for bug 899
svn path=/trunk/; revision=18411
2005-10-12 14:07:49 +00:00
Gé van Geldorp
2d8f114871 Terminate the new environment with a NULL pointer
svn path=/trunk/; revision=18410
2005-10-12 13:00:34 +00:00
Martin Fuchs
76f3a6da01 Fix for Bugzilla Entry 641 - patch from j_anderw at sbox.tugraz.at
svn path=/trunk/; revision=18409
2005-10-12 08:38:45 +00:00
Hervé Poussineau
543acff480 Fix SetupDiGetDeviceRegistryPropertyA, which should return the required size and the registry data type if the buffer is too small
(typical case when you call it 2 times: 1st time to get the required size, 2nd time to get real data)

svn path=/trunk/; revision=18408
2005-10-12 08:14:56 +00:00
Hervé Poussineau
cf9a86c858 Send the right LocaleId to device stack when querying the device description.
Don't erase device description stored by setupapi during next reboot

svn path=/trunk/; revision=18407
2005-10-11 13:35:07 +00:00
Gunnar Dalsnes
75e85af499 nullterm correct string in strndup
nullterm argv list
reformat


svn path=/trunk/; revision=18406
2005-10-11 03:23:01 +00:00
Gregor Anich
aa105de9d7 vdmdbg.dll (stubs only) by Christoph v.W. - thanks!
svn path=/trunk/; revision=18405
2005-10-11 00:58:45 +00:00
Gunnar Dalsnes
b1761726b2 alloc at minimum 16 bytes (spotted by WaxDragon)
realloc should free passed mem if new size is 0

svn path=/trunk/; revision=18404
2005-10-10 22:42:13 +00:00
Gunnar Dalsnes
1fc06afd71 alloc multiple of 16 bytes
svn path=/trunk/; revision=18403
2005-10-10 20:18:07 +00:00
Brandon Turner
fbd6bbbf48 set to eol-style native ;)
svn path=/trunk/; revision=18402
2005-10-10 19:08:57 +00:00
Brandon Turner
657a7f0496 Added a more technical readme for people that want to understand cmd.
svn path=/trunk/; revision=18401
2005-10-10 18:57:56 +00:00
Ged Murphy
7a0a97076f remove a header no longer needed too
svn path=/trunk/; revision=18400
2005-10-10 18:35:33 +00:00
Ged Murphy
7338720bbd remove uneeded text out of the .rc file.
svn path=/trunk/; revision=18399
2005-10-10 18:33:45 +00:00
Ged Murphy
57c3413b9d forgot the eol-style again.
svn path=/trunk/; revision=18398
2005-10-10 17:51:30 +00:00
Ged Murphy
7cd2f8dbb5 Start of a rewrite for netstat.exe
- Simulate the output of the MS netstat tool
- implemented -a, -e, -n, -p, -r, -s and interval

svn path=/trunk/; revision=18397
2005-10-10 17:49:19 +00:00
Thomas Bluemel
361bbd4d9d fixed a typo in the NtAccessCheck declaration
svn path=/trunk/; revision=18396
2005-10-10 15:42:08 +00:00
Andrew Munger
a45c2e461f MiTestCard is only used in DBG=1, surround with ifdef so DBG=0 builds.
svn path=/trunk/; revision=18395
2005-10-10 14:29:15 +00:00
Thomas Bluemel
eb03a7e427 convert DefaultSetInfoBufferCheck and DefaultQueryInfoBufferCheck to inlined functions
svn path=/trunk/; revision=18394
2005-10-10 13:03:55 +00:00
Thomas Bluemel
e0191cfd2a don't jump outside _SEH_TRY with goto in ObpCaptureObjectAttributes()
svn path=/trunk/; revision=18393
2005-10-10 13:03:09 +00:00
Thomas Bluemel
a4bfa110a8 some fixes for CheckTokenMembership:
- properly create an impersonation token from the primary token in case the thread is not impersonating
- use NtAccessCheck to perform the access check

svn path=/trunk/; revision=18392
2005-10-10 11:44:37 +00:00
Magnus Olsen
0c2ceade45 Comment out a fixme, it make a user mode crash (ntoskrnl\ke\exception.c:94 KiRaiseException ), after this viso installer start working, thx Christoph_vW to found it.
svn path=/trunk/; revision=18391
2005-10-09 22:35:54 +00:00
Thomas Bluemel
ea1ba0aefd don't try to free the ansi strings passed by the caller
svn path=/trunk/; revision=18390
2005-10-09 22:35:41 +00:00
Brandon Turner
af2ef3d685 Updated more cmd documentation. This included changing from eric's email to ros-dev / bugzilla for suggested way of reporting bugs.
svn path=/trunk/; revision=18389
2005-10-09 22:33:26 +00:00
Thomas Bluemel
2b001b30bf fixed difference in signedness warning in MulDiv()
svn path=/trunk/; revision=18388
2005-10-09 22:30:27 +00:00
Magnus Olsen
5e45c5916f Fix DD_Cleanup that will make Contry Strike not crashing when it does not found right reslution, thx drfred that found the bug + source cleanup and small bugfix for ntddraw
svn path=/trunk/; revision=18387
2005-10-09 22:15:06 +00:00
Gunnar Dalsnes
690727fe99 Fix MulDiv. This fixes almost any progress-bar to stop showing negative values during installations or etc. Thanks to kichik for originally having found the bug.
Patch by alex ionescu

svn path=/trunk/; revision=18386
2005-10-09 22:12:56 +00:00
Thomas Bluemel
315e77dfab use the correct down-level scope filter flag for the computer selection dialog
svn path=/trunk/; revision=18385
2005-10-09 22:09:02 +00:00
Thomas Bluemel
d49c0b4e12 add a not yet complete tool to dump the recycle bin databases
svn path=/trunk/; revision=18384
2005-10-09 20:56:17 +00:00
Eric Kohl
be1c8d7a38 First shot at CreateServiceW. It crashes due to a bug (aka missing feature) in widl. I'm going to fix it as soon as possible.
svn path=/trunk/; revision=18383
2005-10-09 20:24:00 +00:00
Brandon Turner
0f30dcfddd Make sure that FileList is not empty. fixes bug #884.
svn path=/trunk/; revision=18382
2005-10-09 19:08:18 +00:00
Thomas Bluemel
30a95cc3af added missing ansi/unicode definitions
svn path=/trunk/; revision=18381
2005-10-09 16:58:13 +00:00
Martin Fuchs
54e86c3e2c remove binary attribute from japanese resource file
svn path=/trunk/; revision=18380
2005-10-09 15:23:16 +00:00
Martin Fuchs
f8879f3de8 Fix for Bugzilla Entry 330: Correctly handle WM_COMMAND messages in web windows without web control
svn path=/trunk/; revision=18379
2005-10-09 15:16:41 +00:00
Martin Fuchs
3edf5a41cc fix crash because of NULL command line pointer
svn path=/trunk/; revision=18378
2005-10-09 15:12:13 +00:00
Martin Fuchs
8b65b69d7c Fix from watz@gmx.net for Bugzilla Entry 862: When you resize the taskmanager window, the history graph is not updated anymore. When the window is resized back to default (smallest possible width) it
draws again.

svn path=/trunk/; revision=18376
2005-10-09 15:04:18 +00:00
Martin Fuchs
e42612ca97 replace "search computer" start menu entry by a "not yet implemented" message to avoid the crash because of the currently missing SHFindComputer() implementation in shell32.dll
svn path=/trunk/; revision=18375
2005-10-09 13:05:49 +00:00
Martin Fuchs
8ff67043ab german patch for cmd.exe from Bugzilla Entry 872
svn path=/trunk/; revision=18374
2005-10-09 12:41:35 +00:00
Martin Fuchs
d4b58223f9 fix access violation in SaveBoard()
svn path=/trunk/; revision=18373
2005-10-09 11:57:15 +00:00
Martin Fuchs
5be74add41 display source rectangle
svn path=/trunk/; revision=18372
2005-10-09 11:24:51 +00:00
Eric Kohl
07cba14d02 - Support [out, unique] base type parameters.
svn path=/trunk/; revision=18371
2005-10-09 08:38:29 +00:00
Eric Kohl
c06ae87d5e - Support [out, unique] base type parameters.
svn path=/trunk/; revision=18370
2005-10-09 08:36:50 +00:00
Gregor Anich
9606cf5a82 Add /BREAK option.
Enter KDB on bootup only if /BREAK options is given.
(You can also use KDBinit to enter KDB a little later than with /BREAK)

svn path=/trunk/; revision=18369
2005-10-09 00:45:33 +00:00
Gregor Anich
9b511ef452 Add KDBinit to the installation.
svn path=/trunk/; revision=18368
2005-10-09 00:25:19 +00:00
Brandon Turner
96d70479d0 start of removing #ifdef __Reactos__ in cmd. __Reactos__ = 1 works fine on windows and __Reactos__ = 0 hasnt built since i started working on cmd, making it pointless.
svn path=/trunk/; revision=18367
2005-10-08 23:59:48 +00:00
Emanuele Aliberti
7ab6a27574 Fix startup code for native NT processes.
smss, autocheck, csrss use new startup code.

svn path=/trunk/; revision=18366
2005-10-08 22:42:17 +00:00
Emanuele Aliberti
320979be58 Fix startup code for native NT processes.
smss, autocheck, csrss use new startup code.

svn path=/trunk/; revision=18365
2005-10-08 22:41:49 +00:00
Emanuele Aliberti
4aa4442880 Minor change.
svn path=/trunk/; revision=18364
2005-10-08 22:40:04 +00:00
Emanuele Aliberti
14d42d8dd2 Fix startup code for native NT processes.
svn path=/trunk/; revision=18363
2005-10-08 22:38:55 +00:00
Gé van Geldorp
2ffd7b7d5a Sync to Wine-20050930:
Jakob Eriksson <jakov@vmlinux.org>
- Get rid of HeapAlloc casts.
Robert Reif <reif@earthlink.net>
- Added keyboard data format.
- Fix joystick crash when a button guid is specified in the data
  format.
  Add some parameter checking.
- Pass around real version and do correct thing based on it.
  Change cooperative level to pass on windows.
- Fix SetProperty error returned.
  Add EnumDevice joystick version check.
  Test multiple versions.
- Added dinput tests.
- Effect objects are not supported yet so don't crash when trying to
  enumerate them.
Raphael Junqueira <fenix@club-internet.fr>
- use WINE_DINPUT_KEYBOARD_MAX_KEYS instead hard-coded 256 value
- better use of critical section
- some cleanup to better understand code paths
- logic correction on SetWindowsHookExA/UnhookWindowsHookEx on
  keyboard.
Alexandre Julliard <julliard@winehq.org>
- Build a static list of devices instead of relying on ELF
  constructors.
Gerald Pfeifer <gerald@pfeifer.com>
- Fix compilation of the case without proper Linux joystick support.
James Dean Anderson <petr@pantek.org>
- Report an error if trying to get data from an unacquired mouse.
Lionel Ulmer <lionel.ulmer@free.fr>
- more pretty print for the types flag
- more Windows-aligned check for object instances
- Windows reports 0x80 on pressed buttons not 0xFF
- trace the events reported to the application
- do not flush the buffer when the application only wants to peek the
  number of elements in the queue
- trace the GetDeviceState values before they are reset
Alexandre Julliard <julliard@winehq.org>
- Added rules for building import libraries in the individual dll
  makefiles, and added support for building a .def.a static import
  library too.
- Added rules to build import libraries in the individual dll makefiles.
  Generate import libraries with the right name right away instead of
  using an intermediate .spec.def file.
- Moved config parameters to HKCU\Software\Wine\DirectInput.
- Added magic comments to all Wine-specific registry accesses to make
  them easier to grep.
- Sort entry points alphabetically.
- Removed some unused or redundant configure checks.
  A few cleanups in configure.ac.
- Don't prefix the functions DllCanUnloadNow, DllGetClassObject and
  Dll(Un)RegisterServer with the dll name so that the compiler can check
  the prototypes.
- Fixed some traces to use the right printf format and avoid typecasts.
- Use a more portable scheme for storing the name of a critical
  section.
- Use the COM macros instead of accessing lpVtbl directly.
- We are no longer generating .dbg.c files.
Marcus Meissner <marcus@jet.franken.de>
- The last argument to MultiByteToWideChar is wide character count and
  not the buffer size in bytes. Fixed all places where it was wrong.
- Fixed 3 memset()s which used the wrong size (too large).
Dmitry Timoshkov <dmitry@codeweavers.com>
- Make more of the OLE interface vtables const.
Daniel Remenak <dtremenak@gmail.com>
- Added a linux input system force feedback effect implementation.
- Allow the creation of an FF effect while the joystick is not
  acquired.
- Failing to download an effect after setting parameters is not a
  fatal error.
- Allow enumeration of objects when the device is not yet acquired.
- Flag FF-capable axes during enumeration.
- Protect FF_STATUS usage to avoid compile errors on machines with old
  linux/input.h.
- Implement EnumEffects, CreateEffect, EnumCreatedEffects,
  SendForceFeedbackCommand, and GetForceFeedbackStatus for linux input
  joysticks.
- Correct dinput handling of sliders and non-zero-based axes through the
  linux input system.
- Correctly enumerate evdev joysticks when enumeration is restricted
  with DIEDFL_FORCEFEEDBACK.
- Detect force-feedback-capable linux event device joysticks and return
  DIDC_FORCEFEEDBACK when queried for capabilities.
Mike McCormack <mike@codeweavers.com>
- Interlocked LONG* gcc warning fixes.
- gcc 4.0 warning fixes.
- gcc 4.0 warning fixes for Interlocked* functions.
- Fix warnings for no force feedback case.
Stefan Huehner <stefan@huehner.org>
- Fix some more -Wmissing-declarations warnings.
Vincent Béron <vberon@mecano.gme.usherb.ca>
- Use proper ifdefs around unistd.h.

svn path=/trunk/; revision=18361
2005-10-08 20:11:27 +00:00
Gé van Geldorp
d2af8e74ef Sync to Wine-20050930:
Alexandre Julliard <julliard@winehq.org>
- We are no longer generating .dbg.c files.
- Removed a useless header file.

svn path=/trunk/; revision=18359
2005-10-08 19:52:44 +00:00
Gé van Geldorp
855eb364c8 Sync to Wine-20050930:
Alexandre Julliard <julliard@winehq.org>
- Specify 64-bit integers as double instead of long long in spec files
  so that we get the correct number of arguments.
- We are no longer generating .dbg.c files.
Mike McCormack <mike@codeweavers.com>
- Fix gcc 4.0 warnings.
Gerald Pfeifer <gerald@pfeifer.com>
- #include <stdlib.h> to get abs() prototype.
Frank Richter <frank.richter@gmail.com>
- Remove shlwapi dependency.

svn path=/trunk/; revision=18358
2005-10-08 19:49:47 +00:00
Gé van Geldorp
08702b9203 Sync to Wine-20050930:
Stefan Leichter <Stefan.Leichter@camLine.com>
- Added version resource to urlmon.dll.
Alexandre Julliard <julliard@winehq.org>
- Fixed a compiler warning.
- We are no longer generating .dbg.c files.
Jacek Caban <jack@itma.pwr.wroc.pl>
- Added IHttpNegotiate2 interface.
- Update BINDSTRING and IInternetSession.
- Added MIME type checking to FileProtocol::Start.
- Rewrote FindMimeFromData to pass tests.
- Encode URL in file protocol.
- Added ReleaseBindInfo implementation.
- Added RegisterFormatEnumerator and RevokeFormatEnumerator
  implementation.
- Added PARSE_SECURITY_DOMAIN action implementation.
- Added CreateAsyncBindCtxEx implementation.
- Added PARSE_SECURITY_URL action implementation.
- Added CoInternetGetSession implementation.
- Register zones.
- Added PARSE_PATH_FROM_URL action implementation.
- Added http and ftp protocol stub implementation.
- Register ZoneMap.
- Move protocol's CLSIDs to urlmon.idl.
- Added urlmon.inf as dependency of rsrc.res.
- Added GetZoneActionPolicy implementation.
- Added CoInternetParseUrl implementation.
- Added MapUrlToZone implementation.
- Added file protocol implementation.
- Added IInternetSecurityManager::[SG]etSecuritySite implementation.
- Forward IInternetSecurityManager calls to custom manager.
- Added CreateFormatEnumerator implementation.

svn path=/trunk/; revision=18357
2005-10-08 19:43:11 +00:00
Gé van Geldorp
d2f8256c62 Sync to Wine-20050930:
Francois Gouget <fgouget@free.fr>
- Fix .spec declarations for functinos with 64bit arguments (reported by
  winapi_check).
Stefan Leichter <Stefan.Leichter@camLine.com>
- Added version resource to shlwapi.dll.
Alexandre Julliard <julliard@winehq.org>
- Remove the 'L' suffix on a number of constants to avoid comparison
  errors on 64-bit platforms.
- Take into account -noname functions when checking for duplicate export
  names. Fixed a couple of issues found by the stricter check.
- Specify 64-bit integers as double instead of long long in spec files
  so that we get the correct number of arguments.
- We are no longer generating .dbg.c files.
Dmitry Timoshkov <dmitry@codeweavers.com>
- Fix the usage of COLOR_xxx constants in the place of the window's
  class hbrBackground.
Alexander N. Sørnes <alex@thehandofagony.com>
- Added Norwegian translations.
Marcus Meissner <marcus@jet.franken.de>
- The last argument to MultiByteToWideChar is wide character count and
  not the buffer size in bytes. Fixed all places where it was wrong.

svn path=/trunk/; revision=18356
2005-10-08 19:30:16 +00:00
Martin Fuchs
644b190f61 basic implementation of zoomin functionality
svn path=/trunk/; revision=18355
2005-10-08 19:29:20 +00:00
Gé van Geldorp
aeb7ba332c Vendor import of shfolder
svn path=/trunk/; revision=18354
2005-10-08 19:24:54 +00:00
Gé van Geldorp
bb54f9a8ad Remove old shfolder in preparation for vendor import
svn path=/trunk/; revision=18353
2005-10-08 19:20:41 +00:00
Gé van Geldorp
b181f1cd75 Sync to Wine-20050930:
Alexandre Julliard <julliard@winehq.org>
- Take into account -noname functions when checking for duplicate export
  names. Fixed a couple of issues found by the stricter check.
- We are no longer generating .dbg.c files.
Milko Krachounov <milko@3mhz.net>
- Bulgarian resources for mpr, msi, user, commdlg, oleaut32, shdocvw,
  shell32, comctl32, msrle32, mshtml, winspool, wineps, serialui,
  setupapi, wininet, regedit, uninstaller, notepad, winecfg and
  winhelp.
Alexander N. Sørnes <alex@thehandofagony.com>
- Added Norwegian translations.
Jacek Caban <jack@itma.pwr.wroc.pl>
- Make IPersist* interfaces heap based.
- Added IWebBrowser2 stub implementation.
- Make IProvideClassInfo2 interface heap based.
- Make IConnectionPointContainer interface heap based.
- Make WebBrowser heap based object.
- Improve stubs.
- Make IQuickActivate interface heap based.
- Added SetClientSite implementation.
- Make IOleControl and IOleInPlaceObject interface heap based.
Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com>
- Added Finnish resources.

svn path=/trunk/; revision=18351
2005-10-08 19:07:39 +00:00
Brandon Turner
a5ea3f54c1 Bring it up to date.
svn path=/trunk/; revision=18350
2005-10-08 18:08:17 +00:00
Brandon Turner
6eb6d65bcc DisplayBuffer is only used when DBG=1
svn path=/trunk/; revision=18349
2005-10-08 18:07:45 +00:00
Gé van Geldorp
cfda712e3a Sync to Wine-20050930:
Michael Jung <mjung@iss.tu-darmstadt.de>
- Don't clone pidlLast in SHBindToParent.
- Pass correct pointer to SHFree in case of failure in
  UNIXFS_path_to_pidl.
- Return E_FAIL if we can't get the unix path in
  IPersistFolder3::InitializeEx.
- Return E_NOAGGREGATION if non-NULL pUnkOuter is given to the
  constructor.
Alexandre Julliard <julliard@winehq.org>
- We are no longer generating .spec.c files.
- Generate 16-bit spec files as assembly code too.
- Use a more portable scheme for storing the name of a critical
  section.
- Removed unused debug channels.
- Specify 64-bit integers as double instead of long long in spec files
  so that we get the correct number of arguments.
- We are no longer generating .dbg.c files.
Milko Krachounov <milko@3mhz.net>
- Bulgarian resources for mpr, msi, user, commdlg, oleaut32, shdocvw,
  shell32, comctl32, msrle32, mshtml, winspool, wineps, serialui,
  setupapi, wininet, regedit, uninstaller, notepad, winecfg and
  winhelp.
Kevin Koltzau <kevin@plop.org>
- Fix warnings in 64bit.
Dmitry Timoshkov <dmitry@codeweavers.com>
- Stop using a not initialized variable szTemp in
  _dbg_ILSimpleGetText, make _dbg_ILSimpleGetText return no value since
  nobody is using it.
- Stop dereferencing a possible NULL in pdump since
  _dbg_ILGetDataPointer can potentially return NULL (for instance for
  root or desktop pidl).
- Make shdebugstr_guid use standard wine_dbg_sprintf instead of the
  handmade solution.
- Translate file name from unix to ANSI encoding in
  UnixFolder_IShellFolder2_GetDisplayNameOf.
- Pass a locally modified version of SHELLEXECUTEINFO to
  IShellExecuteHookW_Execute, this should pass through at least
  sei_tmp.nShow retrieved from an .lnk file (fStartup).
Alexander N. Sørnes <alex@thehandofagony.com>
- Added Norwegian translation of comctl32 and shell32.
Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com>
- Update Finnish resources.

svn path=/trunk/; revision=18348
2005-10-08 17:41:41 +00:00
Gé van Geldorp
b40e1a8202 Sync to Wine-20050930:
Robert Shearman <rob@codeweavers.com>
- Implement most of the details around unmarshalling of an object
  pointer.
- Fix allocation scheme in NdrConformantArrayUnmarshal to allocate if
  *ppMemory is NULL, like complex struct and user type unmarshalling.
- Fix ref-counting rules to match native DCOM Dlls.
Alexandre Julliard <julliard@winehq.org>
- Use a more portable scheme for storing the name of a critical
  section.
- We are no longer generating .dbg.c files.
Mike McCormack <mike@codeweavers.com>
- Fix gcc 4.0 warnings.

svn path=/trunk/; revision=18347
2005-10-08 17:26:40 +00:00
Gé van Geldorp
60725dc6bb Sync to Wine-20050930:
Rein Klazes <wijn@wanadoo.nl>
- When scrolling, first update the new position of the control before
  calling UpdateWindow().
Alexandre Julliard <julliard@winehq.org>
- Fixed gcc 4.0 warnings.
- We are no longer generating .dbg.c files.
Krzysztof Foltman <wdev@foltman.com>
- Reimplementation of EM_LINELENGTH.
- Some attempt at documentation of double-linked list of
  ME_DisplayItem's.
- Optional destinations in stylesheets are now skipped properly (and
  not treated as the "proper" styles as they were before).
- EOF condition in the middle of the stylesheet is no longer putting
  the reader into infinite loop,
- Half-full input buffers don't trigger EOF anymore (although it
  could, in theory, break some apps, I find it unlikely - and the
  change makes Out from Boneville installer display license properly).
Marcus Meissner <marcus@jet.franken.de>
- The last argument to MultiByteToWideChar is wide character count and
  not the buffer size in bytes. Fixed all places where it was wrong.

svn path=/trunk/; revision=18345
2005-10-08 17:17:27 +00:00
Gé van Geldorp
579ad59176 Fix EOLs
svn path=/trunk/; revision=18344
2005-10-08 17:15:42 +00:00
Gé van Geldorp
8c43bd1a89 Sync to Wine-20050930:
Alexandre Julliard <julliard@winehq.org>
- We are no longer generating .dbg.c files.
Alexander N. Sørnes <alex@thehandofagony.com>
- Added Norwegian translations.

svn path=/trunk/; revision=18343
2005-10-08 17:13:07 +00:00
Gé van Geldorp
8e75c86a0c Sync to Wine-20050930:
Francois Gouget <fgouget@free.fr>
- Fix .spec declarations for functinos with 64bit arguments (reported by
  winapi_check).
Robert Shearman <rob@codeweavers.com>
- Add VT_UNKNOWN support for VARIANT marshaling by generalising the
  existing VT_DISPATCH code.
- Fix ref-counting rules to match native DCOM Dlls.
Alex Villacís Lasso <a_villacis@palosanto.com>
- Modify VarDiv() and VarSub() to use the existing VarDecSub() and
  VarDecDiv() for DECIMAL.
- Fix a scaling error in VarR4FromDec() and VarR8FromDec() that
  incorrectly multiplies the high 32 bits of the DECIMAL by 1e64 instead
  of the correct 2^64.
- Make Single|Double->BSTR conversion use the specified locale for the
  decimal point even without the LOCALE_USE_NLS flag. Test supplied.
Alexandre Julliard <julliard@winehq.org>
- We are no longer generating .spec.c files.
- Removed unused debug channels.
- Specify 64-bit integers as double instead of long long in spec files
  so that we get the correct number of arguments.
- Use a more portable scheme for storing the name of a critical
  section.
- Use MAKEINTRESOURCE instead of casts where appropriate.
- We are no longer generating .dbg.c files.
Milko Krachounov <milko@3mhz.net>
- Bulgarian resources for mpr, msi, user, commdlg, oleaut32, shdocvw,
  shell32, comctl32, msrle32, mshtml, winspool, wineps, serialui,
  setupapi, wininet, regedit, uninstaller, notepad, winecfg and
  winhelp.
Mike McCormack <mike@codeweavers.com>
- Fix "empty body in an if/else-statement" warnings.
Walt Ogburn <reuben@ugcs.caltech.edu>
- Get IFontDisp type information from stdole2.tlb, instead of IDispatch
  information from stdole32.tlb.
Marcus Meissner <marcus@jet.franken.de>
- Support more arguments in _invoke().
Marcus Meissner <meissner@suse.de>
- VT_PTR->VT_USERDEFINED chains depend on the TKIND of the userdefined
  type due to our handling of COM interfaces in there.

svn path=/trunk/; revision=18342
2005-10-08 17:10:59 +00:00
Magnus Olsen
7725bc4867 sync to Wine-20050930 dsound does not have hardware acclation it is still hardcode to software mode.
svn path=/trunk/; revision=18341
2005-10-08 17:05:40 +00:00
Magnus Olsen
2a5a60d94e remove to file that was mistake by commit by me thx
Mike Lerwill" <mlist@ml-solutions.co.uk> that did notice it

svn path=/trunk/; revision=18340
2005-10-08 16:45:47 +00:00
Magnus Olsen
d0bc2f7b1a Dsound from win 2004 month 12 or month 11. It is working in windows 2000 in software emulation mode. Tested with quake2 and some other apps. Not tested in ReactOS
svn path=/trunk/; revision=18339
2005-10-08 16:38:07 +00:00
Martin Fuchs
ee7df88f58 update change list
svn path=/trunk/; revision=18338
2005-10-08 16:26:04 +00:00
Hervé Poussineau
3e45266afd Restart the device after its installation
svn path=/trunk/; revision=18337
2005-10-08 15:52:14 +00:00
Hervé Poussineau
875492f6ee Update section names
Add a upper filter serenum for serial ports

svn path=/trunk/; revision=18336
2005-10-08 15:20:13 +00:00
Hervé Poussineau
23b8989476 NtPlugPlayControl: Implement PlugPlayControlResetDevice case
svn path=/trunk/; revision=18335
2005-10-08 14:47:25 +00:00
Magnus Olsen
ac31de9a31 prepare for dsound add MAXWAVEDRIVERS and remove #ifdef _WINESRC_from WAVE_DIRECTSOUND
svn path=/trunk/; revision=18334
2005-10-08 13:57:36 +00:00
Gé van Geldorp
20cd7beedc Sync to Wine-20050930:
Aric Stewart <aric@codeweavers.com>
- Add the GUID for Patch files so that they can be opened as well. Looks
  like the database structure is pretty much the same.
- Implement MsiReinstallFeature.
- Be sure to null terminate the string in MsiGetProductInfoA after the
  W->A conversion using MsiGetProductInfoW if there is space.
- Added stub implementations for MsiEnumPatchesA/W.
Alexandre Julliard <julliard@winehq.org>
- We are no longer generating .dbg.c files.
- Use a more portable scheme for storing the name of a critical
  section.
- Get rid of a couple of non-portable long long constants.
- Fixed memory leak introduced in previous change.
- Avoid non-portable va_list manipulations.
Milko Krachounov <milko@3mhz.net>
- Bulgarian resources for mpr, msi, user, commdlg, oleaut32, shdocvw,
  shell32, comctl32, msrle32, mshtml, winspool, wineps, serialui,
  setupapi, wininet, regedit, uninstaller, notepad, winecfg and
  winhelp.
Jan Van Buggenhout <Chipzz@ULYSSIS.Org>
- implement stubs for MsiSequence[AW].
Dmitry Timoshkov <dmitry@codeweavers.com>
- COLOR_3DFACE is a better choice for the dialog background.
- Fix the usage of COLOR_xxx constants in the place of the window's
  class hbrBackground.
Mike McCormack <mike@codeweavers.com>
- Stub implementation of the RemoveIniValues action.
- Fix various memory leaks.
- Simplify the ProcessComponents action a little.
- Make build_icon_path return the path directly.
- Implement MsiSequenceA/W.
- Simplify the InstallValidate action a little.
- Added memory allocation inline functions (part 2).
- Fix a bug in a previous patch spotted by Dieter Komendera.
- Convert progids to a standard list.
- convert verbs into a standard list
- remove limitation of 100 verbs
- use pointers to verbs rather than indexes
- Rename load_dynamic_property and remove its unused 3rd argument.
- Create a macro to write a value to a subkey.
- Use the new msi_reg_set* macros where possible.
- Create a macro function to write registry values.
- fix a bug introduced by the progid list conversion
- make a fixme a little less alarmist
- Add objects to lists at the right time.
- Fix some simple memory leaks.
- Fix an error introduced when converting dialog lists to standard
  lists.
- Added memory allocation inline functions (part 1).
- Make sure not to free a a pointer that has been modified.
  Check that the text identifier doesn't contain invalid characters.
- Don't quote numbers in a query, as it doesn't parse correctly.
- Read the MaskEdit template from the correct db field.
- Don't create MSI handles unless we have to pass one through the API.
- Convert the list of dialog controls to a standard list.
- Deformat all dialog text strings before using them.
- Load riched20.dll on demand, and unload it after it's used (based on a
  patch by Rob Shearman).
- Make sure to release the package we grabbed on the error path.
- Fix and test MsiViewGetColumnInfo and binary fields.
- Skip dash characters in the PIDMask for a MaskedEdit control.
- Don't refcount tables.
- Fix an uninitialized variable problem.
- Fix memory leaks in the table code.
- Fix memory leaks.
- Remove some unused values in the object header.
- Fill out the stubs for MsiApplyTransformA/W a bit more.
- Fix various query related memory leaks.
- Make sure to set the minimum size before allocating string table
  memory.
- Don't include the terminating nul in the length in
  MsiSummaryInfoGetPropertyW.
- fix MsiSummaryInfoGetProperty to return ERROR_MORE_DATA if the
  buffer is too small (based on a patch by Aric Stewart)
- add a test case to show correct behaviour
- Create a function to determine the table's row size and use it.
  Fix a memory leak in the table code.
- Eliminate fixed length buffers from the MSIFEATURE structure.
- Fix more fixed length buffers.
- Reduce the indent level of a function.
- Allocate memory rather than using fixed length buffers.
- Remove an unnecessary level of indent.
- Keep temporary files in a seperate list.
- Rename ACTION_DoTopLevelINSTALL to MSI_InstallPackage, remove its
  duplicate 4th parameter.
  Split the code to copy a package into a separate function.
- Avoid fixed length buffers for conditions.
- Fix a memory leak.
- Create a function to read a property as an integer.
- Make some fixme messages less alarmist.
- Fix if's that are followed by semicolons.
- Add some more action stubs, remove forward declarations.
- Eliminate yet more fixed length buffers.
- Convert RunningActions array into a list.
- Split command line parsing from MSI_InstallPackage into a separate
  function.
- Move a fixed size buffer to the heap.
- Fix memory leaks in custom actions.
- Make a macro function for unimplemented actions.
  Add some more unimplemented action stubs.
- Make load_string_table return the string table.
- Stub implementation of the IsolateComponents action.
- Convert the list of tables to a standard list.
- Add a stub implementation of the BindImage action.
- Avoid UpdateWindow, it causes trouble with WS_EX_TRANSPARENT.
- Stub implementation of the PatchFiles action.
- Fix another memory leak.
- Add the progress control.
- Stub implementation of the MoveFiles action.
- Avoid using static variables in the InstallFiles action.
- Take advantage of the msi_get_deformatted_field function to simplify
  some code.
- Improve a fixme message a little.
- Skip the first character of a font identifier if it's \ or &.
- Make sure not to access invalid components or features.
- Fix the handling of MsiGetTargetPath args (with test case).
- Fix the handling of MsiDoAction args (with test case).
- Fixes for MsiGetSourcePath parameter handling.
- Load a table's column information separately from the table itself.
- Handle copying of the install package to a temporary file in one place
  only.
- Implement MsiGetShortcutTargetA.
- Fix the stub for MsiConfigureFeature.
Alexander N. Sørnes <alex@thehandofagony.com>
- Added Norwegian translations.
Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com>
- Added Finnish resources.

svn path=/trunk/; revision=18333
2005-10-08 13:45:19 +00:00
Gé van Geldorp
ab288dfff4 Sync to Wine-20050930:
Alexandre Julliard <julliard@winehq.org>
- We are no longer generating .dbg.c files.
Milko Krachounov <milko@3mhz.net>
- Bulgarian resources for mpr, msi, user, commdlg, oleaut32, shdocvw,
  shell32, comctl32, msrle32, mshtml, winspool, wineps, serialui,
  setupapi, wininet, regedit, uninstaller, notepad, winecfg and
  winhelp.
Alexander N. Sørnes <alex@thehandofagony.com>
- Added Norwegian translations.

svn path=/trunk/; revision=18332
2005-10-08 13:34:21 +00:00
Gé van Geldorp
7b0072d23f Sync to Wine-20050930:
Alexandre Julliard <julliard@winehq.org>
- We are no longer generating .spec.c files.
- We are no longer generating .dbg.c files.
Milko Krachounov <milko@3mhz.net>
- Bulgarian resources for mpr, msi, user, commdlg, oleaut32, shdocvw,
  shell32, comctl32, msrle32, mshtml, winspool, wineps, serialui,
  setupapi, wininet, regedit, uninstaller, notepad, winecfg and
  winhelp.
Kevin Koltzau <kevin@plop.org>
- Fix warnings in 64bit.
Mike McCormack <mike@codeweavers.com>
- Fix gcc 4.0 warnings.
Alexander N. Sørnes <alex@thehandofagony.com>
- Added Norwegian translations.
Marcus Meissner <meissner@suse.de>
- PrintDlg16: Copy back the Flags, nFromPage, nToPage and nCopies struct
  members after the print dialog finishes.
Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com>
- Bring Finnish resources up to date.

svn path=/trunk/; revision=18331
2005-10-08 13:28:54 +00:00
Gé van Geldorp
4f410ff156 Use Wine solution for MRU problem, which is slightly different from the
solution which was implemented in ReactOS

svn path=/trunk/; revision=18330
2005-10-08 13:24:27 +00:00
Gé van Geldorp
b09d85cc20 Sync to Wine-20050930:
Michael Jung <mjung@iss.tu-darmstadt.de>
- Fixed inconsistency in LISTVIEW_DUMP macro.
Robert Shearman <rob@codeweavers.com>
- Add support for navigating a toolbar with the arrow keys.
- Fix WrapToolbar in the case of no parent window.
- Use the newly added NMTBINITCUSTOMIZE for sending the
  TBN_INITCUSTOMIZE so that it is safe on 64-bit platforms.
Aric Stewart <aric@codeweavers.com>
- Reading the MRUlist using the W functions we need to divide the size
  by sizeof(WCHAR) to get the count of characters.
Alexandre Julliard <julliard@winehq.org>
- Specify 64-bit integers as double instead of long long in spec files
  so that we get the correct number of arguments.
- We are no longer generating .dbg.c files.
Milko Krachounov <milko@3mhz.net>
- Bulgarian resources for mpr, msi, user, commdlg, oleaut32, shdocvw,
  shell32, comctl32, msrle32, mshtml, winspool, wineps, serialui,
  setupapi, wininet, regedit, uninstaller, notepad, winecfg and
  winhelp.
Dmitry Timoshkov <dmitry@codeweavers.com>
- Call SetDIBits with a proper DC in order to set bitmap bits.
Mike McCormack <mike@codeweavers.com>
- Fix if's that are followed by semicolons.
Alexander N. Sørnes <alex@thehandofagony.com>
- Added Norwegian translation of comctl32 and shell32.
Marcus Meissner <marcus@jet.franken.de>
- The last argument to MultiByteToWideChar is wide character count and
  not the buffer size in bytes. Fixed all places where it was wrong.
Frank Richter <frank.richter@gmail.com>
- Unregister theming subclasses at comctl32 shutdown; should fix
  reported re-registration errors.
Jason Edmeades <us@edmeades.me.uk>
- Fix some off by one calculations in the comboboxex functions, and
  handle an out of range positive index the same as windows + unit test
  case.

svn path=/trunk/; revision=18329
2005-10-08 13:20:03 +00:00
Gregor Anich
3e73bd8b79 Add 'break_on_module_load' option to KDB. When enabled KDB will be entered for each module beeing loaded, and one can set
breakpoints etc.

svn path=/trunk/; revision=18328
2005-10-08 12:47:53 +00:00
Gé van Geldorp
34d7b92b27 Sync to Wine-20050930:
Alexandre Julliard <julliard@winehq.org>
- Fixed a number of pointer to integer conversions that wouldn't work
  right on a 64-bit platform.
- Now that we are requiring bison anyway, make the .tab.c file use the
  same base name as the .y file, so that we can generate correct
  dependencies in all cases.

svn path=/trunk/; revision=18327
2005-10-08 12:43:38 +00:00
Hervé Poussineau
0b7207b338 Fix Hardware IDs and Compatible IDs returned for PCI devices
svn path=/trunk/; revision=18326
2005-10-08 12:24:39 +00:00
Gé van Geldorp
017639fcc2 Sync to Wine-20050930:
Alexandre Julliard <julliard@winehq.org>
- Generate 16-bit spec files as assembly code too.
- Output the resource data in assembly too.
- Factor out a couple of useful helper functions.
- Store RVAs instead of pointers wherever possible in the generated NT
  header and directories.
- Output constant strings in a more appropriate section than .text.
- Make sure that values of absolute symbols fit in 16 bits.
- Implemented import thunks for x86-64.
- Generate stub functions directly in assembly.
- Moved stub function generation to import.c. Added a get_stub_name
  function to ensure naming consistency.
- Now that everything is done in assembly in the spec file, directly
  generate a .s file to bypass gcc inefficiency with large data
  structures.
- Added support for 64-bit format NT header and export/import tables.
- Now that we have to be able to run the assembler from winebuild, added
  an option to generate a .spec.o file in a single step.
  Added --save-temps and --verbose options for easier debugging.
- Added an entry point routine for native drivers.
- Added a bit of framework for future x86_64 support.
- Create an assembly file with all undefined symbols and add it to the
  link command so that the symbols show up in the final undefined list.
  Use that list to create thunks for all exported but undefined symbols,
  to make sure all export RVAs point somewhere inside the module.
- Take into account -noname functions when checking for duplicate export
  names. Fixed a couple of issues found by the stricter check.
- Generate the NT header in assembly instead of using a C structure.
- Don't remove ignored symbols from the undefined list, simply skip them
  when resolving imports.
  Added get_temp_file_name utility function.
- Fixed stack offset of %eax register.
- Output the delayed import table using assembly too.
- Added a common function to declare global symbols, and make them
  hidden on platforms that support it.
- Fixed a number of pointer to integer conversions that wouldn't work
  right on a 64-bit platform.
- Output the import directory using assembly instead of C structures.
- Defined a proper structure for debug channels.
  Also put all the function pointers inside a structure and added
  __wine_dbg_set_functions to change them instead of exporting the
  pointers directly.
- Moved return value handling to the individual relay thunks so that we
  only need one version of wine_call_from_16.
  Patch the wine_call_from_16 address along with the cs value directly
  in the 16-bit code segment to avoid the need for special magic in the
  import thunks.
- Moved the spec file init function and constructor to winecrt0.
- Make the users of wine_call_from_32_regs save %eax so that we don't
  need a special hack in the import thunk.
  Added a get_pc_thunk_eax function to simplify the code a bit.
- Get rid of the debug channels support.

svn path=/trunk/; revision=18325
2005-10-08 12:18:07 +00:00
Magnus Olsen
c787e10fca Fixing dsdesc stuct with right name from wine
I did correct right datatype in the struct
fix minor change in dsound.h

svn path=/trunk/; revision=18324
2005-10-08 11:26:13 +00:00
Magnus Olsen
cd198924db prepare for dsound
svn path=/trunk/; revision=18323
2005-10-08 10:52:43 +00:00
Gé van Geldorp
babb2de970 Sync to Wine-20050930:
Alexandre Julliard <julliard@winehq.org>
- Now that we are requiring bison anyway, make the .tab.c file use the
  same base name as the .y file, so that we can generate correct
  dependencies in all cases.

svn path=/trunk/; revision=18322
2005-10-08 10:28:57 +00:00
Gé van Geldorp
3ccfb20218 Sync to Wine-20050930:
Alexandre Julliard <julliard@winehq.org>
- Avoid some warnings on 64-bit platforms.

svn path=/trunk/; revision=18321
2005-10-08 09:33:47 +00:00
Magnus Olsen
a9fba037ec change from warning to allowwarnings ="true" thx Christoph_vW and blight_
svn path=/trunk/; revision=18319
2005-10-08 00:41:31 +00:00
Magnus Olsen
f66d835b98 Sync aginst a older version of wine, fixed GvG patch for so we do not lose poll_mouse, tested in few apps and games in ros and windows. Next sync is against current version of wine. and it does remove almost whole my patch for wine dinput thx to GvG implemet userhook for mouse and keyboard in reactos.
svn path=/trunk/; revision=18318
2005-10-08 00:21:29 +00:00
Magnus Olsen
c968095964 basic NT4 DirectDraw implemet and it is untested
- NtGdiDdGetBltStatus
- NtGdiDdGetFlipStatus
- NtGdiDdSetOverlayPosition

Write some code for NtGdiDdDestroySurface and NtGdiDdCreateSurface, we got now basic all nt4 api implemet and unstested  for directdraw in the kernel


svn path=/trunk/; revision=18317
2005-10-07 22:50:26 +00:00
Magnus Olsen
4495522a13 Fix hotkeys for En.rc by Harteex, thx Tsk to found this bugs
svn path=/trunk/; revision=18316
2005-10-07 22:20:50 +00:00
Magnus Olsen
d36e1abc80 Fix release build uninitialized
Implemet NtGdiDdAddAttachedSurface untested 

svn path=/trunk/; revision=18315
2005-10-07 21:48:12 +00:00
Magnus Olsen
2b24d9c754 make ddraw compile again
svn path=/trunk/; revision=18314
2005-10-07 21:30:33 +00:00
Magnus Olsen
f84e3fa9f1 Remove more stub from ntdraw and implement it, (untested) it is alot of stub that have been implemet. fill DD_CALLBACKS right in NtGdiDdCreateDirectDrawObject, and fix party the internal struct.
implemet follow but not tested
- NtGdiDdCreateSurface, NtGdiDdDestroySurface 
  some part it need fill the info right before it call on DdCreateSurface
-  NtGdiDdFlip done
-  NtGdiDdGetScanLine done
-  NtGdiDdSetColorKey done
-  NtGdiDdUnlock done
-  NtGdiDdUpdateOverlay done
-  NtGdiDdSetExclusiveMode done (need setup the callback)
-  NtGdiDdLock done

svn path=/trunk/; revision=18313
2005-10-07 20:27:52 +00:00
Magnus Olsen
a2e6df2fb3 Updating ddrawint.h header with some new struct and right info.
svn path=/trunk/; revision=18312
2005-10-07 20:15:10 +00:00
Ged Murphy
0b8dac7e24 adding traceroute to build.
svn path=/trunk/; revision=18311
2005-10-07 19:16:14 +00:00
Hervé Poussineau
c2199941a3 Allocate memory even for NULL strings, as we must not return a NULL pointer
svn path=/trunk/; revision=18310
2005-10-07 15:47:17 +00:00
Hervé Poussineau
10e6548a78 - Fill Level field in DEVICE_NODE structure
- Full support of ParentIdPrefix value in registry
- Implement IRP_MJ_PNP/IRP_MN_QUERY_CAPABILITIES for PDOs enumerated by Root bus
- Add a temporary hack in pci driver as long as Plug and Play is not ready

=> This would allow to have two identical devices plugged on different buses (for example, two USB mices plugged on different hubs)

svn path=/trunk/; revision=18309
2005-10-07 13:09:23 +00:00
Thomas Bluemel
b0418e9481 partly implemented AuthzInitializeResourceManager and AuthzFreeResourceManager (no support for auditing so far)
svn path=/trunk/; revision=18308
2005-10-07 02:28:42 +00:00
Nathan Woods
4294896fbd Regedit: Fixed a bug whereby a registry path accessed by "Goto" might not get properly selected
svn path=/trunk/; revision=18307
2005-10-07 00:35:10 +00:00
Nathan Woods
37a51aa3f6 Calc: Now using the proper system brush to paint the number pane
svn path=/trunk/; revision=18306
2005-10-07 00:32:00 +00:00
Thomas Bluemel
69d5c43dbd fixed uninitialized variable warning
svn path=/trunk/; revision=18305
2005-10-06 23:04:00 +00:00
Hervé Poussineau
9a0d62abb9 Various changes to device installation functions:
- AddDriverToList:
  Define a unique return point for the function
- GetVersionInformationFromInfFile:
  Return driver date (still doesn't return driver version)
- SetupDiCallClassInstaller:
  Change device and class co-installers messages (they were swapped)
- SetupDiInstallDevice:
  Create driver key in HKLM\System\CurrentControlSet\Control\Class and write values to it
  Add missing informations to enum key (HKLM\System\CurrentControlSet\Enum)
  Define a unique return point for the function

svn path=/trunk/; revision=18304
2005-10-06 22:47:13 +00:00
Hervé Poussineau
7d441d9406 Implement SetupDiGetINFClassW
svn path=/trunk/; revision=18303
2005-10-06 22:36:14 +00:00
Thomas Bluemel
5bd4220e33 fixed warnings when compiled with -Wmissing-declarations
svn path=/trunk/; revision=18302
2005-10-06 21:39:18 +00:00
Magnus Olsen
03e3c42104 NtGdiDdGetAvailDriverMemory
- implement the code but the pointer is not set to DdGetAvailDriverMemory and it is undtested. 

svn path=/trunk/; revision=18301
2005-10-06 21:18:59 +00:00
Gregor Anich
ff9641a734 Fix KiGetFpuState() - Thanks to Hartmut for finding this bug and testing the patch.
svn path=/trunk/; revision=18300
2005-10-06 20:34:20 +00:00
Andrew Munger
d004682a00 winver.exe by Christoph.AT.ApiViewer.de
svn path=/trunk/; revision=18299
2005-10-06 20:07:24 +00:00
Thomas Bluemel
23acca9ef0 fixed warnings when compiled with -Wmissing-declarations
svn path=/trunk/; revision=18298
2005-10-06 19:24:15 +00:00
Thomas Bluemel
0c48b5f905 fixed warnings when compiled with -Wmissing-declarations
svn path=/trunk/; revision=18297
2005-10-06 18:51:52 +00:00
Gregor Anich
611d7cf177 Patch by Christoph v.W.:
- speed-up adding items to ListView
- fix resource leak (GetDC without ReleaseDC)
(Bug #870)

svn path=/trunk/; revision=18296
2005-10-06 15:02:50 +00:00
Gregor Anich
23dc71c784 ModifyMenuA: Zero initialize MENUITEMINFOA (like ModifyMenuW does)
Fixes bug 818 according to Christoph v.W.
Thanks to j_anderw for his patch proposal.

svn path=/trunk/; revision=18295
2005-10-06 14:31:18 +00:00
Gunnar Dalsnes
93a2fb4cd2 doesnt belong here either
svn path=/trunk/; revision=18294
2005-10-06 13:07:53 +00:00
Gunnar Dalsnes
e70589544c doesnt belong here
svn path=/trunk/; revision=18293
2005-10-06 13:07:00 +00:00
Gregor Anich
8f4754e6fa Huh, what? Oops! Just some stuff which noone cares about...
svn path=/trunk/; revision=18292
2005-10-06 12:36:53 +00:00
Hervé Poussineau
94f68fddfc Add newdev.dll to bootcd
Fix formatting, by replacing tabulations by spaces

svn path=/trunk/; revision=18291
2005-10-06 11:59:15 +00:00
Hervé Poussineau
ceff0e9f0e Do only one exit point in SetupDiInstallDevice
svn path=/trunk/; revision=18290
2005-10-06 09:55:10 +00:00
Nathan Woods
abc9898008 Regedit: Now saves last key visited, like Windows regedit
svn path=/trunk/; revision=18289
2005-10-06 03:23:09 +00:00
Nathan Woods
2c2cc6d808 Calc: TCHAR-izing, formatting and const-correctness
svn path=/trunk/; revision=18288
2005-10-05 23:59:13 +00:00
Nathan Woods
d546f71ac4 Notepad: Goto an offscreen line will now properly scroll the edit control
svn path=/trunk/; revision=18287
2005-10-05 23:52:43 +00:00
Gregor Anich
2446ae0fd7 Change indentation - make it a bit more readable and same style everywhere.
KiCheckFPU: Change calculation of DummyArea/FxSaveArea (avoid conditional)
KeSaveFloatingPointState: Allocate NonPagedPool for the saved state because function can be called only at IRQL >= DISPATCH

svn path=/trunk/; revision=18286
2005-10-05 23:30:39 +00:00
Martin Fuchs
7d6d579a40 strip extended options from the front of the command line
svn path=/trunk/; revision=18285
2005-10-05 23:24:25 +00:00
Martin Fuchs
499bb6d2d7 implemented command line parser for Explorer
svn path=/trunk/; revision=18284
2005-10-05 23:05:13 +00:00
Emanuele Aliberti
361239a411 XML chunks must contain a single subtree.
svn path=/trunk/; revision=18283
2005-10-05 20:36:23 +00:00
Martin Fuchs
9349545f98 comment, const corrections
svn path=/trunk/; revision=18282
2005-10-05 19:52:39 +00:00
Martin Fuchs
e86e062d9a leave TrackStartmenu() function when executing any start menu command
svn path=/trunk/; revision=18281
2005-10-05 19:51:08 +00:00
Magnus Olsen
c82718f9a2 NtGdiDdCreateDirectDrawObject
- add missing error checking for GDIOBJ_AllocObj 
- add missing error checking for GDIOBJ_LockObj 

svn path=/trunk/; revision=18280
2005-10-05 19:50:48 +00:00
Martin Fuchs
b6c5bedb31 use GET_X_LPARAM macro in WM_MOUSEMOVE handlers
svn path=/trunk/; revision=18279
2005-10-05 19:49:37 +00:00
Martin Fuchs
f382f81ffe one-click activation of "Start" button
svn path=/trunk/; revision=18278
2005-10-05 19:48:29 +00:00
Martin Fuchs
dc8d217b1f update TODO list
svn path=/trunk/; revision=18277
2005-10-05 19:47:28 +00:00
Magnus Olsen
24269c114d activate PDD_DIRECTDRAW for GDIOBJ_LockObj so it does not fail if it is GDI_OBJECT_TYPE_DIRECTDRAW request. Thx w3seek for his guiding how todo it.
svn path=/trunk/; revision=18276
2005-10-05 19:29:08 +00:00
Hartmut Birr
09f3f08c6d Implemented SRB_FUNCTION_IO_CONTROL/IOCTL_SCSI_MINIPORT_IDENTIFY.
svn path=/trunk/; revision=18275
2005-10-05 18:36:10 +00:00
Hartmut Birr
baac20f12f Implemented IOCTL_SCSI_MINIPORT.
svn path=/trunk/; revision=18274
2005-10-05 18:24:24 +00:00
Martin Fuchs
006fe6a358 create some start menu entries for notepad, regedit and winefile
svn path=/trunk/; revision=18273
2005-10-05 16:47:19 +00:00
Martin Fuchs
ed14f79996 remove duplicate RegQueryStringValue() function
svn path=/trunk/; revision=18272
2005-10-05 16:11:21 +00:00
Martin Fuchs
5f5bf68c82 partial implementation of ShowWindowAsync() using the synchronous NtUserShowWindow() call to activate the desktop switcher
svn path=/trunk/; revision=18271
2005-10-05 14:47:07 +00:00
Nathan Woods
f8b4f3f219 Regedit: Now restores last position on startup
Still need to save position on exit


svn path=/trunk/; revision=18270
2005-10-05 13:25:14 +00:00
Martin Fuchs
3df2610b06 fix UNICODE control panel calls to handle double clicks on the task bar clock
svn path=/trunk/; revision=18269
2005-10-05 13:08:59 +00:00
Nathan Woods
67bc4a8961 Rbuild: Enhanced MSVC support
1.  Enhanced the MSVC backends so that it pulls in information from the main project
2.  Fixed bugs in Path::RelativeFromDirectory() in tools\rbuild\XML.cpp

With these changes, many VC projects generated by rbuild now compile without any tweaking


svn path=/trunk/; revision=18268
2005-10-05 00:27:25 +00:00
Brandon Turner
4dbeaea6e7 Better way to fix 868. Check the last error instead of checking before hand. Thanks to billgMS for point this out.
svn path=/trunk/; revision=18267
2005-10-04 15:32:04 +00:00
Brandon Turner
4d9e3c92a6 Check to see if a folder or file is already there when makign a folder. Set correct errorlevel when fail to create folder. fixes bug 868.
svn path=/trunk/; revision=18266
2005-10-04 14:56:38 +00:00
Martin Fuchs
55265598c2 activate execution from command bar
svn path=/trunk/; revision=18265
2005-10-04 14:31:11 +00:00
Martin Fuchs
b43dd57063 "execute" menu entry
svn path=/trunk/; revision=18264
2005-10-04 14:06:33 +00:00
Martin Fuchs
ac5f8b6843 set EOL-style
svn path=/trunk/; revision=18263
2005-10-04 13:47:22 +00:00
Brandon Turner
1280e7e797 Add errorlevel for set /A
svn path=/trunk/; revision=18262
2005-10-04 13:45:19 +00:00
Martin Fuchs
a9e32dc111 remove remaining winefile resources
svn path=/trunk/; revision=18261
2005-10-04 13:43:15 +00:00
Nathan Woods
ec1530d488 Notepad: Fixed a bug when opening files with no characters other than byte order marks
svn path=/trunk/; revision=18260
2005-10-04 12:57:04 +00:00
Nathan Woods
ec396aa21f Regedit: Stopgap fix to build error just introduced; need to go through Regedit and TCHAR-ize it
svn path=/trunk/; revision=18259
2005-10-04 12:41:08 +00:00
Martin Fuchs
5638dcb792 complete german resources for explorer
svn path=/trunk/; revision=18258
2005-10-04 12:02:34 +00:00
Nathan Woods
c80b556537 Regedit: Fixed stupid compilation errors
svn path=/trunk/; revision=18257
2005-10-04 02:46:14 +00:00
Nathan Woods
2639ea0346 Regedit: Fixed exporting subtrees with Unicode
Core exporting code still ANSI; need to fix this


svn path=/trunk/; revision=18256
2005-10-04 02:40:01 +00:00
Thomas Bluemel
e908a4d408 don't leak memory in RegDeleteTree() when NtEnumerateKey() returns an unexpected error code (such as when there's insufficient system resources to perform the query)
svn path=/trunk/; revision=18255
2005-10-03 23:01:10 +00:00
Thomas Bluemel
f710105b8b fixed a memory leak in RegDeleteTree() that could be caused when two threads attempt to delete the same tree simultaneously
svn path=/trunk/; revision=18254
2005-10-03 22:46:49 +00:00
Emanuele Aliberti
64e0a3529d A note about this piece of code.
svn path=/trunk/; revision=18253
2005-10-03 21:40:58 +00:00
Thomas Bluemel
3fc6884ed5 Don't fail when there are no more subkeys to delete in RegDeleteTree()
svn path=/trunk/; revision=18252
2005-10-03 21:37:05 +00:00
Emanuele Aliberti
7d51afc9cf A raw attempt to fix the startup code for native processes.
(note: it seems NTOSKRNL passes nothing to smss.exe)

svn path=/trunk/; revision=18251
2005-10-03 21:35:12 +00:00
Brandon Turner
ce7daa3fef dont use the whole commandline as a fall back for execution searching because it could contain spaces. also, wrap commandline params in quotes so if there is a space in the path it still finds it. bug found by billgMS.
svn path=/trunk/; revision=18250
2005-10-03 20:28:29 +00:00
Hartmut Birr
7402ea80eb Return an error instead of STATUS_SUCCESS for functions which are not implemented or supported (in ScsiPortDeviceControl).
svn path=/trunk/; revision=18249
2005-10-03 18:49:44 +00:00
Ged Murphy
0b7743d63e - Don't call winsock initialiser for each seperate server thread
- Add more code for tcpsvcs to be controled via services. Still #if 0'd out until fully implemented.
- Make server more informative with what is happening. (this info will be output to a log file once implemented as a service.

svn path=/trunk/; revision=18248
2005-10-03 18:32:30 +00:00
Thomas Bluemel
b9430af2fd don't use invalid options in the DSOP_INIT_INFO structure of the computer selection dialog
svn path=/trunk/; revision=18247
2005-10-03 14:42:34 +00:00
Thomas Bluemel
9e960ba331 build regedit as unicode by default
svn path=/trunk/; revision=18246
2005-10-03 13:44:18 +00:00
Hervé Poussineau
bb46913ed6 Remove debug output I've incidentally added...
svn path=/trunk/; revision=18245
2005-10-03 12:57:48 +00:00
Hervé Poussineau
4b42aa47f1 Implement IRP_MJ_PNP / IRP_MN_QUERY_TEXT / DeviceTextDescription for ACPI devices
svn path=/trunk/; revision=18244
2005-10-03 12:53:31 +00:00
Nathan Woods
32cf34124f Regedit: Added a "Goto key" right-click option.
This feature allows the user to right click on certain keys that "link" to other keys, Regedit can provide additional "Go to ...." menu items.  For example, if you click on a ProgID under HKCR, a "Go to 'HKCR\CLSID\{....}' menu item will appear.


svn path=/trunk/; revision=18243
2005-10-03 12:39:50 +00:00
Eric Kohl
ccfa60dea9 Revert sublang changes.
svn path=/trunk/; revision=18242
2005-10-03 12:12:19 +00:00
Hervé Poussineau
aa1f470e40 Reference the PDO before returning it
svn path=/trunk/; revision=18241
2005-10-03 10:13:28 +00:00
Eric Kohl
5a455c2aa3 - Add german resources.
- Use SUBLANG_DEFAULT by default.
- Fix control panel description.

svn path=/trunk/; revision=18240
2005-10-03 09:14:57 +00:00
Hervé Poussineau
7a6054e30a Add "Add hardware" control panel applet.
Not added to the build, as InstallNewDevice in newdev.dll is not implemented

svn path=/trunk/; revision=18239
2005-10-03 07:48:59 +00:00
Hervé Poussineau
88f8bc8a25 Add SetupPromptReboot stub
In SetupInstallServicesFromInfSectionExW, LoadOrderGroup value is optional. Don't break if it is missing

svn path=/trunk/; revision=18238
2005-10-03 07:26:39 +00:00
Hervé Poussineau
cd5d63f1b8 Implement CM_Get_DevNode_Registry_Property_ExA
svn path=/trunk/; revision=18237
2005-10-03 07:22:19 +00:00
Hervé Poussineau
ecc00fcc3f Replace STDCALL by NTAPI
Little changes in vfat.h to be able to compile with MSVC

svn path=/trunk/; revision=18236
2005-10-03 07:15:12 +00:00
Hervé Poussineau
5f72d81983 Map status codes to CONFIGRET error codes
svn path=/trunk/; revision=18235
2005-10-03 07:06:42 +00:00
Brandon Turner
b45fcd6e73 fix detection of missing target. thanks to thomas.
svn path=/trunk/; revision=18234
2005-10-03 00:51:24 +00:00
Brandon Turner
f04df80d72 allocate memory for the string. thanks to thomas for finding it.
svn path=/trunk/; revision=18233
2005-10-03 00:26:39 +00:00
Brandon Turner
b736dee2b9 Implemented /S and /Q in remove directory.
Added a check for files in the folder. This fixes bug 742.
Updated res file, translators please update sometime soon.

svn path=/trunk/; revision=18232
2005-10-02 20:17:59 +00:00
Emanuele Aliberti
bc0e74489f add comp.exe (optional).
svn path=/trunk/; revision=18231
2005-10-02 20:03:20 +00:00
Emanuele Aliberti
7411ee2fea More fixes to compile.
svn path=/trunk/; revision=18230
2005-10-02 19:39:30 +00:00
Emanuele Aliberti
fdf33e349f Modify to conform to the new CSR.
svn path=/trunk/; revision=18229
2005-10-02 19:31:30 +00:00
Martin Fuchs
006c9f00e8 a bit of Makefile and string constants cleanup
svn path=/trunk/; revision=18228
2005-10-02 18:31:50 +00:00
Martin Fuchs
723b42a105 work around GCC's wide string constant bug to fix tree list image loading
svn path=/trunk/; revision=18227
2005-10-02 18:28:36 +00:00
Emanuele Aliberti
0732c808f0 Fix compilation.
svn path=/trunk/; revision=18226
2005-10-02 18:00:04 +00:00
Emanuele Aliberti
0862f96309 Support all optional modules and possibly a 'windows' one where every piece of code related to the Win32 subsystem will be stored (eventually to be voted on, I suppose).
The idea of moving the Win32 emulation out of the main ros tree popped up days ago in a chat session with Filip (cleaning it would help those who want an embeddable ros or a native only ros).

svn path=/trunk/; revision=18225
2005-10-02 17:54:56 +00:00
Emanuele Aliberti
62955cc11a csr.exe uses nt startup library.
svn path=/trunk/; revision=18224
2005-10-02 17:41:30 +00:00
Emanuele Aliberti
bdd38fc6a9 Rename the XML chunk too.
svn path=/trunk/; revision=18223
2005-10-02 17:39:54 +00:00
Emanuele Aliberti
21313e9c16 Give ntrt0lib its public name.
svn path=/trunk/; revision=18222
2005-10-02 17:38:28 +00:00
Alex Ionescu
03cc0f01b6 - Implement Native Entrypoint for our NT.LIB
svn path=/trunk/; revision=18221
2005-10-02 16:58:35 +00:00
Emanuele Aliberti
abd8566faa csr.exe is built using ntrt0lib.
svn path=/trunk/; revision=18220
2005-10-02 16:23:26 +00:00
Emanuele Aliberti
bf66746b2d A do-nothing crt0 for native NT processes.
(see note by A.Ionescu in reactos/subsys/crt/main.c)

svn path=/trunk/; revision=18219
2005-10-02 16:09:30 +00:00
Martin Fuchs
a9fdaba902 Doxygen scripts
svn path=/trunk/; revision=18218
2005-10-02 15:59:15 +00:00
Emanuele Aliberti
3ddfd74461 Add stub for RtlSetProcessIsCritical.
svn path=/trunk/; revision=18217
2005-10-02 15:50:30 +00:00
Eric Kohl
855c2bb882 Named pipes must be opened for asynchronous access.
This fixes bug #826.

svn path=/trunk/; revision=18216
2005-10-02 14:10:05 +00:00
Thomas Bluemel
8732a698df sizeof(HelloString) does already contain the terminating NULL. Thanks to Hartmut.
svn path=/trunk/; revision=18215
2005-10-02 13:54:32 +00:00
Thomas Bluemel
d5169058c9 fixed difference in signedness warnings
svn path=/trunk/; revision=18214
2005-10-02 13:47:48 +00:00
Thomas Bluemel
0e10526c80 minor changes (mostly formatting)
svn path=/trunk/; revision=18213
2005-10-02 12:46:49 +00:00
Thomas Bluemel
4ca189ac66 make the tree compilable again...
svn path=/trunk/; revision=18212
2005-10-02 12:27:54 +00:00
Martin Fuchs
90637152d6 fix directory traversing in explorer SDI windows
svn path=/trunk/; revision=18211
2005-10-02 12:25:42 +00:00
Martin Fuchs
6a834bb1fb fix enabling of split border
svn path=/trunk/; revision=18210
2005-10-02 12:24:10 +00:00
Martin Fuchs
63935e005c new option to open explorer subfolders in separate windows
svn path=/trunk/; revision=18209
2005-10-02 11:40:41 +00:00
Hervé Poussineau
5ffe4c4880 Add stubs for InstallNewDevice, InstallSelectedDriver, UpdateDriverForPlugAndPlayDevicesA/W
svn path=/trunk/; revision=18208
2005-10-02 10:33:25 +00:00
Eric Kohl
886778d0b2 Implement CM_Request_Eject_PC[_Ex].
svn path=/trunk/; revision=18207
2005-10-02 10:07:25 +00:00
Hartmut Birr
3a68545201 Disable the serial debug output if the com port doesn't exist.
svn path=/trunk/; revision=18206
2005-10-02 09:42:12 +00:00
Alex Ionescu
5df400b823 - Fix gcc compilation issues
- Fix most ld linking issues.

svn path=/trunk/; revision=18205
2005-10-02 08:40:49 +00:00
Alex Ionescu
29b8aa245a - Don't undef DBG_CONTINUE.
svn path=/trunk/; revision=18204
2005-10-02 08:33:38 +00:00
Alex Ionescu
d753940a60 - Small csr server public header cleanup.
svn path=/trunk/; revision=18203
2005-10-02 08:32:37 +00:00
Alex Ionescu
794f347587 - Small semaphore code simplification/optimization.
svn path=/trunk/; revision=18202
2005-10-02 08:31:45 +00:00
Alex Ionescu
66e502bd5a - Add RtlSetProcessCritical
- Some fixes.

svn path=/trunk/; revision=18201
2005-10-02 08:22:49 +00:00
Aleksey Bragin
00703c571b Add vcprojmaker.cpp to the msvc project
svn path=/trunk/; revision=18200
2005-10-02 08:08:04 +00:00
Emanuele Aliberti
a4808fca79 - add copyright notice
- fix unmatched bracket

svn path=/trunk/; revision=18199
2005-10-02 07:42:52 +00:00
Nathan Woods
46a48736ad Regedit: Implemented exporting specific branches
svn path=/trunk/; revision=18198
2005-10-02 01:21:43 +00:00
Thomas Bluemel
8ec93653e6 fixed some memory leaks and build it as unicode by default
svn path=/trunk/; revision=18197
2005-10-01 19:01:07 +00:00
Ged Murphy
16e0c94db4 fix unused variable warning.
free pointer before returning.

svn path=/trunk/; revision=18196
2005-10-01 18:41:02 +00:00
Martin Fuchs
b1230b8ee5 add code comments
svn path=/trunk/; revision=18195
2005-10-01 18:14:17 +00:00
Martin Fuchs
6a3529155a MDI/SDI option dialog:
- pictures for illustration
- remove resizable flag

svn path=/trunk/; revision=18194
2005-10-01 18:13:33 +00:00
Ged Murphy
d67541c53b Start to alter print output so it correctly simulates the MS 'route print'
svn path=/trunk/; revision=18193
2005-10-01 15:47:40 +00:00
Thomas Bluemel
6526069195 implemented the "Go to process" feature
svn path=/trunk/; revision=18192
2005-10-01 15:30:25 +00:00
Nathan Woods
38ecd48776 Regedit: Moved hEditMenu declaration to the top of the function
svn path=/trunk/; revision=18191
2005-10-01 15:11:31 +00:00
Thomas Bluemel
c1388efea5 use the NT5+ behavior of displaying the system cache size. fixes bug 856
svn path=/trunk/; revision=18190
2005-10-01 14:38:10 +00:00
Magnus Olsen
e89ca27d52 commit new startmenu picture that can be resize, see http://www.reactos.org/bugzilla/show_bug.cgi?id=676
svn path=/trunk/; revision=18189
2005-10-01 13:57:38 +00:00
Thomas Bluemel
626370f6aa check for and write new lines as ascii only in copy /A, regardless of whether cmd was compiled as unicode or ansi
svn path=/trunk/; revision=18188
2005-10-01 12:50:16 +00:00
Thomas Bluemel
0f55e53480 fixed possible buffer overflow bug: pass correct buffer length (in characters, not bytes) to FileGetString()
svn path=/trunk/; revision=18187
2005-10-01 12:21:55 +00:00
Martin Fuchs
580e685078 sync with Wine:
Alexandre Julliard, 2005-09-07: Replace a few more direct lpVtbl accesses by the proper macros. (patch applied only partly - the remaining COBJ macros are nonstandard, and don't exist in MSDN)
Alexandre Julliard, 2005-09-09:	Use Get/SetWindowLongPtr instead of Get/SetWindowLong where appropriate.

svn path=/trunk/; revision=18186
2005-10-01 10:10:39 +00:00
Alex Ionescu
35eb408157 - Remove some duplicated/useless code and use internal forward exports instead.
- Set kernel apc pending flag when needed in KeReleaseMutant
- Optimize check for kernel apc delivery in KeReleaseMutant
- Raise right exception in KeReleaseMutant
- Simplify KeInitializeMutant and remove some duplicated operations.
- Remove duplicated listhead initialization in KeInitiializeMutex
- Use correct increment in KeReleaseMutex

svn path=/trunk/; revision=18185
2005-10-01 08:58:49 +00:00
Martin Fuchs
f57183be46 sync with Wine:
- Fix warnings in 64bit. (Kevin Koltzau <kevin@plop.org>)
- simplify 'sei' structure initialization in ShellExecuteA/W

svn path=/trunk/; revision=18184
2005-10-01 08:20:12 +00:00
Alex Ionescu
7cd4df132d - KeRundownThread:
- Optimize to reduce contention
 - Add bugcheck instead of ASSERT
 - Add debug message to simplify finding errors like Bug 821 (type/size show 0xCC, which means the mutant has been already freed).

svn path=/trunk/; revision=18183
2005-10-01 07:37:13 +00:00
Nathan Woods
403e26da1b Notepad:
1.  Fixed bug in Goto line command
2.  Wrap long lines setting is persisted in the registry
3.  Fixed length limit bug when wrap long lines is toggled


svn path=/trunk/; revision=18182
2005-10-01 00:36:17 +00:00
Thomas Bluemel
0a52c57489 initialize COM on demand only
svn path=/trunk/; revision=18181
2005-09-30 23:32:24 +00:00
Emanuele Aliberti
22f369c6b1 Fix build.
svn path=/trunk/; revision=18180
2005-09-30 22:17:58 +00:00
Thomas Bluemel
133cd71ba8 don't remove mutants twice from the thread's mutant list in KeRundownThread(). This might fix bug 821
svn path=/trunk/; revision=18179
2005-09-30 22:00:30 +00:00
Thomas Bluemel
1e9a5c2f05 set eol-style to native
svn path=/trunk/; revision=18178
2005-09-30 21:32:01 +00:00
Thomas Bluemel
80c03b3f9b - added stubs for authz.dll
- added an authz.h to w32api

svn path=/trunk/; revision=18177
2005-09-30 21:28:29 +00:00
Thomas Bluemel
b05492e038 set eol-style to native
svn path=/trunk/; revision=18176
2005-09-30 21:19:12 +00:00
Steven Edwards
4b65a315a5 simple device manager program by Hervé Poussineau (hpoussin@reactos.org)
* GUI: Michael Fritsch 

svn path=/trunk/; revision=18175
2005-09-30 20:26:16 +00:00
Martin Fuchs
c9d6d045e6 patch applied from Christoph at ApiViewer.de: fix font handle leak
svn path=/trunk/; revision=18174
2005-09-30 19:42:45 +00:00
Thomas Bluemel
2357be7820 - improved control resizing handling
- don't fail when querying the account name length

svn path=/trunk/; revision=18173
2005-09-30 18:54:48 +00:00
Martin Fuchs
39d1d2d86c Fix Bugzilla Bug 676: dynamic explorer start menu sidebar size
svn path=/trunk/; revision=18172
2005-09-30 18:48:14 +00:00
Hartmut Birr
70c65c0144 The registry key name may be longer than 100 characters.
svn path=/trunk/; revision=18171
2005-09-30 16:33:06 +00:00
Hartmut Birr
6141c6f498 - Fixed the font size in IntGdiAddFontResource.
- Allocate a larger buffer for the font names in IntLoadSystemFonts.

svn path=/trunk/; revision=18170
2005-09-30 16:26:11 +00:00
Ged Murphy
5c9111085c set eol-style to native.
Thanks for reminding me, again :)

svn path=/trunk/; revision=18169
2005-09-30 15:37:58 +00:00
Ged Murphy
81bc89466b move quotes to a resource file and use shutdown quotes listed in the wiki.
svn path=/trunk/; revision=18168
2005-09-30 15:28:52 +00:00
Thomas Bluemel
4885539cea fixed pointer types differ in signedness warnings
svn path=/trunk/; revision=18167
2005-09-30 11:57:49 +00:00
Thomas Bluemel
ec05f0f08f set eol-style to native
svn path=/trunk/; revision=18166
2005-09-30 11:25:32 +00:00
Hervé Poussineau
60261f9699 Add newdev.dll, and implement DevInstallW function.
It permits to install devices from command line. ATM, very little functionality is supported.

svn path=/trunk/; revision=18165
2005-09-30 11:07:15 +00:00
Nathan Woods
b0f8c4a5fe Notepad:
1.  Fixed syntax errors in the ES and NL localizations
2.  Added code to save and restore settings; just the font for now


svn path=/trunk/; revision=18164
2005-09-30 02:53:34 +00:00
Thomas Bluemel
106e7a3173 use the correct down-level scope filter flag for the computer selection dialog
svn path=/trunk/; revision=18163
2005-09-30 01:47:46 +00:00
Thomas Bluemel
622b8c6503 display the computer selection dialog for remote registry administration
svn path=/trunk/; revision=18162
2005-09-30 01:26:02 +00:00
Ged Murphy
323ba37842 use carrige returns :)
svn path=/trunk/; revision=18161
2005-09-29 22:57:42 +00:00
Ged Murphy
b5aec3ddac randomise the quote sent
svn path=/trunk/; revision=18160
2005-09-29 22:36:46 +00:00
Ged Murphy
af01d7edd0 discard.c
- implemented discard.

chargen.c
- improve efficiency sending full line instead of singular chars.
TCP will generally wait until the packet is full anyway, so it's pointless to keep calling send for each char.

tcpsvcs.c
- implement the beginnings of the code to start tcpsvcs as a service. #if 0'd out at the moment. Fix bug from calling non existant DiscardHandler.

Surely this is enough info to satisfy lkcl this time :p

svn path=/trunk/; revision=18159
2005-09-29 20:41:12 +00:00
Thomas Bluemel
a83c2a2bb4 Some fixes to CreateDirectoryEx:
- properly copy the directory attributes
- add basic support to handle reparse points and add fallback code if the file system doesn't support them

svn path=/trunk/; revision=18158
2005-09-29 19:34:53 +00:00
Thomas Bluemel
cd88496c7a added clb.dll (mostly just stubs) which is required by MS regedit for it's REG_FULL_RESOURCE_DESCRIPTOR editor. As there doesn't seem to be another application that uses it, this place is probably the best for it.
svn path=/trunk/; revision=18157
2005-09-29 16:55:59 +00:00
Magnus Olsen
0feb129c9e sorry createDirectoryExW fails to create folder why ? change back to CreateDirectoryW sorry
svn path=/trunk/; revision=18156
2005-09-29 16:55:01 +00:00
Magnus Olsen
f16bc096ac MoveFileWithProgressW for movefolder
- change from CreateDirectoryW to CreateDirectoryExW
- fix close handle bug 
- overwrite readonly file
- make sure both dest and src are not set to readonly
- Source cleanup 
- Remove goto

svn path=/trunk/; revision=18155
2005-09-29 16:33:08 +00:00
Hervé Poussineau
514b606aee Set eol-style for new resources files
Add back Da.rc resources

svn path=/trunk/; revision=18154
2005-09-29 12:06:02 +00:00
Hervé Poussineau
358144fb6e - Milko Krachounov <milko@3mhz.net>
Added Bulgarian translations.
- Alexander N. Sørnes <alex@thehandofagony.com>
  Added Norwegian translations.

svn path=/trunk/; revision=18153
2005-09-29 11:58:31 +00:00
Hervé Poussineau
06bd1b672d Don't tell to MultiByteToWideChar that buffer is bigger than its real size. The size is in characters, not in bytes.
Spotted by Robert Shearman <rob@codeweavers.com>

svn path=/trunk/; revision=18152
2005-09-29 09:46:35 +00:00
Nathan Woods
b6c1b16e17 Christoph_vW: Updated notepad rc files to match Windows notepad's menu layout (bug #839)
svn path=/trunk/; revision=18151
2005-09-29 03:39:38 +00:00
Nathan Woods
033b930b16 Christoph_vW: regedit: make "modify" to default menu entry (bug #840)
svn path=/trunk/; revision=18150
2005-09-29 03:33:28 +00:00
Nathan Woods
cb80311ddf Regedit: Set up the export all/export branch UI; currently disabled for now
svn path=/trunk/; revision=18149
2005-09-29 03:07:26 +00:00
Thomas Bluemel
a62c8ab75f display all known value types
svn path=/trunk/; revision=18148
2005-09-29 02:50:38 +00:00
Thomas Bluemel
9da2411dea added stub for PrivCopyFileExW. This is needed by XP's ulib.dll, which XP's regedit.exe imports
svn path=/trunk/; revision=18147
2005-09-29 02:26:33 +00:00
Thomas Bluemel
1a4f353cad export BuildSecurityDescriptorA/W and IsWellKnownSid
svn path=/trunk/; revision=18146
2005-09-29 02:02:40 +00:00
Nathan Woods
0556dd9754 Regedit: Optimized tree expansion
svn path=/trunk/; revision=18145
2005-09-29 00:50:40 +00:00
Thomas Bluemel
1afd009025 added some missing APIs
svn path=/trunk/; revision=18144
2005-09-28 23:52:24 +00:00
Nathan Woods
8c42366a42 Notepad fixes:
1.  Fixed accelerator keys for new commands
2.  Properly parented Find/Replace dialog
3.  Typo in comment


svn path=/trunk/; revision=18143
2005-09-28 22:57:21 +00:00
Ged Murphy
708722cfd9 - Added daytime and quote of the day services
- Use universal header and remove needless seperate dirs
- Many bugfixes
- Added to build, not yet included in install as it's still in the early stages

Tested in WinXP using both Windows and Linux clients. Not yet tried in ROS,

svn path=/trunk/; revision=18142
2005-09-28 22:33:55 +00:00
Thomas Bluemel
a3ff770ebd add the vista application recovery functions to w32api and add their stubs to kernel32
svn path=/trunk/; revision=18141
2005-09-28 21:43:54 +00:00
Thomas Bluemel
85e9a1fa72 don't free random pointer in MmCreateImageSection. should fix bug 836
svn path=/trunk/; revision=18140
2005-09-28 19:56:05 +00:00
Hartmut Birr
87bf9958a5 Disable flushing if the device doesn't support it or if it isn't enabled.
svn path=/trunk/; revision=18139
2005-09-28 19:34:07 +00:00
Thomas Bluemel
b88678d1a3 added the Longhorn registry APIs to w32api
svn path=/trunk/; revision=18138
2005-09-28 18:56:01 +00:00
Thomas Bluemel
56b2e53628 don't dereference the port in NtSetInformationFile with information class FileCompletionInformation. The Also make setting the completion port thread-safe. This might fix bug 816
svn path=/trunk/; revision=18137
2005-09-28 17:15:57 +00:00
Thomas Bluemel
294680db96 improved error handling
svn path=/trunk/; revision=18136
2005-09-28 15:40:52 +00:00
Nathan Woods
7d4df5c225 Notepad: Fixed some bugs in Search->Replace
svn path=/trunk/; revision=18135
2005-09-28 13:20:10 +00:00
Thomas Bluemel
e8285addc9 improved error handling
svn path=/trunk/; revision=18134
2005-09-28 13:00:05 +00:00
Thomas Bluemel
afb1aa2562 Fixed some memory leaks in taskmgr. Patch by Christoph_vW <Christoph@ApiViewer.de>
svn path=/trunk/; revision=18133
2005-09-28 12:26:33 +00:00
Ged Murphy
5d41a8d313 - Set svn:eol-style to native
- Set svn:ignore on directories
Thanks to w3seek for pointing this out.

svn path=/trunk/; revision=18132
2005-09-27 23:37:05 +00:00
Nathan Woods
89effd5ee8 Notepad enhancements:
1.  Removed the 30k limit
2.  Implemented Replace and Replace All


svn path=/trunk/; revision=18131
2005-09-27 23:29:35 +00:00
Magnus Olsen
6653931c3d - Fix move for readonly folder and file. for now it is a small hack for readonly folders, Small Cleanup in the code, thx w3seek for the help with SetFileAttribs code.
svn path=/trunk/; revision=18130
2005-09-27 21:49:18 +00:00
Ged Murphy
6c01ff3c32 Start to implement the beginneings of tcpsvcs.exe. Just ideas at the moment, subject to change.
Working code for basic echo and chargen included. Tested in Windows from both Windows and Linux clients
Run from cmd, not incorporated into services.exe at the moment
Builds ok, but not included into build system just yet.

svn path=/trunk/; revision=18129
2005-09-27 21:44:24 +00:00
Thomas Bluemel
1d982cb8e9 some code reformatting of slayer.dll and make it build again
svn path=/trunk/; revision=18128
2005-09-27 20:22:25 +00:00
Thomas Bluemel
116b8b7916 some code reformatting
svn path=/trunk/; revision=18127
2005-09-27 18:19:59 +00:00
Thomas Bluemel
514a32bcff add hid.dll to the build system
svn path=/trunk/; revision=18126
2005-09-27 15:50:49 +00:00
Hervé Poussineau
e521cf2597 During 2nd stage setup, define also DNS hostname of the computer if possible
svn path=/trunk/; revision=18125
2005-09-27 14:27:14 +00:00
Nathan Woods
514cdac338 Regedit: Optimizations to refreshing; refreshing is still slightly slower than Windows regedit
svn path=/trunk/; revision=18124
2005-09-27 13:47:46 +00:00
Thomas Bluemel
043d319095 load some settings from the registry
svn path=/trunk/; revision=18123
2005-09-27 13:42:20 +00:00
Hervé Poussineau
2d5aef6968 KEBUGCHECK(0) -> KEBUGCHECK(INACCESSIBLE_BOOT_DEVICE)
svn path=/trunk/; revision=18122
2005-09-27 12:43:36 +00:00
Hervé Poussineau
dc6b192e48 Display status code when the file can't be opened
svn path=/trunk/; revision=18121
2005-09-27 12:40:20 +00:00
Thomas Bluemel
305c7e5ef7 fixed uninitialized variable warnings
svn path=/trunk/; revision=18120
2005-09-27 10:52:10 +00:00
Hervé Poussineau
6053e004ad Implement SetupInstallServicesFromInfSectionExW
Process {DDInstall}.HW section in SetupDiInstallDevice

svn path=/trunk/; revision=18119
2005-09-27 08:52:17 +00:00
Alex Ionescu
322841976a - Some NDK fixes when compiling with PSDK.
- Commit the new CSR (csrsrv and csrss). Compiles and passes PREfast with msvc 2005. Does not link yet. Is not complete yet (3 missing functions). Does not build with mingw yet. Code is probably still buggy. Work in other areas is needed as well. I'm comitting this under recommendation from Emanuele. See status.h for more info.
- Thanks to Emanuele and Filip which have helped with this patch.

svn path=/trunk/; revision=18118
2005-09-27 04:53:33 +00:00
Alex Ionescu
29322a96bc - Fix several flaws in APC logic.
- Properly support Special APC Disabling.
- Allow Guarded Mutex and Guarded Regions to function properly.
- Optimize some code and add some additional checks.
- Fix several bugs in KeFreezeAllThreads

svn path=/trunk/; revision=18117
2005-09-27 01:57:27 +00:00
Thomas Bluemel
bfcd1fab3c minor fixes
svn path=/trunk/; revision=18116
2005-09-27 01:48:49 +00:00
Thomas Bluemel
7c58d9be05 partly implemented the mixer selection dialog
svn path=/trunk/; revision=18115
2005-09-27 01:02:15 +00:00
Nathan Woods
2360c29d24 Notepad enhancements
1.  Implemented "Goto line"
2.  Partially implemented Replace (dialog comes up, need to have it actually do the replace )


svn path=/trunk/; revision=18114
2005-09-27 00:46:19 +00:00
Gunnar Dalsnes
b890e50a9e -reorder InsertXscendingOrder macro argument order and update uses
-start to macrofy list enums in ntoskrnl using LIST_FOR_EACH macros
-use IsListEmpty some places instead of manual coding
-profile.c:KeStartProfile() zero correct buffer in (and not the NULL ptr;-)
-improve LIST_FOR_EACH macros so that the iterator is set to NULL at end of enum
-kthread.c:KiServiceCheck() set the shadowtable before calling the win32k proc/thread init funcs
-apc.c:KiInsertQueueApc() insert special apcs in correct fifo order 
-apc.c:KeFlushQueueApc() simplify 
-timer.c:KiExpireTimers() calling RemoveEntryList on a possibly empty list is not ok

svn path=/trunk/; revision=18113
2005-09-26 22:57:48 +00:00
Thomas Bluemel
5b8c6d129b don't use MIXERCONTROLA for unicode builds
svn path=/trunk/; revision=18112
2005-09-26 22:06:31 +00:00
Alex Ionescu
ba942bb6e5 Fix calc.exe redraw problems on XP. Patch by Christoph_vW <Christoph@ApiViewer.de>
svn path=/trunk/; revision=18111
2005-09-26 21:49:03 +00:00
Alex Ionescu
e4dc1dc22d - Implement alldvrm and aulldvrm and export them from ntoskrnl. This fixes bug 467.
svn path=/trunk/; revision=18110
2005-09-26 21:39:04 +00:00
Alex Ionescu
06190df7c1 Err, actually deliver APCs when returning from systemcalls... fixes bug 810
svn path=/trunk/; revision=18109
2005-09-26 20:52:20 +00:00
Magnus Olsen
532121508b change from copyfileW to copyfileExW in MoveFileWithProgressW and add a error check for copyfileExW that was forgotten.
svn path=/trunk/; revision=18108
2005-09-26 20:44:43 +00:00
Filip Navara
4d68062bfb Revert r18070.
svn path=/trunk/; revision=18107
2005-09-26 20:29:08 +00:00
Alex Ionescu
2f5a9a2734 Add NDEBUG back and call LdrLoadDll correctly on Windows.
svn path=/trunk/; revision=18106
2005-09-26 20:08:11 +00:00
Hartmut Birr
ed77c5e942 Don't wait after the flush command for a non busy hd.
svn path=/trunk/; revision=18105
2005-09-26 20:06:49 +00:00
Hartmut Birr
406b5036aa Fixed the reinitialisation if the miniport driver returns SRB_STATUS_BUSY.
svn path=/trunk/; revision=18104
2005-09-26 20:00:48 +00:00
Thomas Bluemel
f9ac23ee7b also compile the resource file...
svn path=/trunk/; revision=18103
2005-09-26 19:16:43 +00:00
Thomas Bluemel
d286c03c70 add sndvol32 to the build system and reformat the code
svn path=/trunk/; revision=18102
2005-09-26 19:15:27 +00:00
Alex Ionescu
469b041e51 Export and implement NlsGetCacheUpdateCount. Almost every WinXP DLL can now import kernel32
svn path=/trunk/; revision=18101
2005-09-26 19:09:32 +00:00
Alex Ionescu
d78f9d9f94 Stub and export EnumCalanderInfoExW and QueryWin31IniFilesMappedToRegistry
svn path=/trunk/; revision=18100
2005-09-26 18:59:04 +00:00
Alex Ionescu
cc19214973 Export and implement CreateProcessInternalA and CreateProcessInternalW (really just shuffling/stubbing, no actual code was written.
svn path=/trunk/; revision=18099
2005-09-26 18:46:30 +00:00
Thomas Bluemel
aefeb9f6be RegOverridePredefKey does not (as opposed to the PSDK documentation) accept predefined handles for the hNewHKey parameter
svn path=/trunk/; revision=18098
2005-09-26 18:05:57 +00:00
Alex Ionescu
3438f98570 Open BNO directory with correct privileges, open CSR connection with correct path. Add InWindows boolean to use the right CSR ServerID in windows and add a hack to get kernel32 to be loadable if used with .local to force an application to use our kernel and not the system one. The result of this is that our kernel32 can now load in Windows XP (not 2000).
svn path=/trunk/; revision=18097
2005-09-26 18:03:17 +00:00
Aleksey Bragin
18a5faec31 Christoph von Wittich: fix for bug 824 ("memory leak in welcome").
-LoadBitmap without DeleteObject
-SelectObject is used with wrong DC

svn path=/trunk/; revision=18096
2005-09-26 16:13:50 +00:00
Aleksey Bragin
714a0377ae Christoph von Wittich: fix for bug 823 ("Resource leak in regedit").
svn path=/trunk/; revision=18095
2005-09-26 16:07:23 +00:00
Aleksey Bragin
7311a97c7e Christoph von Wittich: fix for bug 822 ("Resource leak in calc").
svn path=/trunk/; revision=18094
2005-09-26 15:50:37 +00:00
Thomas Bluemel
2c830b3480 export RegOverridePredefKey, forgot to commit this change
svn path=/trunk/; revision=18093
2005-09-26 13:02:01 +00:00
Thomas Bluemel
265d243da7 implemented RegOverridePredefKey()
svn path=/trunk/; revision=18092
2005-09-26 12:44:03 +00:00
Hervé Poussineau
235187d761 Update .inf files
svn path=/trunk/; revision=18091
2005-09-26 12:05:27 +00:00
Hervé Poussineau
94edbf0294 Fix signedness (SetupGetIntField takes a PINT argument, not a PUINT one)
svn path=/trunk/; revision=18090
2005-09-26 11:43:14 +00:00
Hervé Poussineau
e8a80ca380 Implement parts of SetupDiInstallDevice
svn path=/trunk/; revision=18089
2005-09-26 11:39:24 +00:00
Hervé Poussineau
85061235b4 Implement SetupInstallServicesFromInfSectionA/W, SetupInstallServicesFromInfSectionExW
Add stub for SetupInstallServicesFromInfSectionExW

svn path=/trunk/; revision=18088
2005-09-26 11:37:32 +00:00
Thomas Bluemel
5513508495 copy the buffer to the right place in IntWriteConsoleOutput
svn path=/trunk/; revision=18087
2005-09-26 11:35:23 +00:00
Thomas Bluemel
bbaa62a6a8 - fixed uninitialized variable warning
- fixed memory leak in SetupDiBuildDriverInfoList()

svn path=/trunk/; revision=18086
2005-09-26 11:14:34 +00:00
Thomas Bluemel
a4c2dbda2c fixed uninitialized variable warning
svn path=/trunk/; revision=18085
2005-09-26 11:11:48 +00:00
Thomas Bluemel
c251a38210 don't copy the buffer to a random pointer in IntWriteConsoleOutput()
svn path=/trunk/; revision=18084
2005-09-26 11:10:27 +00:00
Gé van Geldorp
fe931cdfe1 Silence some debug messages
svn path=/trunk/; revision=18083
2005-09-26 08:21:38 +00:00
Alex Ionescu
ad6d758184 - Fix a bug in CSR Capture APIs
- Fix bugs in kernel32 console APIs.
- These changes fix vim and fix bug 796 as I promised.

svn path=/trunk/; revision=18082
2005-09-26 07:43:55 +00:00
Alex Ionescu
4293263024 - Put executive atom functions in the executive folder, not rtl.
- Move purecall to the executive error APIs.

svn path=/trunk/; revision=18081
2005-09-26 05:41:35 +00:00
Alex Ionescu
6279a4838f - Remove some deprecated files.
svn path=/trunk/; revision=18080
2005-09-26 05:03:28 +00:00
Alex Ionescu
a62966103d Forgot to svn add these two files.
svn path=/trunk/; revision=18079
2005-09-26 05:01:14 +00:00
Alex Ionescu
c15e04cf7a - More sharing between ntdll/ntoskrnl: shared Dbg code.
- Added NtCreateDebugObject, NtDebugContinue, NtQueryDebugFilterState, NtSetDebugFilterState, NtWaitForDebugEvent to system call list.
- Added some debug constants to headers
- Updated RtlpCheckForActiveDebugger in ntoskrnl to return whatever we're expecting as the "normal" case.
- Added RtlpSetInDbgPrint to rtl support library for special DbgPrint implementation difference in user-mode
- Removed all the deprecated debug APIs in ntdll.
- Implemented NtQueryDebugFilterState and NtSetDebugFilterState based on royce's implementation.
- Started modifications on KeDebugService, and implemented DebugService in rtl
- Implemented all the Dbg* APIs in RTL.
- Implemented DbgUiConnectToDbg, DbgUiContinue, DbgUiWaitStateChange, DbgUiRemoteBreakin, DbgUiIssueRemoteBreakin
- Changed KD Print callbacks to also receive the length of the string.

Right now, one call that should be shared still isn't (the final DebugPrint call) because calling KeDebugService from kernel-mode seems to cause a hang. Also, DebugService does not currently cause an exception like it should (instead it still calls the Kdp handler), because those changes would've made the patch even bigger and are still untested.


svn path=/trunk/; revision=18078
2005-09-26 04:59:48 +00:00
Nathan Woods
ad2331b8dc 1. More merging from WINE regedit; imported refresh feature (which is wayyy slower than Windows regedit; need to optimize this)
2.  Using GetVersion() to determine whether to add HKEY_DYN_DATA


svn path=/trunk/; revision=18077
2005-09-26 03:18:53 +00:00
Magnus Olsen
2a43a20f74 remove dead code
svn path=/trunk/; revision=18076
2005-09-25 22:16:05 +00:00
Magnus Olsen
157b81edbd don't expect FS drivers to return STATUS_NOT_IMPLEMENTED if they don't know how to do the move (STATUS_NOT_SUPPORTED is also a perfect valid error code), this change did hpoussin suggest
svn path=/trunk/; revision=18075
2005-09-25 22:05:39 +00:00
Hervé Poussineau
aa2f14ed56 Implement SetupDiInstallDriverFiles
svn path=/trunk/; revision=18074
2005-09-25 21:18:27 +00:00
Magnus Olsen
a204d1a5de Implement support for move folder, even from different vol. But for now it does not think of EA or set file attrib right. it is a present to brandon so he stop nag about ros can not move a folder. It maybe got some other bugs. it need more testing see if it handling all case right.
svn path=/trunk/; revision=18073
2005-09-25 21:05:18 +00:00
Eric Kohl
c4035780df - Implement CM_Is_Dock_Station_Present[_Ex]
svn path=/trunk/; revision=18072
2005-09-25 21:02:43 +00:00
Hervé Poussineau
6cc1784d0b USB root hub is not really a child of the USB Controller, so don't give it a device identifier
svn path=/trunk/; revision=18071
2005-09-25 20:56:58 +00:00
Filip Navara
7df1c3d13b Revert r18064 and correctly set the cell size for hash cells.
svn path=/trunk/; revision=18070
2005-09-25 20:54:40 +00:00
Ged Murphy
800ecc9875 Simple implementation of the MS comp utility (remembered to add the files this time :) )
svn path=/trunk/; revision=18069
2005-09-25 20:46:28 +00:00
Ged Murphy
95be977b35 Simple implementation of the MS comp utility
svn path=/trunk/; revision=18068
2005-09-25 20:39:55 +00:00
Emanuele Aliberti
00dca92674 cmdutils: a program a directory (bootcd,livecd,...)
svn path=/trunk/; revision=18067
2005-09-25 19:40:48 +00:00
Emanuele Aliberti
4ebb8ab037 cmdutils: a program a directory.
svn path=/trunk/; revision=18066
2005-09-25 19:38:46 +00:00
Alex Ionescu
500c1e7db2 - Fix mixed tab/space formatting issues.
svn path=/trunk/; revision=18065
2005-09-25 18:17:27 +00:00
Filip Navara
b14657cd56 Correctly interpret the cell type in CmiDestroyCell. Patch by brbak <mpd000@yahoo.de>.
svn path=/trunk/; revision=18064
2005-09-25 18:07:36 +00:00
Martin Fuchs
8b950fec34 refeactor all IUnknown implementations using IComSrvBase
svn path=/trunk/; revision=18063
2005-09-25 17:59:20 +00:00
Thomas Bluemel
029ccdccaa fixed gcc4 warnings
svn path=/trunk/; revision=18062
2005-09-25 17:52:12 +00:00
Thomas Bluemel
2148ae3457 - fixed uninitialized variable warning
- ProbeAndCaptureUnicodeString should check if allocating memory succeeded

svn path=/trunk/; revision=18061
2005-09-25 17:49:14 +00:00
Hartmut Birr
18494d1af0 - Don't convert the device name, if the name is a NULL pointer (in QueryDosDeviceA).
- Convert the string in several steps, because the string may be longer than 32k characters (in QueryDosDeviceA).

svn path=/trunk/; revision=18060
2005-09-25 17:25:55 +00:00
Thomas Bluemel
36b54a2e7c fixed uninitialized variable warnings
svn path=/trunk/; revision=18059
2005-09-25 17:21:45 +00:00
Thomas Bluemel
b078f93c83 fixed uninitialized variable warning
svn path=/trunk/; revision=18058
2005-09-25 17:16:03 +00:00
Ged Murphy
b1c57949ff added more functionality to arp
- display correct interface index
- delete all hosts with -d *
- display informative error messages
- better argument control
- clean up formatting

svn path=/trunk/; revision=18057
2005-09-25 17:01:24 +00:00
Nathan Woods
4f9b4be8fb Lightweight sync with WINE regedit; imported obvious changes such as const correctness, TCHAR string usage etc
svn path=/trunk/; revision=18056
2005-09-25 16:56:52 +00:00
Martin Fuchs
b59af67517 try to use IShellFolderViewCB::MessageSFVCB() in order to override explorer context menus
svn path=/trunk/; revision=18055
2005-09-25 15:59:38 +00:00
Emanuele Aliberti
edd28d722f Minor changes. This program does NOT work in ROS.
svn path=/trunk/; revision=18054
2005-09-25 13:58:27 +00:00
Emanuele Aliberti
fa1f0c6f02 Fix compiling.
svn path=/trunk/; revision=18053
2005-09-25 13:56:45 +00:00
Magnus Olsen
b1da886453 Remove Es.rc from timedate for it is 100% empty. Thx tsk
svn path=/trunk/; revision=18052
2005-09-25 13:54:19 +00:00
Emanuele Aliberti
887b19bebf svn: eol-style + keywords
svn path=/trunk/; revision=18051
2005-09-25 13:43:33 +00:00
Emanuele Aliberti
294b660b25 Required for binary compatibility with MS KERNEL32.DLL.
NOTE
Filip and I still don't understand why KERNEL32 calls twice CsrConnectToServer.
A possible explanation is because the Win32 server is a dual server: gui+console.
This differs with our current implementation in the SM: we accept only console registration requests (see SmpHandleConnectionRequest).

svn path=/trunk/; revision=18050
2005-09-25 13:36:27 +00:00
Hartmut Birr
6ace27feae Let the compiler search for usable register.
svn path=/trunk/; revision=18049
2005-09-25 12:39:32 +00:00
Filip Navara
66e998c053 Use the correct size variables in co_IntCreateWindowEx.
svn path=/trunk/; revision=18048
2005-09-25 12:30:51 +00:00
Martin Fuchs
67429beef5 new tool bar icons for the drive bar
svn path=/trunk/; revision=18047
2005-09-25 11:52:42 +00:00
Filip Navara
8e767a38a4 - Intersect the paint rectangle in NtUserBeginPaint with the client window rectangle.
- Fix the data returned by co_UserGetUpdateRgn and NtUserGetUpdateRect.

svn path=/trunk/; revision=18046
2005-09-25 11:16:54 +00:00
Filip Navara
fa45440822 Patricio Martínez Ros <silencium@wanadoo.es>
Update spanish translation.

svn path=/trunk/; revision=18045
2005-09-25 11:05:00 +00:00
Filip Navara
3c06143dc5 Patricio Martínez Ros <silencium@wanadoo.es>
Update spanish translation.

svn path=/trunk/; revision=18044
2005-09-25 10:52:51 +00:00
Filip Navara
cee1aa7a0d Add TestAlert check to NtContinue.
svn path=/trunk/; revision=18043
2005-09-25 09:23:05 +00:00
Filip Navara
ceb0f5f1eb Fix up the indentation.
svn path=/trunk/; revision=18042
2005-09-25 09:22:22 +00:00
Andrew Munger
2f370af826 Fix getInterfaceInfoSet so GetInterfaceInfo returns only non-loopback adapters, however, we still return some incorrect info.
Silenced a DPRINT.

svn path=/trunk/; revision=18041
2005-09-25 04:55:16 +00:00
Nathan Woods
6e7b2b5af4 1. Moved windows styles pertaining to the edit control to main.h
2.  Stopped using WS_BORDER on the edit control


svn path=/trunk/; revision=18040
2005-09-25 00:35:13 +00:00
Nathan Woods
fd73ac02d7 Fixed property svn:eol-style
svn path=/trunk/; revision=18039
2005-09-25 00:12:12 +00:00
Gé van Geldorp
e8bb7ed8ff Fix GDB backtrace
svn path=/trunk/; revision=18038
2005-09-25 00:00:03 +00:00
Nathan Woods
3c14414c1d Notepad enhancements:
1.  Added line ending handling, so that Notepad can handle line endings other than CR/LF.  This is specified in a dropdown menu similar to the text encoding.  Consequently, I've moved text handling to a new file, text.c

2.  Implemented the Find command

3.  Changed some dialog titles to be 'Notepad' instead of 'ERROR', in line with how Windows notepad works.

4.  The edit control now has the style ES_NOHIDESEL specified


svn path=/trunk/; revision=18037
2005-09-24 23:45:05 +00:00
Thomas Bluemel
5f28a5ed9f removed obsolete goto statement
svn path=/trunk/; revision=18036
2005-09-24 20:37:53 +00:00
Hartmut Birr
1effd8ff68 Allow the system process and a process without a parent process to use all cpus on a smp machine, even if only the boot cpu is running.
svn path=/trunk/; revision=18035
2005-09-24 19:34:54 +00:00
Gé van Geldorp
7ee5d3ea71 This NtGdiCreateCompatableDC misspelling has annoyed me long enough now
svn path=/trunk/; revision=18034
2005-09-24 19:30:12 +00:00
Hartmut Birr
58cb9dc1d9 Set the MaximumLength of the returned string in IntGetFullWindowStationName.
svn path=/trunk/; revision=18033
2005-09-24 19:17:00 +00:00
Hartmut Birr
13355b8eff Do also alert the mouse thread in UserAcquireOrReleaseInputOwnership.
svn path=/trunk/; revision=18032
2005-09-24 19:15:24 +00:00
Hartmut Birr
33ad8f2571 - Moved the definition of REG_NOTIFY_CLASS from cm.h to winddk.h.
- Release the rundown protection if the callback function returns an error (in CmiCallRegisteredCallbacks).  
- Call the registry callback functions in most of the Nt/ZW registry functions.

svn path=/trunk/; revision=18031
2005-09-24 18:42:37 +00:00
Hartmut Birr
262c303ffb - Use the given buffer for getting the name of the parent.
- Check the length of the buffer.  
- Intialise the name string if it is necessary.

svn path=/trunk/; revision=18030
2005-09-24 18:28:04 +00:00
Hartmut Birr
2914b8925b Used NtQueryFullAttributesFile instead of NtOpenFile/NtQueryInformationFile/NtClose in GetFileAttributesExW (suggested by Thomas Weidenmueller).
svn path=/trunk/; revision=18029
2005-09-24 18:09:06 +00:00
Hartmut Birr
e6a04cca76 Merged the main code from NtQueryAttributesFile and NtQueryFullAttributesFile to IopQueryAttributesFile.
Check the access to parameters in IopQueryAttributesFile if we are called from user mode because calling Zw functions from kernel mode will bypass all checks.

svn path=/trunk/; revision=18028
2005-09-24 18:04:13 +00:00
Filip Navara
ffb2fee46a Port the system message queue WM_MOUSEDOWN coalesce fix from win32k rewrite branch.
svn path=/trunk/; revision=18027
2005-09-24 17:34:09 +00:00
Thomas Bluemel
5f8c990b41 implemented RegCopyTreeW() (untested!)
svn path=/trunk/; revision=18026
2005-09-24 17:08:13 +00:00
Hervé Poussineau
5681e54736 If device instance id is not unique, prepend information from parent bus device
svn path=/trunk/; revision=18025
2005-09-24 13:19:25 +00:00
Gunnar Dalsnes
bd79c96a7d uncomment and add mutex asserts
svn path=/trunk/; revision=18024
2005-09-24 11:43:23 +00:00
Eric Kohl
f9725315fe - Implement CM_Get_Device_List_Size_ExW
svn path=/trunk/; revision=18023
2005-09-24 09:30:43 +00:00
Gunnar Dalsnes
5fa3cc8c0f -include/ndk/rtltypes.h: add MAX_ATOM_LEN define
-win32k: remove some NtUser syscalls and merge some NtUser syscalls
-crt/include/internal/file.h: correct spelling
-RtlAddAtomToAtomTable: check for max atom len
-RtlQueryAtomInAtomTable: fix bug. somehow lock wasnt always released.
-fix/reword windows classes impl. based on Wine. All but 2 winetests pass.
-ntoskrnl/rtl/atom.c: add fixme about global atom table
-remove desktop object lock
-dont link windows into the class object
-co_IntShellHookNotify: safely send notify messages
-misc win32k reorg/cleanup

svn path=/trunk/; revision=18022
2005-09-24 02:50:02 +00:00
Ged Murphy
ff4f5a654b First commit, mainly testing.
Cleanup code to follow ROS' coding style better
Remove tabs and trailing whitespace.

svn path=/trunk/; revision=18021
2005-09-23 21:46:54 +00:00
Gé van Geldorp
ce7453f9ed Fix RtlQueryAtomInAtomTable and add regression tests
svn path=/trunk/; revision=18020
2005-09-23 21:08:57 +00:00
Thomas Bluemel
128c57f209 imported shfolder.dll from WINE-20050830
svn path=/trunk/; revision=18019
2005-09-23 19:24:20 +00:00
Alex Ionescu
ea0f14b310 fix identation bug in 18016
svn path=/trunk/; revision=18018
2005-09-23 18:15:39 +00:00
Alex Ionescu
081b39d0ef Fix signalstate check in KGATE code; spotted by magey.
svn path=/trunk/; revision=18017
2005-09-23 16:31:06 +00:00
Alex Ionescu
c6d8b12b89 - Call IsDialogMessage before TranslateAccelerators, so that the accelerator's output, if any, appears in the proper window. Patch by Bletch <npwoods@mess.org>. Fixes bug 803.
svn path=/trunk/; revision=18016
2005-09-23 15:46:10 +00:00
Alex Ionescu
2be4bec4f1 - Return focus to run dialog after showing the file not found messagebox. Patch by brbak <mpd000@yahoo.de>
svn path=/trunk/; revision=18015
2005-09-23 15:42:40 +00:00
Thomas Bluemel
ff1322e0a3 use RegGetKeySecurity() directly to read the security information
svn path=/trunk/; revision=18014
2005-09-23 15:31:42 +00:00
Thomas Bluemel
0243833fef don't read the DACL if it's not present or if it's a NULL-DACL
svn path=/trunk/; revision=18013
2005-09-23 15:31:04 +00:00
Thomas Bluemel
7542d31c35 - fixed buffer size calculation in RtlLengthRequiredSid and RtlLengthSid
- use RtlCreateUnicodeString to allocate the string in RtlConvertSidToUnicodeString

svn path=/trunk/; revision=18012
2005-09-23 14:15:30 +00:00
Thomas Bluemel
528323ece7 minor optimization of RtlCreateUnicodeString: as the memory never overlaps, just copy the memory instead of moving it
svn path=/trunk/; revision=18011
2005-09-23 14:13:44 +00:00
Thomas Bluemel
4b69f7ad42 fixed signedness warning
svn path=/trunk/; revision=18010
2005-09-23 11:12:18 +00:00
Gé van Geldorp
5cf68f2c19 Remove dead file
svn path=/trunk/; revision=18009
2005-09-23 09:51:18 +00:00
Gé van Geldorp
7a74eefb29 Make GDB available for release builds
svn path=/trunk/; revision=18008
2005-09-23 09:23:14 +00:00
Gé van Geldorp
d735771108 Don't use uninitialized var
svn path=/trunk/; revision=18007
2005-09-23 09:17:38 +00:00
Hervé Poussineau
b7a7ffcfcd Report correctly USB device class and subclass when the device reports only one interface and the class is not defined in the device descriptor
svn path=/trunk/; revision=18006
2005-09-23 09:02:16 +00:00
Hervé Poussineau
0c7bb23c18 Cast the right pointer to the structure.
Fix bug 783. Thanks GvG.

svn path=/trunk/; revision=18005
2005-09-23 08:55:33 +00:00
Steven Edwards
9c356c1031 doing my good dead for the day
svn path=/trunk/; revision=18004
2005-09-23 07:32:21 +00:00
Alex Ionescu
33bce1ad24 Forgot these changes, sorry
svn path=/trunk/; revision=18003
2005-09-23 07:19:47 +00:00
Alex Ionescu
c6a32a07bd - Fix a bunch of various bugs in the Rtl String routines, mostly subtle (ie: fail AFTER writing maximum length, not before (some apps might depend on it), fix completely broken RtlAnsiCharToUnicodeChar prototype and functionality, don't clear buffers when we shouldn't/clear buffers when we should...)
- Also cleanup formatting of the file
- Use Index member from Rtl...To...N API when null-terminating the strings.
- Various optimizations and simplifications in some of the loops.
- Remove some duplicated code.
- Notes about special handling where required, also implement it in some parts.
- Add more failure cases.
- Return correct status codes on failures.

svn path=/trunk/; revision=18002
2005-09-23 06:37:14 +00:00
Alex Ionescu
d1d61051c9 Make TAB+ debug combos work again. Based on bugfix by Andrew Munger.
svn path=/trunk/; revision=18001
2005-09-23 06:32:47 +00:00
Alex Ionescu
43fc149042 Fix exception handling/PSEH. Fixes bug 797.
svn path=/trunk/; revision=18000
2005-09-23 06:25:38 +00:00
Steven Edwards
3d31bdc1fc Stefan Huehner <stefan@huehner.org>
Fix more -Wstrict-prototypes warnings.

svn path=/trunk/; revision=17999
2005-09-23 06:06:20 +00:00
Steven Edwards
4db49a2b8f Dmitry Timoshkov <dmitry@codeweavers.com> Fix the usage of COLOR_xxx constants in the place of the window's class hbrBackground.
svn path=/trunk/; revision=17998
2005-09-23 06:04:44 +00:00
Steven Edwards
b3725418f0 Kevin Koltzau <kevin@plop.org> Enable/disable menu items based on edit control state.
svn path=/trunk/; revision=17997
2005-09-23 06:02:23 +00:00
Steven Edwards
94cc96262b Kevin Koltzau <kevin@plop.org> Handle notepad log feature.
svn path=/trunk/; revision=17996
2005-09-23 05:58:27 +00:00
Steven Edwards
05a74dc2dd Lauri Tulmin <lauri_@ut.ee> implement word wrap
svn path=/trunk/; revision=17995
2005-09-23 05:54:46 +00:00
Andrew Munger
1e482c105d Properly return status in iphplapi, and don't close the file handle before we use it in getNumInterfacesInt.
svn path=/trunk/; revision=17994
2005-09-23 03:50:03 +00:00
Thomas Bluemel
b64b3f38a0 mark ZwDuplicateToken as NTSYSAPI. thx to alex
svn path=/trunk/; revision=17993
2005-09-23 00:05:38 +00:00
Thomas Bluemel
c7781723f8 some Nt vs. Zw fixes; these functions shouldn't be used in ntoskrnl but since they're shared there's a chance they could be used
svn path=/trunk/; revision=17992
2005-09-22 23:50:38 +00:00
Thomas Bluemel
da28a303cc some Nt vs. Zw fixes; these functions shouldn't be used in ntoskrnl but since they're shared there's a chance they could be used
svn path=/trunk/; revision=17991
2005-09-22 23:46:20 +00:00
Thomas Bluemel
775f129dc9 some Nt vs. Zw fixes
svn path=/trunk/; revision=17990
2005-09-22 23:23:00 +00:00
Thomas Bluemel
6ec323ac74 fixed gcc4 warning
svn path=/trunk/; revision=17989
2005-09-22 21:09:06 +00:00
Gé van Geldorp
d776d5b356 Bletch <npwoods@mess.org>:
- Implements key and value renaming
- Implements key deleting
- Implements New Key/String/Binary/DWORD option

svn path=/trunk/; revision=17988
2005-09-22 20:54:20 +00:00
Thomas Bluemel
c70c695868 fixed uninitialized variable warning
svn path=/trunk/; revision=17987
2005-09-22 20:44:10 +00:00
Filip Navara
5aab768c19 Handle some failure cases in better way.
svn path=/trunk/; revision=17986
2005-09-22 20:36:07 +00:00
Gé van Geldorp
cb0c6e6a48 Return atom length when requested. Fixes bug 793.
svn path=/trunk/; revision=17985
2005-09-22 20:24:50 +00:00
Filip Navara
e6e62c37b3 InfoTdiQueryInformationEx should return failure if no entity was found.
svn path=/trunk/; revision=17984
2005-09-22 20:17:55 +00:00
Thomas Bluemel
c87bac8d51 minor string initialization optimizations
svn path=/trunk/; revision=17983
2005-09-22 19:46:36 +00:00
Thomas Bluemel
ceb2e22d5f add selected principals to the list (doesn't modify the ACLs yet!)
svn path=/trunk/; revision=17982
2005-09-22 14:30:29 +00:00
Hervé Poussineau
4a4df71398 Fix IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs for root USB hubs.
The vendor and device IDs are not filled in Cromwell code, so ask directly the PCI device to retrieve the information

svn path=/trunk/; revision=17981
2005-09-22 11:20:52 +00:00
Hervé Poussineau
752fed43fb Fix IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextLocationInformation for USB devices
I was mis-using usb_get_string() method...

svn path=/trunk/; revision=17980
2005-09-22 09:17:17 +00:00
Gé van Geldorp
81441a8931 Slicencium <silencium@wanadoo.es>:
Fix precision bug (bug 775)

svn path=/trunk/; revision=17979
2005-09-22 07:24:08 +00:00
Thomas Bluemel
b06b7fb73a fixed some handle leaks in RegDeleteTree() in some failure cases
svn path=/trunk/; revision=17978
2005-09-21 23:56:52 +00:00
Gé van Geldorp
87dda98431 brbak <mpd000@yahoo.de>:
Reset on new calculation. Patch from bug 775.

svn path=/trunk/; revision=17977
2005-09-21 22:55:37 +00:00
Gé van Geldorp
c284fca775 brbak <mpd000@yahoo.de>:
fixes repositioning of text (from bug 749)

svn path=/trunk/; revision=17976
2005-09-21 22:48:52 +00:00
Hartmut Birr
080f8f4a31 - Do only create a registry entry for partitions if the signature of the disk is non zero.
- Do only mount partitions from a registry key if the signature is non zero.  
- Do delete all registry keys for non existing partitions.

svn path=/trunk/; revision=17975
2005-09-21 22:16:17 +00:00
Martin Fuchs
14d1c2cc63 - use size_t for buffer/string lengths instead of int
- define COUNTOF if not defined already

svn path=/trunk/; revision=17974
2005-09-21 21:54:52 +00:00
Martin Fuchs
d4358bfc5e - Bugfix for UTF-8 strings
- insert more XS_vsnprintf() calls
- additional comments
- struct XMLWriter

svn path=/trunk/; revision=17973
2005-09-21 21:44:39 +00:00
Thomas Bluemel
a8f183303f fixed some mismatching prototypes, sorry for breaking the build
svn path=/trunk/; revision=17972
2005-09-21 18:24:16 +00:00
Thomas Bluemel
7fd1af5d12 some arc names might be longer than 100 characters, increase the buffer size to 255 characters for now to fix a buffer overflow during startup
svn path=/trunk/; revision=17971
2005-09-21 17:57:07 +00:00
Thomas Bluemel
2e7c6d22ad fixed differences in signedness warnings
svn path=/trunk/; revision=17970
2005-09-21 17:37:08 +00:00
Thomas Bluemel
6f8faaa0d5 add missing function declarations
svn path=/trunk/; revision=17969
2005-09-21 17:28:14 +00:00
Thomas Bluemel
30da66ac75 pass the buffer size to GetEnvironmentVariable() in characters, not bytes!
svn path=/trunk/; revision=17968
2005-09-21 17:23:27 +00:00
Thomas Bluemel
78e6f0fce1 fixed some warnings
svn path=/trunk/; revision=17967
2005-09-21 17:22:45 +00:00
Richard Campbell
1e7a778c81 -small test commit
svn path=/trunk/; revision=17966
2005-09-21 17:09:33 +00:00
Thomas Bluemel
71a3db7178 fixed differences in signedness warnings
svn path=/trunk/; revision=17965
2005-09-21 15:32:53 +00:00
Filip Navara
8eece91bda Indentation fix.
svn path=/trunk/; revision=17964
2005-09-21 14:01:49 +00:00
Filip Navara
eca43c5532 Incomplete support for WS_EX_TRANSPARENT, should fix Task Manager painting bugs.
svn path=/trunk/; revision=17963
2005-09-21 13:49:09 +00:00
Steven Edwards
32e72ac4f3 Nathan Woods <npwoods _NOSPAM_at_NOSPAM cybercom.net> - Implement a working VS.NET backend, minor fixes to the vc6 backend
svn path=/trunk/; revision=17962
2005-09-21 03:20:07 +00:00
Royce Mitchell III
de51245b10 remove extraneous \n's
svn path=/trunk/; revision=17961
2005-09-21 02:04:07 +00:00
Royce Mitchell III
5c0d0a5c3d give set/a access to "special" variables like errorlevel
svn path=/trunk/; revision=17960
2005-09-21 01:44:18 +00:00
Royce Mitchell III
d25cb331be msvc6 warning fix
svn path=/trunk/; revision=17959
2005-09-21 01:27:54 +00:00
Royce Mitchell III
48bf871025 always strip '^' (unless it was preceded by an '^' itself), not just if it precedes the redirection symbols - fixes some of my test cases in seta_test.cmd
svn path=/trunk/; revision=17958
2005-09-21 01:27:22 +00:00
Royce Mitchell III
d6475d7b86 fix debug output
remove my '!' code - don't know how I thought this was valid
restore part of code I removed previously that was breaking 'not' cases that need to execute and the right half of the == was longer than then left

svn path=/trunk/; revision=17957
2005-09-21 01:25:58 +00:00
Royce Mitchell III
7e3c246bc2 a few more tests to clarify parsing oddities based on my playing around
svn path=/trunk/; revision=17956
2005-09-21 01:23:44 +00:00
Royce Mitchell III
1b64b915a7 %1 %2 etc still work with set/a ( just not %foo% )
svn path=/trunk/; revision=17955
2005-09-21 01:22:56 +00:00
Royce Mitchell III
83471cc423 fix misunderstandings of if syntax
svn path=/trunk/; revision=17954
2005-09-20 20:43:15 +00:00
Royce Mitchell III
7b93cd135c fix escape removal
svn path=/trunk/; revision=17953
2005-09-20 20:32:48 +00:00
Royce Mitchell III
39fd46a7b3 remove now-pointless if statement
add a little more debug output

svn path=/trunk/; revision=17952
2005-09-20 20:13:16 +00:00
Martin Fuchs
d91a17bcbc - fix build for MinGW and VC++ environments
- fix Manifest descriptions
- ignore some immediate files

svn path=/trunk/; revision=17951
2005-09-20 19:51:27 +00:00
Royce Mitchell III
819d52f0da unrevert change - this change is correct and works in windows
svn path=/trunk/; revision=17950
2005-09-20 19:27:08 +00:00
Magnus Olsen
86b46b4572 Revert royce3 change from 17948 to 16488 it break choice in bat files, in some case.
svn path=/trunk/; revision=17949
2005-09-20 18:11:55 +00:00
Royce Mitchell III
4ec7b01faf cmd's documentation says that env variables override the "built-ins" like %errorlevel% and such.
also fixed a couple msvc6 warnings and added a little documentation to the set/a code

svn path=/trunk/; revision=17948
2005-09-20 16:38:02 +00:00
Filip Navara
dff3a0dd3a Restore the pre-r17946 UserGetAncestor behaviour and fix the code calling it.
svn path=/trunk/; revision=17947
2005-09-20 10:45:27 +00:00
Filip Navara
27f30a175b - SetParent shouldn't destroy menus.
- UserGetAncestor(Window, GA_ROOT) really shouldn't return NULL, in any case.

svn path=/trunk/; revision=17946
2005-09-20 10:31:57 +00:00
Filip Navara
0bec9aee61 Don't return NULL regions from DceGetVisRgn.
svn path=/trunk/; revision=17945
2005-09-20 10:29:05 +00:00
Filip Navara
1dc1b56c2f Fix parameter validation in WM_GETTEXT and GetWindowText.
svn path=/trunk/; revision=17944
2005-09-20 09:31:13 +00:00
Filip Navara
7936d2bbcf Support GCW_ATOM in GetClassLong.
svn path=/trunk/; revision=17943
2005-09-20 09:28:49 +00:00
Filip Navara
86ae753de1 Fix the order of window style setting.
svn path=/trunk/; revision=17942
2005-09-20 09:28:18 +00:00
Gé van Geldorp
ac73d1e005 Set eol-style
svn path=/trunk/; revision=17941
2005-09-20 08:00:00 +00:00
Gé van Geldorp
7ec5b38020 Saveliy Tretiakov <saveliyt@mail.ru>:
EventLog changes
- Implement basic file operations (WindowsNT compatible file format)
- Write events from lpc port to System Log
  (to read these events, open \ReactOS\system32\config\SysEvent.evt in Windows
  EventViewer)  
- RPC server (stubs)

svn path=/trunk/; revision=17940
2005-09-20 07:58:28 +00:00
Gé van Geldorp
8528b9b411 Bletch <npwoods@mess.org>:
.lnk files (and other files with hidden file extension) got one character
truncated off the resulting filename.

svn path=/trunk/; revision=17939
2005-09-20 07:37:45 +00:00
Royce Mitchell III
bf84d47c16 hack fix to pass % to set/a unmolested
svn path=/trunk/; revision=17938
2005-09-19 23:00:25 +00:00
Royce Mitchell III
2d9a0aaa6c reformat code
svn path=/trunk/; revision=17937
2005-09-19 22:00:01 +00:00
Gé van Geldorp
f5ffc6c672 - Add ctrl support to (most) keyboard layouts. Only tested for kbdus, added
to a few other I was confident about. Still to do: kbddv, kbdgr, kbdru, kbdsg
- Prevent access outside array in TryToTranslateChar
- Revert r17830, it handles ctrl keys at the wrong location
This fixes bug 763.

svn path=/trunk/; revision=17936
2005-09-19 21:11:41 +00:00
Hartmut Birr
047952c5a1 - Read more information from the registry about the disks detected by the bios.
- Fixed the detection of disks with a signature of zero (in AddDiskToList).  
- Update always the partition table if the modified flag is set.  
- Create an unique disk signature.  
- Declared some registry query structures in cmtype.h.


svn path=/trunk/; revision=17935
2005-09-19 20:01:29 +00:00
Filip Navara
1ddb0f87a0 Remove accidently commited debug code.
svn path=/trunk/; revision=17934
2005-09-19 15:16:00 +00:00
Filip Navara
fe51307bd2 Fix the taskbar button resizing to account for button spacing.
svn path=/trunk/; revision=17933
2005-09-19 15:15:22 +00:00
Filip Navara
e402efe2c3 - Fix region deleting and ownership for DCEs.
- Fix uninitialized hDC variable in painting code :)

svn path=/trunk/; revision=17932
2005-09-19 12:21:52 +00:00
Filip Navara
1d878e0ba5 Partial clean-up of the painting functions:
- Get rid of the DCX_WINDOWPAINT flag (it wasn't used anyway).
- Remove the PaintPosted field from message queue, we don't need it.
- Use screen cooridnates for the WindowUpdate region instead of window relative ones.
- Fix the algorithm for retrieving paint messages to respect the painting order.
- Remove the NCUpdateRegion field from window object and calculate it on demand.
- Fix GetDCEx to take region in screen coordinates.

svn path=/trunk/; revision=17931
2005-09-19 10:39:26 +00:00
Hervé Poussineau
0558c3abc5 Implement IRP_MN_QUERY_CAPABILITIES, IRP_MN_QUERY_RESOURCES, IRP_MN_QUERY_RESOURCE_REQUIREMENTS, IRP_MN_QUERY_DEVICE_TEXT for USB devices
Fix DeviceID and HardwareIDs identifiers returned for root hub (Vendor and Product IDs are still not initialized by Cromwell code)
Fix handling of removal IRPs for USB controller

svn path=/trunk/; revision=17930
2005-09-19 10:04:07 +00:00
Hervé Poussineau
243b1fc88f Automagically select computer type (UP/MP) during first stage setup
svn path=/trunk/; revision=17929
2005-09-19 08:11:43 +00:00
Filip Navara
f1ee99f91a - Move the window showing/hiding notifications from co_WinPosShowWindow to co_WinPosSetWindowPos and fix up the top-level checks.
- Call the redraw routine on parent window if possible in co_WinPosSetWindowPos. Should fix bug #735.

svn path=/trunk/; revision=17928
2005-09-19 07:35:31 +00:00
Royce Mitchell III
07070d0d52 fix if command to work more like expected. seta_test.cmd gets much further now.
fixed some msvc6 warnings while I was in here

svn path=/trunk/; revision=17927
2005-09-19 05:42:01 +00:00
Royce Mitchell III
636cb4e66c fixed mistakes, extra tests illustrating problems with if command
svn path=/trunk/; revision=17926
2005-09-19 05:29:17 +00:00
Royce Mitchell III
1e9a958e20 move hard-coded strings to En.rc before GreatLord shoots me
svn path=/trunk/; revision=17925
2005-09-19 01:14:36 +00:00
Gunnar Dalsnes
acd5c47c18 -set last error (invalid handle) in cases where handle is NULL also
-remove GvG's workaround

svn path=/trunk/; revision=17924
2005-09-19 00:02:39 +00:00
Gunnar Dalsnes
5eaa4fda83 -added better LIST_FOR_EACH macros (ripped from wine) and fix their usage
-make hotkeys session global (they dont belong in winsta)

svn path=/trunk/; revision=17923
2005-09-18 23:06:15 +00:00
Gé van Geldorp
17fba5a631 Set correct error code, IsWindow() depends on this
svn path=/trunk/; revision=17922
2005-09-18 21:48:56 +00:00
Royce Mitchell III
4837e8bf71 regression test for set /a - fails at the moment because 'if' is bork3d
svn path=/trunk/; revision=17921
2005-09-18 18:59:59 +00:00
Royce Mitchell III
0f792e01d4 fixes for UNICODE compilation
svn path=/trunk/; revision=17920
2005-09-18 18:58:11 +00:00
Alex Ionescu
ae1732c6b0 Make LogoffWindowsDialog exit the caller (ie: explorer) so that previous shutdown functionality is restored
svn path=/trunk/; revision=17919
2005-09-18 18:49:30 +00:00
Alex Ionescu
523371b73d Fix shell32 spec file to properly export LogoffWindowsDialog as the proper ordinal (54) so that explorer won't crash on shutdown when calling it. Implement the LogoffWindowsDialog stub.
svn path=/trunk/; revision=17918
2005-09-18 18:46:15 +00:00
Royce Mitchell III
891e470c6d fix escaping
svn path=/trunk/; revision=17917
2005-09-18 18:37:08 +00:00
Royce Mitchell III
9cd240b08f (hopefully) last bugfix to set /a - assignment works again
svn path=/trunk/; revision=17916
2005-09-18 17:52:28 +00:00
Royce Mitchell III
f28d0d895f fixed bugs in shifting (<<, >>, <<=, >>=)
eliminated some code duplication while I was in there.

svn path=/trunk/; revision=17915
2005-09-18 17:33:11 +00:00
Gunnar Dalsnes
098082f49d -remove meaningless use of winstas
-move syscalls to end of file

svn path=/trunk/; revision=17914
2005-09-18 16:56:33 +00:00
Hartmut Birr
45694d291d Revert my last changes.
svn path=/trunk/; revision=17913
2005-09-18 15:25:34 +00:00
Hartmut Birr
dbb79dd925 The share disposition isn't necessary for FILE_READ_ATTRIBUTES.
svn path=/trunk/; revision=17912
2005-09-18 13:46:37 +00:00
Magnus Olsen
ed7f5f3976 revert my change from r17909. Thx hbirr to fix the bug with 17910.
svn path=/trunk/; revision=17911
2005-09-18 13:36:29 +00:00
Hartmut Birr
0cfadced6f Don't check the share access for directories.
svn path=/trunk/; revision=17910
2005-09-18 13:10:43 +00:00
Magnus Olsen
065786c3b7 give GetFileAttributesExW more NtOpenFile right to prevent reactos crash if u using CreateFile then GetFileAttributesExW. It also fix a bug for me for livecd it booting on first try now in vmware. instead second or more booting try.
svn path=/trunk/; revision=17909
2005-09-18 12:05:57 +00:00
Magnus Olsen
fd30631edf Clean up patch from filip, with small change from me, for MoveFileWithProgressW.
svn path=/trunk/; revision=17908
2005-09-18 11:18:28 +00:00
Magnus Olsen
42acc38f81 Implement second part of move folder. Now we can move empty folder. we need add code for move folder with contain now.
svn path=/trunk/; revision=17907
2005-09-18 09:29:37 +00:00
Royce Mitchell III
989e287e31 1) strip ^ escapes from text before processing set command
2) recursive descent implementation of set /a - should fix bug 728
(In case anyone checks I realized there were some gaping holes in the implementation I posted to the ml, so this one is modified from it. This code could stand to benefit from a comprehensive feature/regression test.)

svn path=/trunk/; revision=17906
2005-09-18 03:52:34 +00:00
Alex Ionescu
3682544d27 Fix user-mode stack trace regression caused by my exception patch. Traces are now shown again
svn path=/trunk/; revision=17905
2005-09-18 03:26:52 +00:00
Gé van Geldorp
670b82330c _getch() doesn't echo the chars it retrieves and operates in raw mode.
svn path=/trunk/; revision=17904
2005-09-17 22:33:53 +00:00
Hartmut Birr
f8852fda40 Do not overwrite the disk signature, if we install the boot code into the mbr.
svn path=/trunk/; revision=17903
2005-09-17 22:00:35 +00:00
Gé van Geldorp
5f8481f284 Count each handle which has pending events only once, independent of the number
of pending events. Fixes bug 779.

svn path=/trunk/; revision=17902
2005-09-17 21:22:47 +00:00
Magnus Olsen
8e38aa25a1 Fix some part of MoveFileExW Bug, Can not move folder, but it still can not move folder. some bit more work.
svn path=/trunk/; revision=17901
2005-09-17 21:02:38 +00:00
Gé van Geldorp
90fedad977 Add back support for older binutils versions
svn path=/trunk/; revision=17900
2005-09-17 19:38:34 +00:00
Gé van Geldorp
f47052c1a7 Open handle to sfd.sys as asynchromous. This fixes bug 713.
svn path=/trunk/; revision=17899
2005-09-17 19:30:05 +00:00
Magnus Olsen
fdb70af10b Bug fix dir *. it only show folders
svn path=/trunk/; revision=17898
2005-09-17 18:56:16 +00:00
Eric Kohl
13fa268dc1 - String id 0 becomes a reserved (invalid) id.
- StringTableStringFromId returns a pointer to an empty string if the string id is invalid.
This fixes the stringtable tests.

svn path=/trunk/; revision=17897
2005-09-17 17:16:33 +00:00
Magnus Olsen
d5f2eeedd7 Update the swedish translation by Harteex.
svn path=/trunk/; revision=17896
2005-09-17 16:02:37 +00:00
Royce Mitchell III
39001fdc17 Fix "numberf" function to correctly handle 'g' format specifier. Debugged by Michael Fritscher <michael@fritscher.net>
(fixed a couple return values while I was in there)

svn path=/trunk/; revision=17895
2005-09-17 13:48:38 +00:00
Filip Navara
8895797332 Fix "numberf" function to correctly handle 'g' format specifier. Debugged by Michael Fritscher <michael@fritscher.net>.
svn path=/trunk/; revision=17894
2005-09-17 11:20:25 +00:00
Filip Navara
bd4bdb08c1 Patricio Martínez Ros <silencium@wanadoo.es>
Spanish translation.

svn path=/trunk/; revision=17893
2005-09-17 10:55:29 +00:00
Martin Fuchs
d0ad7f5452 add new winefile icon images in 48x48 and 16x16 resolutions
svn path=/trunk/; revision=17892
2005-09-17 10:54:46 +00:00
Martin Fuchs
f374903282 add comment
svn path=/trunk/; revision=17891
2005-09-17 10:52:43 +00:00
Gé van Geldorp
30f4eba8d2 Hopefully the last in a series of fixes for size of maximized windows
svn path=/trunk/; revision=17890
2005-09-16 21:15:58 +00:00
Gé van Geldorp
d7876f7981 Bletch <npwoods@mess.org>
Partially implemented the treeview right-click menu on Regedit. Just supporting
Expand and Collapse for now, and also started work on renaming keys.

svn path=/trunk/; revision=17889
2005-09-16 20:13:26 +00:00
Gé van Geldorp
a5556fb1e4 RegQueryValueExW retrieves Unicode strings but the size must be specified in
bytes. Fixes bug 770.

svn path=/trunk/; revision=17888
2005-09-16 19:47:44 +00:00
Gé van Geldorp
0f6d6950a2 Do some boundschecking on iOrder. Fixes bug 770.
svn path=/trunk/; revision=17887
2005-09-16 18:18:48 +00:00
Andrew Munger
7f46bf47f7 Fix release build of ntdll by adding __NO_CTYPE_INLINES to rtl.xml
svn path=/trunk/; revision=17886
2005-09-16 18:07:19 +00:00
Andrew Munger
e03998d67c Fix release build of dflat32, initalizing some vars and fixing one typo.
svn path=/trunk/; revision=17885
2005-09-16 18:00:49 +00:00
Gé van Geldorp
0dee5251b9 Fix "var might be used uninitialized" warning
svn path=/trunk/; revision=17884
2005-09-16 17:53:40 +00:00
Gé van Geldorp
17c7dd0144 Only access dwTypeData if the caller pronounced it valid.
svn path=/trunk/; revision=17883
2005-09-16 15:34:19 +00:00
Hartmut Birr
bae216e9d2 Free all messages in LpcpDeletePort.
svn path=/trunk/; revision=17882
2005-09-16 15:18:23 +00:00
Brandon Turner
873253a8e9 start even console apps in there own new window. caught by GvG.
svn path=/trunk/; revision=17881
2005-09-16 15:18:07 +00:00
Brandon Turner
dadab98225 fix a bug in 'if exsist', it was only reading to the first space for the file name, ignoring quotes and there fore searching for bad file names.
svn path=/trunk/; revision=17880
2005-09-16 15:00:22 +00:00
Hartmut Birr
0e07f15c6a Dereference the port object in PspExitThread.
svn path=/trunk/; revision=17879
2005-09-16 14:50:25 +00:00
Brandon Turner
50aaff9bd3 Set errorlevel to 0 when user enters 'no' on del confirmation. this is how MS does it.
svn path=/trunk/; revision=17878
2005-09-16 13:58:37 +00:00
Steven Edwards
2fe4d89ea8 added support for test on 2k,XP and 2k3. Check for a bug in our implementation and wrap it in a todo_wine block
svn path=/trunk/; revision=17877
2005-09-16 08:48:00 +00:00
Brandon Turner
ea5a3afa86 When searching for a file to execute, if you fail to find it using the first part of the input, try to use the full line input. problem is really only seen when doing "start foo.bat".
svn path=/trunk/; revision=17876
2005-09-16 05:51:20 +00:00
Brandon Turner
3d2d6eff0b "start" or "start cmd" now opens a new cmd.exe in its own process. this is how MS cmd does it.
svn path=/trunk/; revision=17875
2005-09-16 05:35:43 +00:00
Brandon Turner
00e96a6cb1 last time. fix a typo. im so sorry!
svn path=/trunk/; revision=17874
2005-09-16 04:53:07 +00:00
Brandon Turner
691589bdf4 forgot to free comspec, very sorry.
svn path=/trunk/; revision=17873
2005-09-16 04:46:06 +00:00
Brandon Turner
b494052296 Use compsec instead of "cmd" when trying to find cmd.exe
svn path=/trunk/; revision=17872
2005-09-16 04:40:46 +00:00
Gé van Geldorp
30aad7b52a Fix some of the damage r17811 did to the GDB stub
svn path=/trunk/; revision=17871
2005-09-15 22:07:35 +00:00
Aleksey Bragin
43bdfc834c Fix the tree at last, by reverting previous changes to RtlpCheckForActiveDebugger.
svn path=/trunk/; revision=17870
2005-09-15 20:24:30 +00:00
Aleksey Bragin
646ee13307 Revert 17867:17866 change, introduced to temporarily fix tree-compiling. Made obsolete by rev. 17868.
svn path=/trunk/; revision=17869
2005-09-15 19:30:27 +00:00
Alex Ionescu
019ed71c23 - Fix build, sorry.
svn path=/trunk/; revision=17868
2005-09-15 19:18:59 +00:00
Aleksey Bragin
fbc3848431 Fix compiling error, feel free to revert this when commiting missing changes (if it's not a typo).
svn path=/trunk/; revision=17867
2005-09-15 19:14:42 +00:00
Hartmut Birr
3d3c2afb41 - Assign first the partitions to drive letters, which have a registry entry in MountedDevices.
- Create for all partitions a registry entry in MountedDevices if none exists.  
- Assign all partitions with arc names first and the others as second.

svn path=/trunk/; revision=17866
2005-09-15 17:26:56 +00:00
Hartmut Birr
1384de5268 - Fixed the creation of arc names. Only valid partitions should be linked to an arc names.
- Create arc names only for partitions on disks, which are visible by the bios.


svn path=/trunk/; revision=17865
2005-09-15 17:23:41 +00:00
Hartmut Birr
9f214815b7 - Do only allow to install reactos on disks which are visible by the bios.
- Arrange the disks in the same sequence how they was detected by the bios.  
- Create a registry entry in MountedDevices for each recognized partition.

svn path=/trunk/; revision=17864
2005-09-15 17:19:31 +00:00
Hartmut Birr
a9ef5d9d40 Fixed the MP build.
svn path=/trunk/; revision=17863
2005-09-15 16:52:23 +00:00
Hartmut Birr
b3f6e62113 Used the given registry path from DriverEntry to query the registry.
This will also fix the bug in I8042ReadRegistry, which has append the string to an unicode string with an uninitialized length value.

svn path=/trunk/; revision=17862
2005-09-15 16:46:17 +00:00
Hervé Poussineau
cff40b3061 If we have a PCI device, try to keep the IRQ assigned by the BIOS instead of forcing 0x9
svn path=/trunk/; revision=17861
2005-09-15 15:57:28 +00:00
Alex Ionescu
184ae2cb27 Return valid status
svn path=/trunk/; revision=17860
2005-09-15 14:07:37 +00:00
Hervé Poussineau
86ce7ba5ab Revert 17858 and fix all warnings at once.
This fix may be strange at first sight, but original Linux code doesn't use "flags" variable at all. This fix is here only to prevent a warning and shouldn't break the behaviour of the code.

svn path=/trunk/; revision=17859
2005-09-15 13:25:32 +00:00
Hervé Poussineau
7329dca76f Initialize flags variable to 0
svn path=/trunk/; revision=17858
2005-09-15 12:57:11 +00:00
Aleksey Bragin
8e8dbdf319 Initialize DeviceNumber to 0
svn path=/trunk/; revision=17857
2005-09-15 12:50:40 +00:00
Art Yerkes
f6cf8905f8 Took some advice from alex re: w32api headers. Use ..._DEFINED to override
items in the standard headers for different wordsize host.  wrc almost working
on 64-bit host.

svn path=/trunk/; revision=17856
2005-09-15 05:58:49 +00:00
Andrew Munger
ddaabb16b4 Added a text test to rosperf, and build as unicode.
svn path=/trunk/; revision=17855
2005-09-15 04:57:51 +00:00
Andrew Munger
a88a9fff19 Fix release build of string library
svn path=/trunk/; revision=17854
2005-09-15 04:51:14 +00:00
Filip Navara
0443a3b73c Update the IDC_* constants.
svn path=/trunk/; revision=17853
2005-09-14 22:13:22 +00:00
Filip Navara
d3a5c3f2bd Patricio Martínez Ros <silencium@wanadoo.es>
Spanish translation.

svn path=/trunk/; revision=17852
2005-09-14 21:07:04 +00:00
Filip Navara
b3abdb0812 Patricio Martínez Ros <silencium@wanadoo.es>
Spanish translation.

svn path=/trunk/; revision=17851
2005-09-14 21:06:35 +00:00
Andrew Munger
1b7481234a Fix regexpl so it properly prints a DWORD_LITTLE_ENDIAN.
svn path=/trunk/; revision=17850
2005-09-14 20:24:43 +00:00
Hervé Poussineau
5b76e2c8f8 Fix indentation of generated code, by letting Output method do its indenting job
svn path=/trunk/; revision=17849
2005-09-14 19:32:47 +00:00
Alex Ionescu
02eed3311f fix build
svn path=/trunk/; revision=17848
2005-09-14 02:03:17 +00:00
Alex Ionescu
e0eea608a6 ntoskrnl header cleanups
svn path=/trunk/; revision=17847
2005-09-14 01:44:19 +00:00
Alex Ionescu
e8dcb74344 ntoskrnl header cleanups
svn path=/trunk/; revision=17846
2005-09-14 01:05:50 +00:00
Alex Ionescu
a6f1511ecb ntoskrnl header cleanups
svn path=/trunk/; revision=17845
2005-09-13 23:48:54 +00:00
Alex Ionescu
11272023e5 Part 1 of <many> ntoskrnl header cleanups
svn path=/trunk/; revision=17844
2005-09-13 23:28:21 +00:00
Royce Mitchell III
10f2fdca23 zero out the struct and disable code that has no connection with reality - I'm thinking MIIM_STRING should be removed from flags also, but I have not tested with that change.
svn path=/trunk/; revision=17843
2005-09-13 23:04:32 +00:00
Alex Ionescu
4d1f146406 Filip doesn't like int3. Implemented Trap6 failure on bad stack and V86M syscall return
svn path=/trunk/; revision=17842
2005-09-13 20:26:57 +00:00
Alex Ionescu
99e5e010dc Properly bias frame, remove bugcheck added for debugging, re-add bugcheck removed for debugging
svn path=/trunk/; revision=17841
2005-09-13 20:13:05 +00:00
Alex Ionescu
736e7b9af0 Missing files...
svn path=/trunk/; revision=17840
2005-09-13 19:41:07 +00:00
Alex Ionescu
38b63156fa Sorry for the debug messages.
svn path=/trunk/; revision=17839
2005-09-13 19:34:48 +00:00
Alex Ionescu
7a5244c46d Some work-in-progress improvements and rethought of system-level code...notable improvemnts till now are: -The KTHREAD alterted flag is now properly set to FALSE during APC delivery during traps, -More support for PKEXCEPTION_FRAME has been added for future PPC/IA64/etc compatibility -Context to/from TrapFrame functions have been greatly fixed to allow for edited frames, special cases, exceptions and also have the necessary support for supporting sanitation based on PreviousMode - KDBG now shows the proper CS/SS at all times, previous hack was removed. - Systemcall code was optimized a bit and the trap code was made a lot more generic so that in can be made into macros (it currently isn't, for debugging purposes). - V86 Mode trap frame bias has now been added to make trap code a lot more generic and shareable in the future. -More support and fixes for future Debugging capabilities have been added. - Random other scalability and stability code. This is still being worked on, syscall.S looks nasty for now (visually)
svn path=/trunk/; revision=17838
2005-09-13 19:33:49 +00:00
Royce Mitchell III
3b0cfca870 rename variable and change parameters in call to find_last_not_of() to hopefully be a little more accurate to what it's doing
svn path=/trunk/; revision=17837
2005-09-13 19:11:37 +00:00
Royce Mitchell III
130efbb545 fix bug in GetBinutilsVersion()
svn path=/trunk/; revision=17836
2005-09-13 19:04:24 +00:00
Hartmut Birr
7f94d6e5bf - Freed the path string for the keyboard dll.
- Freed some strings in all cases.

svn path=/trunk/; revision=17835
2005-09-13 18:08:18 +00:00
Hartmut Birr
535a223492 Fixed the declaration of RtlPinAtomInAtomTable.
svn path=/trunk/; revision=17834
2005-09-13 18:04:00 +00:00
Gregor Anich
887b31e11d Implement QUERYESCSUPPORT escape in ExtEscape (returns FALSE always)
svn path=/trunk/; revision=17832
2005-09-13 14:46:48 +00:00
Gregor Anich
75413f5545 Query support for opengl-driver-info escape before calling it and some other minor changes.
svn path=/trunk/; revision=17831
2005-09-13 14:46:00 +00:00
Royce Mitchell III
0dbbd80237 copy&paste enhancement
patch by "brbak"
(see bug 749)

svn path=/trunk/; revision=17830
2005-09-13 14:34:48 +00:00
Royce Mitchell III
03d6ef4607 fix crash in 'make msvc'
svn path=/trunk/; revision=17829
2005-09-13 11:57:50 +00:00
Steven Edwards
a9c581cdb7 added LGPL license header to the code from Wine and Patrik Stridvall and Royce Mitchell III as authors
svn path=/trunk/; revision=17828
2005-09-13 03:51:18 +00:00
Steven Edwards
e9a29bad13 started working on generation of msvc2kX project files. THESE ARE NOT CORRECT. Right now its just a copy of the existing msvc6 generation code. It will generate a *.sln and *.vcproj files however they are still in the old format.
svn path=/trunk/; revision=17827
2005-09-13 03:46:22 +00:00
Hervé Poussineau
5b89cb0136 Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com>
Added Finnish resources.

svn path=/trunk/; revision=17826
2005-09-12 21:48:21 +00:00
Royce Mitchell III
638efc58aa security audit of explorer code...
strcpy -> lstrcpyn
strncpy -> lstrcpyn
[v]sprintf -> [v]snprintf
moved common Shell::get_path() subclass implementations into Shell::get_path_base() and made function overflow-proof
make other non-common subclass implementations of get_path overflow-proof

svn path=/trunk/; revision=17825
2005-09-12 21:46:09 +00:00
Royce Mitchell III
da407213dc msvc6 warning fix - cast return value of SHAlloc()
svn path=/trunk/; revision=17824
2005-09-12 20:07:29 +00:00
Royce Mitchell III
6994c4711b msvc6 warning fix - cast return value of SHAlloc()
svn path=/trunk/; revision=17823
2005-09-12 20:04:49 +00:00
Royce Mitchell III
6ad405d90f fix breakage - sorry
svn path=/trunk/; revision=17822
2005-09-12 19:58:34 +00:00
Magnus Olsen
831020dc3d DoCommand()
Remove one more hardcode buffer size. Remove limit command to MAX_PATH. No check for limit command line-

svn path=/trunk/; revision=17821
2005-09-12 19:50:16 +00:00
Gé van Geldorp
6ceb694074 Bletch <npwoods@mess.org>
- Implements the Encoding field when you save, allowing the user to save as
  ANSI, Unicode or UTF-8
- Invoking 'Save As' after saving or loading a file will default to the
  earlier filename
(minor changes by GvG, so mistakes are mine).

svn path=/trunk/; revision=17820
2005-09-12 17:10:00 +00:00
Royce Mitchell III
5fbac4d9e6 msvc6 compatibility and small performance improvement in filename completion
svn path=/trunk/; revision=17819
2005-09-12 16:06:53 +00:00
Royce Mitchell III
811a8addb8 io.h only exists for win32 - sorry *nix users
svn path=/trunk/; revision=17818
2005-09-12 14:55:55 +00:00
Royce Mitchell III
912eda64c8 fix warning about unlink() being undeclared
svn path=/trunk/; revision=17817
2005-09-12 14:33:57 +00:00
Alex Ionescu
025e6f6975 Fix previous strangely incomplete NtRaiseException implementation and re-enable the ProbeForRead call that failed
svn path=/trunk/; revision=17816
2005-09-12 03:59:03 +00:00
Alex Ionescu
2dfe1a384e Fix bug in KiUserExceptionDispatcher
svn path=/trunk/; revision=17815
2005-09-12 03:10:08 +00:00
Alex Ionescu
9e5af04e26 Fix RtlpGetStackLimits to get the right limits if called in kernel-mode (separated implementations). Also don't return from _SEH_TRY blocks, because PSEH doesn't support this. Also temporarly disable a ProbeForRead check in KiContinue because it currently causes trouble
svn path=/trunk/; revision=17814
2005-09-12 02:57:47 +00:00
Royce Mitchell III
19ca3d1d83 patch by Alex_Ionescu - fixes crash in usb driver on bootup in vmware
svn path=/trunk/; revision=17813
2005-09-12 01:32:11 +00:00
Royce Mitchell III
2f35400d27 document parameter names
svn path=/trunk/; revision=17812
2005-09-12 01:31:24 +00:00
Alex Ionescu
b9020b11dd Major refactoring of the exception handling code + misc fixes:
- Fix/add prototypes for RtlCaptureContext, RtlDispatchException and RtlUnwind
	- Fix EXCEPTION_REGISTRATION_RECORD structure and PEXCEPTION_ROUTINE
	- Add w32api excpt.h (based on mingw) with PSDK compatibility fixes
	- Fix seriously broken User-Mode Ldr thunk and APC Callback prototypes
	- Fix KiUserExceptionDispatcher
	- Remove useless NTDLL entrypoint
	- Implement NTDLL Ki* callbacks in ASM
	- Implement RtlCaptureContext
	- Fix RtlRaiseException to handle cases when a user-mode debugger is present
	- Fix RtlRaiseStatus as above, plus set the exception address and capture context
	- Little cleanup of RTL headers
	- Implement RtlpGetStackLimits, RtlpGetExceptionList, RtlpSetExceptionList, RtlpGetExceptionAddress in ASM
	- Fix RtlDispatchException, add cases for exceptions in the DPC stack and validate the validity of the 
exception frames. Add support for exception logging by the global flag. Use TRAP_FRAME/EXCPETION_FRAME instead of 
Context.
	- Fix RtlUnwind logic, support cases where it's called with custom arguments instead of NULL.
	- Reimplement RtlpCaptureContext to work properly, convert exception handler calling functions to INTEL syntax 
and fix some bugs (like checking for the right unwind flag, clearing volatile register values, etc. Also use some 
optimizations to increase speed.
	- Modify some kernel functions (like KeContextToTrapFrame, KiDispatchException, KiInitializeUserApc, etc.) to 
support a PKEXCEPTION_FRAME for future PPC compatibility.
	- Reimplement RtlCaptureUnicodeString/FreeUnicodeString as inlined probe macros and optimize them.
	- Export ExRaiseStatus/Exception as Rtl*
	- Reimplement NtContinue to have more platform-independent code, and to protect and validate user-mode context 
and parameters with SEH.
	- Implement KiRaiseException, add SEH to all user-mode parameters and when copying data to the user-mode stack.
	- Fix KiInitializeUserApc to use KeTrapFrameToContext, to save the debug registers, not to deliver APCs during 
v86 mode, and to protect user-mode stack operations in SEH and probing. Also make it generate the proper stack for the 
user-mode callback. 
	- Implement KiUnexpectedInterrupt and KiCoprocessorError
	- Reimplement NtRaiseException in ASM to take advantage of optimizations due to the trap frame being in the 
stack when called through System call interface.
	- Fix Ntcontinue to respect AlertThread paramter
	- Fix some functiosn to return with KiServiceExit2 instead of KiServiceExit when required/needed
	- Fix KiDispatchException's logic, fix hacks when calling KeUserExceptionDispatcher, use correct context 
flags,...
	- Make NTDLL Ki* callbacks have SEH to protect them and return to kernel-mode with notification of any 
exceptions (the kernel-mode code to handle this isn't written yet though)

svn path=/trunk/; revision=17811
2005-09-11 22:32:20 +00:00
Magnus Olsen
801ad7223f Do not compile cmd to unicode, if we do pipe will be 100% broken then.
svn path=/trunk/; revision=17810
2005-09-11 21:19:32 +00:00
Gunnar Dalsnes
f5449547b6 fix referencing bug (ros crashed during setup if mousemove) in co_WinPosSearchChildren
svn path=/trunk/; revision=17809
2005-09-11 21:05:32 +00:00
Magnus Olsen
3a98addd02 Make some more dymatic buffer and correct some free()
svn path=/trunk/; revision=17808
2005-09-11 20:41:39 +00:00
Brandon Turner
6b218f4e59 simple fix for 'del foo' where foo is a folder.
svn path=/trunk/; revision=17807
2005-09-11 20:26:36 +00:00
Magnus Olsen
f586d22df5 Do not crash if the prompt command name are binger that 260char or the command line.
svn path=/trunk/; revision=17806
2005-09-11 20:16:37 +00:00
Brandon Turner
4b1a13ae2f Windows style auto complete should only return folders then the preceding command is cd or rd.
svn path=/trunk/; revision=17805
2005-09-11 19:40:45 +00:00
Gé van Geldorp
0c1c382528 The system menu is allowed to have an unnamed entry which is not a separator
svn path=/trunk/; revision=17804
2005-09-11 17:59:52 +00:00
Magnus Olsen
de603dba17 Update the swedish translation by Harteex
svn path=/trunk/; revision=17803
2005-09-11 17:47:00 +00:00
Gunnar Dalsnes
fdafc67fbe -refcount reworking (simplification & improvement)
-make functions deal with pointers, not handles
-misc formatting

svn path=/trunk/; revision=17802
2005-09-11 14:48:32 +00:00
Eric Kohl
9e486c444b - CFGMGR32.DLL: Forward implemented functions to SETUPAPI.DLL.
- SETUPAPI.DLL: Use PNP_EnumerateSubKeys to implement CM_Enumerate_Classes_Ex.

svn path=/trunk/; revision=17801
2005-09-11 14:38:57 +00:00
Hervé Poussineau
61420d12f3 Signal USB device arrivals to PnP manager
svn path=/trunk/; revision=17800
2005-09-11 13:55:23 +00:00
Hervé Poussineau
cde1a0c17d Disable USB keyboard and mouse support, as they conflict with i8042prt driver.
We need to change kbdclass/mouclass to be an upper filter of keyboard/mouse device objects (which would become unnamed), and to support multiple keyboards/mice

svn path=/trunk/; revision=17799
2005-09-11 13:55:18 +00:00
Filip Navara
019de62105 Make _strtoui64 an alias of strtoull.
svn path=/trunk/; revision=17798
2005-09-11 13:05:33 +00:00
Filip Navara
c25a8a58af Fix strtoull implementation and add it to build files. Based on patch by Mark Junker <mjscod@gmx.de>.
svn path=/trunk/; revision=17797
2005-09-11 12:36:09 +00:00
Aleksey Bragin
a43952c66b updated wait_for_completion, should work similar to schedule_timeout.
svn path=/trunk/; revision=17796
2005-09-11 11:59:25 +00:00
Hervé Poussineau
3745fc25ff Let OHCI miniport use shared code in drivers/usb/miniport/common/*, instead of duplicating it
svn path=/trunk/; revision=17795
2005-09-11 11:40:43 +00:00
Hervé Poussineau
975f584df9 Display debug error message only when action fails
svn path=/trunk/; revision=17794
2005-09-11 09:23:16 +00:00
Art Yerkes
24a13ab689 Previously, the first character written to the buffer was random (off the
stack).  Not sure why this didn't blow up for others.  Make sure we fill
one character before placing one in the buffer.

svn path=/trunk/; revision=17793
2005-09-11 09:19:24 +00:00
Eric Kohl
ac5798e0c9 - Implement CM_Enumerate_Enumerators_ExA.
- Fix a typo in PNP_EnumerateSubKeys.

svn path=/trunk/; revision=17792
2005-09-11 08:45:02 +00:00
Hervé Poussineau
f535ffe39f xHCI:
* Fix value returned by IRP_MN_QUERY_CAPABILITIES and IOCTL_INTERNAL_USB_GET_ROOT_USB_DEVICE
* Remove debug output
USBHUB:
* Don't enumerate too much children. Display informations about them

svn path=/trunk/; revision=17791
2005-09-10 23:50:28 +00:00
Gé van Geldorp
98f577158f Fix some object/handle victims. Fixes bug 765.
svn path=/trunk/; revision=17790
2005-09-10 23:01:56 +00:00
Hartmut Birr
3a292fe93d - Acquire the temporary buffer from non paged pool in NtQueryDirectoryObject, because the buffer is accessed at DPC_LEVEL.
- Do always add an empty entry at the end of the buffer

svn path=/trunk/; revision=17789
2005-09-10 22:35:08 +00:00
Gé van Geldorp
829763c4d7 Handle .msi files
svn path=/trunk/; revision=17788
2005-09-10 20:19:23 +00:00
Gé van Geldorp
58c1ccc051 Also add registry entries when driver files are already present
svn path=/trunk/; revision=17787
2005-09-10 19:37:20 +00:00
Gé van Geldorp
3276e52050 Auto-determine base of DWORD registry entries.
Fixes bug 764.

svn path=/trunk/; revision=17786
2005-09-10 19:21:49 +00:00
Eric Kohl
f913bdb378 - Implement CM_Enumerate_Enumerators[_Ex]A/W
- Fix PNP_EnumerateSubKeys

svn path=/trunk/; revision=17785
2005-09-10 19:01:44 +00:00
Hervé Poussineau
9162d35b10 Remove unneeded pointer indirection
svn path=/trunk/; revision=17784
2005-09-10 18:45:34 +00:00
Royce Mitchell III
4786e1d6f0 change rest of warnings to allowwarnings - sorry I didn't get to this the other day.
svn path=/trunk/; revision=17783
2005-09-10 18:39:34 +00:00
Hervé Poussineau
23d2ee98f5 Move shareable part of USB miniport drivers to a new directory. UHCI uses it.
svn path=/trunk/; revision=17782
2005-09-10 18:04:42 +00:00
Hartmut Birr
d672727c6a Print only the complete information if the fd is valid itself (in is_valid_fd).
svn path=/trunk/; revision=17781
2005-09-10 15:36:35 +00:00
Hartmut Birr
f8c9d4f80f Silence two debug messages after they have cried a little bit.
svn path=/trunk/; revision=17780
2005-09-10 15:30:21 +00:00
Hartmut Birr
10dac7250e Fixed a typo.
svn path=/trunk/; revision=17779
2005-09-10 15:21:16 +00:00
Hartmut Birr
19f7ba6b03 Fixed the allocation of some buffers in Execute.
svn path=/trunk/; revision=17778
2005-09-10 15:20:10 +00:00
Hartmut Birr
a03dfb5235 Fixed GetConsoleTitleA/W.
svn path=/trunk/; revision=17777
2005-09-10 15:18:42 +00:00
Hervé Poussineau
f03b5bcdff Move common code of USB miniport drivers into drivers/usb/miniport/common library
svn path=/trunk/; revision=17776
2005-09-10 15:17:07 +00:00
Emanuele Aliberti
e76d9c0ae2 <module warnings=...>
<module allowwarnings=...>

svn path=/trunk/; revision=17775
2005-09-10 14:46:06 +00:00
Hervé Poussineau
2764f55c6c Add USB drivers to bootcd
svn path=/trunk/; revision=17774
2005-09-10 13:03:17 +00:00
Eric Kohl
71dc00530f Implement CM_Delete_Class_Key[_Ex].
svn path=/trunk/; revision=17773
2005-09-10 13:02:02 +00:00
Eric Kohl
7ad59b629a Add RegDeleteTreeA/W prototype.
svn path=/trunk/; revision=17772
2005-09-10 10:31:22 +00:00
Gé van Geldorp
a2c38b8cdd Fix maximizing problem introduced by r17764
svn path=/trunk/; revision=17771
2005-09-10 08:22:03 +00:00
Gé van Geldorp
ae5de0886a Don't trust the returned date/time from the BIOS. QEmu messes this up sometimes.
Partly fixes bug 716.

svn path=/trunk/; revision=17767
2005-09-09 21:15:32 +00:00
Hervé Poussineau
187b9e3939 Compile cmd.exe as unicode
svn path=/trunk/; revision=17766
2005-09-09 15:58:40 +00:00
Gé van Geldorp
4de7f0f089 maxlen is in characters, _cnt is in bytes.
Note: rebuild of lib/crt required for this change to take effect
(make crt_clean; make crt)
This brings the VMware Tools installer a hell of a lot further (bug 717).

svn path=/trunk/; revision=17765
2005-09-09 14:47:35 +00:00
Gé van Geldorp
61d669da33 Use max tracking size instead of maximized size to limit window size.
Fixes bug 721.

svn path=/trunk/; revision=17764
2005-09-09 13:35:02 +00:00
Gé van Geldorp
589e1e9ee0 Restore console title after running a command
svn path=/trunk/; revision=17763
2005-09-09 12:22:25 +00:00
Gé van Geldorp
7555a90fe9 Don't assume UNICODE_STRINGs are nul terminated
svn path=/trunk/; revision=17762
2005-09-09 12:22:01 +00:00
Gé van Geldorp
c0337d5d24 Convert title from UNICODE_STRING to nul-terminated
svn path=/trunk/; revision=17761
2005-09-09 11:43:26 +00:00
Gé van Geldorp
b1e0054bee RetVal is in bytes, so check against MAX_PATH in bytes
svn path=/trunk/; revision=17760
2005-09-09 10:22:40 +00:00
Gé van Geldorp
1dc718065f Window handle is not valid anymore when the object is in "destroyed" state
svn path=/trunk/; revision=17759
2005-09-09 09:50:58 +00:00
Gé van Geldorp
704232a50f Remove WS_VISIBLE bit from correct member
svn path=/trunk/; revision=17758
2005-09-09 09:48:33 +00:00
Andrew Munger
02471b01a7 Remove stray data from the XML. This one goes out to TLF.
svn path=/trunk/; revision=17757
2005-09-09 00:38:39 +00:00
Gunnar Dalsnes
16addb9060 -cursoricon: naming changes, cleanup
-fix: hide/show caret to accept NULL hWnds
-some handle to pointer converions
-double handle table size
-fix: co_WinPosActivateOtherWindow was trying to access desktop parent

svn path=/trunk/; revision=17756
2005-09-09 00:25:52 +00:00
Royce Mitchell III
6b27e47c88 win32 api compatibility fix
changed 'warnings' attribute of <module> to 'allowwarnings' to make it's function less ambiguous

svn path=/trunk/; revision=17755
2005-09-08 23:10:17 +00:00
Hervé Poussineau
ffb05e59d0 Change driver name ohci.sys -> usbohci.sys
svn path=/trunk/; revision=17754
2005-09-08 21:54:42 +00:00
Hervé Poussineau
d41edbe37f Remove warnings and allow installation of USB files with make install
svn path=/trunk/; revision=17753
2005-09-08 21:32:53 +00:00
Gé van Geldorp
8da043e4f2 Fix double-clicking control panel items
svn path=/trunk/; revision=17752
2005-09-08 21:08:53 +00:00
Hervé Poussineau
67720419df Fix build, by correcting include paths and updating xml files of USB components
svn path=/trunk/; revision=17751
2005-09-08 20:53:17 +00:00
Hartmut Birr
d392fa8a17 Allocate a larger storage for the request buffer. It is necessary since the latest changeing in ntdll for csrss connections.
svn path=/trunk/; revision=17750
2005-09-08 20:18:46 +00:00
Hervé Poussineau
af6ca3d9d4 Add xml files at the right places
Remove now useless cromwell directory

svn path=/trunk/; revision=17749
2005-09-08 20:16:36 +00:00
Hartmut Birr
1df53c9525 Initialize the length in the header in LpcSendTerminationPort.
svn path=/trunk/; revision=17748
2005-09-08 20:12:33 +00:00
Hervé Poussineau
82b0b7c44a Move drivers to the right location
svn path=/trunk/; revision=17747
2005-09-08 20:07:16 +00:00
Hervé Poussineau
6bd521580a Rename drivers to their right name
svn path=/trunk/; revision=17746
2005-09-08 20:02:40 +00:00
Hervé Poussineau
1d6a0c4579 Start of big changes in layout of USB code. Fireball and I are agreeing on these changes.
Step 1: delete all useless stuff

svn path=/trunk/; revision=17745
2005-09-08 19:58:55 +00:00
Casper Hornstrup
21501cda53 Christoph_vW <Christoph@ApiViewer.de>:
Binutils detection

Modified to support cross-compilation

Resolves #707

svn path=/trunk/; revision=17744
2005-09-08 16:41:07 +00:00
Gunnar Dalsnes
b4f5c9b4b5 -remove hotkey lock
-remove dc list lock
-simplify/rework refcounting
-remove keyboard queue state lock
-convert some functions into taking pointerargs, not handles

svn path=/trunk/; revision=17743
2005-09-08 16:18:51 +00:00
Gé van Geldorp
57b5d08a65 Unlock console on alternate return paths. Fixes bug 734.
svn path=/trunk/; revision=17742
2005-09-08 15:51:44 +00:00
Gé van Geldorp
b8d592993d Correct notepad location
svn path=/trunk/; revision=17741
2005-09-08 14:01:53 +00:00
Gé van Geldorp
e8b32e19d9 saveliyt@mail.ru:
Start SCM on livecd too

svn path=/trunk/; revision=17740
2005-09-08 13:27:17 +00:00
Gé van Geldorp
9bec9db6c6 Reserve space for The Terminator
svn path=/trunk/; revision=17739
2005-09-08 13:08:21 +00:00
Gé van Geldorp
f2854a8641 Translate partition 0 to active partition. Fixes bug 181.
svn path=/trunk/; revision=17736
2005-09-08 08:29:01 +00:00
Alex Ionescu
659c21724b - Move s(w)printf to rtl (cannot be shared in string because of differences with the CRT implementation). - Fix build errors due to previous commits (sorry).
svn path=/trunk/; revision=17735
2005-09-08 06:52:01 +00:00
Alex Ionescu
48fe1fb84b Share more duplicated functions
svn path=/trunk/; revision=17734
2005-09-08 05:03:34 +00:00
Alex Ionescu
6ce05ab58e Don't duplicate string and ctype functions 2 (or even 3) times... we have stringlib for that
svn path=/trunk/; revision=17733
2005-09-08 04:27:02 +00:00
Alex Ionescu
7206207210 - Move more stuff to /rtl
- Bring back Ki* callbacks into ntdll.

svn path=/trunk/; revision=17732
2005-09-08 02:29:30 +00:00
Alex Ionescu
c39ccd6592 - Part one of major RTL cleanup. Merge duplicated code and stick everything in lib\rtl that used to be in ntdll. Also cleanup the file headers, copyright information and includes.
svn path=/trunk/; revision=17731
2005-09-08 00:09:32 +00:00
Gunnar Dalsnes
7c6de62098 indent with astyle v1.15.3: --style=ansi -c -s3 -S --convert-tabs
svn path=/trunk/; revision=17730
2005-09-07 21:25:42 +00:00
Gunnar Dalsnes
5d8ed11b10 window pointer was incorrectly passed as wparam to co_IntSendMessage instead of hwnd
svn path=/trunk/; revision=17729
2005-09-07 21:05:16 +00:00
Gunnar Dalsnes
a401832d5f -replace user object/handle manager with the one from wine. its simpler, faster and more correct.
-convert dozens of functions to take pointers as args, not handles
-attempt to simplify/correct refcounting
-remove much useless refcounting
-make callout refcounts auto undoable (ei. if the thread crash in umode during callback)
-misc formatting/naming changes

svn path=/trunk/; revision=17728
2005-09-07 20:59:26 +00:00
Alex Ionescu
b0bac13ce1 Implement NTDLL's CSR routines in a compatible way. Fix prototypes, argument count, deprecated functions and new functions. Some functions will not work (or are designed not to work) fully until the new CSR is committed, but they keep the same functionality as the previous versions (no regressions found; tested with cmd, cmt, putty, telnet, ps). Also added NtSecureConnectPort.
svn path=/trunk/; revision=17727
2005-09-07 19:37:28 +00:00
Andrew Munger
43692c4674 Fix include so packlib builds after latest wine sync.
svn path=/trunk/; revision=17726
2005-09-07 19:09:56 +00:00
Gé van Geldorp
abe6592a41 Make sure memory will be freed on delete of DIB section
svn path=/trunk/; revision=17725
2005-09-07 17:54:47 +00:00
Hartmut Birr
3b7a5daefb Fixed the definition of RtlUnicodeStringToCountedOemSize. This will fix bug 756.
svn path=/trunk/; revision=17724
2005-09-07 17:20:28 +00:00
Gé van Geldorp
8e0fca60da Update status
svn path=/trunk/; revision=17723
2005-09-07 16:34:46 +00:00
Gé van Geldorp
c9a9b98de0 Sync to Wine-20050830:
Alexandre Julliard <julliard@winehq.org>
- Removed a useless header file.

svn path=/trunk/; revision=17721
2005-09-07 16:28:09 +00:00
Gé van Geldorp
3ab848b8e2 Add AC_SRC constants
svn path=/trunk/; revision=17720
2005-09-07 16:23:24 +00:00
Gé van Geldorp
190de1fde5 Sync to Wine-20050830:
Kevin Koltzau <kevin@plop.org>
- Fix 'cast to pointer from integer of different size' warnings in
  64bit.
Frank Richter <frank.richter@gmail.com>
- Add support for the BT_NONE background type.
- Better computations to have uniformly sized parts scaled in both
  directions.
- Implement GetThemeBackgroundExtent().
- Implement DrawThemeEdge().
- Implement support for the ST_TILE background stretching mode.
- Implementation for GetThemePartSize() (not entirely equivalent to
  native uxtheme, but sensibly useable).
- Enhance uxtheme to store the themed system metrics in the registry and
  also backup the old metrics. That way, themed system colors are set
  even uxtheme was not loaded and initialized yet, and when a theme is
  deactivated, the colors prior to the activation are restored as well.
- Also, not having to set the system colors in uxtheme startup works
  around weird problems where SetSystemColors() ended up being called
  from inside window creation and this seemingly led to some creation
  message being sent twice.
- Make GetThemeMargins() return default values (0 margin) if the
  function does not succeed.
- More elaborate IsThemeBackgroundPartiallyTransparent() implementation;
  also returns TRUE for theme parts with 32bpp images.
- Since theme images are reused now it's not really a good idea to
  delete them in drawing functions.
- Pass around what kind of transparency an image actually needs. Use
  alpha-blending for 32bpp images.
- Set some default values for truesize sizing that seem closer to
  Windows.
- If a MINSIZEn property is not present, fall back to actual size of nth
  image to determine whether it is suitable.
- EnumThemeColors() and EnumThemeSizes() actually do not return a single
  string with the color/size name, but rather a struct containing three
  strings - name, display name and tooltip.
- The default image layout is HORIZONTAL, not VERTICAL.
- Take a common computation out of two if-branches in
  UXTHEME_LoadImage().
- Compare result of RegQueryValueExW() with ERROR_SUCCESS.
- Another fix to use magenta as the default transparent color.
- Implement "manual" image sharing(as opposed to using LoadImage() with
  LR_SHARED) by keeping the loaded images in a list. This is needed for
  proper alpha support later on since once-per-image preparations will
  be needed then.
- Add support for horizontal & vertical alignment when doing truesize
  sizing.
- Whatever TrueSizeStretchMark is for - it's not what Wine uxtheme used
  it for. Native uxtheme always stretches "truesize" parts when the
  destination is smaller than the part image size, but
  TrueSizeStretchMark doesn't seem to have an influence.

svn path=/trunk/; revision=17719
2005-09-07 16:22:51 +00:00
Alex Ionescu
3a0cf7d618 Return correct size. This fixes bug 756
svn path=/trunk/; revision=17718
2005-09-07 16:02:32 +00:00
Gé van Geldorp
179c1bfe6c Sync to Wine-20050830:
Francois Gouget <fgouget@free.fr>
- Add missing WINAPI to MSXML_DllGetClassObject().
  Standardize the DllGetClassObject() prototypes so they match the MSDN
  definition.
Alexandre Julliard <julliard@winehq.org>
- Don't prefix the functions DllCanUnloadNow, DllGetClassObject and
  Dll(Un)RegisterServer with the dll name so that the compiler can check
  the prototypes.

svn path=/trunk/; revision=17717
2005-09-07 15:57:31 +00:00
Gé van Geldorp
5be54798fe Sync to Wine-20050830:
Huw Davies <huw@codeweavers.com>
- IUnknown_SetSite calls IObjectWithSite_SetSite or
  IInternetSecurityManager_SetSecuritySite.
- Fix call to GetMenuItemInfo and unicodify while we're at it.
- Implement SHLoadIndirectString.
- _CreateAllAccessSecurityAttributes takes three parameters.
- Forward ordinals 457,458 to GetLongPathNameW,A.
- Implement SHLoadRegUIStringW.
- Partial implementation of DeleteMenuWrap.
- Implement IUnknown_EnumObjects.
- Implement and add tests for the FDSA functions.
Alexandre Julliard <julliard@winehq.org>
- Don't prefix the functions DllInstall and DllGetVersion with the dll
  name so that the compiler can check the prototypes.
Vincent Beron <vberon@mecano.gme.usherb.ca>
- Correct typo in format string.
Mike McCormack <mike@codeweavers.com>
- gcc 4.0 warning fixes.
Steven Edwards <steven_ed4153@yahoo.com>
- Correct RegCreateKeyEx[A/W] prototype to match the PSDK.

svn path=/trunk/; revision=17716
2005-09-07 15:52:47 +00:00
Gé van Geldorp
0e5dde74e7 Sync to Wine-20050830:
Alexandre Julliard <julliard@winehq.org>
- Fixed DllGetClassObject spec entries.

svn path=/trunk/; revision=17715
2005-09-07 15:09:06 +00:00
Gé van Geldorp
75b0c7ce6c Sync to Wine-20050830:
Michael Jung <mjung@iss.tu-darmstadt.de>
- Initialize all members in UnixFolder constructor.
  Support NULL value pidls in GetDisplayNameOf method.
- Implemented IPersist::GetClassID.
- Use wine_get_dos_file_name instead of GetFullPathName.
- Implemented 'My Documents' folder.
- Added stubbed implementation of IPersistPropertyBag interface.
  Register unixfs as CLSID_FolderShortcut.
- Clone pidlLast before free'ing pidl after call to SHBindToParent.
- Use FIXME's in stubs instead of TRACE's.
  Infer pathmode from CLSID in UnixFolderConstructor.
  Fail in IShellFolder::BindToObject, if folder does not initialize.
- Use StringFromGUID2 instead of StringFromCLSID in
  UNIXFS_is_rooted_at_desktop.
Michael Jung <mjung@iss.tu-darmstadt.de>
Ge van Geldorp <gvg@reactos.com>
- Prepend Desktop folder path for files/directories stored in the
  filesystem Desktop folder when GetDisplayNameOf is called with the
  SHGDN_FORPARSING flags.
- Add testcases.
Ge van Geldorp <gvg@reactos.com>
- Fix resource leak on error paths.
- Do not load all shell32 icons during initialization, it wastes a lot of
  memory
Alexandre Julliard <julliard@winehq.org>
- Replace the _ICOM_THIS_From macros by inline functions the way it's
  already done in shelllink.c.
- Use ERR instead of DPRINTF in dump_pidl_hex.
- Don't prefix the functions DllCanUnloadNow, DllGetClassObject and
  Dll(Un)RegisterServer with the dll name so that the compiler can check
  the prototypes.
- Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of
  duplicate typedefs.
- Get rid of the _ICOM_THIS macros and call the inline function
  directly instead.
- Removed the broken mmap64 configure check, and moved the
  _FILE_OFFSET_BITS define to wine/port.h. Made sure that all files that
  need the define include it.
- Added missing ntdll imports.
Francois Gouget <fgouget@codeweavers.com>
- Fix ShellExecute("\"foo.doc\"") for Internet Explorer 6.
- Update the conformance tests accordingly.
- Tweak a trace because it's very confusing to see the path with no
  escaped quotes in ShellExecuteA() and then with escaped quotes in
  ShellExecuteExW32() (due to debugstr_w()).
- Fix the return value of SHELL_Argify() so it once again returns true
  if a '%1' or equivalent placeholder was found. This fixes
  ShellExecuteEx(lpFile="foo.txt", lpClass="txtfile").
- Fix handling of SEE_MASK_CLASSNAME and SEE_MASK_CLASSKEY. They are not
  disjoint flags.
Mike McCormack <mike@codeweavers.com>
- Warning fixes for gcc 4.0.
- Fix some gcc 4.0 warnings.
Jozef Stefanka <jstefanka@codeweavers.com>
- Fixed browsing to other directories in Word 2003 file open
  dialog. Double clicking on a folder in the File->Open dialog works
  now.
Steven Edwards <steven_ed4153@yahoo.com>
- Correct definition of SFGAO_STORAGEANCESTOR.
Jason Edmeades <us@edmeades.me.uk>
- Add the time to the file display dialog modified column.
- Handle context menu->refresh, and F5 to initiate a refresh of the file
  dialog.

svn path=/trunk/; revision=17714
2005-09-07 08:43:45 +00:00
Gunnar Dalsnes
07151bdc1a make co_WinPosShowWindow take pWnd, not hWnd
add co_ to some funcs

svn path=/trunk/; revision=17713
2005-09-07 07:53:31 +00:00
Gunnar Dalsnes
3b0b4c10fd scrollbar:
simplify refcounting
fix a bug in NtUserGetSystemMenu, accessing nullpointer
use pointers internally, not handles

svn path=/trunk/; revision=17712
2005-09-07 00:02:39 +00:00
Gunnar Dalsnes
306250f7f5 prop: simplify refcounting, naming changes
svn path=/trunk/; revision=17711
2005-09-06 23:29:54 +00:00
Gunnar Dalsnes
1e6efaebce menu: code cleanup, naming changes, simplify refcounting, make internal func take objects and not handles
svn path=/trunk/; revision=17710
2005-09-06 23:21:40 +00:00
Gé van Geldorp
cfefbb200a Correct sizes if origin is not (0, 0)
svn path=/trunk/; revision=17709
2005-09-06 23:16:18 +00:00
Alex Ionescu
e988f9d7dc - One last build fix.
svn path=/trunk/; revision=17708
2005-09-06 23:15:15 +00:00
Alex Ionescu
77163e53d7 Fix win32k build errors so HEAD can build again, although most are caused by poor programming and will crash if called with unexpected parameters that aren't being properly handled.
svn path=/trunk/; revision=17707
2005-09-06 23:05:13 +00:00
Gunnar Dalsnes
76e45d3466 remake refcounting
naming changes
convert internal function to page ptr and not handle

svn path=/trunk/; revision=17706
2005-09-06 22:11:37 +00:00
Alex Ionescu
84cbfb9d8e - Fix size functions to return the correct results in all cases.
svn path=/trunk/; revision=17705
2005-09-06 19:47:06 +00:00
Alex Ionescu
7ed06b56e6 - Use Rtl macros instead of manually handling the cases.
svn path=/trunk/; revision=17704
2005-09-06 19:38:51 +00:00
Alex Ionescu
dc86bfb861 - Fix the sad sad definition of sizeof(ANSI_NULL) which returned 4...
svn path=/trunk/; revision=17703
2005-09-06 19:37:38 +00:00
Gé van Geldorp
38a02c040e Fix release build
svn path=/trunk/; revision=17702
2005-09-06 19:21:42 +00:00
Gé van Geldorp
8afef2bda9 Shut up some debug messages
svn path=/trunk/; revision=17701
2005-09-06 18:07:46 +00:00
Alex Ionescu
31a759e85c - Use DDK macros to speed up size calculations on single-byte codepages.
svn path=/trunk/; revision=17700
2005-09-06 17:33:56 +00:00
Alex Ionescu
a2af287dd8 - Remove deprecated zwtypes.h and spread out the types in the NT subsystems where they should go.
svn path=/trunk/; revision=17699
2005-09-06 15:57:42 +00:00
Gunnar Dalsnes
a2c34e3c28 window parent handle -> pointer adaptions
svn path=/trunk/; revision=17698
2005-09-06 14:19:03 +00:00
Gunnar Dalsnes
a1c7e10fc8 make window parent a pointer + fix usage
svn path=/trunk/; revision=17697
2005-09-06 14:09:22 +00:00
Gunnar Dalsnes
e51f10ab47 remove WndObjListLock
svn path=/trunk/; revision=17696
2005-09-06 13:36:04 +00:00
Gunnar Dalsnes
781981aa5f naming changes:
-remove annying "Object" from variables. prepend handles with "h" instead.
-rename window->Self -> Window->hSelf

svn path=/trunk/; revision=17695
2005-09-06 11:00:27 +00:00
Gunnar Dalsnes
4e5ef38048 make handle table session global
svn path=/trunk/; revision=17694
2005-09-06 10:05:31 +00:00
Gunnar Dalsnes
5d3bcdcc13 move object.c and ssec.c into ntuser where they belong
svn path=/trunk/; revision=17693
2005-09-06 09:35:39 +00:00
Gunnar Dalsnes
65123629f5 forgot a file:-| sry
svn path=/trunk/; revision=17692
2005-09-06 07:58:43 +00:00
Alex Ionescu
d1f19a8802 - Add missing decoration to Zw*
svn path=/trunk/; revision=17691
2005-09-06 06:44:34 +00:00
Alex Ionescu
870c588c1e - Handle RtlYyyStringToZzzStringSize->RtlxYyyStringtoZzzStringSize correctly so that the MSDDK macros can work and be added to the NDK/gnu ifs
svn path=/trunk/; revision=17690
2005-09-06 06:30:49 +00:00
Alex Ionescu
80b6230b45 A couple more fixes to prepare for the final patch
svn path=/trunk/; revision=17689
2005-09-06 06:19:30 +00:00
Alex Ionescu
28ab27fe87 - Use inlined functions like MSDDK.
svn path=/trunk/; revision=17688
2005-09-06 05:58:48 +00:00
Alex Ionescu
66711d6344 - Some more MSDDK/IFS compatibility fixes.
svn path=/trunk/; revision=17687
2005-09-06 05:30:39 +00:00
Gunnar Dalsnes
58f5ea229a remove window update lock
svn path=/trunk/; revision=17686
2005-09-06 00:34:23 +00:00
Gunnar Dalsnes
771f9106f8 remove user handle table lock, cursor locks, message queue locks, hook lock
svn path=/trunk/; revision=17685
2005-09-05 23:11:41 +00:00
Gunnar Dalsnes
fd26bfbd6d remove relatives lock, window props lock, classes locks, thread window lock, menu locks
svn path=/trunk/; revision=17684
2005-09-05 22:39:29 +00:00
Gé van Geldorp
eae95884a8 Sync to Wine-20050830:
Robert Shearman <rob@codeweavers.com>
- Don't free previous buffer in NdrGetBuffer.
- Add stubs for NdrMapCommAndFaultStatus, conformant string marshaling
  and context handle functions.
Alexandre Julliard <julliard@winehq.org>
- Don't prefix the functions DllCanUnloadNow, DllGetClassObject and
  Dll(Un)RegisterServer with the dll name so that the compiler can check
  the prototypes.
Mike McCormack <mike@codeweavers.com>
- Fix some gcc 4.0 warnings.

svn path=/trunk/; revision=17683
2005-09-05 22:20:04 +00:00
Gé van Geldorp
2372be838c Sync to Wine-20050830:
Alexandre Julliard <julliard@winehq.org>
- Don't prefix the functions DllInstall and DllGetVersion with the dll
  name so that the compiler can check the prototypes.
- riched32 doesn't need an import library.

svn path=/trunk/; revision=17682
2005-09-05 22:09:45 +00:00
Gé van Geldorp
4e74b68be8 Sync to Wine-20050830:
Phil Krylov <phil@newstar.rinet.ru>
- Added support for backward search to RichEdit EM_FINDTEXT[AW],
  EM_FINDTEXTEX[AW] message handler.
- Fixed EM_SETEVENTMASK RichEdit message handler to return old event
  mask.
- Added handling of deff RTF control word.
- Added common keyboard shortcuts for Select All, Undo, Redo, Cut, Copy
  and Paste to RichEdit.
- Automatically set default font after parsing a font table in RichEdit
  RTF reader.
- Fixed EM_EXLINEFROMCHAR to work for last row of a paragraph.
- Fixed UTF-8 RTF parsing.
- Fixed a bug in EM_STREAMOUT RichEdit message handler which truncated
  some streamed text.
- Generate ending \par in RTF output of RichEdit when streaming out a
  whole document.
- Fixed a RichEdit RTF reader bug which resulted in loss of text.
  Eliminated unneeded recursion in ME_InsertTextFromCursor().
- Implemented EM_CHARFROMPOS RichEdit message.
- Added EM_SETRECT, EM_SETRECTNP, and WM_SETREDRAW message handling.
  Added support for GT_SELECTION flag in EM_GETTEXTEX handler.
Mike McCormack <mike@codeweavers.com>
- gcc 4.0 warning fixes for Interlocked* functions.

svn path=/trunk/; revision=17681
2005-09-05 22:07:52 +00:00
Gé van Geldorp
76e03f2541 Correct eol-style and remove unused file
svn path=/trunk/; revision=17680
2005-09-05 22:03:31 +00:00
Gé van Geldorp
52a92a993f Sync to Wine-20050830:
Francois Gouget <fgouget@free.fr>
- Change some Dll* functions so they are exported by name like on
  Windows.
  Update the documentation accordingly.
Robert Shearman <rob@codeweavers.com>
- Remove redundant QueryInterface in marshal_interface - the object is
  always queried later on for the correct interface of the object.
- Make sure to Release the marshaled pointer in the typelib marshaler
  once it is no longer required.
- Shunt some trace statements over to the typelib channel that aren't
  really much use except in debugging typelib parsing.
- Make sure to release a reference to being returned as VariantCopyInd
  takes one for us.
- Revert to previous behaviour of detecting names with non-alphanumeric
  characters as ones with offsets, but add in a special case for an
  empty name.
- A name in an SLTG typelib only beginning with 0xff is the indicator
  of an offset, instead of any non alpha-numeric character.
- Any dispatch interface should have the fixed vtable size, not just
  dual ones.
- Warn when ITypeInfo_GetDocumentation fails.
- Make typelib marshaler use IRpcChannelBuffer::GetBuffer if possible.
Alexandre Julliard <julliard@winehq.org>
- Replace the ICOM_THIS_From macros by inline functions.
- Moved a number of definitions that are not needed in other files into
  vartype.c
- Removed some unnecessary macros, and make some functions static.
- Get rid of the almost empty tmarshal.h file.
Vincent Beron <vberon@mecano.gme.usherb.ca>
- Uniformize DllMain TRACEing across dlls.
Mike McCormack <mike@codeweavers.com>
- Fix gcc 4.0 warnings.
- gcc 4.0 warning fixes.
Michael Stefaniuc <mstefani@redhat.de>
- Implement IPicture::get_hPal for PICTYPE_BITMAP.
- VarAdd, VarMul: I4 overflows to R8 and not I8 even if the result
  would fit in I8. Fix tests.
- Document a brokeness in the handling of I8 numbers in
  VarNumFromParseNum. Fix tests.
Walt Ogburn <reuben@ugcs.caltech.edu>
- When applying logical / himetric ratio to olefont sizes, must divide
  by the standard ratio 72 / 2540.

svn path=/trunk/; revision=17679
2005-09-05 22:00:07 +00:00
Gé van Geldorp
05aeafcb9c Sync to Wine-20050830:
Francois Gouget <fgouget@free.fr>
- Use LPSTORAGE to better match the PSDK.
  Document the real SEGPTR type using the standard documentation
  mechanisms. Fixes winapi_check warnings.
Robert Shearman <rob@codeweavers.com>
- Remove unused thread handle entry from the apartment structure.
- Implement IMarshal on proxies so that we don't end up with proxies
  to proxies, causing potential deadlock issues and performance
  problems.
- Add a test for this situation and remove the todo_wine from another
  test that now succeeds.
- Add stub for CoAllowSetForegroundWindow.
Vincent Beron <vberon@mecano.gme.usherb.ca>
- Remove local declarations already in included public headers.
- Correct mismatches between spec files and comments about export
  number.
Alexandre Julliard <julliard@winehq.org>
- Uncomment the typedef in the DECLARE_INTERFACE macro, and get rid of
  duplicate typedefs.
- Use the proper WOW functions everywhere instead of the K32WOW variant.
- Don't prefix the functions DllCanUnloadNow, DllGetClassObject and
  Dll(Un)RegisterServer with the dll name so that the compiler can check
  the prototypes.
- Remove duplicate definition of FILE_BEGIN.
- Replace the _ICOM_THIS_From macros by inline functions the way it's
  already done in shelllink.c.
Mike McCormack <mike@codeweavers.com>
- Warning fixes for gcc 4.0.
- Fix some gcc 4.0 warnings.
- return a precomputed result for a NULL string
- pass strlen an LPSTR to eliminate a sign warning
Marcus Meissner <marcus@jet.franken.de>
- Implemented ILockBytes16 (memorystream) support for the 16bit compound
  storage implementation.
- Added ReadClassStg, OleDoAutoConvert, GetConvertStg
  implementations/stubs.
Marcus Meissner <meissner@suse.de>
- Added CoCreateInstance16, CoGetClassObject16, OleLoad16 stubs.

svn path=/trunk/; revision=17678
2005-09-05 21:56:14 +00:00
Gé van Geldorp
c9c505d02f Import from vendor drop
svn path=/trunk/; revision=17677
2005-09-05 21:47:21 +00:00
Gé van Geldorp
110a4ff7fc Delete existing objsel to prepare for vendor import
svn path=/trunk/; revision=17676
2005-09-05 21:44:11 +00:00
Hartmut Birr
b5a7931c86 Revert my last commit.
svn path=/trunk/; revision=17674
2005-09-05 21:39:59 +00:00
Gé van Geldorp
a9179e7930 Sync to Wine-20050830:
Francois Gouget <fgouget@free.fr>
- Change some Dll* functions so they are exported by name like on
  Windows.
  Update the documentation accordingly.
Johan Dahlin <jdahlin@async.com.br>
- Implemented MsiSetComponentState*.
- Added stubs for MsiSetComponentStateA and MsiSetComponentStateW.
- Added a null check for component.
Alexandre Julliard <julliard@winehq.org>
- Don't prefix the functions DllCanUnloadNow, DllGetClassObject and
  Dll(Un)RegisterServer with the dll name so that the compiler can check
  the prototypes.
Vincent Beron <vberon@mecano.gme.usherb.ca>
- Correct mismatches between spec files and comments about export
  number.
Aric Stewart <aric@codeweavers.com>
- Display the correct text string in the action text field for the
  dialog boxes. Also the string should be deformatted.
- Make index INT not UINT because it can be -1.
- Fixed a memory overflow and leak identified by Mike McCormack.
- Add some body to ResolveSource because it is possible to need it when
  an install is begun but the media is not in the drive, such as in
  install-on-demand cases.
- The file name used in the ui messages is the target name not the
  source name.
Yuri Kozlov <kozlov.y@gmail.com>
- Remove duplicate declaration of MSI_SetPropertyW.
Mike McCormack <mike@codeweavers.com>
- Handle loading strings over 64k from the string table.
- build a standard Wine list of folders instead of using an array
- use folder pointers instead of array indexes
- build a standard Wine list of files instead of using an array
- use file pointers instead of array indexes
- build a standard Wine list of features instead of using an array
- use feature pointers instead of array indexes
- build a standard Wine list of components instead of using an array
- use component pointers instead of array indexes
- Store the component information in a standard Wine list.
- Add include guard to header and make functions extern.
- build a standard Wine list of extensions instead of using an array
- use extension pointers instead of array indexes
- build a standard Wine list of appids instead of using an array
- use appid pointers instead of array indexes
- build a standard Wine list of mime types instead of using an array
- use mime type pointers instead of array indexes
- Add the allocated mime type to the mime type list.
- build a standard Wine list of classes instead of using an array
- use class pointers instead of array indexes
- Fix a small bug introduced when converting appids to a list.
- Implement MsiModifyView (MSIMODIFY_INSERT_TEMPORARY).
- Better stub for MsiViewGetError.
- Don't dereference variables in a trace.
- the combination of all table keys must be unique, not each key
- MsiViewExecute may not be called before MsiModifyView
- Make sure to save the result calculated in ACTION_UpdateInstallStates.
Steven Edwards <steven_ed4153@yahoo.com>
- Add real stub for MsiConfigureFeatureW.

svn path=/trunk/; revision=17672
2005-09-05 21:34:19 +00:00
Gunnar Dalsnes
965b06eb4d -surround user part (most of it) with a single lock (currently a mutex, but will be a resource). other now useless locks will be removed next.
-dont call NtUser fucnctions internally (they are syscalls only!)
-prepend co_ to functions leading to a "callout" (callback, wait, etc)


svn path=/trunk/; revision=17671
2005-09-05 21:19:23 +00:00
Gé van Geldorp
767a73be21 Sync to Wine-20050830:
Alexandre Julliard <julliard@winehq.org>
- Mark DllMain and similar exports as private.

svn path=/trunk/; revision=17670
2005-09-05 21:17:26 +00:00
Gé van Geldorp
c696fd3768 Sync to Wine-20050830:
Alexandre Julliard <julliard@winehq.org>
- Don't prefix the functions DllCanUnloadNow, DllGetClassObject and
  Dll(Un)RegisterServer with the dll name so that the compiler can check
  the prototypes.

svn path=/trunk/; revision=17669
2005-09-05 21:15:50 +00:00
Gé van Geldorp
ee77339f00 Sync to Wine-20050830:
Mike McCormack <mike@codeweavers.com>
- gcc 4.0 warning fixes.

svn path=/trunk/; revision=17668
2005-09-05 21:08:24 +00:00
Gé van Geldorp
a3b56ff138 Sync to Wine-20050830:
Alexandre Julliard <julliard@winehq.org>
- Don't prefix the functions DllCanUnloadNow, DllGetClassObject and
  Dll(Un)RegisterServer with the dll name so that the compiler can check
  the prototypes.
- Uncomment out DisableThreadLibraryCalls in DllMain and add the
  kernel32 imports that it requires.

svn path=/trunk/; revision=17667
2005-09-05 21:06:55 +00:00
Gé van Geldorp
851ebece4a Sync to Wine-20050830:
Michael Jung <mjung@iss.tu-darmstadt.de>
- Check the GetPidlFromDataObject's doSelected parameter before calling
  a method on it.
Alexandre Julliard <julliard@winehq.org>
- Replace the _ICOM_THIS_From macros by inline functions the way it's
  already done in shelllink.c.
Vincent Béron <vberon@mecano.gme.usherb.ca>
- Uniformize DllMain TRACEing across dlls.
Vitaly Lipatov <lav@etersoft.ru>
- Restore paper orientation when pagesetupdlg is initializing.
Troy Rollo <wine@troy.rollo.name>
- Browse to the directory if a directory name is typed into the edit box
  of a file dialog and the confirmation button (or Enter key) is hit.
  Return any file name in the edit box if OFN_NOVALIDATE is set and
  OFN_FILEMUSTEXIST is not, even if that file name includes a path name
  or is the name of a folder.

svn path=/trunk/; revision=17666
2005-09-05 21:04:10 +00:00
Hartmut Birr
ce7e038415 - Copy the map registers to the buffer only, if they are used (in IoFlushAdapterBuffers).
- Do not use the byte offset into the page from a given buffer if the map registers are used, 
  because the caller didn't request for one additional register in the call to IoAllocateAdapterChannel 
  and it will not work for a 64k buffer.

svn path=/trunk/; revision=17665
2005-09-05 20:25:31 +00:00
Gé van Geldorp
0389203146 Sync to Wine-20050830:
Vitaliy Margolen <wine-patch@kievinfo.com>
- Fix handling of minimum tab width.
  Add more tests to test it.
Filip Navara <xnavara@volny.cz>
- Use ReleaseDC instead of DeleteDC on DC handle.
Phil Krylov <phil@newstar.rinet.ru>
- Improved header control performance by maintaining an internal order
  array.
- Draw header control items only within the header client area.
Felix Nawothnig <felix.nawothnig@t-online.de>
- Fix DPA_Search for sorted arrays.
Michael Kaufmann <hallo@michael-kaufmann.ch>
- Handle WM_GETFONT and WM_SETFONT.
- Redraw immediately upon PBM_SETPOS, PBM_DELTAPOS, PBM_STEPIT.
- New tests.
Thomas Weidenmueller <wine-patches@reactsoft.com>
- It should be allowed to pass NULL handles in the phpage array of the
  PROPSHEETHEADER structure to PropertySheet(), just ignore them.
Aric Stewart <aric@codeweavers.com>
- Fix for dreamweaver site definition dialog. Need to initialize the
  rect for a tab control to an empty rect if it is not visible.
Alexandre Julliard <julliard@winehq.org>
- Don't prefix the functions DllCanUnloadNow, DllGetClassObject and
  Dll(Un)RegisterServer with the dll name so that the compiler can check
  the prototypes.
- Fixed regression in DPA_Search.
Yuri Kozlov <kozlov.y@gmail.com>
- Set default size for toolbar bitmap if not specified.
Mike McCormack <mike@codeweavers.com>
- Fix gcc 4.0 warnings.
Vitaly Lipatov <lav@etersoft.ru>
- Use STATEIMAGEINDEX / INDEXTOSTATEIMAGEMASK instead of bit
  operations.
Steven Edwards <steven_ed4153@yahoo.com>
- Correct RegCreateKeyEx[A/W] prototype to match the PSDK.
Frank Richter <frank.richter@gmail.com>
- Only draw a themed border when edit control has WS_EX_CLIENTEDGE
  style.
- Merge subclass stubs and subclass proc. Having the stub set the window
  proc to the subclass proc was not a good idea since that breaks
  subclasses of themed standard controls (e.g. what Delphi does a lot).
- Determining the superclass for a window subclassed for theming doesn't
  work - e.g. Delphi buttons have the classname "TButton" for which no
  superclass will be found. Instead, use initial subclass window procs
  that have the subclass hardcoded and store it for the "real" subclass
  window proc.
- Add theming for toolbar control.
- Improved trackbar theming.
- Add initial theming support for trackbars.
- Add theming for treeview control.
- Add theming support for dialogs (to support tab page background).
- Add theming for listbox (and combo listbox) controls.
- Add theming for combo boxes.
- Subclass edit control to draw themed border.
- Added some generic code to allow subclassing (for the purpose of
  theming) of standard controls.
- Fix warnings in 64bit.
- Add hottracking support for the header control.
- Since OpenThemeData() should return 0 in case theming is disabled
  globally or for the application we don't need to check that when
  calling OpenThemeData().
- Remove unneeded theming check.
- Add theming for the monthcal control.
- Instead of adding the border via WM_NCPAINT and WM_NCCALCSIZE, do what
  native does: just clear WS_EX_STATICEDGE when themed and reduce the
  area the actual bar is painted in to the progress bar theme part
  content rect.
- Add theming for the progress control.
- Split up the drawing code into a set of smaller functions and also
  moved some common computations into helper functions. All that to
  facilitate the implementation of the forthcoming theming support.
- Add theming for the rebar control.
- Add theming for status bar control.
- Fix text color for "button" style tabs when theming is enabled.
- Add theming support for the tab control.
- Forward WM_DESTROY to superclass in edit & listbox theming.
- Add WM_CTLCOLORSTATIC handler to dialog theming subclass so static
  text can appear transparent (for e.g. tab pages which commonly have a
  "fancy" background).

svn path=/trunk/; revision=17664
2005-09-05 20:25:16 +00:00
Gé van Geldorp
ae18f3a1cc Sync to Wine-20050830:
Alexandre Julliard <julliard@winehq.org>
- Don't prefix the functions DllCanUnloadNow, DllGetClassObject and
  Dll(Un)RegisterServer with the dll name so that the compiler can check
  the prototypes.
Mike McCormack <mike@codeweavers.com>
- Fix gcc 4.0 warnings.

svn path=/trunk/; revision=17662
2005-09-05 20:07:46 +00:00
Gé van Geldorp
5d793513d1 Alexandre Julliard <julliard@winehq.org>
- Removed the broken mmap64 configure check, and moved the
  _FILE_OFFSET_BITS define to wine/port.h. Made sure that all files that
  need the define include it.

svn path=/trunk/; revision=17661
2005-09-05 20:03:06 +00:00
Alex Ionescu
87507a864e - More NDK + MSDDK/IFS Compatibility fixes
- Prototype fixes

svn path=/trunk/; revision=17660
2005-09-05 18:06:20 +00:00
Gé van Geldorp
94a3a9e377 Sync to Wine-20050830:
Alexandre Julliard <julliard@winehq.org>
- Beginnings of a crt0 library.
- Added a warning for DllGetVersion and DllInstall not being declared
  private. Also warn when one of the Dll* functions is using a different
  internal name.
- Added a --undefined option to allow forcing some symbols to be
  resolved by the linker.
- Byteswap the resources if we detect that the header is in the wrong
  endianness.
- Moved more of the spec initialization code to the winecrt0 library,
  and get rid of implicit kernel32 imports.
- Use __wine_unimplemented_stub from crt0 for 16-bit spec files too.
- Moved the delay loading support code to the winecrt0 library.
- Avoid using common symbols, they are broken on Mac OS.
- Moved the implementation of spec file stubs to the winecrt0 library.
- The exported name strings should be inside the export directory (found
  by Vitaliy Margolen).
- Added some general purpose routines for managing list of symbol
  names.
- Print a warning when a generated import library doesn't export
  anything useful.
- Implemented DelayLoadFailureHook and use it in the winebuild-generated
  delay load code.
- Compute the ordinal base and limit in assign_ordinals instead of doing
  it while parsing.
- Get rid of the unused owner_name field.
Ge van Geldorp <gvg@reactos.org>
- Adapt changes to ReactOS

svn path=/trunk/; revision=17659
2005-09-05 17:35:31 +00:00
Gé van Geldorp
89c566ad64 Sync to Wine-20050830:
Mike McCormack <mike@codeweavers.com>
- Fix a gcc 4.0 -Wpointer-sign warning.
- gcc 4.0 warning fix.

svn path=/trunk/; revision=17658
2005-09-05 10:18:07 +00:00
Gé van Geldorp
2853a0678a Fix compilation when ENABLE_VALIDATE_POOL is defined
svn path=/trunk/; revision=17657
2005-09-05 09:26:02 +00:00
Gé van Geldorp
c542593988 The kernel extension is really a EXTENDED_DEVOBJ_EXTENSION now
svn path=/trunk/; revision=17656
2005-09-05 09:25:06 +00:00
Hervé Poussineau
e77d41b989 Fix the build. TIB field in KIPCR structure is named NtTib, not Tib
svn path=/trunk/; revision=17653
2005-09-05 07:59:29 +00:00
Alex Ionescu
4e8d1019ce - More NDK/MSDDK compatibility fixes.
svn path=/trunk/; revision=17652
2005-09-05 07:51:15 +00:00
Alex Ionescu
51f0dfd307 - NDK compatibility fixes for MSDDK. Use NTAPI instead of STDCALL, and use NTSYSAPI instead of NTOSAPI.
- Remove some functions/types in NDK that were already documented in DDK/IFS.
- Fixup syscall structures for the table and fix protoype of KeAdd/RemoveServiceDescriptorTable.

svn path=/trunk/; revision=17651
2005-09-05 04:48:20 +00:00
Alex Ionescu
118aa9fba3 - Fix kernel32 and ntoskrnl build issues.
- Define public version of DEVOBJ_EXTENSION in DDK.

svn path=/trunk/; revision=17650
2005-09-04 23:48:19 +00:00
Alex Ionescu
a4d8aa2194 - Define NTSYSAPI and NTSYSCALLAPI
svn path=/trunk/; revision=17649
2005-09-04 23:26:35 +00:00
Alex Ionescu
851e0f3f36 - Fix incorrect PFILE_MAILSLOT_SET_INFORMATION definition
- Fix MSFS to build with MSDDK.
- Fix iotypes.h to be MSDDK compatible.

svn path=/trunk/; revision=17648
2005-09-04 23:18:34 +00:00
Alex Ionescu
f069c69225 - Fix typo in NDK
- Fix compilation of NPFS and MSFS and increase their compile speed by using PCH.

svn path=/trunk/; revision=17647
2005-09-04 22:33:28 +00:00
Hervé Poussineau
d41491ef47 Fix SetComputerNameA/W. They were sending a bad parameter to SetComputerNameExA/W. Thanks Hartmut
svn path=/trunk/; revision=17646
2005-09-04 22:20:22 +00:00
Alex Ionescu
a5243c8e37 - Fix incompatible IO_STACK_LOCATION definition in W32api ddk/winddk.k
- Add EXTENDED_IO_STACK_LOCATION to NDK, with the full definition.

svn path=/trunk/; revision=17645
2005-09-04 22:16:57 +00:00
Hervé Poussineau
d5829ea63d Fix definition of STDCALL. Thanks Alex
svn path=/trunk/; revision=17644
2005-09-04 22:13:30 +00:00
Hervé Poussineau
ce468083d1 Alex prefers that we don't locally define structures that not in the DDK/IFS kit, but that we use the NDK headers.
This change breaks the compilation with the DDK/IFS kit only.

svn path=/trunk/; revision=17643
2005-09-04 22:12:35 +00:00
Hervé Poussineau
8857a8b8fd Allow compilation of npfs driver with MSVC
svn path=/trunk/; revision=17642
2005-09-04 21:44:02 +00:00
Hervé Poussineau
e7ad48c2a3 Allow compilation of fs_rec driver with MSVC
svn path=/trunk/; revision=17641
2005-09-04 21:14:54 +00:00
Hervé Poussineau
a650cc6d77 Don't double-define KEBUGCHECK(EX)
svn path=/trunk/; revision=17640
2005-09-04 20:45:34 +00:00
Hervé Poussineau
1037b8be47 Implement SetComputerNameExA/W
svn path=/trunk/; revision=17639
2005-09-04 20:11:51 +00:00
Alex Ionescu
ff6172bd8f - Various fixes to headers, such as fixing some LPC prototypes, adding/correcting some structures, adding some missing definitions, etc...
svn path=/trunk/; revision=17638
2005-09-04 18:00:59 +00:00
Alex Ionescu
84727764b0 - Disable two tests since the Balance Set Manager isn't implemented yet and they'll freeze ROS.
svn path=/trunk/; revision=17637
2005-09-04 15:57:17 +00:00
Filip Navara
eb59fe4b41 Get correct physical address in HalpGrowMapBuffers.
svn path=/trunk/; revision=17636
2005-09-04 15:18:52 +00:00
Eric Kohl
72f4f89fce Implement CM_Get_Class_Name_ExA.
svn path=/trunk/; revision=17635
2005-09-04 14:40:12 +00:00
Magnus Olsen
e6f2e6fcd6 fix bug 739 can not create file notepad newfile.txt
at cmd prompt

svn path=/trunk/; revision=17634
2005-09-04 11:47:50 +00:00
Magnus Olsen
49766a2024 Revers the change after reboot it did carcgh for me hole time.
svn path=/trunk/; revision=17633
2005-09-04 11:31:54 +00:00
Eric Kohl
7fca436afd - Enclose GUID in curly brackets.
- Implement CM_Get_Class_Key_Name_ExA.

svn path=/trunk/; revision=17632
2005-09-04 11:26:09 +00:00
Magnus Olsen
a1b00983ed remove some hardcode buffer value. The dymatic buffer does not work yet, until all CMDLINE_LENGTH are remove.
svn path=/trunk/; revision=17631
2005-09-04 11:18:39 +00:00
Filip Navara
6561d0f414 Fix the return value of HalReadDmaCounter at the end of transfer.
svn path=/trunk/; revision=17630
2005-09-04 11:17:37 +00:00
Filip Navara
3a10e56852 - Set the MAP_BASE_SW_SG flag for map registers in IoFreeMapRegisters.
- Fix address calculation in HalpCopyBufferMap.
- Correctly set the map register counter in IoMapTransfer if dealing with MAP_BASE_SW_SG map registers.

svn path=/trunk/; revision=17629
2005-09-04 10:02:19 +00:00
Magnus Olsen
adb5d8466f Remove more hardcode buffer value to dymatic buffer.
svn path=/trunk/; revision=17628
2005-09-04 09:54:59 +00:00
Magnus Olsen
1cb2b6830e fix a small bug after me, and check if it really got memmory or not.
svn path=/trunk/; revision=17627
2005-09-04 09:29:44 +00:00
Magnus Olsen
25f28a6291 remove some hardcode commadline buffer value. first step to implement dymatic buffer. but we need do it very carefull, so nothing will be broken.
svn path=/trunk/; revision=17626
2005-09-03 23:12:17 +00:00
Magnus Olsen
ada0f8dfe8 fix type can handler \n at text output thx ravelo for the small patch. see file misc.c. prompt.c fix the szParam so it have a buffer set. and do not use szParam for param, the param length can in future very big. when dymatic buffer be implement at command line.
svn path=/trunk/; revision=17625
2005-09-03 19:59:51 +00:00
Eric Kohl
040c539dd5 Fix GUID->String conversion.
Implement CM_Get_Class[_Ex]A/W.

svn path=/trunk/; revision=17624
2005-09-03 19:44:47 +00:00
Andrew Munger
fe417a79c4 Fix cmd build. Please check your changes before commiting.
svn path=/trunk/; revision=17623
2005-09-03 18:05:33 +00:00
Hartmut Birr
b10d2b80c1 Fixed the return value in KeRundownQueue if the queue is empty. This should fix bug 751.
svn path=/trunk/; revision=17622
2005-09-03 18:00:54 +00:00
Hartmut Birr
2cea7b7c46 Set the ownership before locking the bitmap in EngCreateDeviceSurface, because GDIOBJ_SetOwnership runs in a dead lock if the object is already locked by the same process.
This may fix bug 747.

svn path=/trunk/; revision=17621
2005-09-03 17:40:33 +00:00
Brandon Turner
acb0c26036 Setting my changes back for prompt.c. Greatlord and I agreed about this. These was a miscommication about these changes and the way different MS version handle it.
svn path=/trunk/; revision=17620
2005-09-03 11:51:22 +00:00
Magnus Olsen
ff5ad9b6d7 Updated translation by Anders, proofread by Andreas Bjerkeholt, rename Sw to sv, Sw stand for another language's. Steven can you send this change to winehq.
svn path=/trunk/; revision=17619
2005-09-03 11:50:23 +00:00
Magnus Olsen
96791c3aa3 Swedish translation by David Nordenberg, proofread by Andreas Bjerkeholt
svn path=/trunk/; revision=17618
2005-09-03 11:23:24 +00:00
Magnus Olsen
729d73ef17 Swedish translation by Andreas Bjerkeholt, proofread by David Nordenberg. Some did forget add Es.rc to rsrc.rc (the Spanish translations)
svn path=/trunk/; revision=17617
2005-09-03 11:22:13 +00:00
Magnus Olsen
739b84b16d David Nordenberg: Swedish translation, proofread by Andreas Bjerkeholt
svn path=/trunk/; revision=17616
2005-09-03 11:20:04 +00:00
Magnus Olsen
c0fc3dba7b * Updated translation by Anders, proofread by Andreas Bjerkeholt
svn path=/trunk/; revision=17615
2005-09-03 11:05:31 +00:00
Magnus Olsen
5d08c58541 revers brandon change to prompt.c they are incorrect. Add a check if prompt env are set or not. if it is not set cmd set the prompt value. in cmd.c brandon forget that.
svn path=/trunk/; revision=17614
2005-09-03 09:46:46 +00:00
Brandon Turner
35240bd337 Correctly assign %propmt%.
cmd.c = give %prompt% default value of $P$G
prompt.c = when param are null, assign %prompt% to $P$G

svn path=/trunk/; revision=17613
2005-09-03 01:34:40 +00:00
Royce Mitchell III
937e6fc685 small efficiency boost
svn path=/trunk/; revision=17612
2005-09-03 01:19:25 +00:00
Brandon Turner
99c1fbbdfc Fixed a bug that crashed cmd when "cd /D" but no path. Bug reported by Harteex.
svn path=/trunk/; revision=17611
2005-09-02 22:41:40 +00:00
Hervé Poussineau
72784f6c8f Remove warnings
svn path=/trunk/; revision=17610
2005-09-02 21:26:51 +00:00
Hervé Poussineau
45c69b6adb RmRemove warnings
svn path=/trunk/; revision=17609
2005-09-02 21:13:10 +00:00
Hervé Poussineau
9b308f9dbf Remove DbgPrint statements as they were not executed + some of them were badly placed
svn path=/trunk/; revision=17608
2005-09-02 21:11:17 +00:00
Hervé Poussineau
e4ea943f57 Don't fill twice the output buffer. Bug spotted by Filip
svn path=/trunk/; revision=17606
2005-09-02 19:05:01 +00:00
Hervé Poussineau
c1f3b3a122 No need to allocate too much memory, as SetupDiGetDeviceRegistryPropertyW returns a size in bytes, not in characters. Bug spotted by Filip
svn path=/trunk/; revision=17605
2005-09-02 18:51:32 +00:00
Filip Navara
02488d3f49 Check for Request == NULL.
svn path=/trunk/; revision=17604
2005-09-02 13:12:44 +00:00
Filip Navara
b6e746354a Fix open mode passed to CreateFile in DoSaveFile function. Patch by Johannes Anderwald.
svn path=/trunk/; revision=17603
2005-09-02 11:29:40 +00:00
Gregor Anich
63748df6f5 Link against string.a instead of hal and ntoskrnl, otherwise Windows will not load the driver.
svn path=/trunk/; revision=17602
2005-09-01 23:32:59 +00:00
Gunnar Dalsnes
bec034b146 fixed RtlCompareUnicodeString and RtlCompareString (said stuff were equal when it was not) by ripping from wine
svn path=/trunk/; revision=17601
2005-09-01 21:09:07 +00:00
Andrew Munger
5fb5193c82 Correct some checks, fix bug 748 (qemu networking). Fix by his vaingloriousness Alex Ionescu.
svn path=/trunk/; revision=17600
2005-09-01 02:57:27 +00:00
Hartmut Birr
b8b259908a Print the exception code and the faulting address, if the address is available.
svn path=/trunk/; revision=17598
2005-08-30 16:28:36 +00:00
Hartmut Birr
276ca539bd Invoke always our own exception handler if the exception wasn't handled. It prints some nice informations.
svn path=/trunk/; revision=17597
2005-08-30 16:26:38 +00:00
Hartmut Birr
3e0e6887f8 Don't interpret SIG_DFL and SIG_IGN as real handler address.
svn path=/trunk/; revision=17596
2005-08-30 16:24:55 +00:00
Filip Navara
bb3b1de38c Remove WineDebugInfo from TEB and fix type of TlsExpansionBitmap in PEB.
svn path=/trunk/; revision=17595
2005-08-29 22:23:55 +00:00
Filip Navara
a1e4cc1fd8 Formatting and code style changes.
svn path=/trunk/; revision=17594
2005-08-29 21:06:07 +00:00
Thomas Bluemel
d57cdec721 fixed uninitialized variable warning
svn path=/trunk/; revision=17593
2005-08-29 20:06:43 +00:00
Brandon Turner
ac2b9c20d7 fix an if statment. Found by thomas.
svn path=/trunk/; revision=17592
2005-08-29 19:09:41 +00:00
Brandon Turner
d261fc0b2b Fixed a bug in tab complete when there was only one " and it was in the middle or end of the string. Also changed used more optimized code removing " and removed all _tcsncmp(..,..,1).
svn path=/trunk/; revision=17591
2005-08-29 18:25:54 +00:00
Thomas Bluemel
13115c5ce3 - don't close handles of keys in RegDeleteTree() that were deleted
- implemented RegConnectRegistryA()

svn path=/trunk/; revision=17589
2005-08-29 13:54:05 +00:00
Hervé Poussineau
37315f15ba Remove warnings
svn path=/trunk/; revision=17588
2005-08-28 15:43:00 +00:00
Hervé Poussineau
d4eb73201a Remove warnings
svn path=/trunk/; revision=17587
2005-08-28 15:29:36 +00:00
Eric Kohl
624151b290 Implement CM_Get_Class_Key_Name[_Ex]A/W and CM_Open_Class[_Ex]A/W.
svn path=/trunk/; revision=17586
2005-08-28 15:07:45 +00:00
Royce Mitchell III
b17534dfa0 remove single "." entries from paths
svn path=/trunk/; revision=17585
2005-08-28 12:23:37 +00:00
Royce Mitchell III
2b121dc93c remove transient debugging code
svn path=/trunk/; revision=17584
2005-08-28 12:18:13 +00:00
Royce Mitchell III
cdf2899515 don't crash if path == base_directory.
sorry I forgot to commit my changes to this file last night

svn path=/trunk/; revision=17583
2005-08-28 12:08:53 +00:00
Hartmut Birr
bb6a166390 - Allocate the csrss request buffer from heap if the necessary length is larger than the request structure.
- Fixed some buffer length calculations.

svn path=/trunk/; revision=17582
2005-08-28 12:03:25 +00:00
Hartmut Birr
37dced9725 Allocated the message reply buffer according to the size of the message.
svn path=/trunk/; revision=17581
2005-08-28 11:58:06 +00:00
Hervé Poussineau
b5fbf00480 Fix rbuild compilation, by adding Path::RelativeFromDirectory method
svn path=/trunk/; revision=17580
2005-08-28 09:50:00 +00:00
Hervé Poussineau
2142e2dfaf Remove warnings
svn path=/trunk/; revision=17579
2005-08-28 09:07:43 +00:00
Hervé Poussineau
d8fe2ffd8e Remove warnings
svn path=/trunk/; revision=17578
2005-08-28 09:04:39 +00:00
Emanuele Aliberti
84b33992c6 Autoregister Debug internal subsystem too. Now 'sm info' displays meaningful information.
NOTE: It seems the new client management introduced a stupid bug that shows up on system shutdown (smss crashes calling an LPC related API). I can't locate it now (of course, that happens for every 'stupid' bug, but will tray again later).

svn path=/trunk/; revision=17577
2005-08-28 07:34:35 +00:00
Royce Mitchell III
d252387963 add include directories from xml, remove "." hack, as projects that need to include their base directory have done so already in the xml.
svn path=/trunk/; revision=17576
2005-08-28 05:34:22 +00:00
Royce Mitchell III
8bbdffa2ff add . to list of include directories for all projects
svn path=/trunk/; revision=17575
2005-08-28 02:37:06 +00:00
Thomas Bluemel
95f9fe7198 #include "precomp.h" -> #include <precomp.h>
svn path=/trunk/; revision=17574
2005-08-27 23:35:51 +00:00
Eric Kohl
1cedb076b5 Implement StringTableInitializeEx, StringTableGetExtraData and StringTableSetExtraData.
Add StringTableAddStringEx and StringTableLookUpStringEx stubs.

svn path=/trunk/; revision=17573
2005-08-27 19:14:35 +00:00
Thomas Bluemel
4270d01108 implemented RegDeleteTree() (untested!)
svn path=/trunk/; revision=17572
2005-08-27 18:13:52 +00:00
Emanuele Aliberti
ff8b08beb4 native EOL
svn path=/trunk/; revision=17571
2005-08-27 17:21:07 +00:00
Emanuele Aliberti
ca18dcf2d9 Minor changes and IT resource file.
svn path=/trunk/; revision=17570
2005-08-27 17:18:29 +00:00
Hervé Poussineau
3c98221253 Implement SetupDiSelectBestCompatDrv, by sorting drivers by rank in drivers list
svn path=/trunk/; revision=17569
2005-08-27 14:59:22 +00:00
Eric Kohl
1848960041 Implement LogonUserA.
svn path=/trunk/; revision=17568
2005-08-27 14:56:17 +00:00
Emanuele Aliberti
3c693f90bc SM: simplify and fix client (subsystem servers) management.
svn path=/trunk/; revision=17567
2005-08-27 09:55:27 +00:00
Andrew Munger
40a9efb724 17519 requires __REACTOS__ to be defined for KDB to work.
svn path=/trunk/; revision=17566
2005-08-27 04:20:49 +00:00
Andrew Munger
e0ccbec43f "." means current directory, not previous. Spotted by Talley.
svn path=/trunk/; revision=17565
2005-08-27 02:34:46 +00:00
Thomas Bluemel
d1e98bfddd fixed code to compile both as ansi and unicode version, build as unicode by default
svn path=/trunk/; revision=17564
2005-08-26 21:02:47 +00:00
Hartmut Birr
342d03f235 - Moved all members with variable length in CSRSS_XXX structures to the end.
- Defined all members with variable length as arrays with a size of zero.  
- Used the stack for allocating CSR_API_MESSAGE structures.

svn path=/trunk/; revision=17563
2005-08-26 20:35:33 +00:00
Filip Navara
1a8c456007 Make the explorer taskbar look a bit nicer.
svn path=/trunk/; revision=17562
2005-08-26 20:03:41 +00:00
Filip Navara
5c7930f963 Add TBMETRICS structure and associated constants.
svn path=/trunk/; revision=17561
2005-08-26 20:02:53 +00:00
Steven Edwards
21927423a2 Add constants for DBG_CONTROL_C and DBG_CONTROL_BREAK to ntstatus.h, Work around conflict including ntstatus.h with the NDK
svn path=/trunk/; revision=17560
2005-08-26 18:39:20 +00:00
Thomas Bluemel
20e728bbac implemented CreateSymbolicLink() (not tested/verified yet!)
svn path=/trunk/; revision=17559
2005-08-26 13:47:56 +00:00
Hartmut Birr
ead53e0588 Call the correct user mode dispatch function in KiDispatchException. The bug was introduced by r17053.
svn path=/trunk/; revision=17558
2005-08-26 13:06:24 +00:00
Thomas Bluemel
64b5d11940 removed obsolete variable in RegOpenUserClassesRoot()
svn path=/trunk/; revision=17557
2005-08-26 09:53:00 +00:00
Thomas Bluemel
a16e6f61c5 RegLoadMUIStringA/W are not implemented yet...
svn path=/trunk/; revision=17556
2005-08-26 09:49:19 +00:00
Thomas Bluemel
e9b53b73b9 added stubs for RegLoadMUIStringA/W()
svn path=/trunk/; revision=17555
2005-08-26 09:48:13 +00:00
Thomas Bluemel
64d0f61e8a implemented RegDisablePredefinedCacheEx()
svn path=/trunk/; revision=17554
2005-08-26 09:40:37 +00:00
Steven Edwards
f4668aceae Why this thing ships with its own GetConsoleWindow function I don't understand. Rename it and make the rest of the code use it. Compiles fine on gcc 3.x and msvc6 and works properly.
svn path=/trunk/; revision=17553
2005-08-25 23:54:39 +00:00
Steven Edwards
8fcad79576 minor build fixes for msvc
svn path=/trunk/; revision=17552
2005-08-25 23:20:34 +00:00
Steven Edwards
4147a4df09 fix msvc compile
svn path=/trunk/; revision=17551
2005-08-25 22:50:44 +00:00
Steven Edwards
65ff8ee6ca disable the custom rules for Winebuild for now
svn path=/trunk/; revision=17550
2005-08-25 22:49:26 +00:00
Magnus Olsen
06694b3675 Thx ravelo to found a new bug in start.c it did not manger run batfile with path that contain space.
svn path=/trunk/; revision=17549
2005-08-25 22:43:20 +00:00
Brandon Turner
5509951fc0 Don't dereference the pointers. Catch by Thomas.
svn path=/trunk/; revision=17548
2005-08-25 22:09:10 +00:00
Thomas Bluemel
8feae80765 add stub for ControlServiceEx()
svn path=/trunk/; revision=17547
2005-08-25 22:06:31 +00:00
Steven Edwards
95164f7065 Generate a GUID for each module processed. Later on this will be needed to support msvc2k3/5 vcproj files.
svn path=/trunk/; revision=17546
2005-08-25 20:58:01 +00:00
Brandon Turner
c7b88afc3f Implement escape char in console. "^"
cmd.c - when the env isnt found, dont zero out the params
redir.c - skip over all ^ when looking for redir/pipe
echo.c - when printing out, treat ^ correctly.

svn path=/trunk/; revision=17545
2005-08-25 20:05:07 +00:00
Thomas Bluemel
011639b626 enable theming of the checklist control
svn path=/trunk/; revision=17544
2005-08-25 19:53:37 +00:00
Thomas Bluemel
eafb1ee3f7 - added stubs for Set/GetConsoleHistoryInfo(), GetConsoleOriginalTitleA/W(), Set/GetConsoleScreenBufferInfoEx() and GetCurrentConsoleFontEx()
- added missing structure definitions

svn path=/trunk/; revision=17543
2005-08-25 19:47:44 +00:00
Thomas Bluemel
362610233e add stubs for CreateSymbolicLinkA/W
svn path=/trunk/; revision=17542
2005-08-25 18:21:50 +00:00
Brandon Turner
06c225119d Use GetShortPathName and GetLongPathName to correct the case of the new path in SetRootPath. GetFullPathName by itself would not work when there was a space in the name.
svn path=/trunk/; revision=17541
2005-08-25 17:38:15 +00:00
Royce Mitchell III
9010800221 file paths should be relative to the location of the dsp file, not the dsw file
svn path=/trunk/; revision=17540
2005-08-25 17:24:11 +00:00
Maarten Bosma
bebf0b4a61 Fill some more structs, that ms ddraw fill as well.
svn path=/trunk/; revision=17539
2005-08-25 15:31:28 +00:00
Hartmut Birr
25d3bf68ab Fixed a bug in RtlLeaveCriticalSection. We have only to signal the event if someone waits on it.
svn path=/trunk/; revision=17538
2005-08-25 12:33:37 +00:00
Thomas Bluemel
8370e44f84 minor simplifications
svn path=/trunk/; revision=17537
2005-08-25 12:30:10 +00:00
Thomas Bluemel
3b35dd5038 open subkey with sufficient rights in RegDeleteTree
svn path=/trunk/; revision=17536
2005-08-25 12:27:25 +00:00
Thomas Bluemel
8d862306ef added stubs for RegDeleteTreeA/W() and RegCopyTreeA/W()
svn path=/trunk/; revision=17535
2005-08-25 12:25:11 +00:00
Maarten Bosma
d5fd7c89ea Change Install Name to ddraw_demo.exe
svn path=/trunk/; revision=17534
2005-08-25 11:36:49 +00:00
Royce Mitchell III
27ef51709f $default_cfg fix
cleaned up more code that isn't enabled yet
generate correct line endings on *nix, too

svn path=/trunk/; revision=17533
2005-08-25 01:44:23 +00:00
Thomas Bluemel
55610a1a3d check for console handles in Get/SetFileAttributesByHandle()
svn path=/trunk/; revision=17531
2005-08-25 00:33:37 +00:00
Thomas Bluemel
5760f0496c implemented SetFileAttributesByHandle() and GetFileAttributesByHandle()
svn path=/trunk/; revision=17530
2005-08-24 23:59:03 +00:00
Thomas Bluemel
78bc5b9ab0 implemented RegSetKeyValueA/W
svn path=/trunk/; revision=17529
2005-08-24 23:44:27 +00:00
Magnus Olsen
4782b7ce3e fixing a bug in searching for cmd for bat/cmd files, thx ravelo to found this stupied bug
svn path=/trunk/; revision=17528
2005-08-24 23:33:34 +00:00
Thomas Bluemel
bc8811f677 implemented RegDeleteKeyValueA/W()
svn path=/trunk/; revision=17527
2005-08-24 23:29:51 +00:00
Magnus Olsen
519f1108ad Implement start execute support for bat/cmd file. woking in windows
svn path=/trunk/; revision=17526
2005-08-24 23:07:51 +00:00
Thomas Bluemel
8f881e2d04 implemented IsThreadAFiber()
svn path=/trunk/; revision=17525
2005-08-24 23:05:07 +00:00
Royce Mitchell III
5c7747b97c zero the entire buffer
svn path=/trunk/; revision=17524
2005-08-24 22:38:10 +00:00
Thomas Bluemel
a8e3f13a42 install the registry keys before enabling the driver
svn path=/trunk/; revision=17523
2005-08-24 21:54:13 +00:00
Filip Navara
85266e68b5 REVISON -> REVISION
svn path=/trunk/; revision=17522
2005-08-24 21:52:41 +00:00
Magnus Olsen
d9f9178f3e implemented "" remove for the start command. This makes 'start dir1\"dir2a dir2b"\dir3\foo.exe param' work change by Martin Rottensteiner 2005only@pianonote.at irc nick ravelo
svn path=/trunk/; revision=17521
2005-08-24 21:40:01 +00:00
Filip Navara
98d9c65720 Fix a memory leak if VideoPortInitialize is called more than once from the same miniport.
Replace STDCALL with NTAPI.

svn path=/trunk/; revision=17520
2005-08-24 21:29:24 +00:00
Hervé Poussineau
de881e611a Cleanup i8042prt.h
Remove $Id$ tags
Replace Win32 types by their kernel counterparts (DWORD -> ULONG, ...)

svn path=/trunk/; revision=17519
2005-08-24 20:34:50 +00:00
Royce Mitchell III
a2e91278b6 added some verbosity
standardized back on printf from cout
fixed loop variable conflict

svn path=/trunk/; revision=17518
2005-08-24 20:06:54 +00:00
Royce Mitchell III
86018cbc02 invoke _generate_dsp() have it open the output file, and fix some path parsing and const issues.
svn path=/trunk/; revision=17517
2005-08-24 19:58:07 +00:00
Hervé Poussineau
9195c7dd4f Remove $Id$ tags
Use FATEntry.ShortName field instead of FATEntry.FileName when dealing with full name
Remove LL suffix on long long constants
Replace Win32 types by their kernel counterparts (DWORD -> ULONG, ...)

svn path=/trunk/; revision=17516
2005-08-24 18:29:45 +00:00
Royce Mitchell III
bf3117cb5e _generate_dsp() compiles now, haven't tested yet
svn path=/trunk/; revision=17515
2005-08-24 18:13:00 +00:00
Hervé Poussineau
6b3b47323d Fix IRP_MJ_QUERY_INFORMATION/FileStandardInformation (current code was trying to dereference NULL pointer)
Replace MmGetSystemAddressForMdl by MmGetSystemAddressForMdlSafe

svn path=/trunk/; revision=17514
2005-08-24 15:37:04 +00:00
Hervé Poussineau
66c8fe47e0 Replace ExAllocatePool by ExAllocatePoolWithTag
Fix CHECKPOINT1 definition for MSVC compiler

svn path=/trunk/; revision=17513
2005-08-24 15:33:58 +00:00
Filip Navara
820afe2e92 Make BusyLoop volatile. Spotted by Thomas.
svn path=/trunk/; revision=17512
2005-08-24 14:15:54 +00:00
Filip Navara
1ef2914b90 Implement the most over-optimized lock in NT - the NDIS_RW_LOCK.
svn path=/trunk/; revision=17511
2005-08-24 12:21:18 +00:00
Filip Navara
22432ceb48 Fix the NDIS_RW_LOCK structure.
svn path=/trunk/; revision=17510
2005-08-24 12:20:59 +00:00
Filip Navara
6ba28fd06e Remove bogus and unneeded cast.
svn path=/trunk/; revision=17509
2005-08-24 09:50:18 +00:00
Royce Mitchell III
f9b0db47fe Replace() bugfix #2 - forgot to insert replacement text ( yes yes I suck you can stop throwing tomatoes now )
svn path=/trunk/; revision=17508
2005-08-24 06:03:34 +00:00
Royce Mitchell III
2a5ef2ef24 bugfix - Replace() was truncating the string
svn path=/trunk/; revision=17507
2005-08-24 06:01:02 +00:00
Royce Mitchell III
e5cc52e14b almost done converting _generate_dsp(), but have to quit for the night, so commiting what's done so far.
svn path=/trunk/; revision=17506
2005-08-24 05:58:14 +00:00
Royce Mitchell III
47b458eed1 new helper function Replace()
svn path=/trunk/; revision=17505
2005-08-24 05:50:21 +00:00
Royce Mitchell III
db03491cdc vc6 build files - just in case somebody else wants to use them
svn path=/trunk/; revision=17504
2005-08-24 04:00:37 +00:00
Steven Edwards
d708ff3ba3 remove a few of the Wine hacks
svn path=/trunk/; revision=17503
2005-08-24 03:56:25 +00:00
Royce Mitchell III
ff8f4e3c6a new top-level target 'msvc' to create msvc build files
svn path=/trunk/; revision=17502
2005-08-24 03:39:10 +00:00
Royce Mitchell III
a864a2c137 import wine's "msvcmaker" perl script and begin converting it to C++ - so far it creates the DSW file.
svn path=/trunk/; revision=17501
2005-08-24 03:38:20 +00:00
Royce Mitchell III
ed985615ec added some comments to illustrate the output of several path-related functions
svn path=/trunk/; revision=17500
2005-08-24 03:18:13 +00:00
Royce Mitchell III
ae5026eb5b fix to not crash when built with msvc6 ( bad calling convention on imports ).
fix error-handling bugs, added missing error-handling

svn path=/trunk/; revision=17499
2005-08-24 02:55:08 +00:00
Filip Navara
c905ca8a31 Get rid of one memory leak and two more ROS-only fields in LOGICAL_ADAPTER structure.
svn path=/trunk/; revision=17498
2005-08-24 02:20:41 +00:00
Filip Navara
82af9fdaa8 Start removing dead code and ReactOS specific structure fields (the NDIS structures are official, documented and contain all we need).
svn path=/trunk/; revision=17497
2005-08-24 01:51:49 +00:00
Filip Navara
f68e4fcc28 Fix few macros to work with the corrected declarations.
svn path=/trunk/; revision=17496
2005-08-24 00:04:21 +00:00
Royce Mitchell III
b696000363 remove incorrect comment (copy/paste error)
svn path=/trunk/; revision=17495
2005-08-23 23:20:23 +00:00
Filip Navara
1b15c0cf70 Get rid of NdisWorkItemHalt.
svn path=/trunk/; revision=17494
2005-08-23 23:08:40 +00:00
Royce Mitchell III
07b11a6760 msvc6 compatibility
svn path=/trunk/; revision=17493
2005-08-23 23:06:58 +00:00
Royce Mitchell III
431f66d687 proxy makefile for rbuild
svn path=/trunk/; revision=17492
2005-08-23 23:06:19 +00:00
Filip Navara
6b949b43ea Remove buffer pool implementation and replace buffer allocation with binary compatible functions (since some of them are macroized in DDK headers), other cosmetic changes.
svn path=/trunk/; revision=17491
2005-08-23 23:02:35 +00:00
Hervé Poussineau
ac0a5c446f Remove incorrect definition of NLS_MB_CODE_PAGE_TAG. The correct definition is 2 lines above.
svn path=/trunk/; revision=17490
2005-08-23 22:25:35 +00:00
Filip Navara
0a0c2fc103 Remove obsolete APIs and APIs that are actually implemented only as macros.
svn path=/trunk/; revision=17489
2005-08-23 22:24:54 +00:00
Filip Navara
f6283b4bca MS DDK compatibility fixes.
svn path=/trunk/; revision=17488
2005-08-23 22:11:03 +00:00
Filip Navara
4076e16a99 Shut up PREFAST warnings about shadowing declarations.
svn path=/trunk/; revision=17487
2005-08-23 20:18:55 +00:00
Filip Navara
eea6d92c91 Fix incorrect string manipulation in NdisOpenProtocolConfiguration and add few casts to make compiler happy.
svn path=/trunk/; revision=17486
2005-08-23 20:13:31 +00:00
Hartmut Birr
4a6a7d1ccc ReturnRecognizedPartitions in HalIoReadPartitionTable means that used and real partitions should be returned.
svn path=/trunk/; revision=17485
2005-08-23 17:43:58 +00:00
Hartmut Birr
b3f11cfb38 Fixed the calculation of the boot disk number in i386DiskGetSystemVolume.
We have to count all used partititions instead of the known one.

svn path=/trunk/; revision=17484
2005-08-23 17:42:12 +00:00
Hervé Poussineau
d373f6bfb0 Fix special case in SetupGetLineTextA/W and SetupGetStringFieldA/W when Buffer is NULL and BufferSize is 0, by reverting part of r17162
Fixes bug #724, spotted by GvG
Do according changes in SetupDiBuildDriverInfoList

svn path=/trunk/; revision=17483
2005-08-23 17:38:14 +00:00
Filip Navara
05c41b4d84 Name the proxy makefiles "GNUmakefile" instead of "makefile".
svn path=/trunk/; revision=17482
2005-08-23 14:56:38 +00:00
Gé van Geldorp
831c62d703 Rewrite project target
svn path=/trunk/; revision=17481
2005-08-23 14:51:03 +00:00
Filip Navara
9cb9ed7b8b Set the service group for i8042prt.
svn path=/trunk/; revision=17480
2005-08-23 14:26:00 +00:00
Alex Ionescu
f3f3986cdc use correct wait mode when checking alertability in KeDelayExecuteThread. thanks to gunnar for noticing the bug
svn path=/trunk/; revision=17479
2005-08-22 23:33:51 +00:00
Filip Navara
db6c51690e Actually break out of the wait loops if we got alerted.
svn path=/trunk/; revision=17478
2005-08-22 21:35:41 +00:00
Thomas Bluemel
38caf3038e rename IsKernelPointer to IsPointerOffset
svn path=/trunk/; revision=17477
2005-08-22 15:20:49 +00:00
Gunnar Dalsnes
453763e6eb move old cruft
svn path=/trunk/; revision=17476
2005-08-22 14:39:10 +00:00
Gunnar Dalsnes
035c4b73a1 prepare move old cruft
svn path=/trunk/; revision=17475
2005-08-22 14:26:37 +00:00
Thomas Bluemel
bd73d35e4d added a macro IsKernelPointer() to test whether a pointer value points to the kernel address space. This is needed because on IA-64 the MSB is not necessarily set for pointers to the kernel address space.
svn path=/trunk/; revision=17474
2005-08-22 13:38:30 +00:00
Filip Navara
27d68c7b2f Cleanup IoGetDmaAdapter and use HalGetDmaAdapter instead of HalGetAdapter.
svn path=/trunk/; revision=17473
2005-08-22 10:51:05 +00:00
Filip Navara
4fd4530977 Export the HalGetDmaAdapter callback and use some nice macros where appropriate.
svn path=/trunk/; revision=17472
2005-08-22 10:47:29 +00:00
Filip Navara
8872cc5e5d Add missing definitions for HalDispatchTable callbacks.
svn path=/trunk/; revision=17471
2005-08-22 10:29:51 +00:00
Filip Navara
a0b8ef87a8 Complete reimplementation of HAL DMA routines.
The key changes are
* Proper support for bus-master device adapters.
* Real implementation of map registers.
* Basic support for emulating scatter/gather DMA on
  devices that don't support it in hardware.
* Support for transfers that aren't page aligned.
* Proper detection and support of EISA DMA controllers.
* Fixed prototype for HalFlushCommonBuffer.

svn path=/trunk/; revision=17470
2005-08-22 08:39:42 +00:00
Brandon Turner
1fb85e029e Fix a CD bug spotted by ravelo_. This is simlair to bug 690. cd foo\"bar", cd "foo"\"bar"" and other of the sorts are all valid.
svn path=/trunk/; revision=17469
2005-08-21 20:44:47 +00:00
Steven Edwards
b1db227eed prompt to configure for Mingw after building project files
svn path=/trunk/; revision=17468
2005-08-21 19:35:19 +00:00
Thomas Bluemel
5e348c00c1 - use inlined probing macros for basic types
- minor optimizations by comparing the processor mode against KernelMode (==0) instead of UserMode (==1)

svn path=/trunk/; revision=17467
2005-08-21 19:04:23 +00:00
Thomas Bluemel
84f88f6480 use inlined probing macros for basic types
svn path=/trunk/; revision=17466
2005-08-21 17:38:07 +00:00
Filip Navara
632d85cc3b Replace wcsncpy with lstrcpynW / memcpy as appropriate.
svn path=/trunk/; revision=17465
2005-08-21 15:54:48 +00:00
Filip Navara
c2e747ed00 Fix implementation of wcsnlen and strnlen.
svn path=/trunk/; revision=17464
2005-08-21 15:51:57 +00:00
Filip Navara
dc4c46f7cc Fix buffer overflow in lstrcpynW and lstrcpynA.
svn path=/trunk/; revision=17463
2005-08-21 15:51:23 +00:00
Thomas Bluemel
10cd89fb4e - use inlined probing macros for basic types
- documented dozens of vulnerabilities in NtOpenThread, NtCreateThread and NtOpenProcess (owner may fix them)

svn path=/trunk/; revision=17462
2005-08-21 15:38:47 +00:00
Thomas Bluemel
6e74d05c08 add macros to probe basic type pointers
svn path=/trunk/; revision=17461
2005-08-21 15:14:36 +00:00
Thomas Bluemel
5d1efdc288 fixed uninitialized variable warning
svn path=/trunk/; revision=17460
2005-08-21 15:00:29 +00:00
Thomas Bluemel
c0e80c80f9 add prototypes of RtlDosPathNameToRelativeNtPathName_U and RtlReleaseRelativeName and export them
svn path=/trunk/; revision=17459
2005-08-21 14:58:47 +00:00
Steven Edwards
f0652f0b65 add fix it to build on linux
svn path=/trunk/; revision=17458
2005-08-21 14:41:20 +00:00
Steven Edwards
d45951b413 added a genguid helper function based on genguid by Jon Wilson. Will be needed later on when building project files.
svn path=/trunk/; revision=17457
2005-08-21 14:04:19 +00:00
Steven Edwards
b87887e917 ...I hate windows and its concepts of case in filenames...
svn path=/trunk/; revision=17456
2005-08-21 04:04:13 +00:00
Steven Edwards
ceef1f78ae add a more descriptive message about the state of the MSVC backend
svn path=/trunk/; revision=17455
2005-08-21 03:24:37 +00:00
Steven Edwards
fb2f0898bf started working on a msvc2k5 backend. Mostly a dummy atm based on the devcpp backend
svn path=/trunk/; revision=17454
2005-08-21 01:29:56 +00:00
Filip Navara
d08bee5539 Report the PCI bus type as PCIBus instead of Internal.
svn path=/trunk/; revision=17453
2005-08-20 23:50:06 +00:00
Brandon Turner
7677f95c2c optimize 17218 by using memmove instead of memcopy and not using _tcsncmp. Suggested by thomas.
svn path=/trunk/; revision=17452
2005-08-20 19:04:38 +00:00
Brandon Turner
bf127ab4fb Open err redirection the same as output redirection. Batch file does not need to be opened with FILE_FLAG_WRITE_THROUGH since it is read only, catch by thomas.
svn path=/trunk/; revision=17451
2005-08-20 18:30:25 +00:00
Brandon Turner
c7163ec449 Change the way batch files and output files are opened. They now allow write and delete while being excuted. This is how MS cmd is done. Thanks to Greatlord, Filip, Thomas.
svn path=/trunk/; revision=17450
2005-08-20 18:07:59 +00:00
Royce Mitchell III
1ad828873f added clean rule
svn path=/trunk/; revision=17448
2005-08-19 21:58:31 +00:00
Steven Edwards
565a32245f use instead of g++
svn path=/trunk/; revision=17447
2005-08-19 21:56:14 +00:00
Royce Mitchell III
4cdcc88ae0 spelling/grammar
svn path=/trunk/; revision=17446
2005-08-19 21:54:59 +00:00
Royce Mitchell III
07435bc9ca mingw makefile + more mingw compatibility fixes
svn path=/trunk/; revision=17445
2005-08-19 21:53:40 +00:00
Steven Edwards
999292611d ditto
svn path=/trunk/; revision=17444
2005-08-19 21:21:58 +00:00
Royce Mitchell III
595c382dbc mingw compatibility fixes
svn path=/trunk/; revision=17443
2005-08-19 21:21:05 +00:00
Steven Edwards
623af9cd28 mixed case sucks
svn path=/trunk/; revision=17442
2005-08-19 21:21:04 +00:00
Gé van Geldorp
927cbf4440 Add generation of 8bpp DIB code
svn path=/trunk/; revision=17441
2005-08-19 20:56:01 +00:00
Steven Edwards
ceb380247b Added support for MOVEFILE_DELAY_UNTIL_REBOOT, based on Wine code by Gerhard W. Gruber and others. Still requires smss to check the key.
svn path=/trunk/; revision=17440
2005-08-19 19:05:59 +00:00
Emanuele Aliberti
c84b875eac XML chunks are required to contain a single node.
svn path=/trunk/; revision=17438
2005-08-19 15:28:41 +00:00
Emanuele Aliberti
88d1bd4d58 Moved keyboard mappers need to picked up from the right place.
svn path=/trunk/; revision=17437
2005-08-19 15:27:39 +00:00
Emanuele Aliberti
d830459d8c Group keyboard mappers in a common directory, like CPLs.
svn path=/trunk/; revision=17436
2005-08-19 15:26:02 +00:00
Gé van Geldorp
a4c7ecd803 Import VMware open source BusLogic driver
Hartmut made it work in ReactOS.

svn path=/trunk/; revision=17434
2005-08-18 21:59:20 +00:00
Alex Ionescu
20d4ebeffc Fix boot
svn path=/trunk/; revision=17431
2005-08-18 21:25:04 +00:00
Magnus Olsen
9eeadb66ec implement errorlevel in some cmd command and bug fix some errorlevel command. Hopply it is last commit about errorlevel. Please can some test see if all cmd command have right errorlevel set or not set. I have not test every command if they got right errorlevel setting. But They should have it now.
svn path=/trunk/; revision=17430
2005-08-18 20:52:52 +00:00
Gé van Geldorp
a6b62e7c0d Add generation of 32bpp DIB code
svn path=/trunk/; revision=17429
2005-08-18 19:26:37 +00:00
Brandon Turner
106794e0ab make dir change errorlevel to 0 on success.
svn path=/trunk/; revision=17428
2005-08-18 15:21:57 +00:00
Brandon Turner
c7d3d9b183 Test commit, adding myself to the cmd credits.
svn path=/trunk/; revision=17427
2005-08-18 15:04:04 +00:00
Hartmut Birr
6888f719c5 Fixed the directory index for FATX in FATXAddEntry.
svn path=/trunk/; revision=17426
2005-08-18 11:51:27 +00:00
Hartmut Birr
f8cf29f8d0 Load the symbols from ntoskrn.exe from the boot cd, if it is possible.
svn path=/trunk/; revision=17425
2005-08-17 20:41:15 +00:00
Alex Ionescu
fa4888f2fc Add back MessageData to PQUEUED_MESSAGE. It was accidentally removed
svn path=/trunk/; revision=17424
2005-08-17 18:56:57 +00:00
Magnus Olsen
13b5d61c2c implemented batch redirection by saving batch info in tagBATCHCONTEXT by Brandon Turner
svn path=/trunk/; revision=17423
2005-08-17 18:01:47 +00:00
Gé van Geldorp
598f28ffad Samuel Bronson <naesten@gmail.com>:
Reduce the time it takes GDB to attach

svn path=/trunk/; revision=17422
2005-08-17 07:23:05 +00:00
Alex Ionescu
76f11b5f23 Add beginning of lpc docs
svn path=/trunk/; revision=17421
2005-08-17 07:07:43 +00:00
Alex Ionescu
e7d010c5de Major cleanup of NDK. I've decided that it would be much cleaner to accumulate all types, regardless of their um/km availabilty, into each header. Thus, umtypes.h now only contains the equivalent of ntdef.h and is automatically not-included if the DDK is. Similary, I've removed all the NTIFS hacks and added a single ifssupp.h file, which is automatically removed if the IFS is added. That file will be deleted then the Longhorn WDK is made public (it contains the IFS/DDK). Nothing has changed on the includer-side, the same rules still apply
svn path=/trunk/; revision=17420
2005-08-17 07:06:59 +00:00
Emanuele Aliberti
eacc9d1b3a Minor changes.
svn path=/trunk/; revision=17419
2005-08-17 06:14:55 +00:00
Andrew Munger
c9522f3ab8 Do not free a Critical Section we did not initialize. Fixes the silent UM exception I was seeing while trying to install VMWare tools. Patch by Filip.
svn path=/trunk/; revision=17418
2005-08-16 23:37:17 +00:00
Alex Ionescu
9f1cf7b990 Remove all non-official LPC structures/defines/hardcoded hacks, and use actual correct sizes and structures.
svn path=/trunk/; revision=17417
2005-08-16 23:05:33 +00:00
Emanuele Aliberti
81fe025857 Add a stub for NTDLL!CsrGetProcessId.
svn path=/trunk/; revision=17416
2005-08-16 22:16:09 +00:00
Hartmut Birr
75983b1ade - Fixed the offset calculation in MmWritePagePhysicalAddress and MmPageOutPhysicalAddress.
- Add some code which will check for adding of multiple rmap entries.

svn path=/trunk/; revision=17415
2005-08-16 20:36:03 +00:00
Hartmut Birr
37aea079c1 If we delete a page table, we have also to clear the entry in the page directory area explicitly. This may fix parts of bug #710.
svn path=/trunk/; revision=17414
2005-08-16 16:17:47 +00:00
Casper Hornstrup
459c10a65e module_test proxy makefile support
svn path=/trunk/; revision=17413
2005-08-16 15:47:38 +00:00
Casper Hornstrup
bf5462ac03 Change o to optional
svn path=/trunk/; revision=17412
2005-08-16 14:39:17 +00:00
Emanuele Aliberti
9544a940a9 Make NTDLL not bind automatically to the Win32 server.
This will allow other personality subsystem not to depend on Win32.

svn path=/trunk/; revision=17411
2005-08-16 14:24:00 +00:00
Steven Edwards
3bea619a9a Changes to get msi based installers mostly working
ConvertStringSecurityDescriptorToSecurityDescriptor[W/A] - implement based on Winehq code
InitiateSystemShutdownExW - add stub from Wine
Convert registry source file to use Wine debugging Macros

svn path=/trunk/; revision=17410
2005-08-16 05:17:06 +00:00
Filip Navara
51cbaf1419 Make KeFlushQueueApc return a standard cyclic linked list to save a few CPU cycles.
svn path=/trunk/; revision=17408
2005-08-16 00:01:42 +00:00
Alex Ionescu
19f76e91c6 - Remove the APC from the list and then set it as not inserted, instead of backwards.
svn path=/trunk/; revision=17407
2005-08-15 22:44:32 +00:00
Emanuele Aliberti
fc21544784 packlib.dll is DLL, not an EXE!
svn path=/trunk/; revision=17406
2005-08-15 21:06:07 +00:00
Emanuele Aliberti
1c1f104d0c Enlarge the Options buffer.
svn path=/trunk/; revision=17405
2005-08-15 19:53:00 +00:00
Emanuele Aliberti
db0350f4d0 Update the cabman manual.
svn path=/trunk/; revision=17404
2005-08-15 19:50:35 +00:00
Emanuele Aliberti
6dfef1d2d7 Semantic enhancement suggested by Casper Hornstrup (o==>optional).
Fix bug in the method CDFParser::PerformFileCopy (spotted by Sylvain Petreolle).

svn path=/trunk/; revision=17403
2005-08-15 19:46:47 +00:00
Royce Mitchell III
ab9cdfc5dd fix reference counting output to tell us caller's file and line #
svn path=/trunk/; revision=17402
2005-08-15 18:43:56 +00:00
Emanuele Aliberti
9ceeecd2bd Subsystem definitions: convert OS/2 and POSIX to new CSR.
svn path=/trunk/; revision=17401
2005-08-15 17:31:33 +00:00
Emanuele Aliberti
b96f07443c Add winemine.
svn path=/trunk/; revision=17400
2005-08-15 17:30:20 +00:00
Emanuele Aliberti
5b5d163023 Add new CSR and new Win32 server as optional (subsys/csr, subsys/win).
Add images from the optional modules (rosapps,os2,posix,rosky,vms).

svn path=/trunk/; revision=17399
2005-08-15 17:04:34 +00:00
Hartmut Birr
a525c0a910 Fixed a terminating NULL in IoRegisterDeviceInterface (same as r17397).
svn path=/branches/cache_manager_rewrite/; revision=17398
2005-08-15 16:49:20 +00:00
Hartmut Birr
8bb6155fdb Fixed a terminating NULL in IoRegisterDeviceInterface.
svn path=/trunk/; revision=17397
2005-08-15 16:47:15 +00:00
Emanuele Aliberti
a0fb1d3891 CABMAN: add support for optional files (they are listed in the reactos.dff, but may not exist in the output-??? directory).
svn path=/trunk/; revision=17396
2005-08-15 16:41:43 +00:00
Hartmut Birr
84905ce896 Merged r16600:17394 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=17395
2005-08-15 11:39:19 +00:00
Steven Edwards
54bd458644 Changelog:
MSAFD: Add PCH support, PSDK fixes
MISC: Fix everything to build with PSDK changes
PSDK Fixes:
w32api/include/ssdl.h - reimplement based on Wine header which was more correct
w32api/include/ntsecapi.h - Remove duplicate structures and add typedef
w32api/include/winnt.h - add constant and missing structure
w32api/include/winioctl.h - add missing IOCTL code
w32api/include/winbase.h - add missing function declariation
w32api/include/aclui.h - remove duplicate structure

svn path=/trunk/; revision=17394
2005-08-15 02:24:48 +00:00
James Tabor
89d916e2c9 Create Usb bulk storage template.
svn path=/trunk/; revision=17390
2005-08-14 22:27:15 +00:00
Gé van Geldorp
69594926a7 Have vmwinst add back the registry entries which were so brutally removed.
This doesn't fix the problem completely though, blocked by the problem
described here:
http://reactos.com:8080/archives/public/ros-dev/2005-August/004558.html

svn path=/trunk/; revision=17389
2005-08-14 21:44:58 +00:00
Gé van Geldorp
33904bcc83 index is 1-based at this point, index == line->nb_fields is the last
field and is valid

svn path=/trunk/; revision=17388
2005-08-14 20:22:37 +00:00
Hartmut Birr
3568e560b6 Merged r16363:16600 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=17387
2005-08-14 17:12:10 +00:00
Hartmut Birr
5b49054bf4 Merged r16363:16600 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=17386
2005-08-14 17:10:07 +00:00
Hartmut Birr
dd70520fdf Merged r16363:16600 from trunk except lib\aclui, subsys\csrss and subsys\smss.
svn path=/branches/cache_manager_rewrite/; revision=17385
2005-08-14 16:42:46 +00:00
Hartmut Birr
54b25a5487 Merged r16362:16363 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=17384
2005-08-14 13:45:00 +00:00
Hartmut Birr
97614c665d Merged 16330:16362 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=17383
2005-08-14 13:42:08 +00:00
James Tabor
7d093589b4 Implemented USBD_ParseConfigurationDescriptorEx and USBD_ParseDescriptors for bulkusb driver testing.
svn path=/trunk/; revision=17382
2005-08-14 13:18:50 +00:00
Hartmut Birr
365e278fd9 Merged r16249:16330 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=17381
2005-08-14 10:30:10 +00:00
Magnus Olsen
6f3cd1ce3e change CMDLINE_LENGTH to 8192 to keep rbuild happy until dymatic alloc are in place
svn path=/trunk/; revision=17380
2005-08-14 09:14:53 +00:00
Royce Mitchell III
a6f00340b4 WINAPI -> STDCALL, plus fix/expound documentation
svn path=/trunk/; revision=17379
2005-08-14 04:36:36 +00:00
Royce Mitchell III
ffa5fea7b6 implement DbgPrintEx, vDbgPrintEx, and vDbgPrintExWithPrefix
svn path=/trunk/; revision=17378
2005-08-14 04:24:01 +00:00
Royce Mitchell III
199bb66de3 fix declaration of DbgQueryDebugFilterState()
svn path=/trunk/; revision=17377
2005-08-14 04:22:07 +00:00
Hartmut Birr
d92f1d2379 Added the lowercase files from r16249.
svn path=/branches/cache_manager_rewrite/; revision=17376
2005-08-14 01:30:15 +00:00
Hartmut Birr
eeef729ad2 Merged r16249 from trunk except the added lowercase files.
svn path=/branches/cache_manager_rewrite/; revision=17375
2005-08-14 01:12:56 +00:00
Hartmut Birr
ad58a21a17 Merged r15792:16248 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=17374
2005-08-13 23:59:17 +00:00
Martin Fuchs
db5b22a857 Project file maintainance
svn path=/trunk/; revision=17373
2005-08-13 17:29:38 +00:00
Martin Fuchs
cfccce8fda prepare for ANSI builds
svn path=/trunk/; revision=17372
2005-08-13 17:24:50 +00:00
Martin Fuchs
7121be53f2 Project file maintainance
svn path=/trunk/; revision=17371
2005-08-13 16:04:29 +00:00
Martin Fuchs
e2f582841b Winefile Makefile for pure MinGW
svn path=/trunk/; revision=17370
2005-08-13 16:04:08 +00:00
Martin Fuchs
5729cb615a remove special handling of previous MinGW versions
svn path=/trunk/; revision=17369
2005-08-13 13:21:27 +00:00
Emanuele Aliberti
33d084e118 Implement csrsrv!CsrSrvInitializeServerDll based on current code from CsrpInitWin32Csr (partial).
Note: it currently works only for servers with 1 ServerDll, because the entrypoint's name is a literal.

svn path=/trunk/; revision=17368
2005-08-13 13:21:28 +00:00
Royce Mitchell III
ecb6afadcc BCB tracing implementation
svn path=/trunk/; revision=17367
2005-08-13 13:16:16 +00:00
Royce Mitchell III
a2525f8275 function declaration to enable/disable BCB tracing
svn path=/trunk/; revision=17366
2005-08-13 13:13:05 +00:00
Royce Mitchell III
864eea72ca variable to enable per-BCB debugging
svn path=/trunk/; revision=17365
2005-08-13 13:11:59 +00:00
Emanuele Aliberti
ce468cd74a Conform to the new CSR_PROCESS and CSR_THREAD.
svn path=/trunk/; revision=17364
2005-08-13 12:46:37 +00:00
Emanuele Aliberti
f17be37700 Alex Ionescu: CSR_PROCESS and CSR_THREAD layout from WinDBG.
svn path=/trunk/; revision=17363
2005-08-13 12:45:33 +00:00
Emanuele Aliberti
430f07c8ca Begin making the 'posix' module conform to rbuild.
svn path=/trunk/; revision=17362
2005-08-13 12:35:00 +00:00
Emanuele Aliberti
4077565304 Minor changes.
svn path=/trunk/; revision=17361
2005-08-13 12:33:04 +00:00
Emanuele Aliberti
39fa853b50 Make 'rosapps' module build.
svn path=/trunk/; revision=17360
2005-08-13 12:25:16 +00:00
Magnus Olsen
821068b0c7 small clean up. remove double define of COPY_FILE_FAIL_IF_EXISTS and COPY_FILE_RESTARTABLE
svn path=/trunk/; revision=17359
2005-08-13 12:09:34 +00:00
Hartmut Birr
c2df09cd88 Fixed _WINBASE_/_WINBASE_H
svn path=/trunk/; revision=17358
2005-08-12 23:35:14 +00:00
Hartmut Birr
c99100eb75 MEMORY_AREA_PEB_OR_TEB must be handled like MEMORY_AREA_VIRTUAL_MEMORY.
svn path=/branches/cache_manager_rewrite/; revision=17357
2005-08-12 22:04:52 +00:00
Hartmut Birr
a50dddf24c Allocate the segments, page tables and the image section object from non paged pool.
svn path=/branches/cache_manager_rewrite/; revision=17356
2005-08-12 21:56:43 +00:00
Aleksey Bragin
81d3bd9f54 Correct include tree, fixing multiple defines.
svn path=/trunk/; revision=17355
2005-08-12 21:01:32 +00:00
Emanuele Aliberti
84217b8390 Correct version info.
svn path=/trunk/; revision=17354
2005-08-12 20:57:26 +00:00
Emanuele Aliberti
88a218b3f6 OS/2: more changes to make it conform to rbuild.
svn path=/trunk/; revision=17353
2005-08-12 20:55:07 +00:00
Aleksey Bragin
ebfff39168 Xbox hack added, so two exactly the same PCI devices (OHCI controllers) have different locations. Without it USB drivers won't work at all.
svn path=/trunk/; revision=17352
2005-08-12 20:29:01 +00:00
Aleksey Bragin
39007f77e2 Major additions to usb stack:
1) Improve hardware support in linux_wrapper
2) Add embedded drivers, register them in linux usb stack
3) Add working wrapper for keyboard and mouse devices - now if usbohci or uhci loads, it will be the first to create KeyboardClass0 and PointerClass0 devices, so PS/2 keyb/mouse won't work.
4) Added logic for registering miniport at port driver (like Windows' usb stack does)

Bad things:
1) "multithreading" is still done not the proper way, but ugly way
2) under xbox xpad doesn't work
3) it must be wasting lots of CPU power now, since hub thread doesn't block while waiting for events

svn path=/trunk/; revision=17351
2005-08-12 20:21:22 +00:00
Aleksey Bragin
c79bfba64d removed debug message about submitting urb
svn path=/trunk/; revision=17350
2005-08-12 20:11:56 +00:00
Aleksey Bragin
17cc83e8b5 USB keyboard and mouse "embedded" drivers from cromwell and linux 2.5.0 usb stack adapted to our stack.
svn path=/trunk/; revision=17349
2005-08-12 19:54:40 +00:00
Emanuele Aliberti
98051c3a59 OS/2: begin converting the subtree to rbuild.
svn path=/trunk/; revision=17348
2005-08-12 19:22:42 +00:00
Emanuele Aliberti
222891f5a8 Correct the version info.
svn path=/trunk/; revision=17347
2005-08-12 19:15:01 +00:00
Gé van Geldorp
a8308edaa4 Update status
svn path=/trunk/; revision=17345
2005-08-12 19:08:45 +00:00
Hervé Poussineau
e5b47d0df9 Implement SetupDiCallClassInstaller (still doesn't support custom class installers/co-installers)
Implement SetupDiGetDeviceInstallParamsA by calling SetupDiGetDeviceInstallParamsW. Add stub for SetupDiGetDeviceInstallParamsW
Basic implementation of SetupDiSelectBestCompatDrv (selects first driver of the list)
Add stubs for SetupDiInstallDriverFiles, SetupDiRegisterCoDeviceInstallers, SetupDiInstallDeviceInterfaces, SetupDiInstallDevice

svn path=/trunk/; revision=17344
2005-08-12 19:03:35 +00:00
Hervé Poussineau
905e145f73 Always set a valid class Guid in CreateDeviceInfoElement
Fix interfaces enumeration by not copying cbSize field (it should already be correct)

svn path=/trunk/; revision=17343
2005-08-12 19:00:04 +00:00
Gé van Geldorp
013ea78e1d Sync to Wine-20050725:
Thomas Weidenmueller <wine-patches@reactsoft.com>
- IsThemeDialogTextureEnabled should have one parameter to match the
  prototype in the official headers.
Mike McCormack <mike@codeweavers.com>
- gcc 4.0 -Wpointer-sign fixes (Reg* functions).
Stefan Huehner <stefan@huehner.org>
- Make some function static.
- Fix -Wmissing-declarations warnings.
Frank Richter <frank.richter@gmail.com>
- Enable/disable "flat menus" based on the setting from the active
  theme.
- Have the theme INI file parsed upon theme activation and not just when
  the first theme data is requested; that way, the themed system colors
  are set correctly from the start, and not just after some theme data
  was requested.
- GetThemeBackgroundContentRect() does not use the content margins
  alone, it also falls back to the border size or sizing margins, and if
  it can't find any possible margins at all, it returns the original
  rectangle.
- Make dialog theme texture setting non-global (ie a per-window
  setting).
- Better viewport origin in DrawThemeParentBackground().
- OpenThemeData() now always sets the window theme to the handle
  returned (even if that is NULL) - previously, it could happen that
  when no theme was active or the theme data could not be opened that
  the window theme remained became then-dangling (and hence subsequent
  calls to GetWindowTheme() would return that bogus theme).
- Correct border rectangle drawing.
- Don't crash if NULL is passed as the class list to OpenThemeData().
- UXTHEME_LoadImage(): Set default image count to 1 to avoid division by
  zero in case image count property is not given. Properly support 0
  state IDs.
- Every window needs to receive WM_THEMECHANGED (esp. controls), so also
  send it to child windows.
- Changed the default transparent color in case none was explicitly
  specified from the upper left pixel color to magenta. Empirically
  gives better results.
- Write WCHAR strings to registry with correct size.
- Opening some theme class data now also increases the reference count
  of the theme file, so as long as theme class data is still opened
  somewhere, the theme file won't get freed. Otherwise, it could happen
  that invalid class data was used, which could lead to problems.

svn path=/trunk/; revision=17342
2005-08-12 18:22:47 +00:00
Gé van Geldorp
dbd7ad25e3 Sync to Wine-20050725:
Felix Nawothnig <felix.nawothnig@t-online.de>
- Fix misuse of UrlCombineW.
Mike McCormack <mike@codeweavers.com>
- Fix -Wpointer-sign warnings.
Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
- URLMonikerImpl_BindToStorage: Don't use a HeapAllocated pointer for
  other purposes.
- URLMonikerImpl_BindToStorage: Escape special characters.
Jacek Caban <jack@itma.pwr.wroc.pl>
- Register protocols.
- Better module locking.
- Fix handling of pmkContext in CreateURLMoniker.

svn path=/trunk/; revision=17341
2005-08-12 18:17:37 +00:00
Gé van Geldorp
66359f3c63 Sync to Wine-20050725:
Francois Gouget <fgouget@free.fr>
- Assorted spelling fixes.
Mike McCormack <mike@codeweavers.com>
- gcc 4.0 -Wpointer-sign fixes (Reg* functions).

svn path=/trunk/; revision=17340
2005-08-12 18:09:06 +00:00
Gé van Geldorp
b063f039ec Sync to Wine-20050725:
Mike McCormack <mike@codeweavers.com>
- Interlocked LONG* gcc warning fixes.

svn path=/trunk/; revision=17339
2005-08-12 18:06:58 +00:00
Gé van Geldorp
9ba9b8ed9a Sync to Wine-20050725:
Michael Jung <mjung@iss.tu-darmstadt.de>
- Initial support for the IPersistFolder3 interface.
- Use CP_UNIXCP instead of CP_ACP when converting paths (Pointed out by
  Troy Rollo).
- Add file type column in detailed shell view.
- Make the order of shell view columns 'prefix-compatible' with
  shfldr_fs.
- Don't remove filename extensions for path pidls in GetDisplayNameOf.
- Do filename postprocessing in GetDisplayNameOf (Hide filename
  extensions if appropriate).
- Don't cache child pidls in UnixFolder, but create them on the fly.
- Don't use unix filesystem specific attributes in UnixFolder's pidls.
- Partially implemented UnixFolder's ISFHelper::CopyItems method.
- Return correct HRESULT code in UnixFolder's IEnumIDList::Next.
- Corresponding test.
- Release shell folders only if they were successfully acquired.
- Implemented UnixFolder's ISFHelper::DeleteItems interface.
- Fail in SHGetDataFromIDList when called on special folder.
- Return correct attributes in ParseDisplayName.
- Register unixfs at desktop level in DllRegisterServer.
- Fix two more corner cases in UNIXFS_get_unix_path and UNIXFS_path_to_pidl.
- If the unixfs is rooted at the Desktop folder, forward
  ParseDisplayName calls to it instead of to MyComputer.
- Only initialize shell folders via the IPersistFolder3 interface in
  SHELL32_CoCreateInitSF if the pidl which specifies the child is of
  type 'Folder'. Otherwise fall back to IPersistFolder.
- Append filename extension if necessary in IShellFolder::SetNameOf.
- Release parent shell folder in GetAttributesOf.
Francois Gouget <fgouget@free.fr>
- Assorted spelling fixes.
Robert Shearman <rob@codeweavers.com>
- Implement ShellDDEInit.
Michael Lin <mlin@corvu.com.au>
Michael Jung <mjung@iss.tu-darmstadt.de>
- Implemented UnixFolder's ISFHelper::AddFolder.
- ISFHelper interface support for UnixFolder (currently only stubs).
- Implemented UnixFolder's IShellFolder::SetNameOf.
Vincent Béron <vberon@mecano.gme.usherb.ca>
- Remove multiple declarations of the same function, keeping the public
  one as reference.
Mike McCormack <mike@codeweavers.com>
- gcc 4.0 -Wpointer-sign fixes (Reg* functions).
- -Wpointer-sign fixes.
Troy Rollo <wine@troy.rollo.name>
- Return attributes for the correct file in the unixfs ParseDisplayName.
- When using PATHMODE_UNIX, all files are in the file system.
Marcelo Duarte <marcelotduarte@gmail.com>
- Update shell32 resources for Portuguese.
Detlef Riekenberg <wine.dev@web.de>
- Printers_RegisterWindowW / Printers_UnregisterWindow implemented as
  stub.
- Show the FIXME in Printer_LoadIconsW only when needed.
- Printer_LoadIconsW: implemented minimal version.

svn path=/trunk/; revision=17338
2005-08-12 18:04:51 +00:00
Gé van Geldorp
95a149a8df Sync to Wine-20050725:
Francois Gouget <fgouget@free.fr>
- Fix the NdrVaryingArrayUnmarshall prototype (reported by
  winapi_check).
- Assorted spelling fixes.
Robert Shearman <rob@codeweavers.com>
- Add stubs for most of the NDR marshaling functions.
- IRpcStubBuffer_Disconnect can be called more than once.
Mike McCormack <mike@codeweavers.com>
- Interlocked LONG* gcc warning fixes.
Stefan Huehner <stefan@huehner.org>
- Fix -Wmissing-declarations warnings.
- Fix some missing-declarations warnings.

svn path=/trunk/; revision=17337
2005-08-12 17:50:33 +00:00
Emanuele Aliberti
8df355e8a6 XML chunks are required to contain a single node.
svn path=/trunk/; revision=17336
2005-08-12 17:43:23 +00:00
Gé van Geldorp
6dd32969d0 Sync to Wine-20050725:
Phil Krylov <phil@newstar.rinet.ru>
- Added some useful TRACEs.
- Allow NULL parameter for WM_SETTEXT in RichEdit.
- Implemented EM_LINELENGTH RichEdit message.
- Fixed EM_LINEINDEX handler and added EM_LINEFROMCHAR handler.
- Implemented EM_EXLINEFROMCHAR, EM_LINEINDEX, EM_FINDTEXT,
  EM_FINDTEXTW, EM_FINDTEXTEX, and EM_FINDTEXTEXW messages.
- Fixed a comment about EM_STREAMIN.
- Implemented EM_GETLINECOUNT RichEdit message.
- Fixed EM_GETCHARFORMAT for selection containing a single character.
- Fixed an off-by-one error in EM_GETLINECOUNT handler.
- Fixed an off-by-one error in EM_STREAMOUT handler for non-Unicode
  plain text output.
- Fixed another couple of EM_STREAMOUT bugs.
- Removed junk from UTF-8 RTF output.
- Added emulation of RichEdit 1.0 behaviour when the 1.0 window class is
  being used. This emulation (introduced in M$ RichEdit 3.0) counts
  paragraph endings as 2 characters (CR+LF) instead of 1 (CR).
- Added EM_GETZOOM and EM_SETZOOM RichEdit message handlers.
- Added some missing but useful items to the TODO list.
Felix Nawothnig <felix.nawothnig@t-online.de>
- Check structure size and fix return values in EM_GETCHARFORMAT.
Aric Stewart <aric@codeweavers.com>
- Implementation for EM_GETTEXTEX.
Daniel Remenak <dtremenak@gmail.com>
- Basic handling of EM_SETTEXTEX.
Stefan Huehner <stefan@huehner.org>
- Make functions static to fix -Wmissing-declarations warnings.
- Change some char* to const char* to fix warnigns.
- Make some function static.
- Fix -Wmissing-declarations warnings.

svn path=/trunk/; revision=17335
2005-08-12 17:41:40 +00:00
Gé van Geldorp
e97f6fb328 Sync to Wine-20050725:
Mike McCormack <mike@codeweavers.com>
- gcc 4.0 -Wpointer-sign fixes (Reg* functions).

svn path=/trunk/; revision=17334
2005-08-12 17:34:06 +00:00
Gé van Geldorp
a48a2273ec Sync to Wine-20050725:
Huw Davies <huw@codeweavers.com> for Mandriva
- Cope with the index in a import table entry being a typeinfo index
  rather than a guid offset.
Robert Shearman <rob@codeweavers.com>
- Document active object and variant functions.
- Rename OLEAUT32_Dll* Functions to Dll*.
- IRpcStubBuffer_Disconnect can be called multiple times.
- Release TypeLib when freeing stub buffer.
- Fix confusion between number of characters and number of bytes in
  unmarshaling BSTRs. Convert it all to characters for consistency with
  the BSTR_User* routines.
- Marshal and unmarshal TKIND_ENUM and TKIND_ALIAS.
- Fix VT_BYREF|VT_UNKNOWN return values by comparing the correct value
  with VT_UNKNOWN and VT_DISPATCH.
- Better tracing.
- Return DISP_E_EXCEPTION from ITypeInfo_Invoke on an error in the
  called function.
- Remove RegisterTypeLib hack.
- Support VT_BYREF|VT_I4 in _copy_arg.
- Activate ITypeLib, ITypeInfo and IEnumVARIANT Marshalers.
Alex Villacis Lasso <a_villacis@palosanto.com>
- Fix GIF palette allocation, by relying on ColorCount instead of
  SColorResolution.
- Ensure that underflowing negative float is represented as a positive
  0, just as native oleaut32.
Alexandre Julliard <julliard@winehq.org>
- Get rid of cursoricon.h.
Mike McCormack <mike@codeweavers.com>
- gcc 4.0 -Wpointer-sign fixes (Reg* functions).
- Interlocked LONG* gcc warning fixes.
Stefan Huehner <stefan@huehner.org>
- Fix some more -Wmissing-declarations warnings.
Robert Shearman <rob@codeweavers.com> for Mandriva
- Add a generic TYPEDESC VT to VARIANT VT mapper so we can use the
  standard Variant* routines. Use this new function to properly copy &
  de-reference the return value.
- Conversions between variants types of the same size should ignore
  overflows.
- Tests for this behaviour.

svn path=/trunk/; revision=17333
2005-08-12 17:30:09 +00:00
Gé van Geldorp
7835b350bb Sync to Wine-20050725:
Robert Shearman <rob@codeweavers.com>
- Marshal return value from IRemUnknown_RemQueryInterface.
- We should be starting with 1 reference.
- IRpcStubBuffer_Disconnect can be called more than once.
- Silence now noisy error messages caused by changes in the way we call
  ipid_to_stubmanager. Move the error message to the one place it is
  needed.
- By-pass the RPC runtime if possible when calling an STA by posting a
  message directly to the apartment window for it to process. Fixes a
  deadlock in InstallShield caused by having to create a thread when
  freeing an object that comes from an STA apartment. Added tests that
  fail without this fix.
- Hack around broken state management so InstallShield works.
- Delete the stub manager outside of the apartment critical section
  because the deletion may require the object to re-enter the
  apartment.
- Always query for the correct stub interface, otherwise we will be
  pointing to the completely wrong object when a proxy does a
  queryinterface.
- Remove assumption that the stub buffer will handle the lifetime of
  the object.
Alex Villacis Lasso <a_villacis@palosanto.com>
- Initialize RegisteredClass properly in CoRegisterClassObject to
  prevent crash in CoRevokeClassObject when accessing (uninitialized)
  pMarshalledData.
Mike McCormack <mike@codeweavers.com>
- Fix gcc 4.0 -Wpointer-sign warnings.
Vitaly Lipatov <lav@etersoft.ru>
- Added some documentation.
Stefan Huehner <stefan@huehner.org>
- Fix some missing-declarations warnings.
Marcus Meissner <meissner@suse.de>
- 16bit interfaces are cdecl, so drop the WINAPI.
- 16bit COM interfaces are cdecl, not WINAPI.
- OleInitializeWOW gets 2 arguments.
- Added OleSetMenuDescriptor16 stub.
Marcus Meissner <marcus@jet.franken.de>
- Implemented IsValidInterface16, CoMemAlloc.
  Added debug to HGLOBALLockBytes16_QueryInterface.

svn path=/trunk/; revision=17332
2005-08-12 17:19:46 +00:00
Gé van Geldorp
5b9aceccd3 Sync to Wine-20050725:
Robert Shearman <rob@codeweavers.com>
- In MsiLocateComponent pcchBuf can be NULL so don't try to dereference
  it.
Alexandre Julliard <julliard@winehq.org>
- Use the official names for the Unicode string constants.
Aric Stewart <aric@codeweavers.com>
- Implement MsiGetLanguage.
- Relocate the msi file to prevent cd locking, corrected to properly not
  try to relocated #nnnn handles as files.
- Use the SourceList functions to get the source path in
  ConfigureProductExW.
- Handle installs off multiple volumes and properly pull the prompt
  string from the error table.
- If MsiGetProperty(A/W) is called with a NULL for the value buffer but
  a value in the size for the value buffer, then Msi fills in the size
  of the value into the pointer for size.  This is tested and confirmed
  with native MSI.
- Bail out if the reg key is empty. This prevents us from writing
  garbage to the property table.
- Properly resize the buffer based on ERROR_MORE_DATA.
  Also remember to free the allocated buffer.
- Further testing shows that when CustomActionData needs to be blank it
  is an empty string not ' '.
- Correct an error where I was not properly advancing a pointer.
- Add source.c to start handling the various MsiSourceList apis used in
  v3 of MSI, and now internally.
- Update files.c to use the MsiSourceList apis to make sure our
  SourceList keys in the registry are included and correct.
- Use the strings defined in msi.h.
- Use SOURCEDIR instead of PackagePath. Because the PackagePath may be
  local, while SOURCEDIR is more proper and will be a full directory.
- InstallShield does a number of actions using DoAction before the
  Install starts so the PackageCode needs to be loaded on OpenPackage
  instead of the beginning of the install process.
- When working toward install on demand support we need to reset all the
  constant values so that multiple install process do not get confused
  by leftover values from the previous install.
- Fill and use the ProductCode part of the MSIPACKAGE structure.
- Add the string constants located in msi.h and make use of them in
  files.c and source.c.
- Keep track of what sequence we are in and register unique
  actions. This allows us to make sure actions and custom actions
  flagged to run only once, actually run only once.
- Also clean up some of the numeric constants in custom.c using the
  defined values from msidefs.h.
Mike McCormack <mike@codeweavers.com>
- gcc 4.0 -Wpointer-sign fixes.
- Display icons in buttons that have them.
- Use LoadImage to load bitmaps and icons.
- Set the initial focus on the control specified by Control_First in the
  Dialog table.
- Move to the next mask edit field when the current one becomes full.
- Make the tab order in msi dialogs right.
- Don't crash when cancelling out of a modeless dialog.
- Stop the install when cancelling from a modeless dialog.

svn path=/trunk/; revision=17331
2005-08-12 17:07:28 +00:00
Gé van Geldorp
caa4e5c6ee Sync to Wine-20050725:
Mike McCormack <mike@codeweavers.com>
- gcc 4.0 -Wpointer-sign fixes (Reg* functions).

svn path=/trunk/; revision=17330
2005-08-12 16:59:41 +00:00
Royce Mitchell III
32ca0b0274 check for failure of vfatAttachFCBToFileObject() during file creation
svn path=/trunk/; revision=17328
2005-08-12 16:49:04 +00:00
Gé van Geldorp
25afeebf54 Sync to Wine-20050725:
Huw Davies <huw@codeweavers.com>
- Add English neutral version of IDS_COLOR_GRAY.
Eugeny Gorelov <tft@etersoft.ru>
- Implement most functionality of PageSetupDlg function.
Michael Jung <mjung@iss.tu-darmstadt.de>
- Don't expand MyComputer in the file dialogs without user interaction,
  if unixfs is rooted at desktop.
Henning Gerhardt <henning.gerhardt@web.de>
- Update German resource files.
Vincent Beron <vberon@mecano.gme.usherb.ca>
- Remove multiple declarations of the same function, keeping the public
  one as reference.
Mike McCormack <mike@codeweavers.com>
- gcc 4.0 -Wpointer-sign fixes.
- Fix declarations.

svn path=/trunk/; revision=17327
2005-08-12 16:47:29 +00:00
Gé van Geldorp
e98f97ee9f Sync to Wine-20050725:
Vitaliy Margolen <wine-patch@kievinfo.com>
- Send CDDS_ITEMPOSTERASE | CDDS_PREPAINT notify.
Felix Nawothnig <felix.nawothnig@t-online.de>
- Move DPA and DSA functions out of comctl32undoc.c as they are
  documented by now.
- Fix some DPA functions so they pass the new tests.
- Don't invalidate the whole propsheet when the page is switched.
Dimi Paun <dimi@lattica.com>
- Silence uninitialized warnings.
Robert Shearman <rob@codeweavers.com>
- Call SetBkMode with the correct value from the NMTBCUSTOMDRAW
  structure.
- Don't fill the NMTBCUSTOMDRAW structure in again for
  CDDS_POSTPAINT.
- Remove redundant bBtnTransprnt value.
- Height is now calculated based on the number of rows, not on the
  bounding rect.
- Only call CalcToolbar in AutoSize if it has TBSTYLE_WRAPABLE or
  TBSTYLE_EX_UNDOC1 set.
- Remove a bad test in SetButtonWidth that fixes a regression from the
  above change in IE.
- Remove unnecessary nHeight data.
- Remove duplicated code in Size by calling AutoSize.
- Remove unnecessary bAutoSize value because SetWindowPos doesn't
  generate WM_SIZE when there is nothing to do on both Windows and
  Wine.
- TBSTATE_INDETERMINATE only takes effect if the button is enabled,
  otherwise it should just appear like any other disabled button.
- Native autosizes on inserting/adding buttons, so we should too.
- The IsValidImageList test is not needed because if it isn't a valid
  image list we will have set the bitmap width and height to 1 and it
  does the wrong thing when no buttons are present.
- The calculated button height should include the text height when no
  buttons are present.
- Handle CopyImage and other functions failing by not adding the icon
  and notifying the caller.
Thomas Weidenmueller <wine-patches@reactsoft.com>
- Support PSH_WIZARDHASFINISH in wizards.
- Correct tab order of the wizard buttons.
- Support PSM_IDTOINDEX.
Aric Stewart <aric@codeweavers.com>
- When adding an image copy the full previous buffer.
- Implement replacing an icon with one from a resource.
Kevin Koltzau <kevin@plop.org>
- Forward some header notifications to parent of listview.
Frank Richter <frank.richter@gmail.com>
- Enabled "tab" dialog texture for property sheet pages.
- Add theming support for header controls.
- Use theming for the ListView non-client area.
- Let property sheets update the cached system colors upon receiving
  WM_SYSCOLORCHANGE.
- Add theming for the up/down control.

svn path=/trunk/; revision=17326
2005-08-12 16:31:56 +00:00
Emanuele Aliberti
420b109b72 Make the 'rosky' optional module compile.
svn path=/trunk/; revision=17325
2005-08-12 13:46:36 +00:00
Emanuele Aliberti
d12532191d Add 'rosky' module.
svn path=/trunk/; revision=17324
2005-08-12 12:31:33 +00:00
Emanuele Aliberti
6d095fd4bb CSR Reloaded... well, split.
- almost do-nothing base source code for new CSR server DLLs host
- base source code for the core CSR server DLL 'csrsrv.dll' (server 0)
- base source code for the base WIN server DLL 'basesrv.dll' (server 1)
- base source code for the console+user WIN server DLL 'winsrv.dll' (servers 3 and 2)


NOTES
- At present, nothing works, but compilation is OK, sorry.
- The program is temporarily named 'csr.exe' to coexist with current monolithic 'csrss.exe'.
- Code, hints, suggestions, and migration plans welcome! (post 0.3)

svn path=/trunk/; revision=17323
2005-08-12 12:22:02 +00:00
Hartmut Birr
65c59875e1 Set the process exit status.
svn path=/trunk/; revision=17322
2005-08-12 12:10:33 +00:00
Hartmut Birr
ed43d4bddd Fixed compilation.
svn path=/trunk/; revision=17321
2005-08-11 21:56:28 +00:00
Emanuele Aliberti
af7edaaf75 Minor changes to some API signatures.
svn path=/trunk/; revision=17320
2005-08-11 21:46:37 +00:00
Hervé Poussineau
0c6db72406 Input parameter in FSCTL_GET_RETRIEVAL_POINTERS is really a STARTING_VCN_INPUT_BUFFER structure (even if it contains only a LARGE_INTEGER)
svn path=/trunk/; revision=17319
2005-08-11 21:29:37 +00:00
Hervé Poussineau
733f1ba80d BYTE -> UCHAR. Thanks Alex
svn path=/trunk/; revision=17318
2005-08-11 21:25:28 +00:00
Hervé Poussineau
b8cfafc6b8 Add STARTING_LCN_INPUT_BUFFER and VOLUME_BITMAP_BUFFER structures
Remove #pragma pack/pop around RETRIEVAL_POINTERS_BUFFER as it should be standard-packed according to Alex.

svn path=/trunk/; revision=17317
2005-08-11 21:20:42 +00:00
Gé van Geldorp
67b5536716 Revert last Wine sync to pidl.c, since it breaks SHGetPathFromIDListW. Fixes
bug 697

svn path=/trunk/; revision=17316
2005-08-11 21:09:56 +00:00
Filip Navara
2967654c88 Implement NdisAllocatePacketPool by calling NdisAllocatePacketPoolEx.
svn path=/trunk/; revision=17315
2005-08-11 20:48:55 +00:00
Hartmut Birr
6e338ed990 Replaced _WINBASE_ by _WINBASE_H because some headers depends on _WINBASE_H.
svn path=/trunk/; revision=17314
2005-08-11 20:48:55 +00:00
Eric Kohl
7b869f437f The RpcFinally block must always be executed. Otherwise, RPC code will leak allocated buffer memory.
svn path=/trunk/; revision=17313
2005-08-11 20:45:41 +00:00
Hartmut Birr
e9beb0d3eb Moved the pragma to the correct position.
svn path=/trunk/; revision=17312
2005-08-11 20:44:04 +00:00
Emanuele Aliberti
3119900771 A more likely demo VMS server (it should not block, because it is chain-called from the listenig thread in csrsrv.dll.
svn path=/trunk/; revision=17311
2005-08-11 20:43:24 +00:00
Hartmut Birr
749cee8834 Use GetLocalTime instead of GetSystemTime.
svn path=/trunk/; revision=17310
2005-08-11 20:41:20 +00:00
Hartmut Birr
f17e695843 Don't query on batch files.
svn path=/trunk/; revision=17309
2005-08-11 20:39:28 +00:00
Hartmut Birr
d921a7ca15 Clear the memory after we know that the buffer was allocated.
svn path=/trunk/; revision=17308
2005-08-11 20:37:09 +00:00
Hartmut Birr
20731f1883 - Implemented MEMORY_AREA_PEB_OR_TEB and MEMORY_AREA_PAGED_POOL for MiQueryVirtualMemory.
- Fixed the range check in ProbeForRead and ProbeForWrite.

svn path=/trunk/; revision=17307
2005-08-11 20:35:00 +00:00
Hartmut Birr
b4315630d7 - Removed the hole pool allocation, because it needs to much memory and ros will not boot.
- Allocate short blocks in one page.  
- Split the used and free header. It makes it easier to implement a red zone check.

svn path=/trunk/; revision=17306
2005-08-11 20:29:08 +00:00
Hartmut Birr
bae5d406c1 Fixed a debug message.
svn path=/trunk/; revision=17305
2005-08-11 20:23:13 +00:00
Hartmut Birr
312f880b0f Reenabled a debug message.
svn path=/trunk/; revision=17304
2005-08-11 20:18:24 +00:00
Hartmut Birr
2d99925f41 Implemented (copied from NdisAllocatePacketPool) NdisAllocatePacketPoolEx.
svn path=/trunk/; revision=17303
2005-08-11 20:16:03 +00:00
Hervé Poussineau
41890ed14b Remove debug output and some useless code
Replace false by FALSE

svn path=/trunk/; revision=17302
2005-08-11 20:13:26 +00:00
Hervé Poussineau
d240d7dec7 Add DIF_* codes 40 to 42.
Reformat the whole list to align values

svn path=/trunk/; revision=17301
2005-08-11 20:13:16 +00:00
Hervé Poussineau
42551c5494 Move usb controllers and cdrom classes parameters to their own .inf files. They would be regenerated during 2nd stage setup
Fix a typo in mouse.inf

svn path=/trunk/; revision=17300
2005-08-11 20:13:06 +00:00
Hartmut Birr
ad52723693 Initialized the cnt value of the file structure.
svn path=/trunk/; revision=17299
2005-08-11 19:52:33 +00:00
Hartmut Birr
dbabadad17 Defined DbgPrint.
svn path=/trunk/; revision=17298
2005-08-11 19:49:47 +00:00
Hartmut Birr
b393d573db Fixed the loading of the global flag.
svn path=/trunk/; revision=17297
2005-08-11 19:46:39 +00:00
Hartmut Birr
8b3fa3e5d1 - Open the BaseNamedObjects directory case insensitive.
- Interpret INVALID_HANDLE_VALUE for the console handle as NULL.

svn path=/trunk/; revision=17296
2005-08-11 19:44:36 +00:00
Hartmut Birr
52f95df613 Honour the inheritance of a handle if it would be duplicated or opened.
svn path=/trunk/; revision=17295
2005-08-11 19:37:29 +00:00
Hartmut Birr
7faccfa7bb Call the registered exit functions if the dll is unloaded.
svn path=/trunk/; revision=17294
2005-08-11 19:32:02 +00:00
Hartmut Birr
d85fe524ac Fixed some problems if special parameters are delivered like SL_RESTART_SCAN, SL_INDEX_SPECIFIED or SL_RETURN_SINGLE_ENTRY.
svn path=/trunk/; revision=17293
2005-08-11 19:11:17 +00:00
Hartmut Birr
2acde8450d Implemented IRP_MJ_QUERY_VOLUME_INFORMATION/FileFsDeviceInformation. Msvcrt needs to detect the device type.
svn path=/trunk/; revision=17292
2005-08-11 19:07:11 +00:00
Hartmut Birr
77b9c0a70d Reimplemented FindFirstFileEx and removed some overhead.
svn path=/trunk/; revision=17291
2005-08-11 19:02:31 +00:00
Gé van Geldorp
9bfc144257 Sync to Wine-20050725:
Francois Gouget <fgouget@free.fr>
- Assorted spelling fixes.
Gerold Jens Wucherpfennig <gjwucherpfennig@gmx.net>
- Support for big-endian systems.
- The fci_get_little_endian... and fci_set_little_endian... functions
  don't really set and unset little endianes, they do the same thing:
  merely swapping bytes from one endianes to the other.
Stefan Huehner <stefan@huehner.org>
- Make some function static.
- Fix some more -Wmissing-declarations warnings.

svn path=/trunk/; revision=17290
2005-08-11 18:49:40 +00:00
Casper Hornstrup
fbdd1961c7 Ignore .svn folders
svn path=/trunk/; revision=17289
2005-08-11 17:41:30 +00:00
Steven Edwards
6887acc456 remove ros specific functions from public header
svn path=/trunk/; revision=17288
2005-08-11 17:27:13 +00:00
Andrew Munger
c247f5f8b2 Added TimeOut to the correct section, removed ion's 12148 incorrect addition. 10 second default.
svn path=/trunk/; revision=17287
2005-08-11 15:55:25 +00:00
Gé van Geldorp
9664020ca4 Alexandre Julliard <julliard@winehq.org>
- Added support for HTML resource type.
Mike McCormack <mike@codeweavers.com>
- gcc 4.0 -Wpointer-sign fixes.
Stefan Huehner <stefan@huehner.org>
- Fix some -Wsign-compare warnings.
Jacek Caban <jack@itma.pwr.wroc.pl>
- '.' is a valid char of tIDENT.
Marcus Meissner <marcus@jet.franken.de>
- Fixed signedness warnings.

svn path=/trunk/; revision=17286
2005-08-11 15:10:01 +00:00
Emanuele Aliberti
f5a7132861 Cleanup.
svn path=/trunk/; revision=17285
2005-08-11 12:23:51 +00:00
Emanuele Aliberti
26fc2d0d62 VMS: use csrsrv!CsrAddStaticServerThread to hook the listening port.
svn path=/trunk/; revision=17284
2005-08-11 11:52:40 +00:00
Emanuele Aliberti
d008d6c377 Modify CsrAddStaticServerThread signature.
svn path=/trunk/; revision=17283
2005-08-11 11:49:36 +00:00
Emanuele Aliberti
0a7659bfce Fix HEAD compilation.
LPC_MESSAGE.DataSize ==> PORT_MESSAGE.u1.s1.DataLength
LPC_MESSAGE.MessageSize ==> PORT.u1.s1.TotalLength

svn path=/trunk/; revision=17282
2005-08-11 09:19:10 +00:00
Emanuele Aliberti
f83c14b3fc Emit Win32 error messages on failure.
svn path=/trunk/; revision=17281
2005-08-11 09:07:48 +00:00
Emanuele Aliberti
97ffde7504 LPC_MESSAGE.MessageType ==> PORT_MESSAGE.u2.s2.Type
Make head copmpile.

svn path=/trunk/; revision=17280
2005-08-11 09:01:30 +00:00
Emanuele Aliberti
2b0800d266 First attempt to convert the VMS demo server.
Note: it does NOT work.

svn path=/trunk/; revision=17279
2005-08-11 08:46:57 +00:00
Emanuele Aliberti
e1b5e79e30 Some guessing on the API used by server DLLs.
svn path=/trunk/; revision=17278
2005-08-11 07:13:03 +00:00
Alex Ionescu
bd3f2eea3c - Use correct, documented, LPC Message structures (PORT_VIEW, REMOTE_PORT_VIEW). Fix all caller code to use new member names and structure names.
svn path=/trunk/; revision=17277
2005-08-11 03:23:44 +00:00
Steven Edwards
c5785454c2 TrackMoveEvent is a semi-implemented not UNIMPLEMENTED. Shut it up.
svn path=/trunk/; revision=17276
2005-08-11 03:15:17 +00:00
Alex Ionescu
479fa4e4ae - Use correct, documented, LPC Message structure (PORT_MESSAGE). Fix all caller code to use new member names and structure names.
svn path=/trunk/; revision=17275
2005-08-11 02:58:54 +00:00
Royce Mitchell III
eb742a2d70 initialize StringBuffer to NULL, as some code paths lead to it being tested without ever being set.
svn path=/trunk/; revision=17274
2005-08-11 02:51:51 +00:00
Alex Ionescu
f9b3f28fbe Move doc folder to media
svn path=/trunk/; revision=17273
2005-08-11 01:18:22 +00:00
Alex Ionescu
be97362b23 - Fix DEVICE_NODE definition to remove ROS-only fields
- Move RTL_HEAP_PARAMETERS to umtypes.h
- Fix PROCESS_PRIORITY_CLASS_XXX definitions.
- Use PROCESS_PRIORITY_CLASS_INVALID in process creation code.
- Move and correct EX_PUSH_LOCK definition to ntifs.h
- Define KQUEUE along with KAPC_STATE if ntifs.h is not used, so that we don't force its usage
- Enable usage of EX_QUEUE_WORKER_INFO and EX_WORK_QUEUE without requiring the IFS.
- Fix definition of CsrClientConnectToServer
- Update NDK FIXME list
- Define and use a list of Bus Type GUIDs instead of saving the GUID in a ROS-only field of DEVICE_NODE.
- Use a IRP_MN_QUERY_CAPABILITIES PnP IRP to get the Address of a DeviceNode, intead of saving it inside a ROS-only field.

svn path=/trunk/; revision=17272
2005-08-11 00:01:17 +00:00
Gé van Geldorp
4a6a9d5dd2 Phil Krylov <phil@newstar.rinet.ru>
- Fixed winebuild operation in Darwin.
Steve Zellers <zellers@mac.com>
- Fixed leftover import table name in output_import_thunk.
Alexandre Julliard <julliard@winehq.org>
- Replace configure macros by explicit platform checks (probably not
  correct on all platforms yet).
- Moved most of the implementation of CALL32_CBClient(Ex) to the C
  code.
- Don't use the full 32 bits of %esp when called from 16-bit code.
- Added a --target option to allow cross-compilation.
- Improve a bit the assembly generated for import thunks.
- Don't depend on ELF features for PIC code.
- A couple of optimizations.
- Intercept functions for 16-bit relay debugging by patching the
  CALLFROM16 table instead of having the wine_call_from_16 functions
  call out the relay functions explicitly.
- Added vararg argument type so that the relay code can distinguish from
  a normal cdecl function.
- Don't rely on the relay thunk preserving the stack pointer.
- Moved all 16-bit relay code to the text section.
- Changed a few symbol names for better consistency.
- Get rid of the global debugging flag.
Mike McCormack <mike@codeweavers.com>
- gcc 4.0 -Wpointer-sign fixes.
Marcus Meissner <marcus@jet.franken.de>
- Fixed signedness warnings.

svn path=/trunk/; revision=17271
2005-08-10 22:15:12 +00:00
Emanuele Aliberti
455ce26dde Minor change in two strings.
svn path=/trunk/; revision=17270
2005-08-10 21:09:05 +00:00
Steven Edwards
e6c6ee13be enable building shell32_test. some header fixes
svn path=/trunk/; revision=17269
2005-08-10 20:58:29 +00:00
Steven Edwards
877dc5eaf7 added shell32 tests. Not enabled just yet
svn path=/trunk/; revision=17268
2005-08-10 20:35:15 +00:00
Gunnar Dalsnes
be6f8b5112 move WM_SYSTIMER where it belongs
svn path=/trunk/; revision=17265
2005-08-10 19:19:13 +00:00
Gunnar Dalsnes
da39d77ab9 add missing define
svn path=/trunk/; revision=17264
2005-08-10 18:42:27 +00:00
Magnus Olsen
22e4c47f94 Windows 2000 does not always zerofill data if you are using heap_zero fill. to be 100% sure everything are zero fill, we need zerofil the whole object before instate
svn path=/trunk/; revision=17263
2005-08-10 18:10:45 +00:00
Gunnar Dalsnes
16b5d11ec3 move W32PROCESS/W32THREAD into win32\include bcause they are win32k private structs
svn path=/trunk/; revision=17262
2005-08-10 18:09:44 +00:00
Hartmut Birr
daa17455d6 Fixed the base detection in RtlUnicodeStringToInteger again.
svn path=/trunk/; revision=17261
2005-08-10 17:49:57 +00:00
Gunnar Dalsnes
09b2e7c1fc fix horribly broken ftol. this fixes abiword 2.0.3
svn path=/trunk/; revision=17260
2005-08-10 17:48:13 +00:00
Royce Mitchell III
62457a811e registry entries to install .inf files. No clue if this is correct.
svn path=/trunk/; revision=17259
2005-08-10 17:19:13 +00:00
Aleksey Bragin
e7956d8d90 Fixed a typo. According to the url pointed out by Royce3, it's right ( http://www.osronline.com/lists_archive/ntdev/thread1866.html)
svn path=/trunk/; revision=17258
2005-08-10 16:33:49 +00:00
Hartmut Birr
aa33dda36b Fixed the base detection in RtlUnicodeStringToInteger.
svn path=/trunk/; revision=17257
2005-08-10 11:45:50 +00:00
Emanuele Aliberti
c04cc0cebf Alex Ionescu: more details about the CSR core protocol.
svn path=/trunk/; revision=17256
2005-08-10 09:09:28 +00:00
Emanuele Aliberti
a0dd7af2e4 Change the demo VMS subsystem definition.
svn path=/trunk/; revision=17255
2005-08-10 08:36:37 +00:00
Emanuele Aliberti
8236221006 Some new internal headers (draft) to be used in the planned CSR/WIN split subsystem server.
svn path=/trunk/; revision=17254
2005-08-10 08:28:08 +00:00
Steven Edwards
b5fe5d7dcb another shot at fixing writes
svn path=/trunk/; revision=17253
2005-08-10 03:59:01 +00:00
Royce Mitchell III
49844139cc fix typo
svn path=/trunk/; revision=17252
2005-08-10 03:32:15 +00:00
Hervé Poussineau
ce28abcbca Active functions related to interfaces enumeration: SETUP_CreateSerialDeviceList, SETUP_CreateInterfaceList, SetupDiGetDeviceInterfaceDetailW. They were disabled since r17210
Replace ERROR_NO_SYSTEM_RESOURCES by ERROR_NOT_ENOUGH_MEMORY
Replace #ifdef __WINESRC__ by #ifndef __REACTOS__, as ReactOS also defines __WINESRC__
Minor fixes

svn path=/trunk/; revision=17251
2005-08-09 20:12:35 +00:00
Magnus Olsen
7217d69487 Thx harmut you did see the small bug, I miss, do not use MAX_PATH as lenght of command line, it must be CMDLINE_LENGTH instead, patch by Brandon Turner
svn path=/trunk/; revision=17250
2005-08-09 19:52:16 +00:00
Hartmut Birr
f52a064741 Silence a debug message.
svn path=/trunk/; revision=17249
2005-08-09 19:35:07 +00:00
Hartmut Birr
19f47fc57c If the file object is for a device, we must gather some information
from the object attribute (at least the OBJ_INHERIT flag). We cannot 
use IoCreateStreamFileObject because a handle from such a file object 
is never inheritable.

svn path=/trunk/; revision=17248
2005-08-09 19:12:46 +00:00
Maarten Bosma
2afd140d2a Full some additional Structs
svn path=/trunk/; revision=17247
2005-08-09 19:11:57 +00:00
Steven Edwards
296b3402ac implemented ?name@type_info@@QBEPBDXZ.msvcr and __unDName based on code from Wine
svn path=/trunk/; revision=17246
2005-08-09 17:55:47 +00:00
Gunnar Dalsnes
22ad71c0a6 return timer id for windowed timers also
svn path=/trunk/; revision=17245
2005-08-09 16:15:52 +00:00
Hervé Poussineau
ac5643191a Implement SetupDiGetSelectedDriverW/SetupDiSetSelectedDriverW
Define rank of a driver as in MSDN description
Fix comments in Flags/FlagsEx description
Factorise DeviceInfoElement structure creation in CreateDeviceInfoElement().

svn path=/trunk/; revision=17244
2005-08-09 16:13:50 +00:00
Hartmut Birr
1f19cd831e Update KeActiveProcessors if an application processor does start.
svn path=/trunk/; revision=17243
2005-08-09 16:08:00 +00:00
Emanuele Aliberti
58c487c4c3 Minor change.
svn path=/trunk/; revision=17242
2005-08-09 16:01:42 +00:00
Hartmut Birr
0d961d4d80 - Don't try to close the thread handle twice.
- Close the process handle on exit for _P_OVERLAY.

svn path=/trunk/; revision=17241
2005-08-09 15:47:14 +00:00
Hartmut Birr
fa6916cb11 - Don't try to free the returned buffer from getenv.
- Split the path correctly from shell command.

svn path=/trunk/; revision=17240
2005-08-09 15:44:54 +00:00
Hartmut Birr
b4c4fdb519 Don't use the required access rights for the object attributes.
svn path=/trunk/; revision=17239
2005-08-09 15:41:10 +00:00
Maarten Bosma
225642a5f6 Add second call to DdQueryDirectDrawObject.
svn path=/trunk/; revision=17238
2005-08-09 13:57:03 +00:00
Magnus Olsen
c2fcc4a380 fix a minor bug, for bad writen driver. some drv checking for two DDRAWI_DDRAWSURFACE_LCL array instead for one. But it is not the bug
svn path=/trunk/; revision=17237
2005-08-09 11:18:48 +00:00
Alex Ionescu
1d1e963067 Return failure if native function failed. one more test passes
svn path=/trunk/; revision=17236
2005-08-09 08:54:56 +00:00
Alex Ionescu
61ffdb3516 - Last patch was incomplete, apologies. SVN @ 5AM = bad idea.
- Do not report that ROS is running on 0 active processors, that's a bad idea.
- Actually check the affinity mask set by NtSetInformationThread
- Fix the check in KeSetAffinityThread
- Give a valid affinity to the system thread (corresponding to the active cpu affinity set).

This removes all bugchecks from the kernel32 thread winetest.

svn path=/trunk/; revision=17235
2005-08-09 08:50:57 +00:00
Alex Ionescu
6fd4c50fd3 Fix priority formulas, account for saturation, do proper km_um conversions for out of bounds or saturation priorirites, create an internal priority change function to be called if the lock is already held (however it's not efficient yet since ros dispatches instead of schedules, and so the lock is sometimes released, but i did write a small hack to account for that)... this fixes more wine tests
svn path=/trunk/; revision=17234
2005-08-09 08:02:05 +00:00
Magnus Olsen
2b0d98ed0e Thx Royce3 for notice's a typo error CreateData to CanCreateData in a if statement. But it is not the bug we are looking for.
svn path=/trunk/; revision=17233
2005-08-09 07:42:00 +00:00
Alex Ionescu
fe9647d739 It is generally considered a bad idea to dereference an object after the reference failed..... this fixes another wine test and avoids a bugcheck
svn path=/trunk/; revision=17232
2005-08-09 06:28:23 +00:00
Alex Ionescu
c2a85cd273 - Implement KeQueryBasePriorityThread to return the actual Base Priority Increment (or Saturation Increment) to NtQueryInformationThread. The value win32 works with is actually (usually) the difference between process and thread Base Priorities.
This fixes another WINE test.

svn path=/trunk/; revision=17231
2005-08-09 06:23:16 +00:00
Alex Ionescu
4c12530bbc - Fix NtSuspendThread: correct PreviousMode check, return error if thread is terminating, handle KeSuspendThread's possible exception, only attempt to return previous suspend count if asked to.
- Make KeSuspendThread return an exception if the thread has been suspended beyond the limit.

This fixes another wine test.

svn path=/trunk/; revision=17230
2005-08-09 05:54:57 +00:00
Alex Ionescu
2d51263ec6 Sigh... yet another misuse of Object Attributes. Developer Note: Object Attributes are used to pass OBJ_ flags. Not Access Flags.
svn path=/trunk/; revision=17229
2005-08-09 04:59:19 +00:00
Alex Ionescu
576de36736 remove another invalid ObjectAttribute
svn path=/trunk/; revision=17228
2005-08-09 04:56:29 +00:00
Alex Ionescu
56f8494362 - Fix a large amount of bugs in ObpAllocateObjectAttributes & Name
svn path=/trunk/; revision=17227
2005-08-09 04:43:54 +00:00
Alex Ionescu
66c8e646dc - Send the pointer to the handle, not the NULL handle itself. This fixes another winetest bugcheck.
svn path=/trunk/; revision=17226
2005-08-09 04:03:14 +00:00
Alex Ionescu
8cfb5e1c6b - Use the actual previous mode (spotted by Thomas)
svn path=/trunk/; revision=17225
2005-08-09 03:38:34 +00:00
Alex Ionescu
e22539a07b Fix invalid Object Attributes
svn path=/trunk/; revision=17224
2005-08-09 03:31:22 +00:00
Alex Ionescu
3ffa753a9b Add some DDK limits that were missing
svn path=/trunk/; revision=17223
2005-08-09 03:29:51 +00:00
Alex Ionescu
69c49f71df - Fix broken loop, this fixes the WINE thread wait tests
svn path=/trunk/; revision=17222
2005-08-09 01:07:06 +00:00
Alex Ionescu
40602e6777 Fix exception handling by not reseting PreviousMode to kernel when a user-mode exception occurs. This fixes some winetest bugchecks
svn path=/trunk/; revision=17221
2005-08-09 00:02:24 +00:00
Hervé Poussineau
c1c22f5f98 Remove console debug output
svn path=/trunk/; revision=17220
2005-08-08 22:14:04 +00:00
Magnus Olsen
d483bdfcae Add a check to see if surface can be create, it return it can be create, but still createsurface return invaild param
svn path=/trunk/; revision=17219
2005-08-08 21:29:25 +00:00
Magnus Olsen
c8a180611e fixing bug 690 by Brandon Turner. note ms only allown start "notepad" or "note"pad not notep"ad or notepad" but we do that, for we think it is a bug in ms cmd that only allowing " at start of a file name to start the apps.
svn path=/trunk/; revision=17218
2005-08-08 18:59:56 +00:00
Thomas Bluemel
3ed0977d46 revert my last changes back to Alex's version of ObpCaptureObjectAttributes as I'm being an incompetent ass. This will introduce several vulnerabilities and bugs again.
svn path=/trunk/; revision=17217
2005-08-08 16:58:30 +00:00
Magnus Olsen
4280eeb5a3 fix a simple bug that I did intrudes with my last commit
svn path=/trunk/; revision=17215
2005-08-08 16:36:39 +00:00
Hervé Poussineau
6ed3a7acd9 I forgot to add SetupDiDeleteDeviceInfo to .spec file in rev 17212
svn path=/trunk/; revision=17214
2005-08-08 16:21:35 +00:00
Maarten Bosma
d83ab72e69 Fix another bug thanks to GreatLord.
svn path=/trunk/; revision=17213
2005-08-08 16:18:44 +00:00
Hervé Poussineau
c4a2110e0f Implement SetupDiBuildDriverInfoList, SetupDiOpenDeviceInfoA/W, SetupDiEnumDriverInfoA/W, SetupDiCreateDeviceInfoW
Add stubs for SetupDiDeleteDeviceInfo, SetupDiDestroyDriverInfoList

svn path=/trunk/; revision=17212
2005-08-08 16:09:48 +00:00
Hervé Poussineau
6d963834ca Change structures used to keep information about devices/interfaces/drivers. This one is more logical and should be more extensible
Sorry, i've disabled code to enumerate devices implementing some interface (not ported)
Do related changes in the file

svn path=/trunk/; revision=17210
2005-08-08 16:06:52 +00:00
Maarten Bosma
f97732afbd Fix a bug, thanks to Salamander again.
svn path=/trunk/; revision=17209
2005-08-08 15:56:27 +00:00
Thomas Bluemel
273d211c94 don't dereference a NULL pointer
svn path=/trunk/; revision=17208
2005-08-08 15:49:37 +00:00
Thomas Bluemel
e779b15f24 remove a bugcheck that was only used for debug purpose
svn path=/trunk/; revision=17207
2005-08-08 15:46:41 +00:00
Magnus Olsen
079265d1a7 Fix some error checking for DireactDrawCreate and DireactDrawCreateEx, we checking if the param is right or not.
svn path=/trunk/; revision=17206
2005-08-08 15:41:02 +00:00
Thomas Bluemel
a3abeb83af - reverted ObpCaptureObjectAttributes back to my old implementation (slightly modified and extended) because that one at least does what it's supposed to correctly
svn path=/trunk/; revision=17205
2005-08-08 15:39:35 +00:00
Thomas Bluemel
910c9075f0 pass the correct access mode to ObOpenObjectByName
svn path=/trunk/; revision=17204
2005-08-08 15:33:04 +00:00
Steven Edwards
74a0c04f23 add setupapi test for stringtable functions. At this time they only pass on Ros and Windows 2000. I will fix the test to pass on later versions of Windows soon.
svn path=/trunk/; revision=17203
2005-08-08 15:01:03 +00:00
Maarten Bosma
b1b37ffc00 Remove exclamation mark that does not belong there. Thanks to Salamander again.
svn path=/trunk/; revision=17202
2005-08-08 14:54:24 +00:00
Maarten Bosma
ae51cca93f Forgot it again. :)
svn path=/trunk/; revision=17201
2005-08-08 14:20:05 +00:00
Maarten Bosma
f276da4448 Fix wrong syntax, missing file and non existing module in makefile. Thanks to Salamander and Usurp.
svn path=/trunk/; revision=17200
2005-08-08 14:19:20 +00:00
Maarten Bosma
2cacd67bcc The beginning of a ddraw implementation. Does not work yet for unknown reason.
svn path=/trunk/; revision=17199
2005-08-08 13:29:50 +00:00
Thomas Bluemel
1a2a435f9c enter a critical region before looking up a CID handle
svn path=/trunk/; revision=17198
2005-08-08 10:54:32 +00:00
Thomas Bluemel
da23cad0de delete no longer used file
svn path=/trunk/; revision=17197
2005-08-08 10:41:34 +00:00
Thomas Bluemel
e138304bf5 unlock the CID in PsLookupProcessByProcessId, PsLookupProcessThreadByCid and PsLookupThreadByThreadId when the lookup succeeded, not failed
svn path=/trunk/; revision=17196
2005-08-08 10:08:34 +00:00
Filip Navara
f61e4f1230 Revert part of #17156 and #17157 changes.
svn path=/trunk/; revision=17195
2005-08-08 09:24:20 +00:00
Art Yerkes
20732be74c Fixes for various 64-bit hosting problems.
svn path=/trunk/; revision=17194
2005-08-08 04:26:23 +00:00
Hartmut Birr
a3bc4d9c07 Fixed the load count in LdrpDetachProcess. That made it again possible to call the dll entry with DLL_PROCESS_DETACH.
svn path=/trunk/; revision=17193
2005-08-08 01:47:52 +00:00
Thomas Bluemel
e41e25c1e1 use loops instead of gotos
svn path=/trunk/; revision=17192
2005-08-08 00:45:04 +00:00
Thomas Bluemel
afcb29cc7c directly translate handles to indexes in ex/handle.c
svn path=/trunk/; revision=17191
2005-08-07 23:43:58 +00:00
Thomas Bluemel
ebe277b796 use the correct pointer to free the string. Thx to Hartmut for spotting this bug
svn path=/trunk/; revision=17190
2005-08-07 23:37:59 +00:00
Alex Ionescu
12de4ac145 Retry waiting if STATUS_ALERTED is returned
svn path=/trunk/; revision=17189
2005-08-07 23:22:18 +00:00
Thomas Bluemel
ae86070caa RtlFreeHandle only should call RtlIsValidHandle in debug builds.
svn path=/trunk/; revision=17188
2005-08-07 23:19:15 +00:00
Alex Ionescu
7905e74e59 Fix horridly wrong SignalObjectAndWait return values, should make more wine tests pass
svn path=/trunk/; revision=17187
2005-08-07 23:18:40 +00:00
Hartmut Birr
bad46dca35 Allocate the map registers according to the dma controllers properties (boundary and highest possible address).
svn path=/trunk/; revision=17186
2005-08-07 23:08:07 +00:00
Hartmut Birr
6faab780d4 - Changed MmGetContinuousPages from using an alignment to using a boundary.
- Removed MmAllocateContiguousAlignedMemory. 

svn path=/trunk/; revision=17185
2005-08-07 23:07:17 +00:00
Thomas Bluemel
73a4ae89a5 fixed differences in signedness warnings
svn path=/trunk/; revision=17184
2005-08-07 23:05:57 +00:00
Alex Ionescu
5905ef7a1e - Fix return value.
svn path=/trunk/; revision=17183
2005-08-07 23:00:51 +00:00
Alex Ionescu
3dac092c29 - Remove cid.c
- Do direct handle creation/deletion where needed.

svn path=/trunk/; revision=17182
2005-08-07 22:48:07 +00:00
Alex Ionescu
bac942f34d - Return correct error. Spotted by Thomas.
svn path=/trunk/; revision=17181
2005-08-07 21:48:14 +00:00
Alex Ionescu
c5ed8ceb14 - Send proper ClientID structure
svn path=/trunk/; revision=17180
2005-08-07 21:45:12 +00:00
Alex Ionescu
4c1eb86320 - Completely reimplement NtWaitForMultipleObjects:
- Check for invalid Objectcount and wait type
    - Don't use 2.6KB of stack space (kernel threads only get 4...)
    - Don't call ObReferenceObjectByHandle since it does a lot of superflous checks, continous locking/unlocking and makes us extremly slow for a large wait and also doesn't give us the full flexibility we need.
    - Detect if a Waitall is being done with the same object duplicated.
    - Protect wait with SEH.
- General fixes for all NtWaitXXX:
    - Use DefaultObject from Object Header and remove all previous associated hacks, including the IO_TYPE hack. The DefaultObject will either be NULL, an offset to an internal Object Event, or a pointer to a default event. We handle all three.
    - Guard the KeWaitXXX call with SEH since it can raise exceptions.
- Fix all object type intiailizers regarding DefaultObject.

svn path=/trunk/; revision=17179
2005-08-07 21:29:51 +00:00
Eric Kohl
a6b3bd07b6 Replace Win32 types by native ones.
svn path=/trunk/; revision=17178
2005-08-07 20:33:11 +00:00
Thomas Bluemel
562a0fb61f also actually rename the files...
svn path=/trunk/; revision=17177
2005-08-07 18:47:26 +00:00
Alex Ionescu
b1b87307bb - Initialize more fields when creating an Object Type
- Correct the Pool Charge for Object Types, select a Default Object, always use a security procedure, read global flag for maintaing type lists, set the pool type
- Initialize a Default Wait Object.
- Fix security callback for objects.
- Implement SeDefaultObjectMethod for security callbacks of objects which don't have a custom one.

svn path=/trunk/; revision=17176
2005-08-07 18:38:37 +00:00
Steven Edwards
c8e0c7ed3e no need for long xml filenames
svn path=/trunk/; revision=17174
2005-08-07 17:12:11 +00:00
Eric Kohl
12fea44aca Remove trailing whitespace and fix the indentation.
svn path=/trunk/; revision=17173
2005-08-07 17:11:13 +00:00
Steven Edwards
5aebfabb91 change rostest name back to dllname_test.exe
svn path=/trunk/; revision=17172
2005-08-07 17:07:35 +00:00
Steven Edwards
905738c542 rename tests to dllname_winetest to make it less trouble on exception to change build system rules for ros tests
svn path=/trunk/; revision=17171
2005-08-07 17:07:00 +00:00
Magnus Olsen
848867e6b1 GdiEntry11 (not tested, we can not test it yet in ros, until we got ddraw.dll and some api in win32k/ntdraw been implement)
svn path=/trunk/; revision=17170
2005-08-07 16:22:37 +00:00
Filip Navara
3de2a9013a Change the module type to win32gui. We really don't want to attempt to create consoles at this stage.
svn path=/trunk/; revision=17169
2005-08-07 15:55:01 +00:00
Hartmut Birr
fa7dd8c0ff Fixed the comment from my last commit.
svn path=/trunk/; revision=17167
2005-08-07 14:01:17 +00:00
Hartmut Birr
02fe41efa5 - Removed the exclusive deletion because '-' is a valid file name character.
- Optimized the recursive deletion in directories.
- Preload some nice strings.


svn path=/trunk/; revision=17166
2005-08-07 13:59:05 +00:00
Filip Navara
000e3044d8 Fix setupapi build and prototypes.
svn path=/trunk/; revision=17165
2005-08-07 13:06:30 +00:00
Magnus Olsen
b14f99cc46 Implement Gdintry4 (not tested, we can not test it yet in ros, until we got ddraw.dll and some api in win32k/ntdraw been implement)
svn path=/trunk/; revision=17164
2005-08-07 12:54:41 +00:00
Hervé Poussineau
231828406a Implement SetupGetInfFileListW and SetupGetInfInformationW
Inf file parser now accept UNICODE files with FF FE header
Return required buffer size when buffer is too small in SetupGetLineTextA/W, SetupGetStringFieldA/W

svn path=/trunk/; revision=17162
2005-08-07 11:59:43 +00:00
Filip Navara
ebd400d82c Fix a race condition in input packet processing.
svn path=/trunk/; revision=17160
2005-08-07 11:47:50 +00:00
Thomas Bluemel
b6bbf4cd23 fixed the order of the parameters of RtlIsValidIndexHandle
svn path=/trunk/; revision=17159
2005-08-07 11:47:45 +00:00
Eric Kohl
6ab29bbd4b Support size_is(*Length) attributes for strings.
svn path=/trunk/; revision=17158
2005-08-07 11:44:41 +00:00
Filip Navara
9a462169de Readd check that I accidently removed.
svn path=/trunk/; revision=17157
2005-08-07 11:25:36 +00:00
Filip Navara
aef1fdc048 Correctly set internal state in NpfsDisconnectPipe and fix some return values in NpfsRead.
svn path=/trunk/; revision=17156
2005-08-07 10:56:57 +00:00
Maarten Bosma
135eaf6958 A simple test app for DirectDraw.
svn path=/trunk/; revision=17155
2005-08-07 10:13:46 +00:00
Filip Navara
208dc4dcab Fix mutex unlocking in NpfsWaiterThread and add ASSERT.
svn path=/trunk/; revision=17154
2005-08-07 10:08:25 +00:00
Thomas Bluemel
47d6deb829 SVN maintainance
svn path=/trunk/; revision=17153
2005-08-07 09:55:54 +00:00
Thomas Bluemel
fb0db4efa6 fixed uninitialized variable warning
svn path=/trunk/; revision=17152
2005-08-07 09:55:08 +00:00
Thomas Bluemel
a32178f6d9 fixed uninitialized variables warnings
svn path=/trunk/; revision=17151
2005-08-07 09:48:38 +00:00
Alex Ionescu
1479011f30 Fix NtSignalAndwaitForSingleObject: Use SEH when appropriate, use direct Mutant release call, query handle info and write fixmes when permission checking needed, optimize failure cases, fix horrid tab/space formatting mismatches
svn path=/trunk/; revision=17150
2005-08-07 09:40:00 +00:00
Thomas Bluemel
09e2e1a5cb added a newline at the end of the file to fix a warning
svn path=/trunk/; revision=17149
2005-08-07 09:24:10 +00:00
Filip Navara
26d1cb6272 - Fix size check in SystemBasicInformation and SystemTimeOfDayInformation.
- Add SEH protection to SystemProcessInformation.
- Implement SystemKernelDebuggerInformation.
- Fix returning of ResultLength in NtQuerySystemInformation.

svn path=/trunk/; revision=17148
2005-08-07 09:12:10 +00:00
Eric Kohl
6e9638b203 Fix CM_Get_Registry_Property_ExW.
Implement CM_Set_Registry_Property_ExA.

svn path=/trunk/; revision=17147
2005-08-07 09:03:35 +00:00
Hartmut Birr
a48242f711 Allocated a converting buffer for WideCharToMultiByte. This does fix bug #702.
svn path=/trunk/; revision=17146
2005-08-07 08:06:56 +00:00
Martin Fuchs
9a5a82cd3c update SVN properties
svn path=/trunk/; revision=17145
2005-08-07 07:49:07 +00:00
Martin Fuchs
fc506850c2 update SVN properties
svn path=/trunk/; revision=17144
2005-08-07 07:42:36 +00:00
Martin Fuchs
4f8cc9596c update SVN properties
svn path=/trunk/; revision=17143
2005-08-07 07:33:14 +00:00
Martin Fuchs
100b8232d0 update SVN properties
svn path=/trunk/; revision=17142
2005-08-07 07:32:36 +00:00
Alex Ionescu
c3a96b7538 And here goes another test for two unsupported flags.
svn path=/trunk/; revision=17141
2005-08-07 07:30:46 +00:00
Alex Ionescu
17f39f0290 One more test can't hurt.
svn path=/trunk/; revision=17140
2005-08-07 07:14:52 +00:00
Alex Ionescu
0077f21d71 Add failure cases for more things then a WINE test could shake a stick at (hopefully)
svn path=/trunk/; revision=17139
2005-08-07 07:11:03 +00:00
Steven Edwards
e9677a896a enable the ntdll and kernel32 wine tests and watch them fail
svn path=/trunk/; revision=17138
2005-08-07 03:15:15 +00:00
Steven Edwards
17d51a62ab added kernel32 wine tests
svn path=/trunk/; revision=17137
2005-08-07 03:14:17 +00:00
Steven Edwards
eae91ed932 make the ros test name dllname_rostest.exe, suggested by Usurp
svn path=/trunk/; revision=17136
2005-08-07 03:00:44 +00:00
Steven Edwards
65e46acedc Named reactos regression tests dllname_tests.exe and wine test name dllname_test.exe to prevent conflicts
svn path=/trunk/; revision=17135
2005-08-07 02:54:10 +00:00
Steven Edwards
c510ad93ae add some missing values from Wine
svn path=/trunk/; revision=17134
2005-08-07 02:22:29 +00:00
Steven Edwards
57f56eab33 ntdll pending some winerror.h fixes
svn path=/trunk/; revision=17133
2005-08-07 02:16:34 +00:00
Steven Edwards
447a3da0ea updated winternl.h, PSDK fixes, etc...
svn path=/trunk/; revision=17132
2005-08-07 01:23:40 +00:00
Steven Edwards
7357490064 DCX_USESTYLE is a wineism. Dont use it in a header
svn path=/trunk/; revision=17131
2005-08-07 00:26:13 +00:00
Steven Edwards
d4893a7fa5 added local define for DCX_USESTYLE
svn path=/trunk/; revision=17130
2005-08-07 00:25:26 +00:00
Steven Edwards
d2984aea5c added DCX_USESTYLE
svn path=/trunk/; revision=17129
2005-08-07 00:21:24 +00:00
Steven Edwards
55b967315b turn on more the winetests
svn path=/trunk/; revision=17128
2005-08-07 00:06:29 +00:00
Steven Edwards
14e75bd34f again dump the .cvsignore
svn path=/trunk/; revision=17127
2005-08-07 00:03:28 +00:00
Steven Edwards
d8de9b24fb add some of the shlwapi tests
svn path=/trunk/; revision=17126
2005-08-06 23:58:36 +00:00
Steven Edwards
bf046096f1 added user32 wine regression test
svn path=/trunk/; revision=17125
2005-08-06 23:41:45 +00:00
Steven Edwards
68cfd5b234 we don't need a .cvsignore
svn path=/trunk/; revision=17124
2005-08-06 23:20:14 +00:00
Steven Edwards
e2314525fc added gdi32 wine regression tests
svn path=/trunk/; revision=17123
2005-08-06 23:19:47 +00:00
Steven Edwards
42cc66da60 moved psapi test
svn path=/trunk/; revision=17122
2005-08-06 23:12:16 +00:00
Steven Edwards
35154d7eb5 moved psapi test
svn path=/trunk/; revision=17121
2005-08-06 23:11:59 +00:00
Steven Edwards
551795b06d add version tests
svn path=/trunk/; revision=17120
2005-08-06 23:08:51 +00:00
Steven Edwards
f997cb9046 added msvcrt regression test
svn path=/trunk/; revision=17119
2005-08-06 23:05:16 +00:00
Maarten Bosma
a3cd4ae567 add case if _NO_COM is defined structure _DDRAWI_DDRAWSURFACE_MORE
svn path=/trunk/; revision=17118
2005-08-06 22:08:13 +00:00
Thomas Bluemel
958fe98d1d fixed some uninitialized variables warnings
svn path=/trunk/; revision=17117
2005-08-06 20:23:08 +00:00
Magnus Olsen
e651def55f add #define DDRAWISURFGBL_NOTIFYWHENUNLOCKED
svn path=/trunk/; revision=17116
2005-08-06 20:18:59 +00:00
Thomas Bluemel
4023109665 allow warnings
svn path=/trunk/; revision=17115
2005-08-06 20:15:29 +00:00
Thomas Bluemel
19291a67d9 add missing directory.xml
svn path=/trunk/; revision=17114
2005-08-06 19:42:40 +00:00
Filip Navara
4123ecfc6a Fix translation of extended keys.
svn path=/trunk/; revision=17111
2005-08-06 18:56:20 +00:00
Steven Edwards
f3594ebab5 and this
svn path=/trunk/; revision=17110
2005-08-06 18:08:07 +00:00
Steven Edwards
995a19dc6d forgot this
svn path=/trunk/; revision=17109
2005-08-06 18:07:47 +00:00
Steven Edwards
d3a19d3fa2 enable Wine regression tests for advapi32 and comctl32. Not tested under ReactOS. To build tests now you can use the wine name 'make advapi32_test' 'make comctl32_test' etc
svn path=/trunk/; revision=17108
2005-08-06 18:05:15 +00:00
Steven Edwards
8f091947d8 add prototype for DbgPrint so Winetests link properly with ReactOS.
svn path=/trunk/; revision=17107
2005-08-06 18:03:53 +00:00
Steven Edwards
94aa9ed23c stick the winetests in the sub folder with the other regtests
svn path=/trunk/; revision=17106
2005-08-06 18:02:57 +00:00
Steven Edwards
d90f119c90 remove comctl32 winetests
svn path=/trunk/; revision=17105
2005-08-06 18:00:17 +00:00
Steven Edwards
8704e1ebff remove msvcrt winetests
svn path=/trunk/; revision=17104
2005-08-06 17:59:46 +00:00
Steven Edwards
f2272e8e74 remove main winetest program
svn path=/trunk/; revision=17103
2005-08-06 17:59:01 +00:00
Steven Edwards
53a628a613 remove version winetests
svn path=/trunk/; revision=17102
2005-08-06 17:58:12 +00:00
Steven Edwards
09c6b8868b remove advapi32 winetests. I am going to refactor the import
svn path=/trunk/; revision=17101
2005-08-06 17:57:33 +00:00
Hartmut Birr
d46f0ac6da Don't try to acquire the mutex, if the mutex already exist (reported by Joseph Galbraith).
svn path=/trunk/; revision=17100
2005-08-06 15:55:59 +00:00
Thomas Bluemel
4d98b5f8f7 fixed uninitialized variable warning and indentation
svn path=/trunk/; revision=17099
2005-08-06 15:01:08 +00:00
Thomas Bluemel
514aa4a565 #include "precomp.h" -> #include <precomp.h>
svn path=/trunk/; revision=17098
2005-08-06 14:58:07 +00:00
Thomas Bluemel
00d72052e8 #include "usetup.h" -> #include <usetup.h>
svn path=/trunk/; revision=17097
2005-08-06 14:57:57 +00:00
Thomas Bluemel
db692d3cdc fixed uninitialized variable warning
svn path=/trunk/; revision=17096
2005-08-06 11:59:31 +00:00
James Tabor
eac9a2caf0 Show DrawTextExA implemented.
svn path=/trunk/; revision=17095
2005-08-06 05:26:10 +00:00
James Tabor
1556909d27 Show SetParent implemented.
svn path=/trunk/; revision=17094
2005-08-06 05:25:13 +00:00
James Tabor
b492db20dd Show UpdateWindow implemented.
svn path=/trunk/; revision=17093
2005-08-06 05:24:05 +00:00
Thomas Bluemel
044ab19d99 handle the WM_SIZE message and resize/move the controls appropriately
svn path=/trunk/; revision=17092
2005-08-06 01:14:09 +00:00
Maarten Bosma
406b162be2 Add more DDRAWISURFs and remove useless #ifndefs.
svn path=/trunk/; revision=17091
2005-08-05 23:29:52 +00:00
Gé van Geldorp
ebdbcfb097 Sync to Wine-20050725:
Alexandre Julliard <julliard@winehq.org>
- Faster implementation of wcstombs that handles overlapping buffers
  properly (based on a patch by Dmitry Timoshkov).

svn path=/trunk/; revision=17090
2005-08-05 22:24:53 +00:00
Maarten Bosma
518084eb6d include ddk/d3dnthal.h as well
svn path=/trunk/; revision=17089
2005-08-05 21:53:20 +00:00
Filip Navara
94ae83f18a Remove spurious call from I8042BasicDetect.
svn path=/trunk/; revision=17086
2005-08-05 21:31:11 +00:00
Alex Ionescu
1eb8e4cde0 - FS Devices don't need a device queue, optimize the call away.
svn path=/trunk/; revision=17085
2005-08-05 21:25:52 +00:00
Alex Ionescu
6477828cdd - DeviceExtension should be NULL if the caller didn't specify any size for one.
svn path=/trunk/; revision=17084
2005-08-05 21:16:51 +00:00
Maarten Bosma
3d09f34d49 in ddrawgdi.h
- remove #if 0 (Define GdiEntries to thier internal names)
- include the right headers instead of defining things on it's own

svn path=/trunk/; revision=17083
2005-08-05 21:05:03 +00:00
Maarten Bosma
4b9db80475 undo my last change
svn path=/trunk/; revision=17082
2005-08-05 21:02:28 +00:00
Gé van Geldorp
ebe9abeb13 Update status
svn path=/trunk/; revision=17080
2005-08-05 20:49:13 +00:00
Gé van Geldorp
ccf9cf1d90 Sync to Wine-20050628:
Dmitry Timoshkov <dmitry@codeweavers.com>
- Make remaining OLE interface vtables const.
Mike McCormack <mike@codeweavers.com>
- Stub implementation for GetSoftwareUpdateInfo.
- Declare functions and correct prototypes.
Maarten Lankhorst <m.b.lankhorst@gmail.com>
- Improved ObtainUserAgentString stub.
Stefan Huehner <stefan@huehner.org>
- Fix some more -Wstrict-prototypes warnings.

svn path=/trunk/; revision=17079
2005-08-05 20:48:26 +00:00
Maarten Bosma
bb1f81a0fc Actually call the DDRAW_DllRegisterServer() and DDRAW_DllUnregisterServer() functions from DllMain.
svn path=/trunk/; revision=17078
2005-08-05 20:46:20 +00:00
Gé van Geldorp
3f6ea7fd61 Sync to Wine-20050628:
Stefan Leichter <Stefan.Leichter@camLine.com>
- Update version resource of msiexec.exe to current version shipped from
  Windows Update.
Mike McCormack <mike@codeweavers.com>
- Fix some declaration and write string warnings.

svn path=/trunk/; revision=17077
2005-08-05 20:30:42 +00:00
Gé van Geldorp
be83809179 Sync to Wine-20050628:
Alexandre Julliard <julliard@winehq.org>
- Get rid of the WaveMapper and MidiMapper options, the defaults should
  be good enough in all cases.
- Moved the audio driver configuration to HKCU\Software\Wine\Drivers and
  changed it a bit to follow the model of the graphics driver.
- Added magic comments to all Wine-specific registry accesses to make
  them easier to grep.
Mike McCormack <mike@codeweavers.com>
- Make a function static.
Francois Gouget <fgouget@free.fr>
- Fix winapi_check documentation warnings.
Rein Klazes <wijn@wanadoo.nl>
- In MCI_(Un)MapMsg16To32W with wMsg == MCI_OPEN(_DRIVER) only do
  strdupAtoW on those parameters that are flagged to be a string.

svn path=/trunk/; revision=17076
2005-08-05 20:25:46 +00:00
Filip Navara
638c41010a Revert change to ExSystemExceptionFilter.
svn path=/trunk/; revision=17075
2005-08-05 18:27:06 +00:00
Filip Navara
e86cc8cec8 Don't save and restore previous mode in trap handlers. This allows us to call KeGetPreviousMode() from exception handlers and get the right value.
svn path=/trunk/; revision=17074
2005-08-05 18:26:43 +00:00
Filip Navara
957a1ac6da Remove mouse device detection for now, since it fails on some i8042 clones.
svn path=/trunk/; revision=17073
2005-08-05 17:28:17 +00:00
Filip Navara
255c467f03 Protect NtQuerySystemInformation with SEH.
svn path=/trunk/; revision=17072
2005-08-05 15:45:14 +00:00
Filip Navara
c988422fc4 Move a flush call few lines down.
svn path=/trunk/; revision=17071
2005-08-05 15:41:20 +00:00
Magnus Olsen
290d54b180 Fixes a bug which disallows tab complete on empty input and a sorting bug which didnt account for locale by Brandon Turner
svn path=/trunk/; revision=17070
2005-08-05 15:40:53 +00:00
Filip Navara
457bfd725b Fix keyboard and mouse detection. We must disable the controller features before beginning the port check and we shouldn't fail if some port isn't found. Also detect the mouse on port before trying to use it.
svn path=/trunk/; revision=17069
2005-08-05 10:35:32 +00:00
Thomas Bluemel
d974b427de #include "advapi32.h" -> #include <advapi32.h>
svn path=/trunk/; revision=17068
2005-08-05 10:31:28 +00:00
Thomas Bluemel
5ed4bb62cd #include "acluilib.h" -> #include <precomp.h>
svn path=/trunk/; revision=17067
2005-08-05 10:27:32 +00:00
Thomas Bluemel
5fe92f070c #include "precomp.h" -> #include <precomp.h>
svn path=/trunk/; revision=17066
2005-08-05 10:23:56 +00:00
Filip Navara
55ae128183 Comment out the ACPI enumeration entries for i8042prt driver. It's set as system load driver, so it's loaded anyway.
svn path=/trunk/; revision=17065
2005-08-05 10:11:21 +00:00
Filip Navara
6b88626e55 Fix shell32 build.
svn path=/trunk/; revision=17064
2005-08-05 10:01:51 +00:00
Alex Ionescu
ce4441ce6f - Removed all 3rd-party drivers due to popular request. Information on how to make the drivers work is now available on http://www.reactos.com/wiki/index.php/ReactOS_Drivers. .reg files could be created by volunteers to simplify the process, perhaps.
svn path=/trunk/; revision=17063
2005-08-05 09:38:12 +00:00
Thomas Bluemel
e6a171e0ab set eol-style to native and allow warnings (so it compiles with GCC4)
svn path=/trunk/; revision=17062
2005-08-05 09:16:38 +00:00
Gé van Geldorp
6a1354653c Sync to Wine-20050628:
Marcus Meissner <marcus@jet.franken.de>
- Move static variables out of header file, also the local interface
  implementations.
Dmitry Timoshkov <dmitry@codeweavers.com>
- Make remaining OLE interface vtables const.
cjacek <cjacek@gmail.com>
- Fix typo in comment about Wine registry key.
Alexandre Julliard <julliard@winehq.org>
- Moved a few registry keys from HKLM\Software\Wine to
  HKCU\Software\Wine for consistency.
- Added magic comments to all Wine-specific registry accesses to make
  them easier to grep.
- Sort entry points in the same order as Windows.
Stefan Huehner <stefan@huehner.org>
- Fix more -Wstrict-prototypes warnings.

svn path=/trunk/; revision=17061
2005-08-05 08:02:09 +00:00
Gé van Geldorp
a291f2d15a Sync to Wine-20050628:
Dmitry Timoshkov <dmitry@codeweavers.com>
- Make remaining OLE interface vtables const.
Mike McCormack <mike@codeweavers.com>
- SHCreateStreamOnFileW is implemented in shlwapi, so we don't need
  another implementation in shell32.
- Add a cast to get rid of a warning.
- Warning fixes for -Wmissing-declarations and -Wwrite-strings.
- Make functions static.
- -Wpointer-sign fixes.
- forward AddRef, Release, QueryInterface and GetClassID to internal
  implementations
- implement GetClassID properly
- Switch IShellLink to use shlwapi.SHCreateStreamOnFileW.
- Remove some uses of wine/unicode.h functions.
- Add the IContextMenu interface to the ShellLink object.
- Implement ShellLink's IShellExtInit::Initialize() method.
- add the IShellExtInit interface to the ShellLink object
- use inline functions rather than macros to resolve the
  implementation pointer from an interface pointer
- Add the IShellLinkDataList interface to the ShellLink object.
Michael Jung <mjung@iss.tu-darmstadt.de>
- Use the CallForAttributes registry value, instead of promoting the
  root folder's SFGAO_FILESYSTEM flag to the registry.
- Return the correct attributes for the desktop folder.
- Corresponding tests.
- Support for shellfolder's CallForAttributes registry value.
- Let BindToObject fail, if called with empty relative pidl.
- Tests to show that it should do so.
- Fix SHBrowseForFolder to not pass an empty pidl to BindToObject.
- Fix a lurking infinite loop in SHGetPathFromIDList.
- Support for shellfolder's CallForAttributes registry value.
- Use SHGetPathFromIDList instead of SHELL32_GetPathFromIDList.
- Implement SHGetPathFromIDList based on GetDisplayNameOf.
Stefan Doesinger <stefandoesinger@gmx.at>
- Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp.
- Remove the dwAttributes member from the IGenericSFImpl class, it's
  not needed and can't be initialised in Initialize and InitializeEx.
Vitaly Lipatov <lav@etersoft.ru>
- Realize DoEnvironmentSubstA via ExpandEnvironmentStringsA.
- Fix types and return values.
- Add prototype into shellapi.h.
Aric Stewart <aric@codeweavers.com>
- Fix the BrowseForFolder dialog so that when it does the callbacks it
  uses the correct message instead of always sending BEFM_INITIALIZED.
Juan Lang <juan_lang@yahoo.com>
- Const-ify a mask.
- Set default for "My Documents" to $HOME, and "Desktop" to ~/Desktop.
Alexandre Julliard <julliard@winehq.org>
- Sort entry points in the same order as Windows.
Francois Gouget <fgouget@free.fr>
- Fix winapi_check documentation warnings.
Marcus Meissner <marcus@jet.franken.de>
- ExtractAssociatedIconA needs to allocate enough space to have EAIW
  fill in lpIconPathW.
Huw Davies <huw@codeweavers.com>
- Unquote the icon file path if it's quoted.

svn path=/trunk/; revision=17060
2005-08-05 07:48:18 +00:00
Alex Ionescu
53aa4eb206 - Protect semaphore release with SEH, since it can cause an exception
- Correct object type initializer
- Correct incorrect PreviousMode checks
- Correct MaximumCount and ReleaseCount checks since they can't be negative either
- Harmonize formatting

svn path=/trunk/; revision=17059
2005-08-05 06:56:17 +00:00
Alex Ionescu
4a4e5adc99 - Add comments to code and clean it up
- Fix some incorrect operations
 - Optimize and fix loops

svn path=/trunk/; revision=17058
2005-08-05 06:54:15 +00:00
Alex Ionescu
9f32108192 - Optimize locking so that the Wake Lock is only entered after a first attempt determines the timer is a wake timer.
After the lock, a second check is done to make sure. However, since the first check will fail 99% of times, we will
  not acquire/release a spinlock, and thus decrease contention.
- Fix Object Type Initializer to actually use ExpTimerDelete when the object is deleted.
- Fix Initializer to report correct memory usage of timer object.
- Fix Initializer to report OBJ_OPENLINK as an invalid attribute for timer objects.
- Use correct access masks when modifying or querying timer objects.
- Handle wake timers in NtCancelTimer.
- Return warning NTSTATUS code if a wake timer is requested but not supported by the system (default on ROS).
- Check for valid timer type in NtCreateTimer.
- Check for valid period in NtSetTimer.
- Don't dereference the timer in NtSetTimer three times.
- Return the correct Due Time in NtQueryTimer by substracting the stable interrupt time.
- Harmonize formatting, fix some comments.

svn path=/trunk/; revision=17057
2005-08-05 06:53:56 +00:00
Alex Ionescu
2e6566c315 - Makefile change for previous commit.
svn path=/trunk/; revision=17056
2005-08-05 06:13:43 +00:00
Alex Ionescu
7500ee65fa - Move ExCreateUUID to uuid.c
- Move ExpVerifiySuite to sysinfo.c
- Delete util.c

svn path=/trunk/; revision=17055
2005-08-05 06:13:23 +00:00
Steven Edwards
6b12a0217e added oledlg.dll to the build. Needed by visio2k setup.
svn path=/trunk/; revision=17054
2005-08-05 03:59:05 +00:00
Alex Ionescu
1bb6a5ce2c - Remove unused ldr/userldr.c
- Rename LdrLoadInitialProcess to Exp... and move to executive initialization.
- Removed ldr/init.c
- Renamed ldr/sysdll.c functions to Psp (correct naming) and deleted file.
- Renamed SystemDll... ntdll pointers to correct Ke names
- Use direct Ke names instead of going through an API call.
- Make ExpInit... functions STDCALL

svn path=/trunk/; revision=17053
2005-08-05 03:44:24 +00:00
Magnus Olsen
3f935aa835 fix a small bug in cd, it did make all char lower case. done by me and Brandon Turner. clean up CD source bit more. Bug fix GetRootPath. it did not accepted upper case as driver letter. done by me
svn path=/trunk/; revision=17051
2005-08-04 22:08:16 +00:00
Filip Navara
b760d02f8f Fix keyboard input in usetup.
svn path=/trunk/; revision=17050
2005-08-04 21:55:43 +00:00
Steven Edwards
0466e5cbb2 took a stab at write support and turned it on. Removed getopt as its not needed.
svn path=/trunk/; revision=17049
2005-08-04 21:42:32 +00:00
Gé van Geldorp
b3af499b55 Sync to Wine-20050628:
Robert Shearman <rob@codeweavers.com>
- Improve tracing.
- Implement FC_UP and partially FC_OP.
- Don't needlessly marshal 4 bytes in NdrPointer*.
- Fix an RPC server startup race introduced by me.
- Don't pass the PROFILE_SERVER flag in to CreateNamedPipe as it is
  bogus.
- Call FlushFileBuffers to make sure the other end of the pipe doesn't
  get cut off prematurely.
- Don't call CancelIo as we should never have async I/O pending.
- Make NdrInterfacePointer* more reliable.
Dmitry Timoshkov <dmitry@codeweavers.com>
- Make remaining OLE interface vtables const.
Alexandre Julliard <julliard@winehq.org>
- Sort entry points in the same order as Windows.
Mike Hearn <mh@codeweavers.com>
- Initialize DataRepresentation in NdrClientInitializeNew, not
  NdrSendReceive.

svn path=/trunk/; revision=17048
2005-08-04 21:35:00 +00:00
Magnus Olsen
fc05329e7f Windows TAB complete style instead for unix style patch by Brandon Turner. Thuse does people do not like windows tab complete, the can always change in config.h to unix/linux tab complete code again.
svn path=/trunk/; revision=17043
2005-08-04 12:41:42 +00:00
Thomas Bluemel
16025312da compile welcome.exe as unicode application by default
svn path=/trunk/; revision=17042
2005-08-04 10:41:58 +00:00
Gé van Geldorp
52fafec558 Sync to Wine-20050628:
Phil Krylov <phil@newstar.rinet.ru>
- Implemented EM_GETTEXTLENGTHEX RichEdit message.
Krzysztof Foltman <wdev@foltman.com>
- added support for \ulnone (turning underline off)
- support for basic subscript and superscript
- untested support for text offset
- Emit \tx for user-defined TABs.
Dmitry Timoshkov <dmitry@codeweavers.com>
- Make remaining OLE interface vtables const.
Stefan Huehner <stefan@huehner.org>
- Fix some more -Wstrict-prototypes warnings.
Vitaly Lipatov <lav@etersoft.ru>
- Allow null pointers for EM_GETSEL message (as MSDN says).
Robert Shearman <rob@codeweavers.com>
- Richedit classes should be global.

svn path=/trunk/; revision=17041
2005-08-04 06:52:58 +00:00
Thomas Bluemel
ed9faae3c7 properly implement scrolling
svn path=/trunk/; revision=17040
2005-08-04 00:16:41 +00:00
Thomas Bluemel
f89d9a13ad fail as documented when the pointer to the buffer equals the pointer to the string to be converted in MultiByteToWideChar and WideCharToMultiByte
svn path=/trunk/; revision=17039
2005-08-03 23:07:10 +00:00
Gé van Geldorp
9912b90aff Francois Gouget <fgouget@free.fr>
Fix winapi_check documentation warnings.

svn path=/trunk/; revision=17038
2005-08-03 22:49:47 +00:00
Gé van Geldorp
c089737240 Sync to Wine-20050628:
Dmitry Timoshkov <dmitry@codeweavers.com>
- Make remaining OLE interface vtables const.
Robert Shearman <rob@codeweavers.com>
- DispInvoke is correct so there is no need to print a fixme.
- The typelib marshaler should only free the memory it actually allocated.
- Add special cases for two lesser used types that aren't
  sizeof(DWORD) sized.
- If we are accessing a method from a superclass then we need to use the
  superclass's ITypeInfo otherwise we could get errors when accessing
  hreftypes that aren't present in the subclass.
- Don't print out cryptic message if IDispatch or IUnknown object is
  just NULL.
- puArgErr is a ref pointer so we have to provide a dummy pointer if
  it is NULL.
- Fail gracefully and notify caller if we ran out of memoy or if
  variant copying failed.
- Clear out parameters to stop bad pointers lying around in memory if
  the function doesn't set them to anything.
- Fix the return values from QueryPathOfRegTypeLib.
- Open registry key with least access rights necessary.
- Documentation updates.
Michael Stefaniuc <mstefani@redhat.de>
- VarCmp: handle comparision of VT_EMPTY with an integer
- small comment fix
- Reimplement VarAdd, had missing functionality and wrong behaviour.
- Fix a typo in VarMul.
- more VarFormat fixes for number formats (exponent, mixed '#' and '0'
  in formats, rounding, etc). Simplify the code.
- previous VarFormat todo_wine tests pass now + add more tests
- Fix VarFormat for formats that mix '0' and '#' in the whole number
  part.
- Fix VarFormat for negative exponent formats.
- Add tests for the above + a couple of "todo_wine"'s.
- implement handling of exponents (e+,e-,E+,E-) when parsing number
  formats
- fix a small cut'n'paste error in the comments
Francois Gouget <fgouget@free.fr>
- Assorted spelling fixes.
Marcus Meissner <marcus@jet.franken.de>
- Added VarMonthName() implementation.
- Corrected string length method in ITypeLib::IsName() and FindName()
  for LPOLESTR type.
- Fixed IType::Invoke in regards to handling propertyget variables
  longer than 4 bytes (like VT_DATE).
- Added testcases for OLE Picture handling.
- Implemented PICTYPE_NONE loading.
- Cleaned up stream loading, handle "lt" magic.
- Fixed some small problems exposed by tests against native.
Stefan Huehner <stefan@huehner.org>
- Fix some more -Wstrict-prototypes warnings.
Huw Davies <huw@codeweavers.com>
- Add comments describing the first DWORD in an import table entry.

svn path=/trunk/; revision=17037
2005-08-03 22:46:31 +00:00
Gé van Geldorp
7ba677508a Sync to Wine-20050628:
Robert Shearman <rob@codeweavers.com>
- Convert some registry helper functions to use unicode versions of
  CLSID & registry functions (untested).
- Add registry entries for local-only OLE interfaces.
- Change IUnknown to local interface.
- IUnknown isn't a remotable interface so the stub manager shouldn't
  need a marshaller for it.
- Change the RPC code to use the unicode versions of the CLSID &
  registry functions.
- Don't disconnect proxies flagged with SORFP_NOLIFETIMEMGMT. It makes
  no sense and only causes trouble for proxies that depend on these
  proxies being available.
- Change some of the registry helper functions to use the unicode
  versions of the CLSID & registry functions.
- Reindent CoGetClassObject and output an error message if the class
  isn't registered.
- Add tests for the touched functions.
Dmitry Timoshkov <dmitry@codeweavers.com>
- Make remaining OLE interface vtables const.
Richard Cohen <richard@daijobu.co.uk>
- Base FileMonikerImpl_Save() on XP.
- Correct handling of Unicode strings & multibyte locales.
- More error checking.
- Change ERR to WARN.
- Match Windows quick & dirty estimate for GetSizeMax().
Stefan Huehner <stefan@huehner.org>
- Fix some more -Wstrict-prototypes warnings.
Mike Hearn <mike@navi.cx>
- Add some tracing to the IRemUnknown RpcProxyBuffer implementation.
Eric Pouech <pouech-eric@wanadoo.fr>
- Const correctness fixes.
Richard Cohen <richard@daijobu.co.uk>
- IEnum::Clone shouldn't do a Reset.
Marcus Meissner <marcus@jet.franken.de>
- Removed CLSID_CompositeMoniker (conflicting with static definition).
Alexandre Julliard <julliard@winehq.org>
- Sort entry points alphabetically.

svn path=/trunk/; revision=17036
2005-08-03 22:31:39 +00:00
Thomas Bluemel
9faf200230 fixed difference in signedness warning (GCC4)
svn path=/trunk/; revision=17035
2005-08-03 22:31:41 +00:00
Gé van Geldorp
4e23c74418 Sync to Wine-20050628:
Mike McCormack <mike@codeweavers.com>
- Repaint the area behind the "transparent" text control when it
  changes.
- Implement transparency in the text control.
- Make the MSI icon control work.
- Make tabs work in msi dialogs.
- Added support for the MSI MaskEdit control.
- Use a richedit control for license text.
- Fix radio button groups. Don't add the WS_GROUP style to every
  window.
- Use standard lists in the event subscription code.
- Take the dialog frame into account when calculating the dialog size.
- Use MSI_QueryGetRecord in one more place.
- Create a helper function to fetch a single record from a query.
- More -Wmissing-declarations and -Wwrite-strings warning fixes.
- Get rid of some redundant parser types.
- Use the new helper function MSI_QueryGetRecord.
- Use MSI_RecordGetString in more actions.
- Use MSI_RecordGetString where possible.
- Fixes for -Wmissing-declarations and -Wwrite-strings warnings.
- Remove some unused code.
- Add and correct some function declarations.
- Improve number parsing and avoid unicode.h.
- avoid unicode.h
- add a missing function prototype
- Create a stub implementation for MsiViewGetError.
- Remove more types from the parser.
- Test and fix the size of stream fields in a record.
- Clean up headers and make some functions static.
Marcus Meissner <meissner@suse.de>
- Use a simpler expression for the "RichEdit20W" string to workaround
  compiler bug.
- Remove cszbs from msi/action.h.
Aric Stewart <aric@codeweavers.com>
Mike McCormack <mike@codeweavers.com>
- Allow dialog controls to subscribe to installer events.
- Fix handling of checkbox properties.
- Implement dialog events and hook up the dialog code.
Aric Stewart <aric@codeweavers.com>
- Break out all the file related actions and helper functions into
  files.c
- Break out all the top level apis into install.c.
- Break out all the class registration actions into classes.c. This
  includes RegisterClassInfo, RegisterProgIds, RegisterExtensions and
  RegisterMIMETypes.
- Break out all the helper functions into helpers.c.
- Added module upgrade.c and implemented FindRelatedProducts.
- A long overdue fix to MSI_SetTargetPath. This should fix an error with
  some installers that where unable to change the target path.
- Add functions to add the User UpgradeCodes.
- A simple cleanup to only track the temp file if we need to have it
  laying around because the action is going on asynchronously. Otherwise
  clean up the temp file as the action finishes.
- Introduce really basic scripting of actions. This is primarily to get
  the order of execution of the action correct since some custom actions
  can be scripted and others are run during the script building phase.
- Perform ExecuteAction at UILevel 2.
- Rework CreateShortcuts to use MSI_IterateRecords.
- Properly handle -1 as a registry key root.
- Rework SelfRegModules to use MSI_IterateRecords.
- Rework component, feature and file loading to use MSI_IterateRecords.
- Rework RegisterFonts to use MSI_IterateRecords.
- Rework WriteIniValues to use MSI_IterateRecords.
- Rework PublishProduct to use MSI_IterateRecords.
- Rework RegisterTypeLibraries to use MSI_IterateR
- Rework LaunchConditions to use MSI_IterateRecord
- Rework CostFinalize to use MSI_IterateRecords.
- Rework WriteRegistryValues to use MSI_IterateRecords.
- Rework CreateFolders to use MSI_IterateRecords.
- Use MSI_IterateRecords for processing actions.
  Some whitespace cleanup and replace a comment block I did not want to
  remove.
- Flesh out the remaining keys in RegisterProduct.
- Extending upon Mike McCormack's cleanup to use MSI_RecordGetString.
- Register the Product Version also.
  Also help plug some memory leaks pointed out by Mike McCormack.
- Avoid a loop where a parent's parent refers to itself as its parent.
- Added module upgrade.c and implemented FindRelatedProducts.
- Set the Preselected property if appropriate (relevant to
  MigrateFeatureStates when implemented).
- Write out Product Language and Product Icon to the registry.
- Write out UpgradeCodes to the registry to allow for future upgrades.
- Don't get caught in loops on parent progids.
- Since multiple progids can refer to 1 class we need to check if that
  class is isntalled instead of just relying on having it set the
  InstallMe variable.
- Add install_on_demand for Extension servers also. currently defaulting
  to TRUE.
- Extension need to have 1 verb to mark the given progid to be
  installed.
- Do not loop if a ProgId's Parent Index it itself.
- Add a VersionIndIndex for tracking version independent fields for the
  ProgIds properly.
- Print a message for skipped actions in ProcessExecSequence like in the
  UISequence.
- Do not change a features state to Advertise if it explicitly disallows
  it.
- For typelibs index 1 do not add \\1 to the path. This cleans up
  registry diffs with native MSI.
- Register the FileType and correct short vs long path problems with
  InprocServer32. Also add install_on_demand boolean for future
  expansion.
- First pass at writing out CurVer keys for ProgIds. Also print a
  message for the actions we skip. Lines up with native MSI output logs
  for ease of comparison.
- A big rewrite of the whole RegisterClass, RegisterProgId,
  RegisterExtension and RegisterMIME actions. We now handle verbs
  properly, handle dependancies and such properly and keep track of what
  we need to register and what we do not properly.
- Allow control events to return codes to halt the processing of event.
  Needed for the SetTargetPath Event.
- Fix situations where TARGETDIR is set to a non \ terminated
  path. Fixes a few installers.
- Redo how we extract files from a cabinet in order to dramatically
  improve performance, especially if picking and choosing files out of
  the cabinet.
- Duplicate files should not fail if unable to get Destination
  Directory.
- Use MSI_IterateRecords for DuplicateFiles.
- Add UI messages to FindRelatedProducts.
- Reduce unneeded includes.
- A "1" is returned not a 1 for AssignmentType. Also as a bit more to
  the FIXME message.
- Add Language to the values we can query with MsiGetProductInfo.
- Correct a crash if the length buffer is NULL.
- Locate where a buffer size is not being set and correctly handle the
  buffer size conversion from W to A (with help from Robert Shearman).
- Make sure the TRACE statements do not spew garbage by using
  debugstr_wn.
- Restrict deformating of nested index keys [[1]].
- Introduce the beginning of group deformating {}.
- Implement the [!file] format to produce the short filename.
Stefan Huehner <stefan@huehner.org>
- Fix more -Wstrict-prototypes warnings.
Francois Gouget <fgouget@free.fr>
- Assorted spelling fixes.
Dmitry Timoshkov <dmitry@codeweavers.com>
- Make more of the OLE interface vtables const.

svn path=/trunk/; revision=17034
2005-08-03 22:12:15 +00:00
Gé van Geldorp
0f766beac3 Sync to Wine-20050628:
Mike McCormack <mike@codeweavers.com>
- Switch IShellLink to use shlwapi.SHCreateStreamOnFileW.
Dmitry Timoshkov <dmitry@codeweavers.com>
- Make remaining OLE interface vtables const.
Alexandre Julliard <julliard@winehq.org>
- Sort entry points in the same order as Windows.
Stefan Huehner <stefan@huehner.org>
- Fix some more -Wstrict-prototypes warnings.

svn path=/trunk/; revision=17033
2005-08-03 21:34:01 +00:00
Thomas Bluemel
fd1eac7f05 implemented OffsetClipRgn()
svn path=/trunk/; revision=17031
2005-08-03 20:15:58 +00:00
Eric Kohl
f86b5b132c - Add registry property constants.
- Finish CM_Set_DevNode_Registry_Property_ExW.

svn path=/trunk/; revision=17030
2005-08-03 20:10:32 +00:00
Filip Navara
1bbf906bf4 Use valid timer ID for SetTimer.
svn path=/trunk/; revision=17029
2005-08-03 19:34:29 +00:00
Thomas Bluemel
f1cc84e27c define __NO_CTYPE_INLINES so DBG:=0 builds don't import from msvcrt
svn path=/trunk/; revision=17028
2005-08-03 19:28:51 +00:00
Casper Hornstrup
157587d815 Fix building 'make test'
svn path=/trunk/; revision=17027
2005-08-03 19:15:47 +00:00
Martin Fuchs
8f8a4dbabd switch back to #include "precomp.h" for precomp.cpp because it's needed for VC++ and doesn't irritate GCC since it's not compiled with GCC anyways.
svn path=/trunk/; revision=17026
2005-08-03 17:46:56 +00:00
Emanuele Aliberti
ee4b8ce5d4 Document <module type="nativecui" ...>
svn path=/trunk/; revision=17004
2005-08-03 15:05:54 +00:00
Hervé Poussineau
e0d12ad786 Fix mouse.inf file (missing %)
svn path=/trunk/; revision=17003
2005-08-03 14:48:38 +00:00
Hervé Poussineau
fc64a3b777 Don't display available resolutions even if DBG is set. Rely only on NDEBUG
svn path=/trunk/; revision=17002
2005-08-03 14:46:17 +00:00
Hervé Poussineau
3f4fb2baec Implement VideoPortVerifyAccessRanges
svn path=/trunk/; revision=17001
2005-08-03 14:46:12 +00:00
Casper Hornstrup
0349ed11fb Fix building kernel32 test
svn path=/trunk/; revision=17000
2005-08-03 14:45:50 +00:00
Filip Navara
e51757630c Fix name length handing in RtlQueryAtomInAtomTable.
svn path=/trunk/; revision=16999
2005-08-03 14:45:39 +00:00
Filip Navara
1eaff64466 - Implement !DeletePinned case in RtlEmptyAtomTable.
- Fix error checking in RtlAddAtomToAtomTable / RtlpCheckIntegerAtom.

svn path=/trunk/; revision=16998
2005-08-03 14:26:56 +00:00
Hervé Poussineau
5327167d43 Set right compatible IDs for USB devices with multiple interfaces
Better implementation of IOCTL_USB_GET_NODE_CONNECTION_INFORMATION

svn path=/trunk/; revision=16997
2005-08-03 14:03:31 +00:00
Thomas Bluemel
6cf95c3fcd #include "precomp.h" -> #include <precomp.h>
svn path=/trunk/; revision=16994
2005-08-03 11:10:21 +00:00
Filip Navara
0ee2eb988f #include "precomp.h" -> #include <precomp.h>
svn path=/trunk/; revision=16993
2005-08-03 10:00:30 +00:00
Filip Navara
ec8d77890b #include "precomp.h" -> #include <precomp.h>
svn path=/trunk/; revision=16992
2005-08-03 09:31:39 +00:00
Gé van Geldorp
2564afd831 i386DX <i386dx@hotmail.com>:
Dutch resources

svn path=/trunk/; revision=16991
2005-08-03 08:31:30 +00:00
Filip Navara
7cdbc1d414 Add stub for VpNotifyEaData.
svn path=/trunk/; revision=16990
2005-08-03 07:50:16 +00:00
Martin Fuchs
ae646476ce set svn:eol-style of *.vcproj and *.sln to CRLF
svn path=/trunk/; revision=16989
2005-08-03 05:20:59 +00:00
Martin Fuchs
f32aa7a945 set svn:eol-style of *.dsp/dsw to CRLF
svn path=/trunk/; revision=16987
2005-08-03 05:11:43 +00:00
Martin Fuchs
64e350d6d5 set svn:eol-style of *.dsp/dsw to CRLF
svn path=/trunk/; revision=16986
2005-08-03 05:09:33 +00:00
Thomas Bluemel
1bfe04d376 Rouven Wessling <pentiumforever@gmail.com>:
- German translations

svn path=/trunk/; revision=16985
2005-08-02 22:20:03 +00:00
Filip Navara
c635b98ceb Move #endif one line down to make the source code balanced.
svn path=/trunk/; revision=16984
2005-08-02 22:14:52 +00:00
Filip Navara
595f9f988d Revert changes accidently commited along with last patch.
svn path=/trunk/; revision=16983
2005-08-02 22:04:02 +00:00
Thomas Bluemel
91e5ea7dfa fix typo...
svn path=/trunk/; revision=16982
2005-08-02 21:46:42 +00:00
Filip Navara
aea5c02d13 Make w3seek happy.
svn path=/trunk/; revision=16981
2005-08-02 21:22:40 +00:00
Thomas Bluemel
c04526fcde Violin Iliev <violin@developer.bg>:
- Bulgarian translation

svn path=/trunk/; revision=16980
2005-08-02 21:16:50 +00:00
Thomas Bluemel
4d49702340 SVN maintainance: fix line endings and ignore proxy makefiles
svn path=/trunk/; revision=16979
2005-08-02 21:12:28 +00:00
Filip Navara
03eedf362f Use mapped sections for fonts instead of paged pool memory.
svn path=/trunk/; revision=16977
2005-08-02 20:33:33 +00:00
Emanuele Aliberti
b8940ad696 A really simple Win32 implementation of 'hostname'.
svn path=/trunk/; revision=16976
2005-08-02 20:17:01 +00:00
Filip Navara
ce5d8968c6 Fix linux build.
svn path=/trunk/; revision=16975
2005-08-02 18:21:48 +00:00
Filip Navara
29532ce6f6 Fix the -sections option of PEFIXUP tool and adapt RBUILD to use it.
svn path=/trunk/; revision=16974
2005-08-02 18:13:21 +00:00
Casper Hornstrup
db35c17756 Locate latest revision ISO
svn path=/trunk/; revision=16973
2005-08-02 16:13:02 +00:00
Emanuele Aliberti
a7acccff70 Modify NTDLL!DbgSsInitialize/4 signature.
svn path=/trunk/; revision=16972
2005-08-02 16:11:13 +00:00
Casper Hornstrup
c9a2c8aab8 Locate next revision ISO
svn path=/trunk/; revision=16971
2005-08-02 15:58:41 +00:00
Alex Ionescu
178ec80139 - Remove CmpFindObject hack and use ObFindObject with on-demand ObjectCreateInfo.
- Note that the code is still wrong and will be fixed soon.

svn path=/trunk/; revision=16970
2005-08-02 14:01:43 +00:00
Filip Navara
b0c4274c66 Fix some pointer casts.
svn path=/trunk/; revision=16969
2005-08-02 13:53:52 +00:00
Filip Navara
ef03d1cb40 - Remove the DoneInitYet hack.
- Add stub for PsSetProcessPriorityByClass.
- Rename PsSetProcessWin32WindowStation to PsSetProcessWindowStation.

svn path=/trunk/; revision=16968
2005-08-02 13:52:10 +00:00
Filip Navara
b5bd68a13b Remove duplicate definitions.
svn path=/trunk/; revision=16967
2005-08-02 13:21:18 +00:00
Thomas Bluemel
0f4524a978 fixed the CONTAINING_RECORD macro
svn path=/trunk/; revision=16966
2005-08-02 11:23:40 +00:00
Alex Ionescu
91907678f1 - Add access state functions.
svn path=/trunk/; revision=16965
2005-08-02 03:56:29 +00:00
Eric Kohl
226f6c1ce2 Implement CM_Get_DevNode_Registry_Property[_Ex]A/W and CM_Set_DevNode_Registry_Property[_Ex]A/W partially.
svn path=/trunk/; revision=16964
2005-08-01 19:42:19 +00:00
Filip Navara
2b6bb7a79e Don't fallback to linear search for exports, it's not needed.
svn path=/trunk/; revision=16963
2005-08-01 18:11:54 +00:00
Filip Navara
1dfc824d91 Don't do linear search for exports, it's not needed.
svn path=/trunk/; revision=16962
2005-08-01 18:04:49 +00:00
Filip Navara
aad6d78c8c Remove the PESUM tool, the PEFIXUP tool can be used instead.
svn path=/trunk/; revision=16961
2005-08-01 17:58:47 +00:00
Filip Navara
28aff5352b Add new PEFIXUP tool and use it in the build system.
svn path=/trunk/; revision=16960
2005-08-01 17:56:41 +00:00
Thomas Bluemel
0c3b9e8545 print percentage character for the memory load in debug message (GlobalMemoryStatusEx). Suggested by WaxDragon
svn path=/trunk/; revision=16959
2005-08-01 16:28:11 +00:00
Emanuele Aliberti
e466431f36 RBuild 'project' document DTD (rough draft).
svn path=/trunk/; revision=16958
2005-08-01 16:11:29 +00:00
Emanuele Aliberti
178f4d48e9 Replace 'Value' with 'Content' as per XML spec.
Minor changes.

svn path=/trunk/; revision=16957
2005-08-01 16:08:29 +00:00
Thomas Bluemel
9c8224926f revert my last changes, it seems to cause problems when building on *nix
svn path=/trunk/; revision=16956
2005-08-01 15:21:40 +00:00
Filip Navara
7f3c5f0932 Various LdrGetProcedureAddress fixes:
- Fix the binary search limits.
- Fix the comparsion of names (previously "XXX" and "XXXyyy" would be considered identical) and make it case sensitive.
- Remove non-binary search, it's not needed.
- Don't use ULONG to store pointers.

svn path=/trunk/; revision=16955
2005-08-01 13:50:07 +00:00
Emanuele Aliberti
7c6d6d777a First attempt to make the XML data we feed rbuild conforming the XInclude spec.
svn path=/trunk/; revision=16954
2005-08-01 13:34:33 +00:00
Thomas Bluemel
91d235bf79 fixed uninitialized variable warning
svn path=/trunk/; revision=16953
2005-08-01 13:27:02 +00:00
Thomas Bluemel
d613b54421 revert back to -Os because of some buggy versions of GCC
svn path=/trunk/; revision=16952
2005-08-01 13:01:58 +00:00
Thomas Bluemel
5d4a08e403 compile release builds with -O3 instead of -Os because it catches more mistakes
svn path=/trunk/; revision=16951
2005-08-01 12:57:34 +00:00
Emanuele Aliberti
305aa85bd7 Add reference to the 'compilerflag' element.
Add reference to the 'group' element.
Add Parents section to more elements.

svn path=/trunk/; revision=16950
2005-08-01 12:54:50 +00:00
Thomas Bluemel
4ae7cce227 temporarily disable -Werror for tools, there seem to be differences between versions of gcc issuing some warnings
svn path=/trunk/; revision=16949
2005-08-01 12:51:20 +00:00
Filip Navara
7fafe4314a Pass correct pool type to PsChargePoolQuota.
svn path=/trunk/; revision=16948
2005-08-01 11:59:22 +00:00
Thomas Bluemel
1ae15efc80 don't count references for the default quota block and fixed warnings
svn path=/trunk/; revision=16947
2005-08-01 11:58:47 +00:00
Filip Navara
f4ff4e648a Fix a typo. Thanks to Hervé Poussineau for noticing.
svn path=/trunk/; revision=16946
2005-08-01 11:46:30 +00:00
Filip Navara
9b42911e3d Add pool type masks and use them.
svn path=/trunk/; revision=16945
2005-08-01 11:33:15 +00:00
Filip Navara
981faa01eb Fix definition of EPROCESS_QUOTA_ENTRY.
svn path=/trunk/; revision=16944
2005-08-01 11:26:53 +00:00
Filip Navara
160b65f87e Setup quota blocks for processes.
svn path=/trunk/; revision=16943
2005-08-01 11:21:42 +00:00
Filip Navara
f28b5f7302 Setup quota blocks for processes.
svn path=/trunk/; revision=16942
2005-08-01 11:20:44 +00:00
Thomas Bluemel
50398b7a03 define common build flags so they can easily be changed for all tools
svn path=/trunk/; revision=16941
2005-08-01 10:58:28 +00:00
Thomas Bluemel
0bd9fc8ef1 fixed some warnings when compiling with -O3
svn path=/trunk/; revision=16940
2005-08-01 10:21:20 +00:00
Filip Navara
73113cc87d Fix prototype of RtlCreateHeap and respect the CommitRoutine if passed. Also fix the heap manager to be usable by kernel mode code.
svn path=/trunk/; revision=16939
2005-08-01 10:19:22 +00:00
Thomas Bluemel
f928348d93 fixed some uninitialized variables warnings
svn path=/trunk/; revision=16938
2005-08-01 09:23:13 +00:00
Hervé Poussineau
fc10b038f5 Add back changes of revision 16783. Sorry Alex
svn path=/trunk/; revision=16937
2005-08-01 09:08:07 +00:00
Filip Navara
f89cc27ede Cleanup SID initialization and fill all SeExports fields.
svn path=/trunk/; revision=16936
2005-08-01 09:05:20 +00:00
Filip Navara
e18c5c1218 Fix LdrAccessResource for ordinary mapped files.
svn path=/trunk/; revision=16935
2005-08-01 08:58:15 +00:00
Filip Navara
4f9fb92e50 Fix DPRINT.
svn path=/trunk/; revision=16934
2005-08-01 08:56:51 +00:00
Filip Navara
a4ba1bf284 Fix paramater validation and pointer manipulation in RtlAddAce.
svn path=/trunk/; revision=16933
2005-08-01 08:55:22 +00:00
Filip Navara
ff9444533e Fix locking in RtlPinAtomInAtomTable.
svn path=/trunk/; revision=16932
2005-08-01 08:50:30 +00:00
Hervé Poussineau
515aaf6a7e Merge from Wine:
- Add traces at the start of functions
- (reported by Matthew Davison)
  Preserve the spaces before an opening quote in the middle of a token.
- Matthew Davison <mjd77@cam.ac.uk>
  Stub out the error dialog functions.
  Modify the default callbacks to call these for Delete and Rename errors.
  Modify the default callbacks to ignore file missing errors when deleting files.
- Stefan Huehner <stefan@huehner.org>
  Fix some more -Wmissing-declarations warnings.
- Mike McCormack <mike@codeweavers.com>
  gcc 4.0 -Wpointer-sign fixes (Reg* functions).
- Detlef Riekenberg <wine.dev@web.de>
  SetupSetFileQueueAlternatePlatform{AW} implemented as stub.

svn path=/trunk/; revision=16931
2005-08-01 07:46:06 +00:00
Hartmut Birr
15a077c46a Used MmFreeVirtualMemory in MmDeleteTeb because MmFreeMemoryAreaByPtr doesn't free the region list entries.
svn path=/trunk/; revision=16930
2005-08-01 00:06:18 +00:00
Thomas Bluemel
3a76f91710 fixed some warnings when compiling with -O3
svn path=/trunk/; revision=16928
2005-07-31 23:39:05 +00:00
Thomas Bluemel
9804ebb026 fixed uninitialized variable warning
svn path=/trunk/; revision=16927
2005-07-31 21:51:04 +00:00
Hartmut Birr
2f708e9f44 - Changed BasepConvertUnicodeEnvironment to obtain the calculated length.
- Optimized the calculation of the environment length.  
- Disable the execution of vdm for com-files, because it breaks the execution of batch files.
- Removed an unused variable.


svn path=/trunk/; revision=16926
2005-07-31 21:27:56 +00:00
Hartmut Birr
bec5197e46 Don't use INVALID_HANDLE_VALUE as HANDLE_DETACH_PROCESS.
svn path=/trunk/; revision=16925
2005-07-31 21:24:35 +00:00
Hartmut Birr
d20bf6a780 - Implemented CsrDuplicateHandleTable.
- Duplicate the handle table in CsrCreateProcess if the caller wants to inherit all handles.  
- Don't allocate new handles in CsrAllocConsole if the caller wants to reuse a console and if the parent handles were inherited.  
- Do only allow to reuse the console from parent.

svn path=/trunk/; revision=16924
2005-07-31 21:23:40 +00:00
Hartmut Birr
22332a5bae Fixed a typo.
svn path=/trunk/; revision=16923
2005-07-31 21:02:05 +00:00
Thomas Bluemel
918a8eeeb5 fixed typo in a comment
svn path=/trunk/; revision=16922
2005-07-31 20:35:08 +00:00
Thomas Bluemel
197982e303 fixed success check in RtlpCreateAtomHandle, ExCreateHandle returns EX_INVALID_HANDLE in case of failure. Thx to Filip
svn path=/trunk/; revision=16921
2005-07-31 18:52:36 +00:00
Martin Fuchs
611498e8d2 set svn:eol-style to native
svn path=/trunk/; revision=16920
2005-07-31 12:11:56 +00:00
Filip Navara
f2f5fc2afb Fix NULL-terminating of symbol image names.
svn path=/trunk/; revision=16919
2005-07-31 11:06:50 +00:00
Filip Navara
d6820f5fff Implement the magic flag in RtlImageDirectoryEntryToData and make the Size parameter non-optional.
svn path=/trunk/; revision=16918
2005-07-31 10:22:29 +00:00
Filip Navara
5b7fe4e1d2 Revert #16904 and clarify the comment about the race condition.
svn path=/trunk/; revision=16917
2005-07-31 09:48:12 +00:00
Martin Fuchs
6859ea0c71 set eol-style for all remaining XML files
svn path=/trunk/; revision=16916
2005-07-31 08:33:39 +00:00
Emanuele Aliberti
6540f242bf Document pch and linkerflag elements.
Rename Elements sections into Children.
Add Parents sections for some elements.
Make link work (tested with DBK=>HTML).

svn path=/trunk/; revision=16915
2005-07-31 07:08:15 +00:00
Emanuele Aliberti
90d0826221 Turn NTDLL.DLL a SUBSYSTEM_WINDOWS_CUI PE image (Casper Hornstrup suggested to use -nostartfiles, for the compilation to succeed).
svn path=/trunk/; revision=16914
2005-07-31 07:07:26 +00:00
Alex Ionescu
2f532c71f4 - Silence some debug messages
- Modify base address of iphlpapi so it doesn't get relocated
- Implemented SetTaskmanWindow and SetProgmanWindow

svn path=/trunk/; revision=16913
2005-07-31 06:22:05 +00:00
Alex Ionescu
a5bc0e6462 Define NDEBUG
svn path=/trunk/; revision=16912
2005-07-31 05:46:42 +00:00
Alex Ionescu
838cc74dd0 Silence debug messages
svn path=/trunk/; revision=16911
2005-07-31 05:43:10 +00:00
Alex Ionescu
3f30061228 Fix error handle output.
svn path=/trunk/; revision=16910
2005-07-31 03:27:04 +00:00
James Tabor
29c3f9ae54 Correct build name. Should be Edit.exe.
svn path=/trunk/; revision=16909
2005-07-31 00:17:57 +00:00
Alex Ionescu
7cf9ad08e3 Don't use CSRSS handles if we alreay have some (so we can inherit file handles, etc)
svn path=/trunk/; revision=16908
2005-07-30 23:57:14 +00:00
Alex Ionescu
eb86553bed Decrease quantum during wait and during no-wait... mentionned by Shmuel Baron
svn path=/trunk/; revision=16907
2005-07-30 23:43:45 +00:00
Filip Navara
08fe62965f Remove code that I accidently commited in revision 16905.
svn path=/trunk/; revision=16906
2005-07-30 23:16:03 +00:00
Filip Navara
9f784a4848 Ignore the "magic flag" in RtlImageDirectoryEntryToData.
svn path=/trunk/; revision=16905
2005-07-30 23:08:26 +00:00
Filip Navara
34674d7646 Fix a race condition in quantum code. Spotted by Shmuel Baron.
svn path=/trunk/; revision=16904
2005-07-30 23:06:46 +00:00
Eric Kohl
46be8912e3 - Support conformant arrays as in and out parameters.
- Fix message buffer size calculation for client and server.

svn path=/trunk/; revision=16903
2005-07-30 19:31:52 +00:00
Aleksey Bragin
237b710b56 Move NDEBUG higher so it actually works and doesn't output all debug messages (fix suggested by hpoussin).
svn path=/trunk/; revision=16902
2005-07-30 19:06:53 +00:00
Hartmut Birr
2e4f8bfdb1 If a mutex already exist, open it instead of create.
svn path=/trunk/; revision=16901
2005-07-30 19:03:34 +00:00
Hartmut Birr
65c8fe4c15 Initialized Basep8BitStringToUnicodeString
svn path=/trunk/; revision=16900
2005-07-30 19:00:33 +00:00
Hartmut Birr
2316f95498 Check if the cpu supports the pae mode.
svn path=/trunk/; revision=16899
2005-07-30 18:55:25 +00:00
Hartmut Birr
dce178cf7c Made cmd unicode compatible.
svn path=/trunk/; revision=16898
2005-07-30 18:52:33 +00:00
Hartmut Birr
dc648e2083 Use FileGetString instead of ReadFile, because ReadFile doesn't return a null terminated string.
svn path=/trunk/; revision=16897
2005-07-30 18:51:43 +00:00
Hartmut Birr
498a7947fe Put FindClose onto the correct position.
svn path=/trunk/; revision=16896
2005-07-30 18:32:18 +00:00
Emanuele Aliberti
3e4d8abf36 Create a subdir for rbuild documentation.
Move rbuild.txt there.
Convert rbuild.txt in Docbook.
Fix some minor inconsistencies in the element reference.

svn path=/trunk/; revision=16895
2005-07-30 16:53:09 +00:00
Filip Navara
ca071d7417 - Replace MODULE_OBJECT with LDR_DATA_TABLE_ENTRY.
- Export PsGetCurrentThread and PsGetCurrentProcess.

svn path=/trunk/; revision=16894
2005-07-30 16:25:35 +00:00
Hartmut Birr
f25c9b142b Reverted back to 16420, because it contains too many bugs.
svn path=/trunk/; revision=16893
2005-07-30 13:49:41 +00:00
Magnus Olsen
c34da245a4 fix waring kdump.c:246: warning: 'OldIrql' may be used uninitialized for dgb=0;
svn path=/trunk/; revision=16892
2005-07-30 13:44:07 +00:00
James Tabor
050a6ba318 Implement SetMenuItemBitmaps and fix bool flags.
svn path=/trunk/; revision=16891
2005-07-30 00:52:22 +00:00
James Tabor
af30e6342b Patch by Dmitry Timoshkov dmitry@baikal.ru. Take into account CS_NOCLOSE window class style and SC_CLOSE system menu item state while adding MDI system menu buttons and generating WM_SYSCOMMAND messages.
svn path=/trunk/; revision=16890
2005-07-29 23:37:11 +00:00
James Tabor
8fe920ee49 Show SetMenuItemInfoA&W implemented.
svn path=/trunk/; revision=16889
2005-07-29 23:15:01 +00:00
Thomas Bluemel
a37c5005c7 make the telProcessNetwork() thread function STDCALL!
svn path=/trunk/; revision=16888
2005-07-29 23:04:48 +00:00
Steven Edwards
62e33ea5ff dos line endings
svn path=/trunk/; revision=16887
2005-07-29 23:03:42 +00:00
Thomas Bluemel
f5bba7d9af - simplified BasepAnsiStringToHeapUnicodeString
- fixed linking (global variable Basep8BitStringToUnicodeString was missing)
- fixed typo in the debug print in SetThreadUILanguage

svn path=/trunk/; revision=16886
2005-07-29 23:03:12 +00:00
Steven Edwards
4214fc67a7 turn on command options
svn path=/trunk/; revision=16885
2005-07-29 23:01:16 +00:00
Steven Edwards
42f41fa7c2 imported mkdosfs, added getopt.c for use with dosfsck
svn path=/trunk/; revision=16884
2005-07-29 22:53:33 +00:00
Steven Edwards
c7cd667539 Major fixes for partitions larger than 4GB. Thanks to Tamlin again.
svn path=/trunk/; revision=16883
2005-07-29 22:22:12 +00:00
Hartmut Birr
7006f75f63 - Copy all data in FindFirstFileA.
- Changed back to the old code in FindFirstFileExW, because too many things are broken or useless.

svn path=/trunk/; revision=16882
2005-07-29 21:59:06 +00:00
Hartmut Birr
ade86ba7d7 Fixed some bugs in CreateProcessA which was introduced by r16730.
svn path=/trunk/; revision=16881
2005-07-29 21:55:09 +00:00
Filip Navara
7559937efb Fix definiton of DPRINT1 for non-DBG build.
svn path=/trunk/; revision=16879
2005-07-29 18:11:04 +00:00
Thomas Bluemel
e069829247 dynamically import functions from ntdll on startup
svn path=/trunk/; revision=16878
2005-07-29 18:01:01 +00:00
Thomas Bluemel
209e4c128e silence debug messages when calling the SEH handler
svn path=/trunk/; revision=16877
2005-07-29 17:35:22 +00:00
Thomas Bluemel
23d295c1ca fix the SetThreadUILanguage stub
svn path=/trunk/; revision=16876
2005-07-29 17:31:59 +00:00
Magnus Olsen
b2c6d0e0d9 Implement GdiEntry14 (party tested see older commit msg)
svn path=/trunk/; revision=16875
2005-07-29 17:11:11 +00:00
Thomas Bluemel
af45d81b0e don't limit read/write access for kdb to umode mem
svn path=/trunk/; revision=16874
2005-07-29 16:53:27 +00:00
Steven Edwards
7917a7f21d Fixes by tamlin. It really works now.
svn path=/trunk/; revision=16873
2005-07-29 16:48:09 +00:00
Alex Ionescu
6aa9f0c2da - Don't always print TRACE/WARN on WINE DLLs. Thanks to Filip Navara.
svn path=/trunk/; revision=16872
2005-07-29 16:06:13 +00:00
Emanuele Aliberti
f781c38507 Even if the Session Manager is a degenerate subsystem, keep its include files in the include/subsys tree.
svn path=/trunk/; revision=16871
2005-07-29 15:17:25 +00:00
Thomas Bluemel
3536691731 define __NO_CTYPE_INLINES to get DBG:=0 builds work again
svn path=/trunk/; revision=16870
2005-07-29 15:11:26 +00:00
Filip Navara
9697817837 Stop abusing the non-paged pool.
svn path=/trunk/; revision=16869
2005-07-29 15:08:20 +00:00
Filip Navara
dd2dc39610 Fix the file to be actually compilable (with GAS 2.16.91).
svn path=/trunk/; revision=16868
2005-07-29 15:00:02 +00:00
Alex Ionescu
1afce7ac9b - Add back and fix useful dprint.
svn path=/trunk/; revision=16867
2005-07-29 14:56:38 +00:00
Casper Hornstrup
62104039bc Add stylesheet header to xml
svn path=/trunk/; revision=16866
2005-07-29 14:36:11 +00:00
Filip Navara
be84f5ac52 IoAllocateAdapterChannel should set CurrentIrp field in the wait context block.
svn path=/trunk/; revision=16865
2005-07-29 13:58:25 +00:00
Emanuele Aliberti
852cd1035f Add posix, os2, and vms optional modules.
svn path=/trunk/; revision=16864
2005-07-29 13:56:00 +00:00
Filip Navara
12e1f03a17 IoAllocateAdapterChannel should set CurrentIrp field in the wait context block.
svn path=/trunk/; revision=16863
2005-07-29 13:54:13 +00:00
Thomas Bluemel
7fdc3cb55b Saveliy Tretiakov <saveliyt@mail.ru>:
serialui returns error codes directly.

svn path=/trunk/; revision=16862
2005-07-29 13:50:05 +00:00
Emanuele Aliberti
91ae1adf27 More details in the rosapps makefile message.
Split sysutils.

svn path=/trunk/; revision=16861
2005-07-29 13:46:03 +00:00
Filip Navara
93155e947c Initialize DescriptorTranslated->u.Interrupt.Level before calling HalGetInterruptVector. Remember, casting hides bugs! Debugged by Hervé Poussineau.
svn path=/trunk/; revision=16860
2005-07-29 13:30:22 +00:00
Thomas Bluemel
bbdbd036ca added a forward declaration to _DRIVE_LAYOUT_INFORMATION(_EX). this fixes building io/disk.c with GCC4. The reason is that the structures were used in function prototypes, which are forward declarations in the scope of the function declaration only. Since the structures were defined later, the implementations of the functions using them, actually used the defined structure types, which were different from the forward declarations in the function prototypes (even though they have the same name, they just differ in their scope). This caused GCC to warn because of incompatible function prototypes and incompatible pointer types passed to those functions
svn path=/trunk/; revision=16859
2005-07-29 13:28:37 +00:00
Filip Navara
05bc18eb6c Properly propagate the SL_PENDING_RETURNED flag to stack locations in IofCompleteRequest and fix the priority boost for master IRPs.
svn path=/trunk/; revision=16858
2005-07-29 13:28:34 +00:00
James Tabor
714eb0ec09 Sorry for the mess. Fixup debug prints.
svn path=/trunk/; revision=16857
2005-07-29 12:20:28 +00:00
Casper Hornstrup
14344dd176 Display implemented/unimplemented icon for functions
svn path=/trunk/; revision=16856
2005-07-29 12:19:26 +00:00
Casper Hornstrup
e4bb3b1573 Browser XSLT support. Optimize for size.
svn path=/trunk/; revision=16855
2005-07-29 11:40:01 +00:00
Emanuele Aliberti
3b17d563fa Various fixex to make HEAD compile.
I hope I did break nothing.

svn path=/trunk/; revision=16854
2005-07-29 10:04:38 +00:00
Emanuele Aliberti
c20aa760c5 Add PORT_MESSAGE_TYPE macro.
svn path=/trunk/; revision=16853
2005-07-29 09:51:08 +00:00
Emanuele Aliberti
62e6228e7e Various fixes to DPRINT parameter list.
Some were #if0'ed because they referenced non existing variables or parameters.

svn path=/trunk/; revision=16852
2005-07-29 09:30:41 +00:00
Emanuele Aliberti
3bf350101f [11:21] EmanueleAliberti: Usurp: drivers/dd/beep/bbep.c:178: only one DPRINT was #if 0'ed
[11:22]	Usurp: EmanueleAliberti: its a 2 line change
 	[11:22]	Usurp: <Usurp> -        pbsp->Frequency,
 	[11:22]	Usurp: <Usurp> -        pbsp->Duration);
 	[11:22]	Usurp: <Usurp> +        BeepParam->Frequency,
 	[11:22]	Usurp: <Usurp> +        BeepParam->Duration);

svn path=/trunk/; revision=16851
2005-07-29 09:25:26 +00:00
Alex Ionescu
ddb24faedc - Fix debug header, spottted by Gunnar
svn path=/trunk/; revision=16850
2005-07-29 00:14:05 +00:00
Thomas Bluemel
a661e95cdf clear out the lower 2 bits of a pid before using it to calculate the hash as they may vary
svn path=/trunk/; revision=16849
2005-07-28 23:29:44 +00:00
Thomas Bluemel
d0f433ab3a don't generate meaningless lvalue typecast
svn path=/trunk/; revision=16848
2005-07-28 23:22:47 +00:00
Thomas Bluemel
f2c7927059 discard explicitly returned value
svn path=/trunk/; revision=16847
2005-07-28 23:19:22 +00:00
Alex Ionescu
b5027d8a17 - Fix/update w32api PE headers
- Implement proper PEB creation, set all necessary fields and read data from PE Header and Config Directory. Fixes "corruption" issue with console apps.

svn path=/trunk/; revision=16846
2005-07-28 22:43:24 +00:00
Magnus Olsen
01cbbcac9c Implement GdiEntry13, GdiEntry15, GdiEntry16 (all are party tested)
svn path=/trunk/; revision=16845
2005-07-28 22:34:11 +00:00
Magnus Olsen
480b18f588 Implement GdiEntry12 (8 of 16 are done and party tested)
svn path=/trunk/; revision=16844
2005-07-28 22:08:29 +00:00
Magnus Olsen
6f8996d82e implement GdiEntry 8, Implement GdiEntry 10
svn path=/trunk/; revision=16843
2005-07-28 21:55:51 +00:00
Magnus Olsen
01918f37b1 thx irc : unC0Rr did sport typo fault in GdiEntry3
svn path=/trunk/; revision=16842
2005-07-28 21:34:00 +00:00
Magnus Olsen
52754f93e1 implement GdiEntry7 (some part is untested)
svn path=/trunk/; revision=16841
2005-07-28 21:08:55 +00:00
Magnus Olsen
642c3770b3 implement GdiEntry6 (party untested)
svn path=/trunk/; revision=16840
2005-07-28 21:00:24 +00:00
Magnus Olsen
a5fb10e380 delete ddentry.h for it was it was party copy of include/win32k/ntdraw.h, change to ros coding style forgot about that. Implement GdiEntry5 (3 of 16 are done and untested)
svn path=/trunk/; revision=16839
2005-07-28 20:35:53 +00:00
Magnus Olsen
b5f3ac7964 set eol style native
svn path=/trunk/; revision=16838
2005-07-28 19:37:36 +00:00
Magnus Olsen
4d4bdde2eb implemet GdiEntry3 (2 of 16 are now implement) but some part is still untested
svn path=/trunk/; revision=16837
2005-07-28 19:28:25 +00:00
Filip Navara
f99da74356 Add definition of PI_RESOURCE_ARBITER_ENTRY.
svn path=/trunk/; revision=16836
2005-07-28 19:23:11 +00:00
Steven Edwards
6d7b5426e7 some cleanups and I hope closer to making it work
svn path=/trunk/; revision=16835
2005-07-28 18:53:35 +00:00
Magnus Olsen
c33b209409 implement GDIEntry1 of 16, the code is bit untested, we can not test it until all are in place and win32k/ntdraw got some stub remove. when all GdiEntry1-16 we are compatble with ms directdraw1-7 interface in gdi32.dll
svn path=/trunk/; revision=16834
2005-07-28 18:45:58 +00:00
Steven Edwards
1aa3ba72f9 fixed opening of the device
svn path=/trunk/; revision=16833
2005-07-28 18:34:01 +00:00
Magnus Olsen
fea82752a1 add copyright note
svn path=/trunk/; revision=16832
2005-07-28 16:52:15 +00:00
Magnus Olsen
0ee80aa69e Do not do syscall. redirect the call to DdEntry1-56 in gdi32.dll it make our d3d8thk windows xp compatible.
svn path=/trunk/; revision=16831
2005-07-28 16:44:25 +00:00
Magnus Olsen
7b99ee39f8 Add DdEntry 1-56 it is pure syscall to win32k/ntdraw. Windows XP and higher does have this entry. And thanks to that we can make directdraw Windows XP or higher compatible. But rember alot of directdraw api are still stub in win32k/ntdraw.
svn path=/trunk/; revision=16830
2005-07-28 16:42:06 +00:00
Emanuele Aliberti
ab051595b1 Fix compilation (as hinted by Alex).
svn path=/trunk/; revision=16828
2005-07-28 11:48:58 +00:00
Casper Hornstrup
509048a223 Don't clean alias modules
svn path=/trunk/; revision=16827
2005-07-28 10:45:21 +00:00
Alex Ionescu
f15bd378aa - Start of fixing CreateProcess's problems. Implemented the console creation as it should be done (not quite, but much closer to design then before). There are still some problems (input/output handle inconsitencies), I am currently working on these issues;
- Some debug header cleanup.
 - Use the proper debug macros in some of the network code, shuts up a lot of spam when debugging for those modules wasn't enabled.

svn path=/trunk/; revision=16826
2005-07-28 04:12:43 +00:00
Steven Edwards
7851e816be fixed building dosfsck
svn path=/trunk/; revision=16825
2005-07-28 03:10:35 +00:00
Steven Edwards
ab92efdeca added port of dosfsck. Does not work yet as I cannot figure how to open the device. Win32 file access code is included ported from mkdosfs.c
svn path=/trunk/; revision=16824
2005-07-28 02:37:42 +00:00
Thomas Bluemel
71a12f48d0 implemented TreeResetNamedSecurityInfo and forward it to the MARTA provider
svn path=/trunk/; revision=16823
2005-07-27 23:11:38 +00:00
Alex Ionescu
42a3e034f8 - Fix incorrect definitions
svn path=/trunk/; revision=16822
2005-07-27 21:48:47 +00:00
Thomas Bluemel
9dabbd25fc implemented GetExplicitEntriesFromAcl and forward it to the MARTA provider
svn path=/trunk/; revision=16816
2005-07-27 20:24:11 +00:00
Alex Ionescu
6870957b9a - Fix included headers in GDI for PSDK compatibility
- Fix some incorrect definitions.
 - Remove more quintuplicated header nonsense...

svn path=/trunk/; revision=16815
2005-07-27 20:09:46 +00:00
Casper Hornstrup
f5ef0f7c0f Add Revison ISO interface
svn path=/trunk/; revision=16814
2005-07-27 20:09:19 +00:00
Casper Hornstrup
efcdb62b24 Move API status stylesheet
svn path=/trunk/; revision=16813
2005-07-27 20:06:18 +00:00
Casper Hornstrup
4f757b3d6e Add API status scripts
svn path=/trunk/; revision=16812
2005-07-27 20:04:48 +00:00
Alex Ionescu
ea3d8b6b8d - Fix debug header nonsense
- Fix some w32api definitions
 - MSVC/PSDK Compatibility fixes.
 - Clean up user32 headers for greater PCH usage.

svn path=/trunk/; revision=16811
2005-07-27 19:21:46 +00:00
Casper Hornstrup
24f28bb15b Put halmp.dll on CD
svn path=/trunk/; revision=16810
2005-07-27 19:10:57 +00:00
Casper Hornstrup
dc0201cafa Update API status to SVN
svn path=/trunk/; revision=16809
2005-07-27 18:46:52 +00:00
Casper Hornstrup
cfa4cb7478 rgenstat makefile
svn path=/trunk/; revision=16808
2005-07-27 18:46:27 +00:00
Thomas Bluemel
d04a2e183c implemented GetInheritanceSource and FreeInheritedFromArray and forward them to the MARTA provider
svn path=/trunk/; revision=16807
2005-07-27 18:24:18 +00:00
Thomas Bluemel
a3b5b6b8a8 implemented SetEntriesInAclA/W and forward the call to the MARTA provider
svn path=/trunk/; revision=16806
2005-07-27 17:20:57 +00:00
Steven Edwards
0acd7d503b revert the ctype.h changes to wine dlls
svn path=/trunk/; revision=16805
2005-07-27 17:06:06 +00:00
Alex Ionescu
298b0372cd - Include ctype.h by default.
svn path=/trunk/; revision=16804
2005-07-27 16:55:40 +00:00
Alex Ionescu
52973bb61c - Use inline function instead of macro.
svn path=/trunk/; revision=16803
2005-07-27 16:34:14 +00:00
Alex Ionescu
5af8e51ad1 - Use PCH everywhere to increase compile speed
- Some PSDK compatibility.

svn path=/trunk/; revision=16802
2005-07-27 16:18:06 +00:00
Alex Ionescu
c91952309a - Combine some assembly files together and move them to rtl
- Convert rtl memory functions written by Greatlord to GAS and properly add them into build system (not used yet since they haven't been tested)
 - Misc cleanups

svn path=/trunk/; revision=16801
2005-07-27 16:11:29 +00:00
Aleksey Bragin
6cc3428516 Timer modifications, turning on debug messages, implementing more functions (but spinlocks are disabled now).
Now it detects attached device(s) and show info in debug messages.

svn path=/trunk/; revision=16800
2005-07-27 14:57:33 +00:00
Alex Ionescu
ad3464c9a6 - Some more PSDK compatibility fixes
- Misc cleanup...

svn path=/trunk/; revision=16792
2005-07-27 06:18:52 +00:00
Martin Fuchs
b12a9db3c1 fix last patch: LPWSTR -> LPTSTR
svn path=/trunk/; revision=16791
2005-07-27 05:42:33 +00:00
Alex Ionescu
a9d517d95c - Fix all ACPI warnings and add default case for unhandled ACPI cases.
svn path=/trunk/; revision=16790
2005-07-27 05:09:05 +00:00
Alex Ionescu
14e0bc6128 - Fix warnings
- Remove code that isn't used in ReactOS because our _SHExpandEnvironmentStrings was completely re-written and thus doesn't use the two helper functions that WINE's _SHExpandEnvironmentStrings does.

svn path=/trunk/; revision=16789
2005-07-27 05:08:32 +00:00
Alex Ionescu
bafc9b7881 - Fix warnings
svn path=/trunk/; revision=16788
2005-07-27 02:06:31 +00:00
Alex Ionescu
3028ef48f1 - Fix warnings
svn path=/trunk/; revision=16787
2005-07-27 02:04:55 +00:00
Alex Ionescu
d6e5f3f636 - Fix warnings
svn path=/trunk/; revision=16786
2005-07-27 02:03:01 +00:00
Alex Ionescu
97ff2de432 - Fix warnings
svn path=/trunk/; revision=16785
2005-07-27 02:01:02 +00:00
Alex Ionescu
65282e530e - Fix warnings
svn path=/trunk/; revision=16784
2005-07-27 01:59:41 +00:00
Alex Ionescu
e1e6c8844c - Fix warnings
svn path=/trunk/; revision=16783
2005-07-27 01:58:34 +00:00
Alex Ionescu
1f1ef9eab3 - Fix broken IInternetZoneManagerVtbl definition.
svn path=/trunk/; revision=16782
2005-07-27 01:56:55 +00:00
Alex Ionescu
e618d8965d - Fix export definition
svn path=/trunk/; revision=16781
2005-07-27 01:52:27 +00:00
Alex Ionescu
42fb82a647 - Fix warnings
svn path=/trunk/; revision=16780
2005-07-27 01:50:31 +00:00
Alex Ionescu
edcb998459 - Fix warnings
svn path=/trunk/; revision=16779
2005-07-27 01:44:10 +00:00
Alex Ionescu
59d0d06535 - Fix warnings
svn path=/trunk/; revision=16778
2005-07-27 01:40:13 +00:00
Alex Ionescu
8f5a8d1f57 - Use correct wine debug functions
svn path=/trunk/; revision=16777
2005-07-27 01:38:51 +00:00
Magnus Olsen
6ea556e014 fix errorlevel for type, the r16766 was Brandon Turner patch sorry I forgt menoty his name.
svn path=/trunk/; revision=16776
2005-07-27 01:38:00 +00:00
Thomas Bluemel
961df2a275 export these stubs: AddAccessAllowedObjectAce, AddAccessDeniedObjectAce, AddAuditAccessObjectAce, CreatePrivateObjectSecurityEx, CreatePrivateObjectSecurityWithMultipleInheritance, ConvertToAutoInheritPrivateObjectSecurity, EqualDomainSid, GetWindowsAccountDomainSid and CreateWellKnownSid
svn path=/trunk/; revision=16775
2005-07-27 01:31:34 +00:00
Alex Ionescu
020c2e8477 - Fix warnings
svn path=/trunk/; revision=16774
2005-07-27 01:26:16 +00:00
Alex Ionescu
ffcb5d176a - Fix warnings
svn path=/trunk/; revision=16773
2005-07-27 01:22:46 +00:00
Alex Ionescu
2596f83747 - Fix warnings.
svn path=/trunk/; revision=16772
2005-07-27 01:14:00 +00:00
Alex Ionescu
71333e755e - Add wine_dbgstr_w
- Revert changes, msiexec is shared.

svn path=/trunk/; revision=16771
2005-07-27 01:12:53 +00:00
Alex Ionescu
0359f3c1eb - Fix warnings
- Print unicode strings normally with %S instead of wine macro.

svn path=/trunk/; revision=16770
2005-07-27 01:09:38 +00:00
Alex Ionescu
bbd697daa6 - Fix warnings
- Revert to wZ, gcc is being stupid.

svn path=/trunk/; revision=16769
2005-07-27 01:02:51 +00:00
Alex Ionescu
c8370e3506 - Fix warnings
svn path=/trunk/; revision=16768
2005-07-27 00:55:36 +00:00
Alex Ionescu
e5d3501d91 - Fix warnings
svn path=/trunk/; revision=16767
2005-07-27 00:54:07 +00:00
Magnus Olsen
b4ee0d0b03 update the english text for type
svn path=/trunk/; revision=16766
2005-07-27 00:50:24 +00:00
Magnus Olsen
a06de608ff add /P as param for Type, from PCDOS by Brandon Turner
svn path=/trunk/; revision=16765
2005-07-27 00:05:34 +00:00
Filip Navara
dac7500f25 Do not dereference NULL pointers and this time for real.
svn path=/trunk/; revision=16764
2005-07-26 22:51:03 +00:00
Filip Navara
09e1dd8b9b Do not dereference NULL pointers.
svn path=/trunk/; revision=16763
2005-07-26 22:40:03 +00:00
Thomas Bluemel
cbb15fff51 implemented GetNamedSecurityA/W and SetNamedSecurityInfoA/W and forward them to the MARTA provider
svn path=/trunk/; revision=16762
2005-07-26 22:21:02 +00:00
Hartmut Birr
13b2222c28 reverted last change
svn path=/trunk/; revision=16761
2005-07-26 21:33:38 +00:00
Thomas Bluemel
b0faf4f537 - implemented GetSecurityInfo and SetSecurityInfo which just check and/or transform parameters and pass the call to the MARTA provider
- added missing definitions to w32api

svn path=/trunk/; revision=16760
2005-07-26 21:20:55 +00:00
Thomas Bluemel
5887e9c4c9 added an initial MARTA provider (only two functions stubbed)
svn path=/trunk/; revision=16759
2005-07-26 21:17:06 +00:00
Hartmut Birr
9c8f710c8a Lock the handle table if we trying to get a pointer from a handle.
svn path=/trunk/; revision=16758
2005-07-26 19:46:07 +00:00
Hartmut Birr
2c31fcac60 Used IoQueryFileInformation and IoSetInformation instead of ZwQueryInformationFile and ZwSetInformationFile to remove some overhead.
svn path=/trunk/; revision=16757
2005-07-26 19:38:33 +00:00
Hartmut Birr
522a0e59cd Silence debug messages.
svn path=/trunk/; revision=16756
2005-07-26 19:35:22 +00:00
Hartmut Birr
1bae97d5ce - Remove the permanent flag from an object if ObInserObject failed (in IoCreateFile).
- Bypass the driver for FilePositionInformation and FileAlignmentInformation in NtQueryInformationFile and NtSetInformationFile.

svn path=/trunk/; revision=16755
2005-07-26 19:31:41 +00:00
Hartmut Birr
dd90242aa7 Acquire always the apc lock if we are modifying the apc queue.
svn path=/trunk/; revision=16754
2005-07-26 19:21:27 +00:00
Hartmut Birr
ec8a1499ee - Forgot one change to KeAcquireSpinLockAtDpcLevel.
svn path=/trunk/; revision=16753
2005-07-26 19:15:08 +00:00
Hartmut Birr
3cccb4ec8d - Fixed the broken implementation of KeFlushQueueApc.
- Fixed some locking operations with two spin locks.

svn path=/trunk/; revision=16752
2005-07-26 19:11:25 +00:00
Filip Navara
dfaa3196ee Yet another fix to WinPosActivateOtherWindow, we should search only for top-level windows next to the window we're about to deactivate.
svn path=/trunk/; revision=16751
2005-07-26 19:02:31 +00:00
Filip Navara
b165c36180 Don't steal foreground window focus from other applications in WinPosActivateOtherWindow and remove incorrect code for searching top-most windows.
svn path=/trunk/; revision=16750
2005-07-26 17:46:48 +00:00
Filip Navara
2ce933f05b Fix reverting of focus to owner windows.
svn path=/trunk/; revision=16749
2005-07-26 16:34:48 +00:00
Filip Navara
609a60c719 Add check for global handles to NtGdiDeleteDC, this prevents applications from destroying DCs that are part of DCEs.
svn path=/trunk/; revision=16748
2005-07-26 16:03:46 +00:00
Filip Navara
fc8add5154 Don't use DeleteDC on DC handles returned by GetDC.
svn path=/trunk/; revision=16747
2005-07-26 15:47:26 +00:00
Filip Navara
1d059a1ddf Implement ValidateRect.
svn path=/trunk/; revision=16746
2005-07-26 15:21:41 +00:00
Alex Ionescu
cdfdfa0b8b - Allow file debug prints to happen at IRQL > DISPATCH_LEVEL, but don't queue a work item until we are at <= DISPATCH. Fixes /DEBUGPORT=FILE freeze/crash/bug.
svn path=/trunk/; revision=16745
2005-07-26 15:15:18 +00:00
Alex Ionescu
b8f8df7565 - Various Microsoft DDK/PSDK compatibility fixes and some MSVC stuff too.
- Fix PSECURITY_DESCRIPTOR_RELATIVE names.c
 - Don't use rtltypes.h as a replacement for normal stdlib headers.
 - Fix a HAL header fixme.

svn path=/trunk/; revision=16744
2005-07-26 14:00:45 +00:00
Thomas Bluemel
9acecc8bdd add uxtheme.dll and objsel.dll to the bootcd
svn path=/trunk/; revision=16743
2005-07-26 13:50:18 +00:00
Thomas Bluemel
20dbd58c45 show the object picker dialog when clicking the Add button
svn path=/trunk/; revision=16742
2005-07-26 13:42:15 +00:00
Thomas Bluemel
1d403604a1 import objsel.dll from wine-20050726
svn path=/trunk/; revision=16741
2005-07-26 13:40:31 +00:00
Magnus Olsen
095f3025fb update the En.rc for del by Brandon Turner and me
svn path=/trunk/; revision=16740
2005-07-26 13:24:44 +00:00
Magnus Olsen
06abc8209f Implement /S /F and code clean up by Brandon Turner
svn path=/trunk/; revision=16739
2005-07-26 13:15:50 +00:00
Thomas Bluemel
d7702b47f9 removed some MmCopyTo/FromCaller calls from win32k's GDI
svn path=/trunk/; revision=16738
2005-07-26 12:22:55 +00:00
Filip Navara
e0cd2dc6bf Fix some bugs in DIB mapping code to prevent instant system crashes.
svn path=/trunk/; revision=16737
2005-07-26 11:22:48 +00:00
Filip Navara
11c02111f0 Properly setup the I/O stack location in IopSecurityFile.
svn path=/trunk/; revision=16736
2005-07-26 11:00:15 +00:00
Filip Navara
ead342935a Don't allow setting menu for child windows in IntSetMenu.
svn path=/trunk/; revision=16735
2005-07-26 10:35:13 +00:00
Filip Navara
c5646382a5 #include "csrss.h" -> #include <csrss.h>
svn path=/trunk/; revision=16734
2005-07-26 08:55:25 +00:00
Filip Navara
3f77d0e91e #include "rtl.h" -> #include <rtl.h>
svn path=/trunk/; revision=16733
2005-07-26 08:40:02 +00:00
Filip Navara
d2bc064abf #include "rtl.h" -> #include <rtl.h>
svn path=/trunk/; revision=16732
2005-07-26 08:39:07 +00:00
Alex Ionescu
f3622d33aa - Remove ROSRTL. The era is over. Thanks to Filip for his help during the last month.
svn path=/trunk/; revision=16731
2005-07-26 04:52:11 +00:00
Alex Ionescu
1e8c8e3fe6 - Final ROSRTL removal patch. The next patch will remove the actual library and code.
- Changes:
    - CreateProcess
        * Cleanup creation of the initial thread using new utility functions and remove rosrtl
        * Almost entirely rewrote the function to support features such as:
            - SxS (locally only, patch will follow),
            - SFP (SAFER) (locally only, patch will follow),
            - DllPaths (locally only, patch will follow), 
            - Proper process environment/paramter block creation
            - Proper console handle management (needs more work in kernel32/csr),
            - Tokens/CreateProcessAsUser (locally only, patch will follow), 
            - Simpler code for path lookup, and more robust.
            - Support for "auto-correction" (see Raymond Chen's blog)
            - 16-bit/NE detection
            - A variety of creation flags are now properly supported
            - Added support for an undocumented-yet-known (see comment) shell flag
            - Alert for flags we don't support yet
            - Catch invalid flag combinations and other caller errors
            - Improve and correct path searcing to use documented behaviours
            - Created a multitude of helper functions to make the code easier to read
              and allow them to be used for other apis as time goes on.
    
    - BaseProcessStartup
        * Call NtSetThreadInformation to let the Kernel know of the Thread's Start Address.
        * Correct prototype of Thread Startup function for this case.

This fixes MANY things, some of which may not be evident, and possibly creates regressions which I have not yet seen but will try to correct. Some of these may be caused by the fact that I've seen code send CreateProcessW incorrect flags. Some things of note: DO NOT send partial names as "lpApplicationName". It's not supposed to work unless you're in the same current directory. Also, do NOT send CREATE_UNICODE_ENVIRONMENT if you don't have a unicode environement, and vice-versa. I've seen lots of code doing mistakes related to this. I hope you appreciate this patch and won't all jump on me for possbile regressions :(.

svn path=/trunk/; revision=16730
2005-07-26 04:14:10 +00:00
Alex Ionescu
286cccb1de - Fix compilation if redzone detection is diabled.
svn path=/trunk/; revision=16729
2005-07-26 00:50:17 +00:00
Alex Ionescu
55234f6094 - Don't try to get the length of a possibly empty string. This fixes many menu applications (such as WinRAR). However I'm now getting a bug due to a double-free. It seems a GDI Object is being freed twice. Can anyone check this out please?
svn path=/trunk/; revision=16728
2005-07-26 00:43:19 +00:00
Alex Ionescu
e7c2fa1d9c - Message Queue Fix, resolves a number of application regressions (Total Commander works again, for example). Patch by Hartmut Birr. To be commited into 0.2.7 after more testing.
svn path=/trunk/; revision=16727
2005-07-25 23:19:12 +00:00
Aleksey Bragin
663bb3a53e Fix stupid typo-mistake, which lead to allocating only 4 bytes intead of sizeof(struct pci_pool).
svn path=/trunk/; revision=16726
2005-07-25 21:09:21 +00:00
Filip Navara
38cd13eb67 Build Wine DLLs without the UNICODE and _UNICODE definitions. (Note: The Wine DLLs use A/W functions explicitely, so this doesn't have any performance impact.)
svn path=/trunk/; revision=16725
2005-07-25 20:28:29 +00:00
James Tabor
f04a4eea8c Added more Wine MDI functions. I've tested these for +4 weeks, with Winefile, mdi(mdi test program), and AbiWord. More work is needed.
svn path=/trunk/; revision=16724
2005-07-25 20:07:19 +00:00
Filip Navara
8bac7925c0 Miscellaneous header fixes (packing and TCHAR stuff).
svn path=/trunk/; revision=16723
2005-07-25 20:03:42 +00:00
James Tabor
a2f80d0873 Patch by Robert Shearman rob@codeweavers.com, Use GdiGetCharDimensions Instead of DIALOG_GetCharSize.
svn path=/trunk/; revision=16722
2005-07-25 04:21:29 +00:00
Eric Kohl
971f04ec99 Fix grammar of the size_is attribute so that size_is(*Length) gets accepted.
svn path=/trunk/; revision=16721
2005-07-24 22:17:02 +00:00
Martin Fuchs
66fd6f0880 set eol-style for most xml files
svn path=/trunk/; revision=16720
2005-07-24 21:42:00 +00:00
Martin Fuchs
7944b41ae3 set eol-style for XML files in rosapps
svn path=/trunk/; revision=16719
2005-07-24 21:44:45 +00:00
Martin Fuchs
f6815841ae set eol-style to 'native'
svn path=/trunk/; revision=16718
2005-07-24 21:31:13 +00:00
Martin Fuchs
851bb090ac set eol-style to 'native'
svn path=/trunk/; revision=16717
2005-07-24 21:29:01 +00:00
Steven Edwards
7c343c4a57 fix line ending I hope
svn path=/trunk/; revision=16716
2005-07-24 21:17:54 +00:00
Steven Edwards
ea5ff9f06e added directory.xml for tests
svn path=/trunk/; revision=16715
2005-07-24 18:32:34 +00:00
Hartmut Birr
0dea0a5836 - Removed R_EXTRA_STACK because R_EXTRA_STACK and R_STACK must have the same size.
- Initialized an allocated block completely before release the lock.

svn path=/trunk/; revision=16714
2005-07-24 17:48:52 +00:00
Hervé Poussineau
8c34b25c71 Don't compare GUID strings with wcsicmp, but compare GUID* with IsEqualIID
Directly use HKEY_LOCAL_MACHINE instead of RegOpenKey(HKEY_LOCAL_MACHINE, NULL, ...).
Remove use of UNICODE_NULL
Replace #ifdef __WINE__ by #ifdef __WINESRC__
Fix SetupDiCallClassInstaller prototype (DWORD -> DI_FUNCTION)

Thanks Usurp for your testing on Wine!

This file works now unmodified in Wine. A patch would be soon sent to wine-patches ML.

svn path=/trunk/; revision=16713
2005-07-24 17:21:26 +00:00
Hartmut Birr
6aeadd25fd Fixed the memory allocation in EngCreateEvent.
svn path=/trunk/; revision=16712
2005-07-24 14:08:20 +00:00
Hervé Poussineau
07d3247011 Patch by Andrey Korotaev <unC0Rr@inbox.ru>: Fix scrolling with mouse
This multiplication was deleted when replacing old psaux driver by i8042prt
Fixes bug #652

svn path=/trunk/; revision=16711
2005-07-24 11:59:28 +00:00
Eric Kohl
2763e3353b Implement CM_Get_Device_ID_List_Size_ExA, CM_Get_Device_ID_ExA and CM_Get_Device_ID_List_ExA.
svn path=/trunk/; revision=16710
2005-07-24 11:48:08 +00:00
Thomas Bluemel
45e2c259ef use ZwQueryInformationFile instead of NtQueryInformationFile in IntGdiAddFontResource because we're passing kernel pointers in UserMode
svn path=/trunk/; revision=16709
2005-07-24 09:20:43 +00:00
Thomas Bluemel
1375ddbb83 use ZwQueryInformationFile and ZwSetInformationFile instead of the Nt version since we're passing kernel pointers to them which cause a probe failure in UserMode. This should fix the 1st stage setup
svn path=/trunk/; revision=16708
2005-07-24 09:11:30 +00:00
Steven Edwards
6bdd4f6993 dont try to buid font.c as its a empty file for now
svn path=/trunk/; revision=16707
2005-07-23 17:47:28 +00:00
Maarten Bosma
56ad48118f Added makefile which tell how to compile rosapps.
svn path=/trunk/; revision=16706
2005-07-23 17:45:41 +00:00
Alex Ionescu
7669e8fd6d - Disable APC Queuing & Flush APC queues during thread shutdown.
- Detect if Kernel APCs were pending during thread shutdown.
 - Call Lego Routine, if registered, during thread shutdown.

svn path=/trunk/; revision=16705
2005-07-23 17:40:48 +00:00
Eric Kohl
b244520c5a - Implement CM_Get_Child_Ex, CM_Get_Parent_Ex, CM_Get_Sibling_Ex and CM_Set_DevNode_Problem[_Ex].
- Clean-up indentation.

svn path=/trunk/; revision=16704
2005-07-23 13:43:52 +00:00
Eric Kohl
8b127ceac1 - Fix offset calculation bug in the ProcFormatString.
- Fix offset calculation bug in the marshalling and unmarshalling code.
- Fix typos in the TypeFormatString.
This makes the [string, out, size_is()] parameters work properly.

svn path=/trunk/; revision=16703
2005-07-23 11:55:33 +00:00
Hartmut Birr
95a28ce6c5 Fixed an uninitialized variable error.
svn path=/trunk/; revision=16702
2005-07-23 11:51:47 +00:00
Hartmut Birr
906754b0ed Fixed an uninitialized variable error.
svn path=/trunk/; revision=16701
2005-07-23 11:43:34 +00:00
Hartmut Birr
82cd3d5f80 Split the page fault handler from the trap handler.
svn path=/trunk/; revision=16700
2005-07-23 11:25:12 +00:00
Thomas Bluemel
184ff4dd27 export LsaLookupSids which is required by aclui.dll
svn path=/trunk/; revision=16699
2005-07-23 10:08:15 +00:00
Thomas Bluemel
108b262074 regedit should be installed in %SystemRoot% directly
svn path=/trunk/; revision=16698
2005-07-23 09:58:23 +00:00
Hartmut Birr
683d42211c If a page fault occurs in user mode, we must deliver user mode apc's.
svn path=/trunk/; revision=16697
2005-07-23 08:14:21 +00:00
Magnus Olsen
d5ae40868c last mins bug fix frirc nick jjkola, Jyrki Jaakkola <jjkola@email.com> for move. solve some new bugs. I forget menoter multuser is not done yet. But move folder from a vol to another works. Move need really clean up after his patch.
svn path=/trunk/; revision=16696
2005-07-22 23:58:26 +00:00
Magnus Olsen
6af5a6f78f irc nick jjkola, Jyrki Jaakkola <jjkola@email.com> frist patch solv to move file from a vol to another, and move mulite file same time. (not tested in ros) it works in windows with ros cmd. The patch are not very clean , but it fix alot of bugs also in move.
svn path=/trunk/; revision=16695
2005-07-22 23:15:54 +00:00
Thomas Bluemel
7aad44a4f5 - replaced IopCreateUnicodeString with RtlCreateUnicodeString
- allocate the DriverName from paged pool

svn path=/trunk/; revision=16694
2005-07-22 22:40:54 +00:00
Thomas Bluemel
5518114830 declare RtlDuplicateUnicodeString
svn path=/trunk/; revision=16693
2005-07-22 22:25:25 +00:00
Thomas Bluemel
648f859ea2 allocate LogFileName and HiveFileName from paged pool
svn path=/trunk/; revision=16692
2005-07-22 21:10:52 +00:00
Thomas Bluemel
9f2bf70ddb removed MmCopyFromCaller and MmCopyToCaller and depend on SEH instead
svn path=/trunk/; revision=16691
2005-07-22 20:52:31 +00:00
Thomas Bluemel
4bfbd2cfaf probe the pointers in _MmCopyFromCaller and _MmCopyToCaller. There's no need to check the processor mode since it's always just used to copy from/to user memory
svn path=/trunk/; revision=16690
2005-07-22 20:51:36 +00:00
Steven Edwards
8112d02490 some fixes for the host gcc4 on FC4
svn path=/trunk/; revision=16689
2005-07-22 19:45:32 +00:00
Eric Kohl
30f4461f0e Forgot to commit this file.
svn path=/trunk/; revision=16688
2005-07-22 14:53:24 +00:00
James Tabor
0f84d9e6fd Update and implement UnrealizeObject.
svn path=/trunk/; revision=16687
2005-07-22 12:25:02 +00:00
Eric Kohl
c85a086e9e Make IoGetDeviceObjectFromDeviceInstance work without using the Registry. (experimental)
svn path=/trunk/; revision=16686
2005-07-21 20:30:55 +00:00
Eric Kohl
446d367792 Add parameter checks.
svn path=/trunk/; revision=16685
2005-07-21 20:10:47 +00:00
Hartmut Birr
c5a9d200e8 Initialized all stack related values.
svn path=/trunk/; revision=16684
2005-07-21 18:32:28 +00:00
Maarten Bosma
cf27db3375 Created the d3d8thk makefile and a internal header file.
svn path=/trunk/; revision=16683
2005-07-21 18:22:45 +00:00
Magnus Olsen
daeb68b5cc fix bug in date if the input arg are not right dateformat, it should prom after new date
svn path=/trunk/; revision=16682
2005-07-21 17:24:15 +00:00
Hartmut Birr
4f8eb764a1 Merged 15583:15793 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=15797
2005-06-04 22:53:14 +00:00
Hartmut Birr
e4a7113f33 Copied a missing file to the branch.
svn path=/branches/cache_manager_rewrite/; revision=15791
2005-06-04 20:17:19 +00:00
Hartmut Birr
e97cffd272 Copied a missing file to the branch.
svn path=/branches/cache_manager_rewrite/; revision=15790
2005-06-04 20:16:48 +00:00
Hartmut Birr
932cb88b42 Merged 15499:15582 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=15789
2005-06-04 19:50:39 +00:00
Hartmut Birr
0023392dca Merged 15422:15498 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=15785
2005-06-04 19:07:10 +00:00
Hartmut Birr
118a0d363d Copied a missing file.
svn path=/branches/cache_manager_rewrite/; revision=15784
2005-06-04 18:57:27 +00:00
Hartmut Birr
1f679b9019 Copied a missing file.
svn path=/branches/cache_manager_rewrite/; revision=15783
2005-06-04 18:56:51 +00:00
Hartmut Birr
8b8d629491 Copied a missing file.
svn path=/branches/cache_manager_rewrite/; revision=15782
2005-06-04 18:54:06 +00:00
Hartmut Birr
84f133ff44 Copied a missing file.
svn path=/branches/cache_manager_rewrite/; revision=15781
2005-06-04 18:53:04 +00:00
Hartmut Birr
5191d3db32 Copied a missing file.
svn path=/branches/cache_manager_rewrite/; revision=15780
2005-06-04 18:50:33 +00:00
Hartmut Birr
4120295fb2 Copied a missing file.
svn path=/branches/cache_manager_rewrite/; revision=15779
2005-06-04 18:49:28 +00:00
Hartmut Birr
bf485a0b88 Copied a missing file.
svn path=/branches/cache_manager_rewrite/; revision=15778
2005-06-04 18:46:55 +00:00
Hartmut Birr
8f2ebf84c8 Copied 15422 from trunk. There was an mixed case filename conflict.
svn path=/branches/cache_manager_rewrite/; revision=15776
2005-06-04 17:47:53 +00:00
Hartmut Birr
a3758fc18b svn path=/branches/cache_manager_rewrite/; revision=15775 2005-06-04 17:40:26 +00:00
Hartmut Birr
d8786a6116 Merge 15381:15421 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=15773
2005-06-04 17:35:39 +00:00
Hartmut Birr
60d6a7d169 Reverted the changes from the previous commit for rsym.c.
svn path=/branches/cache_manager_rewrite/; revision=15385
2005-05-17 19:09:27 +00:00
Hartmut Birr
52049ef2ea Merge 15187:15381 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=15384
2005-05-17 19:07:27 +00:00
Hartmut Birr
39d27138f8 svn path=/branches/cache_manager_rewrite/; revision=15370 2005-05-17 01:33:40 +00:00
Hartmut Birr
aa3b6859fb Merge 14454:15187 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=15369
2005-05-17 01:26:31 +00:00
Hartmut Birr
883444c685 svn path=/branches/cache_manager_rewrite/; revision=15368 2005-05-17 01:25:08 +00:00
Hartmut Birr
ddaaa84fcf svn path=/branches/cache_manager_rewrite/; revision=15367 2005-05-17 01:23:33 +00:00
Hartmut Birr
a719a095da svn path=/branches/cache_manager_rewrite/; revision=15366 2005-05-17 01:06:11 +00:00
Hartmut Birr
9b72c87557 svn path=/branches/cache_manager_rewrite/; revision=15365 2005-05-17 01:00:13 +00:00
Hartmut Birr
1911a5e55d svn path=/branches/cache_manager_rewrite/; revision=15363 2005-05-16 22:21:00 +00:00
Hartmut Birr
1ce027e7bd svn path=/branches/cache_manager_rewrite/; revision=15362 2005-05-16 22:20:03 +00:00
Hartmut Birr
39e2266f38 svn path=/branches/cache_manager_rewrite/; revision=15361 2005-05-16 21:24:08 +00:00
Hartmut Birr
429afe7d29 svn path=/branches/cache_manager_rewrite/; revision=15360 2005-05-16 21:22:06 +00:00
Hartmut Birr
07965bc53d svn path=/branches/cache_manager_rewrite/; revision=15356 2005-05-16 20:17:42 +00:00
Hartmut Birr
a14b39871b svn path=/branches/cache_manager_rewrite/; revision=15355 2005-05-16 20:16:49 +00:00
Hartmut Birr
7c2d2ce044 svn path=/branches/cache_manager_rewrite/; revision=15353 2005-05-16 19:46:56 +00:00
Hartmut Birr
0c2d6a83a1 svn path=/branches/cache_manager_rewrite/; revision=15352 2005-05-16 19:46:03 +00:00
Hartmut Birr
f10e90b97c Merge 14269:14454 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=15351
2005-05-16 19:34:42 +00:00
Hartmut Birr
133003260a Copy w32api from trunk.
svn path=/branches/cache_manager_rewrite/; revision=15343
2005-05-16 15:18:03 +00:00
Hartmut Birr
34c2158d0c Remove w32api from branch.
svn path=/branches/cache_manager_rewrite/; revision=15342
2005-05-16 15:17:33 +00:00
Hartmut Birr
d9162b4e03 Merge 13755:14269 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=14272
2005-03-22 20:15:04 +00:00
Hartmut Birr
a1a9771107 Merge 13543:13754 from trunk.
svn path=/branches/cache_manager_rewrite/; revision=13756
2005-02-26 17:47:14 +00:00
Hartmut Birr
af87e0fc68 Copied msiexec from the current trunk.
svn path=/branches/cache_manager_rewrite/; revision=13754
2005-02-26 16:40:44 +00:00
Hartmut Birr
170f172217 svn path=/branches/cache_manager_rewrite/; revision=13753 2005-02-26 16:39:01 +00:00
Hartmut Birr
5374514ebe - Copy winebuild from the current trunk.
svn path=/branches/cache_manager_rewrite/; revision=13750
2005-02-26 15:15:11 +00:00
Hartmut Birr
fe3eb9261b svn path=/branches/cache_manager_rewrite/; revision=13749 2005-02-26 15:12:30 +00:00
Filip Navara
89112ccf7e Fix inline assembler register specification (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10153).
svn path=/branches/cache_manager_rewrite/; revision=13586
2005-02-15 19:40:30 +00:00
Hartmut Birr
d9a71a1b2b - Ported 13554, 13556, 13566 and 13568 (recent changes within the timer implementation) from trunk.
svn path=/branches/cache_manager_rewrite/; revision=13571
2005-02-14 18:19:29 +00:00
Hartmut Birr
57e70c1987 - Started the rewriting of the cache manger.
- The new cache manager uses section objects and maps the content of cached files 
  into the kernel address space for functions like CcCopyRead.   
- The implementation isn't complete. It works for me to compile ros on ros if enough ram is available.

svn path=/branches/cache_manager_rewrite/; revision=13570
2005-02-14 17:34:10 +00:00
Hartmut Birr
2efdd33126 Created cache_manager_rewrite branch
svn path=/branches/cache_manager_rewrite/; revision=13543
2005-02-13 22:08:14 +00:00
Hartmut Birr
a5fb761524 Created cache_manager_rewrite branch
svn path=/branches/cache_manager_rewrite/; revision=13542
2005-02-13 22:07:16 +00:00
4816 changed files with 610267 additions and 766819 deletions

View File

View File

@@ -1,604 +0,0 @@
// 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 )
{
for ( int i = 0; i < ops.size(); i++ )
{
if ( ops[i] == user )
{
printf ( "remove '%s' to ops list\n", user.c_str() );
ops.erase ( &ops[i] );
}
}
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 );
}
for ( i = 0; i < list.list.size(); i++ )
{
if ( list.list[i] == s )
{
list.list.erase ( &list.list[i] );
{
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 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' )
{
for ( int i = 0; i < ops.size(); i++ )
{
if ( ops[i] == target )
{
printf ( "remove '%s' to ops list\n", target.c_str() );
ops.erase ( &ops[i] );
}
}
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

@@ -1,216 +0,0 @@
# 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

@@ -1,29 +0,0 @@
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>
{{{
}}}
###############################################################################

View File

@@ -1,265 +0,0 @@
// 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
using File::filesize_t;
using File::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
}

View File

@@ -1,173 +0,0 @@
// 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 _MSC_VER
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

@@ -1,418 +0,0 @@
// 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

@@ -1,148 +0,0 @@
// 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

View File

@@ -1,418 +0,0 @@
// 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

View File

@@ -1,95 +0,0 @@
// 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

View File

@@ -1,315 +0,0 @@
/*
** 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

View File

@@ -1,143 +0,0 @@
// 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

@@ -1,331 +0,0 @@
// 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

View File

@@ -1,229 +0,0 @@
// 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

@@ -1,504 +0,0 @@
// 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

@@ -1,132 +0,0 @@
// 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

@@ -1,96 +0,0 @@
// 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

@@ -1,32 +0,0 @@
// 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

@@ -1,240 +0,0 @@
// 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

@@ -1,28 +0,0 @@
// 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

@@ -1,87 +0,0 @@
// 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

@@ -1,141 +0,0 @@
// 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 ( ptr );
}
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

@@ -1,58 +0,0 @@
// 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

@@ -1,12 +0,0 @@
// 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

@@ -1,15 +0,0 @@
// 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 );
}

View File

@@ -1,13 +0,0 @@
// 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

@@ -1,7 +0,0 @@
#define SERVER "irc.freenode.net"
#define BOTNAME "ArchBlackmann"
#define CHANNEL "#ReactOS"
#define MODE "+i"
#define PASS "ilovebunnies"

View File

@@ -1,23 +0,0 @@
// 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

@@ -1,15 +0,0 @@
// 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

@@ -1,27 +0,0 @@
shit
fuck
pussy
ass
ass-
-ass
dumbass
jackass
fatass
asshole
smartass
cunt
fucker
bitch
dick
penile
stfu
omfg
lmao
ass.
-ass.
semprini
goat.cx
ekush
akshor
poop
guten morgen

View File

@@ -1,10 +0,0 @@
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

View File

@@ -1,15 +0,0 @@
Royce3
kjk_hyperion
tamlin
GvG
filip2307
hardon
w3seek
arty
sedwards
Exception
blight_
jimtabor
mtempel
Gge
Alex_Ionescu

View File

@@ -1,580 +0,0 @@
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

@@ -1,10 +0,0 @@
/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

@@ -1 +0,0 @@
/me is bored

View File

@@ -1,9 +0,0 @@
PASSIVE_LEVEL
APC_LEVEL
DISPATCH_LEVEL
PROFILE_LEVEL
CLOCK1_LEVEL
IPI_LEVEL
POWER_LEVEL
HIGH_LEVEL
SYNCH_LEVEL

View File

@@ -1,13 +0,0 @@
the kernel
ntoskrnl
win32k
msafd
ws2_32
user32
shell32
the cache manager
tdi
the scheduler
the thread queue
the message queue
atapi

View File

@@ -1,5 +0,0 @@
/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

@@ -1,34 +0,0 @@
// 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 );
}

View File

@@ -1,18 +0,0 @@
// 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

@@ -1,11 +0,0 @@
minute
hour
day
week
fortnight
month
year
decade
century
millenium
eon

View File

@@ -1,44 +0,0 @@
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 sentces ArchBlackmann sais when he finds his name
- curse - this are the curses he looks for
- cursecop - this the responces to them
- grovel - this is said when a 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

@@ -1,998 +0,0 @@
// 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 string(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 unsigned short* 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 = va_arg(args, wchar_t *);
result = stringw(f, sw, -1, field_width, precision, flags);
} else {
/* print ascii string */
s = va_arg(args, char *);
result = string(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 = string(f, s, -1, field_width, precision, flags);
} else {
/* print unicode string */
sw = 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 = string(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

@@ -1,12 +0,0 @@
// 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

@@ -1,654 +0,0 @@
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

@@ -1,7 +0,0 @@
FAST_MUTEX
KPCR
PEB
TEB
SPINLOCK
APC
DPC

View File

@@ -1,73 +0,0 @@
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

@@ -1,17 +0,0 @@
// 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 );
}

View File

@@ -1,13 +0,0 @@
// 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

File diff suppressed because it is too large Load Diff

View File

@@ -1,37 +0,0 @@
// 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

@@ -1,32 +0,0 @@
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

@@ -1,274 +0,0 @@
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

@@ -1,325 +0,0 @@
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

@@ -1,286 +0,0 @@
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

@@ -1,256 +0,0 @@
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

@@ -1,821 +0,0 @@
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

@@ -1,288 +0,0 @@
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

@@ -1,235 +0,0 @@
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

@@ -1,308 +0,0 @@
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

@@ -1,245 +0,0 @@
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

@@ -1,395 +0,0 @@
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

@@ -1,593 +0,0 @@
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

@@ -1,220 +0,0 @@
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

@@ -1,550 +0,0 @@
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

@@ -1,245 +0,0 @@
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

@@ -1,175 +0,0 @@
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

@@ -1,19 +0,0 @@
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

@@ -1,16 +0,0 @@
<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

@@ -1,58 +0,0 @@
<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

@@ -1,201 +0,0 @@
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

@@ -1,478 +0,0 @@
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

@@ -1,23 +0,0 @@
<?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

@@ -1,894 +0,0 @@
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

@@ -1,855 +0,0 @@
//
// 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

@@ -1,322 +0,0 @@
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

@@ -1,396 +0,0 @@
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

@@ -1,216 +0,0 @@
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

@@ -1,146 +0,0 @@
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

@@ -1,494 +0,0 @@
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

@@ -1,198 +0,0 @@
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

@@ -1,32 +0,0 @@
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

@@ -1,200 +0,0 @@
// 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

@@ -1,211 +0,0 @@
// 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

@@ -1,93 +0,0 @@
// 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

@@ -1,159 +0,0 @@
// 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

@@ -1,16 +0,0 @@
<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

@@ -1,45 +0,0 @@
<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

@@ -1,20 +0,0 @@
<?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

@@ -1,542 +0,0 @@
// 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

@@ -1,85 +0,0 @@
// 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

@@ -1,653 +0,0 @@
// 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

@@ -1,780 +0,0 @@
// 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

@@ -1,52 +0,0 @@
// 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

@@ -1,782 +0,0 @@
// 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

@@ -1,207 +0,0 @@
// 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

@@ -1,213 +0,0 @@
// 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