Comparar commits

...

1094 Commits

Autor SHA1 Mensagem Data
Dan Rollo 13f2419f33 For some reason, depenency version on jna didn't get updated in pom-platform.xml, so update now 2012-10-27 20:57:32 -04:00
Dan Rollo ec9868b85b Merge pull request #152 from bhamail/master
Release 3.5.1 - dist jars, etc.
2012-10-27 17:40:39 -07:00
Dan Rollo a31faf3026 Release 3.5.1 - commit 'ant clean dist' generated files. 2012-10-27 20:35:00 -04:00
Dan Rollo e1fda6694b Release 3.5.1 - add notes about 'ant clean dist' additional files to commit. 2012-10-27 20:33:04 -04:00
Dan Rollo 2fb117023b Release 3.5.1 - add note about 'ant clean dist'. 2012-10-27 15:28:19 -04:00
Dan Rollo d2a70dac78 Release 3.5.1 - add note about manual delete of platform.jar 2012-10-27 14:54:00 -04:00
Dan Rollo 18218163fd Release 3.5.1 - Update README.md links 2012-10-27 14:45:49 -04:00
Dan Rollo fccab0ac15 Release 3.5.1 - set release versions, update notes 2012-10-27 14:40:39 -04:00
Daniel Doubrovkine 02a01db39a Made 3.5.0 links go to Maven. 2012-10-27 08:24:40 -04:00
Dan Rollo bd950aa654 Merge pull request #149 from bhamail/master
update release docs
2012-10-24 20:59:50 -07:00
Dan Rollo 32758ee8e2 add note to send release notice. 2012-10-24 23:57:35 -04:00
Dan Rollo 0c79114d30 typo 2012-10-24 23:57:18 -04:00
Dan Rollo 43b426410d update release docs to include incrementing version for next development iteration. 2012-10-24 23:52:08 -04:00
Dan Rollo 26de4b0dd0 update release notes to include incrementing version for next development iteration. 2012-10-24 23:51:09 -04:00
Dan Rollo 58243488fc Merge pull request #148 from bhamail/master
revert publish sources SNAPSHOT jar. Only do jars for now.
2012-10-24 20:01:40 -07:00
Dan Rollo 489b5ddde1 Merge remote branch 'upstream/master' 2012-10-24 22:59:51 -04:00
Dan Rollo 0d0d36d599 revert: deploy sources and javadoc SNAPSHOT jars. Only do jar for now. 2012-10-24 22:58:57 -04:00
Dan Rollo 2d454fb7dc Merge pull request #147 from bhamail/master
also deploy sources and javadoc SNAPSHOT jars.
2012-10-24 18:58:49 -07:00
Dan Rollo 5097ed533f update 'deploy snapshot' target to also deploy sources and javadoc SNAPSHOT jars. 2012-10-24 21:56:59 -04:00
Dan Rollo 160dee7d84 Merge pull request #146 from bhamail/master
increment to next development version (if "-SNAPSHOT" suffix causes problems, I will remove it).
2012-10-24 17:40:43 -07:00
Dan Rollo 7395736b9f increment jna.version to next development version (3.5.1-SNAPSHOT). 2012-10-24 20:10:59 -04:00
Daniel Doubrovkine (dB.) b64c489135 Update CHANGES.md 2012-10-24 19:11:14 -03:00
Daniel Doubrovkine (dB.) fffc3f0f7c Merge pull request #145 from aikidojohn/master
Fixing Netapi32Util.getDomainTrusts() includes "empty" domain object
2012-10-24 15:10:00 -07:00
John Hite 5dd4e0c846 Updating CHANGES.md 2012-10-24 17:20:44 -04:00
John Hite e32ae1cae6 Fixing the DOMAIN_CONTROLLER_INFO structure. It was missing a field declaration. This should fix the getDC method and unit test 2012-10-24 17:09:32 -04:00
John Hite 8771dce348 Fixing null values in first domain trust array entry 2012-10-24 16:15:50 -04:00
Daniel Doubrovkine (dB.) 3ac6f75611 Update www/Contributing.md 2012-10-20 17:33:17 -03:00
Dan Rollo f88d243071 Merge pull request #143 from bhamail/master
Release 3.5.0 - dist jars and doc links
2012-10-18 18:53:11 -07:00
Dan Rollo feb7b88279 Release 3.5.0 - Update README.md, commit and push. 2012-10-18 21:33:40 -04:00
Dan Rollo 070b47e825 Release 3.5.0 - Run ant dist target. Commit and push generated jar files in dist. Includes new jna-min.jar. 2012-10-18 21:25:14 -04:00
Dan Rollo c1289c07be Merge pull request #141 from bhamail/master
typo
2012-10-15 09:12:47 -07:00
Dan Rollo e68fd9dfaf doc typo 2012-10-15 12:00:35 -04:00
twall f23a4bf9d5 Merge pull request #139 from trespasserw/patch-1
Diagnostic for temp jnidispatch file creation
2012-10-13 06:05:36 -07:00
Roman Shevchenko b769daec0c Diagnostic for temp jnidispatch file creation
Nesting underlying exception will provide more insight
on what may caused an error.
2012-10-11 14:38:59 +03:00
Daniel Doubrovkine (dB.) 4e36f71f3a Merge pull request #137 from danwi/registry_get_empty_values
Add issue #135 to CHANGES.md
2012-10-08 08:32:02 -07:00
Daniel Wiklund 25db8ccfa7 Add issue #135 to CHANGES.md 2012-10-08 16:56:44 +02:00
Daniel Doubrovkine (dB.) 5c2923c0af Merge pull request #136 from danwi/registry_get_empty_values
Add fix for issue #135 in Advapi32Util (reading empty values)
2012-10-08 07:33:25 -07:00
Daniel Wiklund 018ad7f2c0 Add fix for issue #135 in Advapi32Util (reading empty values)
With this fix it is possible to read values from registry of the following
types even when the size of the value is 0:

REG_SZ
REG_EXPAND_SZ
REG_MULTI_SZ
REG_NONE
REG_BINARY (fixed by earlier committer)

Advapi32UtilTest updated with unit test triggering the bug.
2012-10-08 16:16:30 +02:00
Timothy Wall c1a7fd7267 Merge branch 'master' of github.com:twall/jna 2012-10-06 11:49:59 -04:00
Timothy Wall 3c086de42c add 'min' jar to dist 2012-10-06 11:49:09 -04:00
Timothy Wall b48390fc1e note platforms where test fails 2012-10-06 10:30:50 -04:00
Timothy Wall 136fe02333 Merge branch 'master' of github.com:twall/jna 2012-10-06 09:01:54 -04:00
Timothy Wall 5f9d100b2d attach native thread as daemon to avoid tests hanging on exit 2012-10-06 09:01:30 -04:00
twall 176f3f32d4 Update www/FrequentlyAskedQuestions.md 2012-10-06 09:47:27 -03:00
twall 2667202a3f Move native long != Java long to top of list 2012-10-06 09:46:50 -03:00
Timothy Wall 245eb88b40 fix #128, use 16-bit mask for upper/lower parts of DWORD 2012-10-06 00:49:17 -04:00
Timothy Wall d51479c357 update changes, fixes #113, fixes #114 2012-10-06 00:44:07 -04:00
Timothy Wall 7a583b1aaa apply PR #114, support for gnu/kfreebsd 2012-10-06 00:38:56 -04:00
Timothy Wall eaff9bd176 fixes #129 2012-10-05 06:58:14 -04:00
Timothy Wall da4d941906 add dlopen mods to changelog 2012-10-05 05:48:30 -04:00
Dan Rollo ed94e60da3 Merge pull request #132 from bhamail/maven-cleanup
note maven changes
2012-10-04 19:24:38 -07:00
Dan Rollo 2fe6c956b4 note maven changes 2012-10-04 22:22:45 -04:00
Timothy Wall 559c7d7f13 add library open options 2012-10-04 21:58:28 -04:00
Timothy Wall 6b7f2eeadb catch all AWT loading errors 2012-10-02 07:26:58 -04:00
Dan Rollo 7bda1b3d0e Merge pull request #131 from bhamail/maven-cleanup
Maven cleanup
2012-10-01 17:10:45 -07:00
Dan Rollo d516b01c75 Add note about settings.xml location. 2012-10-01 20:07:45 -04:00
Dan Rollo 08c579f0cb Add note about settings.xml location. 2012-10-01 20:06:33 -04:00
Timothy Wall c231069066 fix typos 2012-09-29 11:26:17 -04:00
Timothy Wall ec16947808 update w32ce-arm build, native 2012-09-29 09:13:39 -04:00
Dan Rollo 2d61573175 Merge pull request #126 from bhamail/maven-cleanup
Maven cleanup
2012-09-27 15:06:49 -07:00
Dan Rollo 507c065c0e fix typo 2012-09-27 17:47:18 -04:00
Dan Rollo cf6b6299e0 Keep pom-platform.xml version tag in since automatically (same as pom.xml version tag). Update release docs to match. Add a note that 'deploy' target only works for SNAPSHOT. 2012-09-27 17:45:31 -04:00
Dan Rollo 862a746170 Update maven release step links. 2012-09-27 15:02:00 -04:00
Dan Rollo 14717ce21f Update maven release steps. 2012-09-27 14:59:06 -04:00
Dan Rollo 72aade4f8f fix typo 2012-09-27 14:52:35 -04:00
Dan Rollo fbf75539f9 fix typo 2012-09-27 14:51:45 -04:00
Dan Rollo 879402d020 md format cleanup 2012-09-27 14:49:15 -04:00
Dan Rollo 7296f2213d Add step in release process to update the pom <version> values to match the version (jna.version) in build.xml. 2012-09-27 14:44:25 -04:00
Dan Rollo fb243c6cf5 Add reference to java.net maven repo docs. 2012-09-27 13:50:47 -04:00
Dan Rollo 20d1a720ce Add slash to urls, to match doc's examples. 2012-09-27 13:50:22 -04:00
Dan Rollo ea12e0755b settings.xml example 2012-09-26 22:37:48 -04:00
Dan Rollo 83cc22a24c settings.xml example 2012-09-26 22:36:44 -04:00
Dan Rollo c795c80439 Go back to using java.net maven repo. Add settings.xml example. 2012-09-26 22:31:36 -04:00
Dan Rollo edab625da6 Change deploy snapshot target to include platform jar. 2012-09-26 11:33:36 -04:00
Dan Rollo 9f9240391b Add failonerror=true to mvn calls so ant build will fail if mvn goal fails. 2012-09-25 21:11:10 -04:00
Dan Rollo 4fbbc6b42a comment cleanup 2012-09-25 21:01:45 -04:00
Dan Rollo cdbc379608 comment cleanup 2012-09-25 20:59:38 -04:00
Dan Rollo bfeac30452 Add warning about quiet mvn failures. 2012-09-25 20:54:08 -04:00
Dan Rollo 2e7d188afa Add warning about quiet mvn failures. 2012-09-25 20:53:39 -04:00
Dan Rollo d291bd52cd Extract maven-gpg-plugin version to common property. Add 'useagent' so will be prompted for gpg passphrase. 2012-09-25 20:45:47 -04:00
Dan Rollo d8e8fd09a6 Remove obsolete maven artifact files. 2012-09-25 19:55:52 -04:00
Dan Rollo d66471e4c0 Restore 'depends' to maven targets - some jars are not banked in 'dist'. Make maven artifact jar names more consistent. Only include files (src, javadoc) for the specific project (jna or platform). 2012-09-25 19:49:54 -04:00
Dan Rollo bb7d364f45 Update maven repo URL's to use sonatype for publishing to central repo. Remove 'depends' from maven deploy and stage tasks - will use what is in 'dist' folder. 2012-09-25 17:19:34 -04:00
Dan Rollo f9f8474e7f Add maven ant tasks jar to lib dir for use in deploying maven artifacts. Update maven repo URL's to use sonatype for publishing to central repo. Remove 'depends' from maven deploy and stage tasks - will use what is in 'dist' folder. 2012-09-25 17:05:47 -04:00
Dan Rollo e2cac3a280 Remove unused tags, add dependency to jna 2012-09-25 12:45:51 -04:00
Dan Rollo d6b5c2c797 Remove unused tags 2012-09-25 12:00:36 -04:00
twall c0e51cb47f Update www/DirectMapping.md 2012-09-25 11:57:04 -03:00
twall 03f054b474 Update www/DirectMapping.md 2012-09-25 11:56:18 -03:00
twall 511676e0e9 Update www/GettingStarted.md 2012-09-25 08:11:06 -03:00
twall 94ac8af162 Update www/GettingStarted.md 2012-09-25 08:08:43 -03:00
twall a814936bd7 Note direct mapping and link 2012-09-25 08:06:52 -03:00
twall e42b2ca09d Link directly to examples 2012-09-25 08:02:43 -03:00
Timothy Wall 7be159d0c2 update solarix/intel natives 2012-09-24 19:33:02 -04:00
Timothy Wall c53c384096 update sunos natives 2012-09-24 23:46:00 +02:00
dblock 6a52c22a02 Moved some hanging docs into www. 2012-09-24 09:09:53 -04:00
Daniel Doubrovkine 6f30debd34 Minor prettifications to CHANGES. 2012-09-23 18:43:24 -04:00
Timothy Wall d400921e17 Merge branch 'master' of github.com:twall/jna 2012-09-23 17:30:28 -04:00
Timothy Wall e95b37e5de update android-arm native 2012-09-23 17:29:51 -04:00
Timothy Wall b9cc27c1ad update win32-x86 native 2012-09-23 15:14:11 -04:00
Timothy Wall c8852f7c44 update win32-x86 native 2012-09-23 14:44:22 -04:00
Timothy Wall 18b0700337 obsolete outdated native jars, update darwin 2012-09-23 14:08:04 -04:00
Timothy Wall 8d535e72c7 update win32-amd64 native 2012-09-23 12:43:56 -04:00
Timothy Wall 2f51fc68cb fix file perms 2012-09-23 09:28:00 -04:00
Timothy Wall 1f1972bf0e remove msvc90 dependency, spurious '-g' flags in libffi, fix compiler warnings against dlmalloc.c 2012-09-23 08:37:30 -04:00
Timothy Wall e91fbd35c2 tweaks for win32-amd64 build 2012-09-23 02:24:52 -04:00
Timothy Wall f46c5ffc2b w32 tweaks 2012-09-22 22:40:33 -04:00
Timothy Wall a9f90b508a fix build on w32 2012-09-22 21:03:29 -04:00
Timothy Wall 7dd96c6978 fix build on win32 2012-09-22 20:45:03 -04:00
Timothy Wall 0c888d992b accommodate makefile variable overrides from ant or environment 2012-09-22 19:58:14 -04:00
Timothy Wall 14da21e9f9 Merge branch 'master' of github.com:twall/jna 2012-09-22 17:06:20 -04:00
Timothy Wall 019e861539 merge android branch 2012-09-22 17:05:24 -04:00
Kristian Rosenvold 79d208096b o Added first (untested) verison of how to publish to maven central 2012-09-22 11:32:47 +02:00
Timothy Wall 28c4c5fef5 merge from upstream 2012-09-21 06:57:14 -04:00
Timothy Wall 5e211134d5 merge from master 2012-09-21 06:55:08 -04:00
Timothy Wall 310e829d70 note changes 2012-09-21 00:29:29 -04:00
Timothy Wall 3d0040a183 check more thoroughly for unanticipated exceptions 2012-09-20 23:57:20 -04:00
Timothy Wall bbb0501f76 properly propagate exceptions through native code 2012-09-20 23:41:03 -04:00
Timothy Wall 641b7aa3ad fix crash on win64 2012-09-20 22:45:22 -04:00
Timothy Wall 1572b12f75 merge from master 2012-09-20 17:37:25 -04:00
Timothy Wall 689ddc493f android doesn't support shlib jar unpack; place in a convenient location instead 2012-09-20 17:28:33 -04:00
Timothy Wall cb05293c11 clean up thread termination handling 2012-09-20 16:19:25 -04:00
Timothy Wall d5e2ee902d update change log 2012-09-20 15:59:14 -04:00
Timothy Wall b9995b2ad0 w32 thread auto-cleanup 2012-09-20 15:02:07 -04:00
Timothy Wall bd243519df w32 implementation 2012-09-20 13:52:34 -04:00
Timothy Wall f11614bc27 simplified thread-local destructor (pthreads) 2012-09-20 13:17:47 -04:00
Timothy Wall 58a5185c20 auto-cleanup of attached callback threads 2012-09-20 08:41:57 -04:00
Timothy Wall e92ff82c19 update android instructions 2012-09-20 07:21:36 -04:00
Timothy Wall c4c07d7878 fixes issue #121 2012-09-20 01:17:55 -04:00
Timothy Wall e07ed3082d clean up some var usage 2012-09-20 01:14:09 -04:00
Timothy Wall 5728822dad tweak formatting 2012-09-19 13:49:32 -04:00
Timothy Wall fd13022f7c don't copy out-of-date.jar to dist, copy native jars *only* directly from lib/native 2012-09-19 11:23:39 -04:00
Timothy Wall 296eaec0e6 perform cross-builds into dedicated build directory 2012-09-19 10:28:45 -04:00
Timothy Wall 8b8672214c add android native jar 2012-09-19 10:08:04 -04:00
Timothy Wall 2f662bcf6d remove obsolete setFieldOrder references 2012-09-19 10:03:39 -04:00
Timothy Wall 35f12b7027 merge from master 2012-09-19 09:51:01 -04:00
Timothy Wall 719fab1ad2 fix main class reference 2012-09-18 22:38:44 -04:00
Timothy Wall 67ffdd5168 pushed wrong versions of demo jars 2012-09-18 22:32:34 -04:00
Timothy Wall afc3fe3687 update demos to include full native libs 2012-09-18 22:27:14 -04:00
Timothy Wall 14dbeda4ed fix broken demo jars 2012-09-18 22:24:28 -04:00
Timothy Wall f5ee066cc0 demos must be in same directory as jna.jar to run properly 2012-09-18 20:43:43 -04:00
Timothy Wall ad65bcccfb avoid spurious errors when common osx frameworks don't actually exist 2012-09-18 20:36:05 -04:00
Timothy Wall fab66d7d49 search additional OSX paths 2012-09-18 18:49:40 -04:00
Timothy Wall d78c38e4e2 update changelog 2012-09-19 00:14:22 +02:00
Timothy Wall 21cecef8ef fix crash with native mapped callback args 2012-09-18 21:58:39 +02:00
Timothy Wall 3e8511fbc6 Merge branch 'master' of github.com:twall/jna 2012-09-18 09:34:58 -04:00
Timothy Wall 21863e190d use upstream libffi as subtree instead of separate local copy 2012-09-18 09:28:54 -04:00
Timothy Wall fb84300563 Merge libffi as native/libffi 2012-09-18 09:06:50 -04:00
Timothy Wall a8de00b8e5 fix MSVC dll callbacks build (mingw64 required) 2012-09-17 07:23:01 -04:00
Timothy Wall 5fd52be589 add missing file 2012-09-16 15:47:12 -04:00
Timothy Wall 6335fef0b1 fix build for MSVC express 10 2012-09-16 13:24:35 -04:00
Daniel Doubrovkine 3455742d89 The javadoc and src-mvn.zip should be ignored; out-of-date.jar is used to wipe all the native binaries when there's an incompatible JNI change. 2012-09-15 22:08:25 -04:00
Timothy Wall 6ba364f64f Merge branch 'master' of github.com:twall/jna into dll-callback 2012-09-15 21:58:55 -04:00
Daniel Doubrovkine 164da6cf1c Minor updates to CHANGES. 2012-09-15 21:28:33 -04:00
Daniel Doubrovkine 1b6bc6342e Re-added missing declaration. 2012-09-15 21:26:54 -04:00
Daniel Doubrovkine bde74fdccf Merged 3.5.0 from master. 2012-09-15 21:15:47 -04:00
Timothy Wall 6dd612162d synch with master 2012-09-15 17:58:44 -04:00
Timothy Wall 2ff4d20fad require structure field order 2012-09-15 17:52:01 -04:00
unknown fbcd02ae6e Merge branch 'master' of github.com:twall/jna into netapi32-fixes 2012-09-15 09:31:01 -04:00
Timothy Wall 6de51cdf5a move field validation out of layout derivation 2012-09-14 21:10:48 -04:00
unknown e97b1df6ee Merge branch 'master' of github.com:twall/jna into netapi32-fixes 2012-09-14 07:53:37 -04:00
Timothy Wall 65d68b8d70 avoid using deprecated setTypeMapper 2012-09-14 07:00:55 -04:00
Daniel Doubrovkine f915ec7e05 Merge branch 'master' of github.com:twall/jna into netapi32-fixes 2012-09-08 20:39:06 -04:00
Timothy Wall 44b4bc0cac fix gcc version check, avoid deprecated function in structure test 2012-09-08 16:27:08 -04:00
Daniel Doubrovkine 2a6ac9a20d Fixed ANT build and package name. 2012-09-08 16:22:52 -04:00
Daniel Doubrovkine 076298e343 Merged from master. 2012-09-08 16:11:47 -04:00
Timothy Wall 1c3ab0f80f fix javadoc errors 2012-09-08 16:04:27 -04:00
Timothy Wall a0ae2836d9 merge from upstream 2012-09-08 15:02:25 -04:00
Timothy Wall 2309762aca fix broken Structure.setFieldOrder issue 2012-09-08 11:07:05 -04:00
Daniel Doubrovkine e4d89f7087 Fixed typos. 2012-09-08 08:42:36 -04:00
Daniel Doubrovkine 44c41b6faf Fix: Netapi32Test broken. 2012-09-08 08:41:57 -04:00
Daniel Doubrovkine 8003de03ec Fix: w32keyhook package to make Eclipse happy. 2012-09-08 08:40:58 -04:00
twall c5ae6a3cbb Merge pull request #117 from phailwhale22/master
Closes issue #116
2012-09-07 16:34:22 -07:00
twall 4581cb2f61 Avoid invalid 3.4.2 build 2012-09-07 20:32:46 -03:00
phailwhale22 804795c5f8 fix for issue #116 (continued yet again)
I'm failing hard... ok to merge? Indentation was fixed and I removed the
try block.
2012-09-07 18:26:30 -04:00
Timothy Wall efce3ec30e update OSX native reference 2012-09-06 07:27:45 -04:00
Timothy Wall e56835fccc fix native jar file refresh 2012-09-06 07:25:42 -04:00
Timothy Wall 4f495756aa Merge branch 'master' of github.com:twall/jna 2012-09-06 07:05:38 -04:00
Timothy Wall 9dce43affa fix file perms 2012-09-06 07:03:33 -04:00
Timothy Wall 7200f90633 fix native jar propagation 2012-09-06 07:02:39 -04:00
Daniel Doubrovkine (dB.) 861e4cc3bc Update www/Contributing.md
Updated link to Windows Development Environment.
2012-09-05 11:46:33 -03:00
phailwhale22 c2c1f81ea5 fix for issue #116 (continued)
Some stuff that was missing from my previous commit. Sorry for the
hurdles, this is my first time contributing to a project. Updated the
appropriate unit test and CHANGES.md for version 3.4.3.
2012-09-04 19:00:17 -04:00
phailwhale22 14481ee346 fix for issue #116 2012-09-04 18:07:13 -04:00
Timothy Wall a92256bc72 keep native builds separate from dist; copy on dist 2012-09-03 09:13:07 -04:00
Timothy Wall be42dda63d update javadoc 2012-09-03 08:27:53 -04:00
Timothy Wall 7313da6156 bump version to 3.4.2 2012-08-31 09:17:01 -04:00
Timothy Wall b7d94d6a14 fix minor javadoc, compile bugs 2012-08-31 08:12:41 -04:00
Timothy Wall 782b11f201 fix issue #107 2012-08-27 23:23:34 -04:00
Timothy Wall aea387ce02 fix failing tests in StructureTest (avoid returning self when sharing memory) 2012-08-22 16:38:21 -04:00
Timothy Wall 4ddad49369 save function field offsets instead of actual function pointers, which may change 2012-08-21 21:43:17 -04:00
Timothy Wall 224f18fef4 fix file perms 2012-08-21 19:29:43 -04:00
Timothy Wall 2390543445 add dll callbacks, tests, explicit flags for dlopen 2012-08-21 19:28:40 -04:00
Timothy Wall 473d48b39b fix up Netapi32Test to match DS_DOMAIN_TRUSTS changes elsewhere; I vaguely recall db saying something about removing a related test entirely for duplication of effort, perhaps this was missed checking in? 2012-08-11 22:27:44 -04:00
Timothy Wall a947dfdac5 address issue #84 2012-08-11 18:03:27 -04:00
Timothy Wall b83e977839 ensure memory always initialized when calling useMemory, even if layout is unknown 2012-08-03 07:10:06 -04:00
Timothy Wall ab2d5a72e7 enforce declaration of structure field order 2012-08-02 07:28:30 -04:00
Timothy Wall bc5855e900 Merge branch 'master' of github.com:twall/jna 2012-08-02 07:08:47 -04:00
twall 2c5993d680 simplify env settings 2012-07-27 07:52:29 -03:00
Timothy Wall 2cc7fe3272 Merge branch 'master' of github.com:twall/jna 2012-07-27 06:39:38 -04:00
twall 958ecde56b Update www/WindowsDevelopmentEnvironment.md 2012-07-26 22:37:05 -03:00
twall 0a9a4c926a Update www/WindowsDevelopmentEnvironment.md 2012-07-26 22:36:20 -03:00
Daniel Doubrovkine a0b50515e2 Moved windows development environment to www. 2012-07-26 21:15:49 -04:00
Daniel Doubrovkine (dB.) edf2dacfac Made instructions prettier. 2012-07-26 22:13:06 -03:00
Timothy Wall d65bd51895 add windows build notes 2012-07-26 20:17:17 -04:00
Timothy Wall e0bd677ffc update win64 build to work with MSVS C++ Express 10 and cygwin+mingw64 2012-07-26 19:58:59 -04:00
Timothy Wall c7123cf59b add change note 2012-07-19 06:39:00 -04:00
Timothy Wall 187fcdc2fb use a more applicable return type 2012-07-19 06:37:42 -04:00
Timothy Wall a064b2a0e1 add android link 2012-07-17 07:38:50 -04:00
Daniel Doubrovkine (dB.) 777406eb7b Merge pull request #98 from trejkaz/master
Third attempt at fixing Netapi32Util.getDomainTrusts()
2012-07-13 15:31:19 -07:00
twall 37f108fa51 Merge pull request #70 from jglick/master
Warnings reported by FindBugs et al.
2012-07-13 04:47:37 -07:00
Daniel Doubrovkine (dB.) f0817a3e75 Update master 2012-07-13 08:35:18 -03:00
Daniel Doubrovkine (dB.) 0eb9636bdf Prettified CHANGES, more consistent between w32 and win32. 2012-07-13 08:34:29 -03:00
Timothy Wall 3f3872974e closes #100 2012-07-13 07:32:34 -04:00
Timothy Wall 99533d2052 more unsigned fixes 2012-07-13 07:21:17 -04:00
Timothy Wall dce035056a fix some unsigned pointer-aliasing types, platform/win32 2012-07-13 07:12:47 -04:00
Trejkaz (pen name) 53cb504e90 Use Structure.toArray() instead of domains.getTrusts() 2012-07-13 10:46:39 +10:00
Daniel Doubrovkine 2162f14786 Moved Kernel32 definitions into Kernel32.java, added GetEnvironmentVariable. 2012-07-12 19:48:48 -04:00
Trejkaz (pen name) bd7fdf2438 Third attempt at fixing Netapi32Util.getDomainTrusts(). 2012-07-13 09:13:46 +10:00
Daniel Doubrovkine cc399eca28 Fixed testReadFile, not always null-terminated. 2012-07-12 16:08:40 -04:00
Daniel Doubrovkine adb048c01a Don't use NativeLong, equivalent to int on Windows. 2012-07-12 15:54:19 -04:00
Daniel Doubrovkine 738900d840 Using int and IntByReference for ULONG, also added ULONG. 2012-07-12 14:25:26 -04:00
Timothy Wall 3755747fda update notes 2012-07-12 08:45:48 -04:00
twall 36020c6d33 Merge pull request #95 from buckensens/master
Check for null-ness in initializeFields() before overwriting a field.
2012-07-12 03:33:01 -07:00
Patrik Burkhalter b64e24691b Properly getting fields in initializeFields() 2012-07-12 09:33:37 +02:00
Patrik Burkhalter a97377bb4a Merge remote branch 'upstream/master' 2012-07-12 09:12:16 +02:00
Daniel Doubrovkine (dB.) b661a7ecbd Update master 2012-07-12 01:53:27 -03:00
Daniel Doubrovkine (dB.) 2f3807d9a4 Merge pull request #96 from trejkaz/master
Fixing crash in Netapi32Util (or anyone who calls DsEnumerateDomainTrusts)
2012-07-11 21:31:56 -07:00
Trejkaz (pen name) 9932ce345e Updating changelog for my fixes 2012-07-12 14:05:01 +10:00
Trejkaz (pen name) b254399c02 NetApiBufferFree was freeing the pointer we were passing in rather than the pointer to what DsEnumerateDomainTrusts allocated. 2012-07-12 14:00:28 +10:00
Trejkaz (pen name) 5c08bfcd5c Some DS_DOMAIN_TRUSTS fields were mapping ULONG to NativeLong instead of int. 2012-07-12 11:09:24 +10:00
Trejkaz (pen name) fcd4cafe8a Second attempt at fixing the crash in Netapi32Util.
This time we change the definition of Netapi32.DsEnumerateDomainTrusts. Crash is still not happening and this fix is more likely to be correct.
2012-07-12 09:02:44 +10:00
Trejkaz (pen name) cd6a1f48c8 Merge branch 'master' of https://github.com/twall/jna 2012-07-12 08:38:16 +10:00
Patrik Burkhalter 2996d99914 Test for null on fields in initializeFields(). 2012-07-11 16:38:53 +02:00
Timothy Wall 785173f106 Avoid overwriting string fields within structures when unnecessary; fix failing direct mode tests 2012-07-10 07:30:53 -04:00
Trejkaz (pen name) bf66cb55d6 Fixing a crash when trying to free the wrong pointer in Netapi32Util. 2012-07-10 15:56:15 +10:00
Daniel Doubrovkine (dB.) 9ce2f894c3 Update master 2012-07-09 19:59:12 -03:00
Daniel Doubrovkine (dB.) 436e842faa Update master 2012-07-09 19:58:59 -03:00
Daniel Doubrovkine (dB.) adf4a382a3 Update master 2012-07-09 12:53:10 -03:00
Daniel Doubrovkine d4ba6b3575 Updated CHANGES. 2012-07-09 11:49:53 -04:00
Daniel Doubrovkine 6439e36464 Fix: platform.win32.Secur32.AcquireCredentialsHandle, InitializeSecurityContext and AcceptSecurityContext. 2012-07-09 11:49:10 -04:00
Timothy Wall 57ded8d803 android tweaks 2012-07-09 07:39:10 -04:00
Timothy Wall aa5fc9b3d8 tweak resource path for android 2012-07-09 07:14:54 -04:00
Timothy Wall afb3a7cc84 fix path to strip 2012-07-06 17:25:00 -04:00
Timothy Wall e14201201d remove superflous section marker 2012-06-26 21:15:31 -04:00
Timothy Wall 92b5085dd8 remove superflous section marker 2012-06-26 21:14:44 -04:00
Timothy Wall 4c814e7700 auto-sync memory for struct** arguments, add tests 2012-06-24 15:17:05 -04:00
twall fb6d9e6908 !@#$% magic links 2012-06-13 08:25:40 -03:00
twall 1398a5764b fix download links 2012-06-13 08:24:17 -03:00
twall e66bea10d4 Update master 2012-06-12 08:28:08 -03:00
twall 8ba666dfe0 Update master 2012-06-12 08:19:17 -03:00
twall 882bd3dd11 Update master 2012-06-12 08:14:54 -03:00
twall 317d41e1df Update master 2012-06-12 08:13:26 -03:00
twall 02bd142758 Update master 2012-06-12 08:00:18 -03:00
Daniel Doubrovkine 5f2620944f Made prettier. 2012-06-09 16:37:56 -04:00
Daniel Doubrovkine 0405f305f9 Updated changelog. 2012-06-09 16:37:09 -04:00
Daniel Doubrovkine 501dc9054a Fix: #78 NPE platform.win32.Netapi32Util.getDomainTrusts. 2012-06-09 16:33:07 -04:00
Timothy Wall b2c3c585db bump version 2012-06-08 09:27:55 -04:00
Timothy Wall 481010d0b3 Merge branch 'master' of github.com:twall/jna 2012-06-08 09:26:58 -04:00
Timothy Wall 4f79bd12e1 fix javadoc error 2012-06-08 09:26:36 -04:00
Timothy Wall 0bfd959bcb fix OSGI entries (closes issue #71 and issue #63) 2012-06-08 09:26:16 -04:00
twall d7845899b4 update javadoc links 2012-06-06 22:39:41 -03:00
Timothy Wall 307bf2600b update jar files 2012-06-06 21:25:30 -04:00
Timothy Wall 04f7f25563 update file download links 2012-06-06 21:22:01 -04:00
twall de33b60d87 Make javadoc more prominent. 2012-05-31 10:54:15 -03:00
twall 6e0914b1c9 Add link to dependency walker 2012-05-24 12:20:05 -03:00
twall f7f4b349e9 fix site doc link 2012-05-24 12:17:45 -03:00
twall 3c2f3115e0 add links to type mapping pages 2012-05-24 12:14:17 -03:00
twall 2df1b3675c add link to jnaerator 2012-05-24 12:09:15 -03:00
Timothy Wall 76f7b189fa add closures patch from auris 2012-05-22 08:13:17 -04:00
Daniel Doubrovkine 8c2d495e1c Updated CHANGES with SID and Netapi32Util.getUserInfo fixes. 2012-05-15 08:02:05 -04:00
Daniel Doubrovkine 42c9dea2c2 Updated tests: skip when not joined to a DC and check returned SID. 2012-05-15 07:44:36 -04:00
Daniel Doubrovkine c52599b6d9 Merge branch 'master' of github.com:twall/jna into trejkaz 2012-05-15 07:43:41 -04:00
Daniel Doubrovkine (dB.) ec90593be8 Merge pull request #74 from trejkaz/master
Fixing Netapi32Util.getUserInfo(String, String)
2012-05-15 04:43:27 -07:00
Daniel Doubrovkine 382d0098af Merge branch 'master' of git://github.com/trejkaz/jna into trejkaz 2012-05-15 07:31:15 -04:00
Trejkaz (pen name) 4c14dddec3 Commenting out Netapi32UtilTest.testGetUserInfo
The default behaviour of getUserInfo() in the absence of a domain name seems to be to fail, but this
was already occurring without my fix.
2012-05-15 16:32:24 +10:00
Trejkaz c2ce8be50f Tests for Netspi32Util.getUserInfo 2012-05-15 07:44:24 +10:00
Trejkaz a7717e5933 Ignore .DS_Store metadata files 2012-05-15 07:44:07 +10:00
Trejkaz (pen name) 9b255071f2 Make Netapi32Utils.getUserInfo(String,String) work.
Netapi32Utils.getUserInfo was ignoring the parameter for the domain name, which caused it to fail when the "domain" name was not actually a domain controller.

On fixing that, I got an error about the SID being in an invalid format. It seems like JNA's "PSID" is actually just the SID, so to get PSID you have to use "PSID.ByReference".
 This is bound to confuse someone else in the future so it might be worth renaming PSID to SID?
2012-05-14 12:39:25 +10:00
Daniel Doubrovkine (dB.) 70bb54e13f Merge pull request #73 from trejkaz/master
Making fields on USER_INFO_23 public
2012-05-13 18:10:18 -07:00
Trejkaz (pen name) 4461ca926c Making fields on USER_INFO_23 public so that it might actually be possible to use it 2012-05-14 10:15:20 +10:00
Nicolas Lelong d330f19292 iOS build fixes. 2012-05-05 09:37:02 -04:00
Timothy Wall b14ccb8eab update jna.jar 2012-05-04 07:28:06 -04:00
Timothy Wall d873f6f6be add android binary 2012-05-04 07:27:25 -04:00
Timothy Wall 7f0d465e98 set all structure fields, add android as a recognized platform 2012-05-04 07:24:00 -04:00
Jesse Glick 7855615a9d FindBugs has some other suggestions about nested classes which could be static.
In the case of LayoutInfo, this is especially important because otherwise
the layoutInfo WeakHashMap leaks references (compare issue #40).
2012-05-03 17:12:40 -04:00
Timothy Wall 9889489355 successful compilation/link of android 2012-05-03 08:09:54 -04:00
Anthony Green 09b23cfc1d Update README with Blackfin/uClinux support 2012-04-27 08:29:48 -04:00
Anthony Green 213ed15c70 Add blackfin supprt from Alexandre Keunecke. 2012-04-27 01:34:15 -04:00
Jesse Glick 6f7ece8603 FindBugs points out that StructField could be static. 2012-04-20 18:31:38 -04:00
Jesse Glick 5d44e011b9 API error in Structure.getFieldTypeInfo: StructField is not accessible outside this package,
so the method could not possibly be overridden outside it either.
Revealed by SigTest run on JNA 3.4.0:
Hidden class found: com.sun.jna.Structure$StructField in method protected com.sun.jna.Pointer com.sun.jna.Structure.getFieldTypeInfo(com.sun.jna.Structure$StructField) in class com.sun.jna.Structure
2012-04-20 18:29:04 -04:00
twall 0a190774b4 Add link to javadoc overview. 2012-04-12 13:19:40 -03:00
Anthony Green ff3d76fd42 3.0.11 2012-04-11 23:16:48 -04:00
Anthony Green 7e0a412c4f Update files to ship 2012-04-11 22:47:44 -04:00
Zachary Waldowski 39e6a58604 More mac/ios build improvements 2012-04-11 22:39:46 -04:00
Anthony Green 853cc722a1 Fix typo for darwin targets 2012-04-10 06:33:33 -04:00
Anthony Green 3f5023068c mend 2012-04-06 20:34:51 -04:00
Mike Lewis ebb8e89456 Build iOS library with xcode 2012-04-06 20:02:08 -04:00
Anthony Green a098b44f4c Reapply missing testsuite changes for arm 2012-04-06 17:04:35 -04:00
Anthony Green 10d1e51393 Update to rc4. Upgrade autoconf version. 2012-04-06 11:58:33 -04:00
Anthony Green 9bcc884276 Fix Linux/x32 reference in README 2012-04-06 11:53:07 -04:00
Anthony Green a044a56b1c Linux/x32 libtool fix 2012-04-06 10:39:10 -04:00
Anthony Green 59bb61a366 Update libtool version, README, tests dists 2012-04-06 08:26:14 -04:00
Anthony Green f2981454cb Revert debug code changes 2012-04-05 15:45:19 -04:00
Zachary Waldowski 39dccddb60 Fix building with Clang for Darwin (OS X 10.6+ and iOS
4.0+)
2012-04-05 12:32:41 -04:00
Peter Rosin 3afaa9a34a Fix return_uc.c test case on windows. 2012-04-03 07:40:31 -04:00
Anthony Green 65f40c35a2 Repair ppc build regression. 2012-04-03 07:35:59 -04:00
Peter Rosin 0a1ab12a8d Various MSVC-related changes. 2012-03-30 08:14:08 -04:00
Anthony Green e1539266e6 ARM VFP fix for old toolchains 2012-03-30 00:40:18 -04:00
Anthony Green 7c5e60b5f4 Rebase on fixed GCC sources 2012-03-29 08:48:22 -04:00
Anthony Green e72ed5eeaa Fix vararg float test 2012-03-21 09:52:28 -04:00
Anthony Green bd78c9c331 More cygwin fixes 2012-03-21 08:09:30 -04:00
Anthony Green 84d3253f86 Rebase post GCC merge 2012-03-19 23:07:35 -04:00
twall a09b116a9c Merge pull request #58 from tivv/master
JNA initialization fails with PermissionDenied
2012-03-19 07:52:44 -07:00
twall f351facdf4 Merge pull request #59 from SitChenNam/master
JNA port for AIX PowerPC
2012-03-19 07:46:55 -07:00
Vitalii Tymchyshyn 2143c18459 Fix for permission denied 2012-03-12 14:03:19 +02:00
SIT chen nam 8c0df63844 JNA AIX port on PowerPC
distribuable binary.
2012-03-12 12:00:25 +01:00
SIT chen nam 121430dac1 JNA port for AIX on PowerPC
The port has been made with GCC v4.6.2 on AIX 6.1 PowerPC.
Both aix-ppc and aix-ppc64 have been generated.

All JUNIT test runs successfuly, except DirectTest.registerMethod(),
because the standard /usr/libm.a is a static library.
You can install GCC libmpc.so.2 for AIX, and use it instead of libm.a, if
you want to run this test.
2012-03-12 11:53:30 +01:00
SIT chen nam 71163d3b9a FIX libffi (aix) error.
aix_closure.S: Invalid computed offset for register r3, wchen returning
from ffi_closure_helper_DARWIN().

ffi_darwin.c: add missing "break;" in "case FFI_AIX:"
              return FFI_BAD_ABI when unknown ABI is encountered.
2012-03-12 11:40:00 +01:00
Anthony Green 964c5b93f8 abi check fixes and Linux/x32 support 2012-03-03 14:46:20 -05:00
Anthony Green 6c194233a5 Add -no-undefined for both 32- and 64-bit x86
windows-like hosts.
2012-03-03 14:17:54 -05:00
Anthony Green 8360bf1cd0 Ensure that users don't include ffitarget.h directly 2012-02-23 07:01:13 -05:00
Daniel Doubrovkine (dB.) 3c916775ee Merge pull request #55 from joval/master
Some fixes and additions
2012-02-22 15:22:47 -08:00
David A. Solin 5ba54ed055 Note changes to log. 2012-02-21 19:24:19 -06:00
David A. Solin bd5b7fb376 Improved fix for empty string array registry types. 2012-02-21 14:30:41 -06:00
David A. Solin 05ed5c68bf Post-merge fixes. 2012-02-20 16:56:27 -06:00
David A. Solin b8dd54f99b Merge remote-tracking branch 'upstream/master'
Conflicts:
	contrib/platform/src/com/sun/jna/platform/win32/Kernel32.java
2012-02-20 16:21:14 -06:00
Daniel Doubrovkine (dB.) e20d384f9d Merge pull request #54 from chatellier/master
Add to platform.win32.User32 : GetLastInputInfo
2012-02-20 13:51:22 -08:00
David A. Solin bd63a56975 MULTI_SZ registry values take the form String1\0String2\0\0. The final \0 does not mean that there is a String3, but signals the termination of the value. This commit corrects the misinterpretation, making it possible for JNA to correctly retrieve MULTI_SZ values. 2012-02-20 13:58:16 -06:00
Anthony Green d578b89619 Fix ABI check regression 2012-02-15 00:18:18 -05:00
Eric Chatellier 1f10720f6e Fix code style and update CHANGES.md 2012-02-14 16:07:09 +01:00
Eric Chatellier 1ef26f6227 Remove useless import 2012-02-14 11:31:49 +01:00
Eric Chatellier 7d59645a67 Add to platform.win32.User32 : GetLastInputInfo 2012-02-14 09:56:55 +01:00
Anthony Green dee20f8e45 Rebased from gcc 2012-02-10 13:06:46 -05:00
Eric Chatellier 70e7b8f1f9 Add to platform.win32.User32 : GetLastInputInfo 2012-02-09 16:57:51 +01:00
Eric Chatellier 9e9b898452 Add to platform.win32.User32 : GetLastInputInfo 2012-02-09 15:57:55 +01:00
Anthony Green 4130e1972d Refresh autoconf-archive m4 scripts 2012-02-03 13:18:27 -06:00
Anthony Green 1ff9c604bb Rebase from GCC 2012-02-01 16:34:30 -06:00
Timothy Wall 00e3608c54 Clarify some javadoc 2012-01-29 12:57:11 -05:00
David A. Solin af6bd86757 Added GetDriveType. 2012-01-27 15:43:52 -06:00
David A. Solin 0952ce45c1 Added support for GetFileType. 2012-01-27 11:49:56 -06:00
Timothy Wall 040e67b637 bump version 2012-01-27 09:46:39 -05:00
Timothy Wall cd6fe24df5 update platform jar 2012-01-27 09:43:57 -05:00
Timothy Wall 42d2fb8607 Merge branch 'master' of github.com:twall/jna 2012-01-27 09:37:10 -05:00
Timothy Wall 241028bbd8 link linux x86/amd64 against older glibc versions (2.1.3 and 2.2.5 respectively) 2012-01-27 09:36:47 -05:00
Timothy Wall 0c58f7cb59 revise comment for accuracy 2012-01-27 09:19:06 -05:00
twall 47887c1d95 Merge pull request #50 from biggunbenny/master
Pull request on issue #49 as requested.  Properly read native data on first entry of array of printer info structs.
2012-01-24 08:14:03 -08:00
Anthony Green 211060eb8f Alpha fix 2012-01-23 14:24:01 -05:00
Anthony Green 78d9c638ba mend 2012-01-23 14:17:24 -05:00
Anthony Green afaf338160 mend 2012-01-23 14:17:13 -05:00
Anthony Green 9e9c4aeb77 Add Amiga support 2012-01-23 14:11:23 -05:00
Anthony Green 8efc0b1f40 Unlikely fixes 2012-01-23 13:47:38 -05:00
Anthony Green 1df51398ae mend 2012-01-23 13:43:59 -05:00
Anthony Green cd2277cc79 mend 2012-01-23 13:43:38 -05:00
Anthony Green 164e6fe04b m68k fixes 2012-01-23 12:41:06 -05:00
Anthony Green c365ee7577 Refresh 2012-01-23 11:13:18 -05:00
unknown cbc16d2a48 Fixed bug in WinspoolUtil.getPrinterInfo1() and WinspoolUtil.getPrinterInfo4() where the first element's fields was never populated 2012-01-18 09:18:24 +01:00
Timothy Wall 636b01b95c fix pom update path, maven javadoc path 2011-12-24 08:49:11 -05:00
Timothy Wall 41683e76bb don't delete 'dist' dir on clean 2011-12-23 22:52:55 -05:00
Timothy Wall 4030e1c015 use -mno-cygwin only on gcc < 4 2011-12-23 11:00:33 -05:00
Timothy Wall db6a8e7cda remove inadvertent build directory override 2011-12-22 18:08:16 -05:00
Kristian Rosenvold dd93afa50e Made build work clean as well 2011-12-21 23:25:20 +01:00
Kristian Rosenvold 822d49087b Maven central deployment 2011-12-21 22:50:59 +01:00
twall e463de8cc8 from Guillaume Cottenceau <gcottenc_AT_gmail_DOT_com> 2011-12-21 14:40:01 -05:00
twall 0c060dbaaa Merge pull request #40 from jglick/master
Accepted fix for memory leak
2011-12-14 07:15:56 -08:00
Timothy Wall 0fec165454 remove superfluous javah headers 2011-12-14 10:08:29 -05:00
Timothy Wall 504460458c ensure consistent JNI checksum 2011-12-14 09:36:22 -05:00
Timothy Wall 2fba190dde Merge branch 'master' of github.com:twall/jna 2011-12-12 09:41:25 -05:00
Timothy Wall b8fb3290b2 Allow for 'unsigned' IntegerType 2011-12-12 09:41:04 -05:00
David A. Solin 2e0c0a670f Fixed exception thrown when querying for the existence of a REG_QWORD. 2011-12-07 09:16:32 -06:00
Jesse Glick 9473f51d7b "Leaking WeakHashMap" canned analysis from NB Profiler turns up:
NativeMappedConverter.converters: java.util.WeakHashMap#116 is wrong: key java.lang.Class#5600 is reachable from value com.sun.jna.NativeMappedConverter#3
Indeed the value type strongly refers to the key type so a WeakHashMap is a potentially major memory leak.
Since Java lacks ephemerons, need to either eliminate the cache, or make the values be soft references.
2011-12-05 18:50:37 -05:00
Jesse Glick de857048a2 Merge branch 'master' of https://github.com/twall/jna 2011-12-05 18:36:24 -05:00
twall 83ec260e09 fix list formatting 2011-12-02 16:24:35 -05:00
Timothy Wall cbf8b37734 fix javadoc comment for field ordering 2011-12-01 13:52:43 -05:00
Timothy Wall e81f46ecf5 update download references 2011-11-26 08:53:53 -05:00
Timothy Wall c2089f5275 update download references 2011-11-26 08:53:09 -05:00
Timothy Wall e9da3c61c1 update jars for 3.4.0 2011-11-26 08:17:49 -05:00
Timothy Wall 01ff3f1d86 fix keyhook demo jar generation 2011-11-23 13:49:00 -05:00
Timothy Wall 931deeef94 fix javadoc warnings, move interface method definitions to WinNT from WinBase 2011-11-23 12:34:36 -05:00
Timothy Wall 5caa17a994 Separate NIO buffer mappings between Kernel32 and CoreDLL 2011-11-23 11:58:48 -05:00
Timothy Wall ecbfaa4b2d fix shell32 alignment on win64 2011-11-23 11:50:25 -05:00
Timothy Wall 0d273fefc6 fix keyhook build 2011-11-23 11:44:01 -05:00
Timothy Wall 9c4232b6e2 clean up w32 platform sources 2011-11-23 10:01:03 -05:00
Timothy Wall 79c2aaaebb correct mappings causing failure on win64 2011-11-23 09:36:45 -05:00
Timothy Wall 7141c7a612 Merge branch 'master' of github.com:twall/jna 2011-11-22 11:02:33 -05:00
Timothy Wall cd420e3e33 update docs 2011-11-22 10:24:05 -05:00
Timothy Wall ef2cc89023 fix build using mingw64 2011-11-21 14:58:56 -05:00
Timothy Wall 2beeabb17b fix struct layout cacheing in Union 2011-11-21 10:50:19 -05:00
Timothy Wall d83dde09a7 Merge branch 'master' of github.com:twall/jna 2011-11-19 11:43:19 -05:00
Timothy Wall 3ca38481c7 cache structure layout results 2011-11-19 11:41:10 -05:00
twall 288a5157be Merge pull request #38 from joval/master
Changes logged to CHANGES.md
2011-11-18 15:44:51 -08:00
David A. Solin f5bde32616 Changes logged to CHANGES.md 2011-11-18 17:14:21 -06:00
Timothy Wall bffbc30c3d Merge branch 'master' of github.com:twall/jna 2011-11-18 17:38:28 -05:00
Timothy Wall 9ca125ddc4 fix/cleanup platform tests 2011-11-18 17:29:12 -05:00
Timothy Wall df2721c0ce Implement mac move to trash 2011-11-18 17:13:38 -05:00
Anthony Green f22c38bbd9 Update variadic patch 2011-11-18 15:13:41 -05:00
Anthony Green 03e9ee321a Fix cls_double_va.c and update docs 2011-11-18 15:13:00 -05:00
David A. Solin 961e41be26 Additional changes per twall 2011-11-18 13:17:14 -06:00
David A. Solin 1332fbbcb0 Additional changes per twall 2011-11-17 20:30:41 -06:00
David A. Solin 8325f7cd82 Merge remote-tracking branch 'upstream/master' 2011-11-16 16:06:33 -06:00
David A. Solin 86f7b9788d File security and registry QWORD changes merged by samuel-aubin. 2011-11-16 16:02:53 -06:00
Timothy Wall b23411bc2b update w32 native 2011-11-15 11:22:44 -05:00
Timothy Wall 7c43abaf4e include error string in LastErrorException, if available, update wince native 2011-11-15 10:30:36 -05:00
Timothy Wall d7c106d08b fix JIRA issue 188 2011-11-14 13:48:54 -05:00
Anthony Green 95f31151ec Rerun automake 2011-11-12 23:46:05 -05:00
Anthony Green 198ed1ef85 Update version number 2011-11-12 23:45:20 -05:00
Anthony Green 4f17e1f142 Fix last patch 2011-11-12 17:22:24 -05:00
Anthony Green ff9454da44 Add David Gilbert's variadic function call support 2011-11-12 17:18:51 -05:00
Anthony Green ea14ae85e8 clean up 2011-11-12 16:36:59 -05:00
Anthony Green 52891f8a93 Add powerpc soft float support 2011-11-12 16:35:55 -05:00
Anthony Green c8f1bde8e2 Remove junk file 2011-11-12 16:21:02 -05:00
Anthony Green 6a6e7f862f Fix kfreebsd 2011-11-12 16:20:42 -05:00
Anthony Green d52fbed05c Add missing ChangeLog entry 2011-11-12 16:13:41 -05:00
Anthony Green 322052ce65 Fix arm wince alignment issue 2011-11-12 16:11:49 -05:00
Anthony Green af18df2bc2 Remove use of ppc string instructions 2011-11-12 15:52:08 -05:00
Anthony Green 236c939132 Fix darwin11 build problem 2011-11-12 07:37:40 -05:00
Anthony Green c411f140f3 Fix ax_enable_builddir macro on BSD systems 2011-11-12 07:32:36 -05:00
Anthony Green 3d56106b07 Rebase 2011-11-12 07:20:24 -05:00
Timothy Wall fdf9bbcc31 fix bug with aliasing buffers in Memory ByteBuffer tracking 2011-11-11 08:38:57 -05:00
Timothy Wall 65385d2ac6 v3.4.0rc all natives updated 2011-11-09 16:28:59 -05:00
Timothy Wall 133d956592 Merge branch 'master' of github.com:twall/jna 2011-11-09 13:13:48 -08:00
Timothy Wall 245dcb0f4a enable ppc builds on ppc64 2011-11-09 13:13:12 -08:00
Timothy Wall 6b19aa7ec9 avoid attempts to write to final fields on J2ME 2011-11-09 09:47:51 -05:00
Timothy Wall c5cbdbb1e8 rebuild for wince target 2011-11-09 08:56:40 -05:00
Timothy Wall cbf16d3f82 fix 2 failing w32ce tests 2011-11-09 08:46:53 -05:00
Timothy Wall df6ab34e5b Merge branch 'master' of github.com:twall/jna 2011-11-09 07:56:50 -05:00
Timothy Wall 816317b8a6 re-enable WCE failing tests, fixes to allow proper phoneME operation w/r/t AWT classes 2011-11-09 07:30:18 -05:00
Timothy Wall 521aa2dad0 don't set LD_PRELOAD if libjsig is unavailable 2011-11-07 16:30:52 -05:00
Timothy Wall 6e439ca778 fix compiler longjmp warnings in getChar/setChar 2011-11-07 11:02:25 -05:00
Timothy Wall d66e9e98b7 avoid crash with really long strings 2011-11-07 09:15:14 -05:00
Timothy Wall a3994e009d update sunos-x86/amd64 natives 2011-11-05 08:33:48 -04:00
Timothy Wall 062afd1773 fix contrib test runs on win64 2011-11-04 11:38:43 -04:00
Timothy Wall 8d2d8086b1 add linux x86/amd64 natives, w64 native, fix w64 compiler warnings 2011-11-04 09:18:31 -04:00
Timothy Wall cf71299f3b Merge branch 'master' of github.com:twall/jna 2011-11-03 11:00:31 -04:00
Timothy Wall 36dad4738a update freebsd natives 2011-11-03 11:00:03 -04:00
Timothy Wall fb744c65bd update sparc natives 2011-11-03 10:58:23 -04:00
Timothy Wall a9949b3fe0 update win32-x86 native 2011-11-03 10:14:32 -04:00
Timothy Wall a72d5b473b update linux-arm native 2011-11-03 13:56:58 +00:00
Timothy Wall 201931d2f8 update linux-ia64 native 2011-11-03 14:28:13 +01:00
Timothy Wall c58c5260a0 fix clobber warning 2011-11-03 09:08:14 -04:00
Timothy Wall e25dcd7c5f update osx/darwin native 2011-11-03 08:55:36 -04:00
Timothy Wall 04e36d1560 merge wince branch into master 2011-11-03 08:53:33 -04:00
Timothy Wall 681e840d97 add osgi for linux-ia64 2011-11-02 22:05:35 -04:00
Timothy Wall 59b44d532c rebuild ia64-linux 2011-11-03 03:03:26 +01:00
Timothy Wall 04a6806957 remove redundant src in javac 2011-11-02 18:56:04 -07:00
Timothy Wall 6041c067a5 incorporate linux-arm|ppc|ppc64 natives into main 2011-11-02 21:46:58 -04:00
Timothy Wall 9b9e6510ac build linux-ppc64 2011-11-02 18:42:53 -07:00
Timothy Wall 489d797df5 update note on winCE 2011-11-02 18:39:48 -04:00
Timothy Wall 9df51dd4d8 add change note for w32ce-arm 2011-11-02 16:41:46 -04:00
Timothy Wall 6ffbf31eda down to two failing tests on w32ce-arm 2011-11-02 16:37:43 -04:00
Timothy Wall 7ea92aa923 ensure separated buffer tests still work 2011-11-02 15:34:45 -04:00
Timothy Wall 1d481a7050 remove redundant message 2011-10-28 09:34:19 -04:00
Timothy Wall 76781972a2 update change log, account for NIO buffer position 2011-10-28 09:31:53 -04:00
Timothy Wall 2953b46a3c use Buffer position when it's backed by an array 2011-10-28 08:25:58 -04:00
Timothy Wall aae0c47f5c Merge branch 'master', remote-tracking branch 'origin' into wince 2011-10-27 15:22:25 -04:00
Timothy Wall 6d83a71bdd update natives (osx) 2011-10-27 13:03:40 -04:00
Timothy Wall 7b515a7dc8 merge master ARM changes into wince branch 2011-10-27 13:00:57 -04:00
Timothy Wall 8c06f5762f structure alignment fixes for ARM 2011-10-27 16:45:38 +00:00
Timothy Wall 1d96ae4ab2 fix missing import 2011-10-19 21:24:02 -04:00
Timothy Wall c1b875ff38 Merge branch 'wince' of github.com:twall/jna into wince 2011-10-19 20:34:38 -04:00
Timothy Wall 5b15ee4ae3 Merge branch 'master' of github.com:twall/jna into wince 2011-10-19 20:34:29 -04:00
Timothy Wall 92d3c433c4 Add a little explanatory info to balloon tips demo 2011-10-19 20:33:31 -04:00
Timothy Wall 79ff2f7a93 Merge branch 'master' of github.com:twall/jna 2011-10-19 20:32:57 -04:00
Timothy Wall b78618dca1 add wince basic mapping to platform.jar 2011-10-19 20:32:06 -04:00
Timothy Wall 0967615734 add wince basic mapping to platform.jar 2011-10-19 20:31:58 -04:00
twall 9eb51ebaba Update README.md 2011-10-17 15:20:59 -03:00
Timothy Wall d9c887c0d4 Merge branch 'master' of github.com:twall/jna 2011-10-12 09:40:14 -04:00
Timothy Wall 6e6d761f2b Merge branch callback-threads into master 2011-10-12 09:36:50 -04:00
Timothy Wall 7865bb46ad fix signal chaining link 2011-10-11 12:27:01 -04:00
Timothy Wall c6ad9adbe0 Boolean.parseBoolean not available on wce 2011-10-11 12:23:51 -04:00
Timothy Wall 907e2eb411 add docs for lasterror, fix last error failure 2011-10-11 12:09:25 -04:00
Timothy Wall e1ed265df7 all direct tests pass 2011-10-11 11:35:27 -04:00
Timothy Wall 1466833fb7 fixed tests related to 64-bit alignment 2011-10-11 09:39:24 -04:00
Timothy Wall ebf08cfede update docs re: JNA loading 2011-10-11 09:38:58 -04:00
Timothy Wall fc703cadb8 strip and explicitly link 2011-10-11 09:03:22 -04:00
Timothy Wall bb69e3d099 fix errors in libffi build 2011-10-11 08:46:13 -04:00
Timothy Wall 08e6f64a64 copy native bits *before* generating full jar file 2011-10-10 18:54:14 -04:00
Timothy Wall d9193f4442 fix more tests 2011-10-10 18:39:35 -04:00
Timothy Wall e658538926 fix some more failing tests 2011-10-10 17:00:33 -04:00
Timothy Wall b55b60cff4 fix load from current module 2011-10-10 14:57:21 -04:00
Timothy Wall ac272df5d3 down to 24 failures (4 crashes) on w32ce-arm 2011-10-10 14:40:16 -04:00
Timothy Wall b61e701298 NativeTest passes 2011-10-10 11:45:42 -04:00
Timothy Wall 7e2f27fe42 w32ce-arm library load on wince 5 (WM6.1) 2011-10-10 09:04:52 -04:00
Timothy Wall 078763cb92 Merge branch 'master' of github.com:twall/jna into callback-threads 2011-10-06 09:25:17 -04:00
Timothy Wall 2f66bb2b77 use default vm attach options 2011-10-06 09:24:42 -04:00
Timothy Wall b3de77c961 bump native version 2011-10-06 09:17:16 -04:00
Timothy Wall 60184e16f5 remove debug output 2011-10-05 19:35:50 -04:00
Timothy Wall 3e71e6cb3e Merge branch 'master' of github.com:twall/jna into callback-threads 2011-10-05 19:33:13 -04:00
Timothy Wall f0b5b01a5f avoid negative interactions with system install of JNA 2011-10-05 17:30:52 -04:00
Timothy Wall 877af01713 add direct method declaration in callbacks test 2011-09-30 16:11:24 -04:00
Timothy Wall 39ce53e6c9 clean up before merge 2011-09-30 10:47:43 -04:00
Timothy Wall 3d60203509 Merge branch 'master' of github.com:twall/jna into callback-threads 2011-09-22 11:54:22 -04:00
Timothy Wall ed3da68670 Merge branch 'master' of github.com:twall/jna 2011-09-22 11:53:38 -04:00
Timothy Wall a0cf56bdac Clean up javadoc parameters 2011-09-22 11:53:09 -04:00
Jesse Glick 26b8fad3c1 Merge branch 'master' of https://github.com/twall/jna 2011-09-21 17:36:21 -04:00
twall 6f9c712b22 Add link to JNAerator. 2011-09-14 10:31:54 -03:00
twall b95bcb2b63 Note existence of Pointer(long) ctor 2011-09-14 10:25:45 -03:00
twall 67fb8d11c2 Merge pull request #27 from bhamail/macPPC
1.5-level source compliance (Mac ppc) (via branch)
2011-09-13 04:34:32 -07:00
Timothy Wall e1f846df99 Fix default ABI used in prep_cif call 2011-09-12 09:12:51 -04:00
Dan Rollo b8cba40e84 change javac source/target props from 1.6 to 1.5 (allows build on mac ppc). 2011-09-10 16:15:13 -04:00
Dan Rollo 0d9dede3c4 comment out Override annotation to be 1.5 compliant. 2011-09-10 15:49:58 -04:00
Timothy Wall bb2888f670 remove tmp files 2011-09-10 11:42:39 -04:00
Timothy Wall 1cb727a62a enable callback threads on windows 2011-09-10 11:41:49 -04:00
Timothy Wall 77419e2808 clean up 2011-09-10 08:47:08 -04:00
Timothy Wall 6b42585e82 Merge branch 'master' of github.com:twall/jna into callback-threads 2011-09-09 10:25:39 -04:00
Timothy Wall 2841c3aaf1 functional detach switch from callback 2011-09-09 10:17:30 -04:00
Timothy Wall 72871bbd4c Merge branch 'master' of github.com:twall/jna 2011-09-09 07:38:18 -04:00
Timothy Wall 697e024936 fix javadoc link 2011-09-09 07:38:02 -04:00
Anthony Green 8c01954c50 Build assembly files with debug info 2011-09-06 14:26:32 -04:00
Jesse Glick c7603bffa8 Ignore the doc directory; it is a build product. 2011-09-06 14:25:44 -04:00
twall 366296743b Merge pull request #26 from jglick/master
Pull request #22 cleanup
2011-09-06 10:34:19 -07:00
Jesse Glick a48f90067e Removing stray references to nbproject. 2011-09-06 12:08:41 -04:00
twall 8e6b046ee0 Merge pull request #22 from jglick/master
Sundry build script fixes
2011-09-06 07:41:08 -07:00
Anthony Green fed646a207 Regenerate configury with missing m4 macros 2011-09-06 09:50:20 -04:00
Anthony Green d76441cf71 Update list of supported OpenBSD systems 2011-08-24 10:14:23 -04:00
Anthony Green ee6696fdf4 3.0.11-rc1. soname bump. 2011-08-23 12:30:29 -04:00
Anthony Green c6265c36a9 Version 3.0.10 2011-08-23 10:31:33 -04:00
Anthony Green cc5e41bf32 Fix use of autoconf macros 2011-08-22 16:34:24 -04:00
Anthony Green 049d8386ff Many new patches 2011-08-22 14:50:10 -04:00
Jesse Glick af9c4e6cb9 Pass jna.builddir as an absolute path.
Otherwise various tests fail when the CWD used to invoke Ant is not the project basedir.
2011-08-16 13:26:34 -04:00
Jesse Glick 1af26d22fd <sysproperty key="k" value="v"/> more natural than <jvmarg value="-Dk=v"/>. 2011-08-16 12:34:28 -04:00
Jesse Glick f9c9e0ef41 <formatter type="brief" usefile="false"/> has similar command-line behavior to printsummary="yes" but allows Ant listeners like NetBeans to track progress. 2011-08-16 12:14:04 -04:00
Jesse Glick 06060b7dff Should specify tempdir prop to <junit> so as not to pollute versioned dir with junit*.properties after aborted tests. 2011-08-16 12:07:50 -04:00
Jesse Glick 6b9d964e36 Correcting confused paths: classpaths should not include source roots. 2011-08-16 11:47:13 -04:00
Jesse Glick 43752710f8 Move misleading project metadata out of the way.
Should be friendlier to the NetBeans IDE.

1. A project should not have a "pom.xml" at top level (or preferably anywhere)
   unless it is really a Maven-based project and pom.xml gives all relevant
   information about the sources, which is certainly not the case here.

2. nbproject/project.xml was that of an IDE-managed project, which is
   inappropriate here where there is a complex build.xml that does not (and
   cannot) conform to the expectations of that project type (e.g. different Java
   source levels for src/ and test/ dirs). Could use the "freeform" project type
   for such cases, but http://wiki.netbeans.org/AutomaticProjects should do just
   as well, with no IDE-specific metadata or administration.
2011-08-16 11:17:15 -04:00
Anthony Green 3b7efa4e74 Revert remove-debug-code patch temporarily (for ARM Fedora release) 2011-08-15 13:25:13 -04:00
Timothy Wall c397a0a4e3 add callback thread initializer 2011-08-11 15:45:13 -04:00
Timothy Wall 5a674bf44b Merge branch 'master' into callback-threads 2011-08-11 11:35:26 -04:00
Timothy Wall cea1743630 Merge branch 'master' of github.com:twall/jna 2011-08-11 11:34:20 -04:00
Timothy Wall 2666f05790 update .gitignore 2011-08-11 11:34:13 -04:00
Timothy Wall 53822961b9 update .gitignore 2011-08-11 11:33:19 -04:00
Timothy Wall 0574c76c4f add full native list for OSGI Bundle-NativeCode manifest attribute 2011-08-11 11:27:12 -04:00
twall 6941166a71 Fix JavaDoc warning 2011-08-11 12:02:56 -03:00
Timothy Wall 34ab92f0fb initial callback behavior flags setup and test harness 2011-08-11 09:51:21 -04:00
twall b5dbe3bb94 Added basic build instructions for w32/w64. 2011-08-09 12:31:58 -03:00
twall 542b9c47ed Merge pull request #19 from dblock/contributing
Added a contributing section and links to JavaDoc.
2011-08-08 06:59:41 -07:00
Timothy Wall bf6a58c9b7 fix reported file path for platform test results 2011-08-06 14:28:28 -04:00
Timothy Wall a7182710cc avoid deleting native library when it already exists as a file in the classpath 2011-08-06 14:26:12 -04:00
Timothy Wall cd238a0800 ensure temporary/unpacked files are marked for deletion; attempt deletion immediately after load 2011-08-06 13:39:46 -04:00
Timothy Wall 3e6f098b34 Add option to avoid automatic jar unpacking, with test 2011-08-06 10:21:22 -04:00
Timothy Wall 244dd4296b update jna website address 2011-08-06 10:20:47 -04:00
Timothy Wall c7ef8c3223 update main website in javadoc overview 2011-08-06 10:19:57 -04:00
Daniel Doubrovkine 34b5f2f206 Moved javadoc one level back. 2011-08-06 08:58:26 -04:00
Timothy Wall ae4c442077 fix incorrect comment 2011-08-05 18:08:21 -04:00
dblock 1da72d973d Reformatted. 2011-08-05 12:29:26 -04:00
dblock 8ef79fb6a6 Try without spaces. 2011-08-05 12:27:45 -04:00
dblock 15e8e58f67 Lets try again. 2011-08-05 12:27:10 -04:00
dblock c082e4813d One more tab. 2011-08-05 12:26:18 -04:00
dblock fc2c75c7df Added link to JavaDoc. 2011-08-05 12:24:52 -04:00
dblock d033c4c5a9 More contributing. 2011-08-05 12:22:25 -04:00
dblock 04e4a24664 Merge branch 'master' of github.com:twall/jna into contributing 2011-08-05 12:20:29 -04:00
Daniel Doubrovkine (dB.) 2a7ecd3847 Merge pull request #18 from dblock/javadoc
Regenerated 3.3.0 javadocs into www.
2011-08-05 09:20:06 -07:00
dblock 727c8a47d1 Updated Javadoc. 2011-08-05 12:09:54 -04:00
dblock 37630b17c3 Added contributing. 2011-08-05 12:07:49 -04:00
Anthony Green d992ac54a2 Refresh from GCC 2011-07-29 17:32:53 -04:00
Daniel Doubrovkine (dB.) 1ec856379d Merge pull request #15 from tulskiy/master
Mapping functions required for global hotkeys
2011-07-27 11:48:58 -07:00
tulskiy 8d43c5cabf Updated CHANGES.md with new functions for global hotkeys 2011-07-28 00:39:56 +06:00
Denis Tulskiy 0fae5813f6 [osx] added Carbon library mapping with functions required for global hotkeys functionality 2011-07-28 00:31:44 +06:00
Denis Tulskiy 62242cd708 [x11] added mappings to XGrabKey and XUngrabKey functions used for Global Hotkeys and XSetErrorHanler used to handle program errors without exiting 2011-07-28 00:31:43 +06:00
Denis Tulskiy 5c758d3baf [user32] added mappings to RegisterHotKey and UnregisterHotKey functions used for Global Hotkeys 2011-07-28 00:31:43 +06:00
Daniel Doubrovkine (dB.) 1f495f5fec Merge pull request #16 from tmyroadctfig/master
Updated changes.md as per code review comments.
2011-07-27 05:02:52 -07:00
Luke Quinane 9e6ebd4c8e Update changes.md - move new functions to correct sub-heading and expand the added list. 2011-07-27 09:12:53 +10:00
twall dd323edec4 Merge pull request #14 from bhamail/master
first attempt at a pull request...
2011-07-21 17:44:11 -07:00
Dan Rollo 53006d6ff4 replace non-UTF8 character 2011-07-21 19:51:51 -04:00
Daniel Doubrovkine (dB.) 94097d4656 Merge pull request #11 from tmyroadctfig/master
Code review changes.
2011-07-13 04:23:37 -07:00
Luke Quinane 033ef99663 Update changes.md. 2011-07-13 15:46:50 +10:00
Luke Quinane c82e2b01a4 Code review changes - remove ANSI comments and make all functions Unicode. 2011-07-12 08:58:52 +10:00
Luke Quinane b25bc96eb7 Code review changes - move some constants. 2011-07-12 08:47:13 +10:00
Timothy Wall 00c79242fe closes #10 2011-07-11 13:05:18 -04:00
Timothy Wall 46dac8226a Merge branch 'JNA-184' of https://github.com/kohsuke/jna into kohsuke-10 2011-07-11 12:42:49 -04:00
Daniel Doubrovkine (dB.) 8e919e7298 Merge pull request #2 from tmyroadctfig/master
Added some more Win32 platform calls.
2011-07-11 05:28:34 -07:00
Luke Quinane 499b115a01 Merge remote-tracking branch 'upstream/master' 2011-07-11 10:15:06 +10:00
Kohsuke Kawaguchi 75c0885a5b Integrating the fix for JNA-184 as submitted in http://java.net/jira/browse/JNA-184 2011-07-10 10:57:47 -07:00
Timothy Wall 1cec02f2d8 add linux/ppc failure notes 2011-07-08 09:23:54 -04:00
Timothy Wall b05e7835c6 add linux/ppc native 2011-07-08 15:22:30 +02:00
Timothy Wall 62201ceba0 fix structure alignment issues on linux/ppc 2011-07-08 14:32:54 +02:00
Timothy Wall 7d28dd8114 move osgi entries to the proper location 2011-07-08 07:32:08 -04:00
Luke Quinane 6d3f003133 Add version docs and test. 2011-07-08 10:11:33 +10:00
Luke Quinane 167d6bcbb7 Move more values into the correct Java file. 2011-07-07 11:19:54 +10:00
Luke Quinane fac681cfa2 Move another value into the correct Java file. 2011-07-07 11:11:30 +10:00
Luke Quinane a1643fcdc2 Move another value into the correct Java file. 2011-07-07 11:10:42 +10:00
Luke Quinane d1d7f2eb2b Add documentation for some more structures / values. 2011-07-07 11:05:06 +10:00
Luke Quinane 605ab234d7 Add documentation for the SetupApi interface. 2011-07-07 10:47:15 +10:00
Luke Quinane d10c7c922e Add tests and documentation for the MSI interface. Add some licence details to new files. 2011-07-07 10:10:31 +10:00
Luke Quinane 1c82657c0c Add unit tests for new kernel32 functions. Move out bits declared in other header files. 2011-07-06 14:53:09 +10:00
Luke Quinane a4a7faba40 Move new win32 structures into the correct Java files. Migrate new win32 interfaces still in the old project structure. 2011-07-06 13:31:28 +10:00
Luke Quinane ffa4cc6ac9 Merge remote-tracking branch 'upstream/master' 2011-07-06 12:44:52 +10:00
Timothy Wall 0cdc7ff542 use java.io.tmpdir as a fallback if can't create jna tmpdir 2011-06-23 10:07:25 -04:00
Timothy Wall 71de662675 revise temporary file cleanup on win32 2011-06-23 08:34:08 -04:00
Timothy Wall a18e453686 move jnalib up to top level 2011-06-22 07:34:11 -04:00
Daniel Doubrovkine (dB.) 6e99ab0184 Merge pull request #3 from notnoop/master
Correct the Callback documentation
2011-06-21 08:37:59 -07:00
notnoop 4b8d91084b correct C equivalence of Callback documentation 2011-06-21 15:29:57 +00:00
dblock ed900e2b31 Fixed link. 2011-06-20 08:14:19 -04:00
dblock e2e67eac9f Added links to download. 2011-06-20 08:13:39 -04:00
Luke Quinane 7ce94ed58e Restore original imports. 2011-06-20 11:34:33 +10:00
Luke Quinane 57d44c3c36 Revert some removed upstream changes. 2011-06-20 11:31:39 +10:00
Luke Quinane 3a86a62865 Whitespace fixes. 2011-06-20 11:27:56 +10:00
Luke Quinane 65d5d4303d Added some missing javadocs. 2011-06-20 11:20:52 +10:00
Luke Quinane 8d7256ef08 Whitespace fixes. 2011-06-20 11:20:38 +10:00
Luke Quinane fd16cfc67a Revert further duplicated changes. 2011-06-20 10:22:29 +10:00
Luke Quinane e7bd55637a Remove duplicated structures. 2011-06-20 10:11:57 +10:00
Luke Quinane 0f459174c8 Fix compilation errors. 2011-06-20 10:05:47 +10:00
Luke Quinane 1d19323026 Copy changes into Github checkout. 2011-06-20 09:29:58 +10:00
Timothy Wall ed1cc99506 update CHANGES with current version 2011-06-17 10:36:51 -04:00
twall f66cb26c58 Merge pull request #1 from dblock/master
Initial documentation in markdown format.
2011-06-17 07:30:49 -07:00
dblock 707412d1b6 Merge branch 'master' of github.com:twall/jna 2011-06-07 20:25:46 -04:00
dblock a7ebdc5453 Sync with svn, 3.3.0 release. 2011-06-07 20:22:40 -04:00
dblock dc35957f63 Updating revisions 1197 and 1998 from svn. 2011-05-30 15:30:38 -04:00
dblock 0711483bb7 Updated readme. 2011-05-23 11:26:05 -04:00
dblock f4f5ff1887 Fixed table. 2011-05-23 11:24:30 -04:00
dblock 33a4fa3203 Changes are in markdown format. 2011-05-23 11:20:46 -04:00
dblock 8b22412e55 The rest of the documentation. 2011-05-23 11:19:40 -04:00
dblock 92d721d9d0 Started porting docs into markdown. 2011-05-23 10:47:24 -04:00
dblock 0f06d0b8ce Added top-level build.xml. 2011-05-23 09:37:48 -04:00
dblock e321ec4c6f Updated classpaths to jnalib, default Eclipse import. 2011-05-23 09:13:09 -04:00
dblock 2f2892ff08 Updated classpaths to match default Eclipse import (jnalib). 2011-05-23 09:11:44 -04:00
dblock 1dd559e80e Added .gitignore. 2011-05-23 08:47:12 -04:00
Timothy Wall b7fb1b7e5a update sparc jars
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1196 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-05-17 14:24:16 +00:00
Timothy Wall eb60877793 update native jar
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1195 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-05-16 17:10:05 +00:00
Timothy Wall 5907ce0a02 import libffi 3.0.10-rc8
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1194 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-04-30 21:54:20 +00:00
Anthony Green 2d3fb36420 Fix darwin EH 2011-03-30 16:54:42 -04:00
Timothy Wall 5a1d431e51 fix javadoc warnings
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1193 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-03-12 22:21:17 +00:00
Timothy Wall 0552c4a001 fix javadoc warning
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1192 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-03-12 22:20:48 +00:00
Timothy Wall 96d017869a move all native functions into Native class, reduce JNI crossings where possible
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1191 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-03-03 14:29:29 +00:00
Timothy Wall ddc2688af8 update release notes
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1190 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-03-03 14:26:47 +00:00
Timothy Wall baa60b6198 fix invalid PPC relocation types
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1189 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-03-03 12:15:51 +00:00
Timothy Wall 8abdddf11a avoid ant warning
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1188 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-03-03 12:13:02 +00:00
Timothy Wall 9141018b27 partial repair of osx build
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1187 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-02-28 23:04:20 +00:00
Timothy Wall 3370fecdf2 make Memory easier to extend, use synchronized map to track buffers
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1186 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-02-28 22:19:33 +00:00
Anthony Green 30ff28e1d8 Fix permissions 2011-02-28 15:36:23 -05:00
Anthony Green 09f8f310f4 More AIX fixes. rc9. 2011-02-28 15:36:07 -05:00
Anthony Green 53d7b16564 Merge branch 'master' of https://github.com/landonf/libffi-ios 2011-02-28 15:23:31 -05:00
Daniel Doubrovkine 5e91f76f0f Added Kernel32.GetFileAttributes and Kernel32Util.getFileAttributes.
Patch by cdanninger.
http://java.net/jira/browse/JNA-175


git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1185 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-02-28 01:33:47 +00:00
Timothy Wall 557b3e1c93 allow multiple fields of same type in union
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1184 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-02-26 02:51:01 +00:00
Anthony Green 18dd85d6cb rc8. fix last patch. 2011-02-25 16:23:04 -05:00
Anthony Green 74ee6ea8b4 rc7. More AIX fixes. 2011-02-25 15:52:14 -05:00
Anthony Green 2541679dbd Fix ppc32 bug 2011-02-25 15:09:13 -05:00
Anthony Green cbb062cc35 Another non-GCC configury fix 2011-02-17 20:39:21 -05:00
Anthony Green 8cf8878425 Fix ax_cc_maxopt.m4 2011-02-15 15:19:49 -05:00
Daniel Doubrovkine 3f65e56ccd Moved release notes to www. Modified HTML to fit Kenai website.
To upload to Kenai use Webdav to jna.java.net (w/SSL), the path is /website/jna/. 
Results at http://jna.java.net/. 

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1183 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-02-15 18:09:05 +00:00
Anthony Green 24b72070c0 Fix warning and msvcc patches 2011-02-14 15:30:57 -05:00
Anthony Green d72c49e556 Add missing msvcc.sh 2011-02-13 11:41:05 -05:00
Landon Fuller 3000dc237f Merge remote branch 'upstream/master' 2011-02-13 08:55:53 -05:00
Anthony Green 1fbf9dc44f Fix bad_abi test. rc5. 2011-02-13 08:06:39 -05:00
Anthony Green 90af15ef5c iOS fixes 2011-02-12 12:29:36 -05:00
Landon Fuller 55e4a5aa15 Add support for building a full armv6/armv7/i386 universal iOS library 2011-02-12 12:13:46 -05:00
Landon Fuller a0c80f279b Update my e-mail address. 2011-02-12 11:43:49 -05:00
Landon Fuller 8195e0e11d Fix symbol prefixes on Darwin. 2011-02-12 11:27:00 -05:00
Landon Fuller 56b3f8cef0 Modify the ffi_closure structures to hold table/table entry pointers instead of a code buffer.
This re-integrates commit da2773e02a.
2011-02-12 11:14:54 -05:00
Landon Fuller 28a00f61ff Apple assembler support; fixed most gas/ELF-isms. 2011-02-12 11:01:48 -05:00
Landon Fuller 7f2ea33a80 Replace RETLDM macro.
The macro is incompatible with Apple's assembler; switch to
a simple inline version.
2011-02-12 10:39:18 -05:00
Landon Fuller 92ff23e77f Switch to the current iOS 4.2 SDK. 2011-02-12 10:24:49 -05:00
Landon Fuller 58fb8ca2df Merge remote branch 'upstream/master' 2011-02-12 10:23:19 -05:00
Landon Fuller cc3fbd975c Merge branch 'master' of github.com:landonf/libffi-ios 2011-02-12 10:21:02 -05:00
Landon Fuller e449a43bbe Allow specification of the minimum supported iOS version. 2011-02-12 10:20:42 -05:00
Anthony Green 71c792f51b rc4 2011-02-12 09:33:11 -05:00
Anthony Green 7c7c9f3272 ungccify parts of the build 2011-02-12 09:29:29 -05:00
Anthony Green ed62e48b95 Fix permissions 2011-02-11 12:23:58 -05:00
Anthony Green 17d9e9e68d Use newer autotools. Only build debug.c when --enable-debug. 2011-02-11 12:23:20 -05:00
Anthony Green 6972a4ffda Fix xlc build on AIX 2011-02-11 07:32:51 -05:00
Anthony Green 1833aa0fb9 sparc ABI test fix. 2011-02-11 07:11:04 -05:00
Anthony Green f1fb139b4e Fix tests 2011-02-09 18:30:02 -05:00
Anthony Green 5cb470331d Fix permissions 2011-02-09 15:23:06 -05:00
Anthony Green 269deef6db rc3 2011-02-09 15:22:23 -05:00
Anthony Green 42695e7250 Fix IRIX support 2011-02-09 15:12:35 -05:00
Anthony Green a6e56b97f6 Add powerpc64-*-darwin* support 2011-02-09 15:00:42 -05:00
Anthony Green 747d6c32d4 Add Interix support 2011-02-09 14:56:23 -05:00
Anthony Green eab6e41cde Remove README.markdown form libffi-ios 2011-02-09 10:15:02 -05:00
Anthony Green 69dbe845f4 Fix xfails 2011-02-09 07:38:43 -05:00
Anthony Green f498318c07 Update README for iOS again 2011-02-09 06:26:46 -05:00
Anthony Green 630b9c0ac4 Update to rc2 2011-02-09 06:24:23 -05:00
Anthony Green 0cad4386fa Add ChangeLog entry. Fix copyright headers. 2011-02-09 06:11:46 -05:00
Anthony Green 09cb76f264 Add missing change 2011-02-08 20:39:51 -05:00
Anthony Green 2e3a48ccdd Fix make dist 2011-02-08 20:37:26 -05:00
Anthony Green 5e4814d992 fix permissions 2011-02-08 19:46:28 -05:00
Anthony Green 5c0cc6f153 3.0.10rc1 2011-02-08 19:45:59 -05:00
Anthony Green 857fe3de46 Clean ups 2011-02-08 19:39:20 -05:00
Anthony Green e2214f8adb Update README 2011-02-08 19:22:56 -05:00
Anthony Green 1106229a57 Add iOS support 2011-02-08 19:20:09 -05:00
Anthony Green bc9d0be295 3.0.10rc0 changes 2011-02-08 17:04:26 -05:00
Anthony Green 3b836249fe Rebase from GCC 2011-02-08 14:28:59 -05:00
Anthony Green a26e394061 copyright updates patch 2011-02-08 13:56:12 -05:00
Anthony Green b8099539f0 Fix msvcc.sh botch 2011-02-08 13:50:43 -05:00
Anthony Green dc411e8f99 Fix HP-UX build 2011-02-08 10:49:29 -05:00
Anthony Green 404585d134 Fix sparc v8 aggregate type returns for sun's compiler 2011-02-08 10:44:36 -05:00
Anthony Green 19ce713188 grammar fix 2011-02-08 10:34:23 -05:00
Anthony Green 89284fe55f Fix AIX build with IBM XLC 2011-02-08 10:19:19 -05:00
Anthony Green ba022c338a fix win64-underscore patch 2011-02-08 10:12:48 -05:00
Anthony Green 097e5f3924 x86 pcrel test part 2 2011-02-08 10:11:00 -05:00
Anthony Green ed2c518d96 x86 pcrel test 2011-02-08 10:10:07 -05:00
Anthony Green 0e5843995f Refresh from GCC 2011-02-08 07:52:40 -05:00
nguillaumin 5bd2cba2c2 Added platform.win32.Advapi32.ImpersonateSelf
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1182 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-02-03 04:04:12 +00:00
nguillaumin 3de7eb58a7 Added platform.win32.Advapi32.AdjustTokenPrivileges, platform.win32.Advapi32.LookupPrivilegeName, platform.win32.Advapi32.LookupPrivilegeValue + tests.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1181 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-01-30 22:31:15 +00:00
nguillaumin 41eb294ce6 [issue #169] Added new Win32 platform function mappings related to process creation. SECURITY_ATTRIBUTES structure has been moved to WinBase to reflect latest MSDN doco.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1180 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-01-16 22:17:34 +00:00
Timothy Wall ba94f2ebe0 add platform.jar to maven package
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1179 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-01-12 14:34:21 +00:00
Timothy Wall 7912248950 add platform.jar to maven package
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1178 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2011-01-12 14:24:50 +00:00
Daniel Doubrovkine 5d27c255b3 Killed link to forum. Forum RIP.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1177 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-12-22 04:56:38 +00:00
Eugine Lev 80e86e3b83 Bug: fix issues with starting/stopping services, caused by the service resetting progress checkpoint to 0.
Add getters for service handle and service manager handle in W32Service and W32ServiceManager respectively.

CR: dBlock

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1176 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-12-14 19:28:19 +00:00
Daniel Doubrovkine 3a759f1eea Fix platform.win32.Netapi32Util.getDC AV on Win64
https://jna.dev.java.net/issues/show_bug.cgi?id=167
Fix Advapi32Test.testGetTokenOwnerInformation AV.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1175 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-12-13 18:35:21 +00:00
Timothy Wall a09e503f19 fix Structure(Pointer) array field init bugs
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1174 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-11-24 22:59:12 +00:00
Timothy Wall da4524b05c partially fix build on OSX 10.6 (omits ppc build)
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1173 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-11-24 21:59:42 +00:00
Timothy Wall 1a98283709 Fix NPE in array element initialization
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1172 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-11-24 21:50:09 +00:00
Timothy Wall acca8c5ac9 add two (failing) tests based on Samuel Audet's reports on lack of field initialization in Structure with Pointer ctors
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1171 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-11-24 20:25:03 +00:00
Timothy Wall 55eabb84e4 fix Structure.StructureSet.Iterator bug
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1170 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-11-24 20:15:45 +00:00
Anthony Green 5b9cd52784 win64-underscore patch 2010-11-22 15:19:57 -05:00
Anthony Green 2db72615b5 Rebase 2010-11-21 10:50:56 -05:00
Landon Fuller f6ab3edc23 Include the license header in the generated output. 2010-10-27 19:34:51 -04:00
Landon Fuller cef6194628 Add missing copyright/license header. 2010-10-27 14:01:01 -04:00
Daniel Doubrovkine 90ba9fce2a Added EventLogRecord.getData() and getStrings().
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1169 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-10-13 23:57:22 +00:00
Daniel Doubrovkine 76b3982ddd Fixed Javadoc warnings.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1168 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-10-06 21:35:28 +00:00
Daniel Doubrovkine c946f80d5b Fixed Javadoc warnings.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1167 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-10-06 21:34:20 +00:00
Eugine Lev 8d350c7d99 Add platform.win32.W32ServiceManager and W32Service.
Add platform.win32.Kernel32.GetTickCount.
CR: dBlock

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1166 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-10-06 21:18:43 +00:00
Daniel Doubrovkine 7cd7fb8d6c Add REG_BINARY, REG_EXPAND_SZ and REG_MULTI_SZ support to Advapi32Util.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1165 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-10-06 14:26:31 +00:00
Daniel Doubrovkine b12e563340 Build break: fixed service name in Advapi32Test.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1164 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-10-06 03:39:51 +00:00
Daniel Doubrovkine 9c0aadce1e Added REG_BINARY support to Advapi32Util registry functions.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1163 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-10-06 01:03:30 +00:00
Daniel Doubrovkine b8d538b1b4 Removed unused functions in NTService demo, equivalents have long been ported to platform.win32.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1162 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-10-06 01:02:18 +00:00
Daniel Doubrovkine 0219cd71b9 Fix platform.win32.Kernel32.GetNativeSystemInfo and GetSystemInfo AV on Win64.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1161 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-10-06 00:03:25 +00:00
Eugine Lev 899fcbdfcc Add Win32 Service functions to platform.win32.Advapi32
CR: dBlock

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1160 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-10-05 23:51:34 +00:00
Daniel Doubrovkine 79fed6e32f Updated projects using JNA to be a link to a forum where people can post themselves.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1159 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-10-03 20:42:48 +00:00
Daniel Doubrovkine 55263ca11d Documented EVENTLOGRECORD.
Added flags to iterate forwards and backwards.
Collapsed record ID using the value in the structure.
Shortened tests.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1158 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-09-30 20:04:58 +00:00
Daniel Doubrovkine fe1f4a3bac Add EventLogIterator to Advapi32Util.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1157 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-09-30 15:08:26 +00:00
Daniel Doubrovkine dd4fda55b5 Re-oredered test report for JNA to run after tests to avoid merging wrong results.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1156 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-09-29 14:03:56 +00:00
Daniel Doubrovkine 2aae506110 Added xml test report, generating in jnalib\contrib\platform\build\test\results\TESTS-TestSuites.xml.
Shortened runtime of testReadEventLogEntries.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1155 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-09-29 14:01:56 +00:00
Daniel Doubrovkine aae54a6f41 Added WinspoolUtil.getPrinterInfo4.
Not expecting failure in spool tests on the first call: when no printers are installed the function succeeds and returns 0 bytes required and 0 printers returned.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1154 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-09-29 12:18:31 +00:00
Daniel Doubrovkine 89da58adec Added PRINTER_INFO_4.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1153 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-09-29 02:41:40 +00:00
Daniel Doubrovkine 57ef003eb9 Added Advapi32.GetOldestEventLogRecord.
Added WinNT.EVENTLOGRECORD.
Bug: ReadEventLog broken, added full test.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1152 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-09-29 01:24:56 +00:00
Daniel Doubrovkine d378a64096 Hopefully fixed the WinspoolTest for when there're no printers installed.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1151 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-09-29 00:17:01 +00:00
Daniel Doubrovkine 58ac91bc10 Fixed spool tests for cases where no printers are available.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1150 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-09-28 23:43:19 +00:00
Daniel Doubrovkine 97602c0bf8 Fixed a number if UNUSED warnings.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1149 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-09-28 19:42:46 +00:00
Daniel Doubrovkine 8523c487c1 platform.win32.Advapi32Util.registryCreateKey returns true if key was created, false if it already exists.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1148 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-09-28 15:47:03 +00:00
Daniel Doubrovkine 3580b58bf6 Add platform.win32.Kernel32.DeleteFile and com.sun.jna.platform.win32.deleteFile.
Add Event Logging functions to platform.win32.Advapi32.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1147 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-09-27 23:51:27 +00:00
Landon Fuller 53f387b203 Minor README fix. 2010-09-19 19:57:17 -07:00
Landon Fuller 4fbcb5b5fb Minor README fix. 2010-09-19 19:50:37 -07:00
Landon Fuller 8e7652ef6a Add a libffi-ios-specific github README. 2010-09-19 19:49:39 -07:00
Landon Fuller 83038cf24a Implement FFI_EXEC_TRAMPOLINE_TABLE allocator for iOS/ARM.
This provides working closure support on iOS/ARM devices where
PROT_WRITE|PROT_EXEC is not permitted. The code passes basic
smoke tests, but requires further review.
2010-09-19 14:36:45 -07:00
Landon Fuller b00ff3e98f Rename the generated symbol 2010-09-19 14:22:26 -07:00
Landon Fuller da2773e02a Modify the ffi_closure structures to hold table/table entry pointers instead of a code buffer. 2010-09-19 14:21:37 -07:00
Landon Fuller 01d71b7bed Regenerated the autoconf script 2010-09-19 14:21:14 -07:00
Landon Fuller 19afda0069 Enable AC_SUBST for FFI_EXEC_TRAMPOLINE_TABLE 2010-09-19 14:20:52 -07:00
Landon Fuller 9e1196444e Add a hard-coded FFI_EXEC_TRAMPOLINE_TABLE arm implementation.
This implements support for re-mapping a shared table of executable
trampolines directly in front of a writable configuration page, working
around PROT_WRITE restrictions for sandboxed applications on Apple's
iOS.

This implementation is for testing purposes; a proper allocator is still
necessary, and ARM-specific code needs to be moved out of
src/closures.c.
2010-09-19 10:43:06 -07:00
Landon Fuller f38364b399 Fix symbol prefix for ffi_closure_SYSV_inner on Darwin. 2010-09-19 10:42:36 -07:00
Landon Fuller 36849e7716 Whitespace/comment fixes. 2010-09-19 09:35:04 -07:00
Landon Fuller b764162526 Fix the script name (build-iphone.sh -> build-ios.sh) 2010-09-19 09:04:34 -07:00
Landon Fuller a3d9aa8501 Update the autogenerated autoconf/automake files. 2010-09-19 09:03:52 -07:00
Landon Fuller c71480eaf8 Update automake/autoconf to conditionally build src/arm/trampoline.S if FFI_EXEC_TRAMPOLINE_TABLE is enabled. 2010-09-19 09:02:05 -07:00
Landon Fuller 9af9291b73 Add the trampoline table generated by gentramp.sh 2010-09-19 08:52:33 -07:00
Landon Fuller 68ce0c383e Add a shell script that generates the ARM trampoline page.
This generates a page of 340 trampolines, aligned within one page. The
trampolines use pc-relative addressing to reference config data
(context, jump address) from a page placed directly prior to the
trampoline page. This can be used on systems -- such as iOS -- that do not
support writable, executable memory by remapping the executable page
containing the trampolines directly above a newly allocated writable
config page.
2010-09-19 08:38:19 -07:00
Landon Fuller 75af086be8 Update autoconf files 2010-09-18 18:12:19 -07:00
Landon Fuller 1ac92cca9b Add autoconf check for W^X platforms that require a trampoline table.
This adds the FFI_EXEC_TRAMPOLINE_TABLE. The flag is enabled for
arm-apple-darwin, where PROT_EXEC on writable (or formerly writable) pages is
not permitted for sandboxed binaries.
2010-09-18 18:08:14 -07:00
Landon Fuller be72fbab29 Use the correct host triple for arm/darwin 2010-09-18 18:02:25 -07:00
Landon Fuller 70150bdf45 Add missing UNWIND entry; disables .pad on non-EABI targets. 2010-09-18 16:38:03 -07:00
Landon Fuller 6b452bafae Apple assembler support; fixed most gas/ELF-isms. 2010-09-18 16:21:32 -07:00
Landon Fuller 8ddac835b6 Fix placement of the __APPLE__ macro. 2010-09-18 15:38:06 -07:00
Landon Fuller 69043d0293 Work-around libffi's FP ABI detection.
On iOS, we must use the AAPCS floating point return value calling
conventions. libffi's ARM implementation will only use these conventions
if __SOFTFP__ is defined, which is not the case when GCC's
-mfloat-abi defaults to 'softfp' instead of 'soft'. To work around this
we manually define __SOFTFP__ for Apple platforms in the ARM-specific
sysv.S.

See also:
  http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iPhoneOSABIReference/Introduction/Introduction.html
  http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf
2010-09-18 15:32:08 -07:00
Landon Fuller a82e6c354e Add a stub iOS build script to drive autoconf 2010-09-18 14:44:24 -07:00
Anthony Green 84e8de6e9f Restore execute permissions 2010-08-06 01:35:12 -04:00
Anthony Green 3aeecc9eb1 Fix win64-struct-args patch 2010-08-05 15:19:00 -04:00
Anthony Green 00d0b59cd1 Fix debug build for windows 2010-08-05 14:56:53 -04:00
Anthony Green bda487e870 Don't use -safeseh with ml64 2010-08-05 09:02:41 -04:00
Anthony Green c1d28ba8d5 stdcall-x86-closure-fix 2010-08-05 08:48:16 -04:00
Anthony Green 5feacad4a5 define generic symbols carefully 2010-08-05 08:30:04 -04:00
Anthony Green 10ea848900 don't copy win64 struct args 2010-08-05 08:24:27 -04:00
Timothy Wall 9b26a4d5ce add omitted field type which might use current value if available
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1146 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-29 15:46:00 +00:00
Timothy Wall c43fc68bc8 fix potential NPE
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1145 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-29 15:43:44 +00:00
Timothy Wall df07539331 fix unused parameter warnings under gcc
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1144 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-29 15:22:22 +00:00
Timothy Wall 563931750b fix compiler error
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1143 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-29 15:22:02 +00:00
Timothy Wall 6b090de7b1 avoid potential overflow
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1142 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-29 14:28:54 +00:00
Timothy Wall d8863ef95f fulfill hashCode contract for Function
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1141 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-29 14:28:21 +00:00
Timothy Wall 36f9595ce7 make memory clear intent obvious
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1140 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-29 14:26:53 +00:00
Anthony Green d14178be4c FFI_LAST_ABI fix 2010-07-23 09:14:00 -04:00
Timothy Wall 48565e6305 integrate platform javadoc
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1139 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-22 15:08:26 +00:00
Timothy Wall 3727f9583b remove extraneous stuff from source archives
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1137 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-21 14:48:27 +00:00
Timothy Wall 4a6bbf0b3c update javadoc (version change)
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1136 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-21 03:17:25 +00:00
Timothy Wall 7513a7157f ensure source properly synched with binaries
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1135 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-21 03:11:04 +00:00
Timothy Wall e7dbdb6ead tweak BITMAPINFO structure
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1134 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-21 01:39:21 +00:00
Timothy Wall db5f101bfc tweak BITMAPINFO structure
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1133 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-21 01:39:00 +00:00
Timothy Wall 3c06e8b6fd add GDI test
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1132 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-21 01:33:44 +00:00
Timothy Wall 28f94cbd0b simplify and clean up contrib hierarchy, fix contrib builds on 64-bit platforms
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1131 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-20 02:30:38 +00:00
Timothy Wall 6f37cbd946 update platform.jar
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1128 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-20 01:39:22 +00:00
Timothy Wall 396281263b update javadoc
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1126 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 20:44:33 +00:00
Timothy Wall a00e8ac201 tweak version on main jar file
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1125 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 20:31:04 +00:00
Timothy Wall b1772a89c1 bump version in release notes
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1124 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 20:15:58 +00:00
Timothy Wall 58f07ff045 update jars
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1123 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 19:56:16 +00:00
Timothy Wall 12f99d4fc7 update native lib to 3.2.2
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1122 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 19:40:26 +00:00
Timothy Wall 05da0a6877 update native jar to 3.2.2
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1121 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 19:21:05 +00:00
Timothy Wall 46ce871f34 update copyright notices
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1120 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 19:20:51 +00:00
Timothy Wall 4b22c2f044 update release notes
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1119 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 19:10:54 +00:00
Timothy Wall 4014828eff add some GDI32 functions
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1118 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 19:09:53 +00:00
Timothy Wall bc87a62d59 update native lib to 3.2.2
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1117 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 15:40:33 +00:00
Timothy Wall f6862442d3 update native lib to 3.2.2
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1116 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 15:22:42 +00:00
Timothy Wall bff7f57eb8 update native lib to 3.2.2
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1115 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 15:17:21 +00:00
Timothy Wall e19024ca0d update native to 3.2.2
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1114 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 15:07:25 +00:00
Timothy Wall 73997e4799 update native libs to 3.2.2
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1113 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 13:28:35 +00:00
Timothy Wall ffa97aa438 update native lib (w/ correct version)
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1112 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 13:22:00 +00:00
Timothy Wall d08244dfd8 properly patch Makefile with native version
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1111 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 13:15:14 +00:00
Timothy Wall 2e0d367045 update native code
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1110 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 13:09:12 +00:00
Timothy Wall 0f1fb2e6a1 Bump native code bug revision
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1109 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 13:05:17 +00:00
Timothy Wall 672e362ed8 add pointer peer accessor
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1108 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-19 13:04:05 +00:00
Daniel Doubrovkine bcae16c441 Native.loadLibrary can now load .drv files.
Add platform.win32.Winspool.GetPrinterInfo.
Add platform.win32.WinspoolUtil.getPrinterInfo1.


git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1107 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-18 16:51:39 +00:00
Timothy Wall 19b8f5cb59 clarify FAQ entry
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1106 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-16 14:41:05 +00:00
Timothy Wall 68b37156d8 update FAQ
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1105 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-16 14:13:28 +00:00
Timothy Wall d9237b64c0 update FAQ
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1104 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-07-16 14:05:56 +00:00
Anthony Green 3f5b1375ab rebase 2010-07-12 14:39:18 -04:00
Anthony Green eaf444eabc Fix selinux test 2010-07-10 08:59:09 -04:00
Scott Palmer da037b38e3 Updated release notes.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1103 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-06-28 13:20:15 +00:00
Scott Palmer 62f864f4ab Added SHGetDesktopFolder.
It obtains a COM interface, so this is just to prepare
for Com4JNA support (will need to get a COM interface
to test Com4JNA).



git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1102 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-06-25 19:13:56 +00:00
Daniel Doubrovkine bf89f1d37d Add Kernel32.GetDiskFreeSpaceEx, GetLogicalDriveStrings, GlobalMemoryStatusEx.
Add Kernel32Util.getLogicalDriveStrings.
Add WinDef ULONGLONG and DWORDLONG.
Refactor WinNT.LARGE_INTEGER into a union.


git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1101 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-06-23 00:55:05 +00:00
Daniel Doubrovkine 3dc986e609 Added VER* constants.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1100 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-06-22 17:05:38 +00:00
Daniel Doubrovkine 2f5e874201 Add com.sun.jna.platform.win32.BaseTSD.DWORD_PTR.
Add com.sun.jna.platform.win32.WinBase.SYSTEM_INFO.
Add com.sun.jna.platform.win32.WinNT.OSVERSIONINFOEX.
Add Kernel32 GetVersionEx, GetSystemInfo, GetNativeSystemInfo and IsWow64Process.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1099 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-06-22 14:46:07 +00:00
Daniel Doubrovkine 05291932f8 Add com.sun.jna.platform.win32.Kernel32.GetVersion and GetVersionEx.
Add com.sun.jna.platform.win32.User32.GetSystemMetrics.
Refactor constants from com.sun.jna.platform.win32.GDI32 into WinGDI, matching Windows SDK headers.
Refactor constants from com.sun.jna.platform.win32.User32 into WinUser, matching Windows SDK headers.


git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1098 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-06-22 02:39:37 +00:00
Timothy Wall 72aa450ecb Provide String.replace for 1.4 compatibility
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1097 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-06-18 11:07:10 +00:00
Daniel Doubrovkine 926ea21fe0 Added Advapi32Util.isWellKnownSid.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1096 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-06-16 12:10:45 +00:00
Daniel Doubrovkine 657a077cdb Add com.sun.jna.platform.win32.WinNT.WELL_KNOWN_SID_TYPE, SECURITY_MAX_SID_SIZE and other related SID-related constants.
Add com.sun.jna.platform.win32.Advapi32.CreateWellKnownSid and IsWellKnownSid. 

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1095 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-06-15 14:41:44 +00:00
Daniel Doubrovkine 9a90f56845 Fixed incorrect comments on autoread/write.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1094 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-06-02 17:24:45 +00:00
Daniel Doubrovkine 7d36e0d63b Fix error not reported properly in getTokenGroups/getTokenAccount.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1093 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-05-28 23:29:55 +00:00
Daniel Doubrovkine 865d5ed7a1 Updated copyright notices so that Tim doesn't go to jail for my bugs (also makes my company legal happy).
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1092 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-05-28 21:27:01 +00:00
Daniel Doubrovkine 9dd91ee17e Deleting the wrong pointer.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1091 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-05-28 21:08:34 +00:00
Daniel Doubrovkine 425ea821d7 Add platform.win32.Secur32.ImpersonateSecurityContext and RevertSecurityContext.
Fix platform.win32.Secur32.QuerySecurityContextToken take a CtxtHandle, avoid indirection.
Updated release notes with win32 changes so far.


git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1090 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-05-28 14:58:27 +00:00
Scott Palmer bea5049a2f Updated release notes to reflect new behavior of jna.library.path.
Fixed invalid HTML in the Release 3.0 notes.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1089 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-05-20 18:54:54 +00:00
Scott Palmer eae1e34696 Re-evaluate jna.library.path on each library load instead of caching the value.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1088 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-05-20 14:21:59 +00:00
Scott Palmer e63b6b00bc Added ObjBase.java for constant definitions. Modified unit test to use constants from ObjBase.java
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1087 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-05-19 13:26:45 +00:00
Daniel Doubrovkine e5b3ed226b Bug: read() of uninitialized memory in getTokenGroups/getTokenAccount.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1086 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-05-16 22:33:28 +00:00
Daniel Doubrovkine d5ce354c87 Added missing docs.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1085 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-05-14 16:50:11 +00:00
Timothy Wall e280838989 fix typo in comment
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1084 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-05-14 13:38:15 +00:00
Timothy Wall 2309054b1f address issue 156
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1083 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-05-14 13:10:56 +00:00
Timothy Wall 9dcc44a76b addrss issue 154
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1082 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-05-14 13:08:13 +00:00
Scott Palmer 7a417c6d3b Moved CLSCTX_* definitions to WTypes.java
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1081 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-05-13 20:51:44 +00:00
Scott Palmer 425ab15ae1 Added CoInitializeEx, CoUninitialize, and CoCreateInstance, with unit tests.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1080 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-05-13 18:47:54 +00:00
Daniel Doubrovkine c75ff4f118 Minor doc/comment changes.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1079 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-05-12 20:14:26 +00:00
Daniel Doubrovkine 75d3dd19ec Added Scott Palmer's oleaut32.dll interface + tests.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1078 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-05-12 20:11:41 +00:00
Timothy Wall 4cd556555e add note on win32 gcc version
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1077 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-05-12 13:30:03 +00:00
Anthony Green 6309741522 Micharl Kohler's spelling fixes 2010-05-05 20:14:56 -04:00
Daniel Doubrovkine feebe921af Fixed all the trivial warnings. Down to about 30 or so.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1076 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-28 00:38:42 +00:00
Daniel Doubrovkine 92929308bd Refactor com.sun.jna.platform.win32.WINBASE into WinDef, WinNT and BaseTSD, matching Windows SDK headers.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1075 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-27 02:10:00 +00:00
Timothy Wall ca4f14b555 fix issue 152
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1074 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-25 20:05:14 +00:00
Timothy Wall a7bcfacbd9 fix issue 151
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1073 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-15 13:22:45 +00:00
Timothy Wall e097b4820d fix deprecation warnings
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1072 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-13 21:22:45 +00:00
Timothy Wall 566ec7974c split contrib jars into its own target
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1071 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-13 17:37:45 +00:00
Timothy Wall c735d6c420 avoid deprecated function
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1070 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-13 17:31:21 +00:00
Timothy Wall cf54ca9551 fix issue 133
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1069 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-13 17:04:04 +00:00
Anthony Green 9dc9a293f3 Rebase to latest GCC sources 2010-04-13 10:33:52 -04:00
Anthony Green f2c2a4fce9 Remove warnings and add OS/2 support 2010-04-13 10:19:28 -04:00
Timothy Wall 9f1da1b562 sync libffi
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1068 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-10 16:36:02 +00:00
Timothy Wall f5a3dbf82b add OSX 10.6 SDK
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1067 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-10 16:34:00 +00:00
Daniel Doubrovkine 89f83e796a Collapsing accounts and groups, all of those are just windows accounts.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1066 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-07 19:27:20 +00:00
Daniel Doubrovkine 977a9e49c5 Extended Group to include FQN and domain.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1065 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-07 16:33:19 +00:00
Daniel Doubrovkine 7ee0a4b39f Added 3.2.5 javadoc, fixed links in index.html.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1064 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-06 16:27:46 +00:00
Daniel Doubrovkine 4268e3a1d2 Release 3.2.5.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1062 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-06 15:32:21 +00:00
Daniel Doubrovkine 860b9a266a Fixed demo builds to make .jar files double-clickable.
Added eclipse project to www.
Documented platform.jar in site.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1061 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-06 15:14:53 +00:00
Daniel Doubrovkine c39d752ccb Added Netapi32.DsGetDcName, DsGetForestTrustInformation and DsEnumerateDomainTrusts.
Ported some of DsGetDC.h and NTSecApi.h.
Bug: Netapi32Util.getDCName returns wrong value.
Bug: Netapi32Util.getCurrentUserLocalGroups doesn't work for a user logged onto a domain.
Added WinNT.LARGE_INTEGER.


git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1060 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-02 17:05:27 +00:00
Daniel Doubrovkine 15db1cf385 Updated release notes with all the win32/platform changes.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1059 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-01 15:47:49 +00:00
Daniel Doubrovkine 38d684d1e6 Used generics for several existing utility classes, fixing warnings (platform is built with Java 1.5+). Split FileUtils into win32, mac specifics so we can write os-based unit tests just like W32FileMinotorTest.
Fixed exception in W32FileMonitor which throws an unhandled exception when disposing because the watched handle is closed.
Modified W32FileUtils and ShellAPI's SHFILEOPSTRUCT to support unicode paths.
Fixed ShellApi structure alignment introduced in a previous check-in.
Readded LastErrorException string constructor.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1058 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-04-01 12:59:08 +00:00
Daniel Doubrovkine ccb1bc514b Split FileMonitor and W32FileMinitor into different namespaces, removed isWindows hack in the tests.
Added Kernel32.GetTempPath and Kernel32Util.getTempPath.
Added missing copyright notices.
Divided Shell32 into ShellApi (ported from ShellApi.h), ShlObj (ported from ShlObj.h).
Added Shell32Util.getFolderPath.
Added WinDef (ported from Windef.h) with MAX_PATH.


git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1057 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-31 15:47:04 +00:00
Daniel Doubrovkine 27c46a2c8e Added Kernel32Util.FormatMessageFromLastError and FormatMessageFromHR.
Added Win32Exception that properly maps system error messages, to be used in Win32 util classes instead of LastErrorException that's a cross-platform version that doesn't try to format the string error.


git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1056 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-31 14:08:25 +00:00
Daniel Doubrovkine ff2f1d237a Added Ole32.CoCreateGuid, StringFromGUID2 and IIDFromString.
Added Ole32Util.getGUIDFromString, getStringFromGUID and generateGUID.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1055 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-30 23:09:26 +00:00
Daniel Doubrovkine 402f4c162c Added Secur32.QuerySecurityContextToken.
Added Sspi.PSecHandle.


git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1054 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-30 21:45:14 +00:00
Anthony Green c0b69e57d5 Dan Witte's windows build fixes. 2010-03-30 08:30:22 -04:00
Daniel Doubrovkine 81013a98b4 Added Secur32.EnumerateSecurityPackages and FreeContextBuffer.
Added Secur32Util.getSecurityPackages.


git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1053 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-29 17:51:58 +00:00
Daniel Doubrovkine 971dd622c7 Added Sspi.java, ported from sspi.h.
Added Secur32.AcquireCredentialsHandle, InitializeSecurityContext, DeleteSecurityContext, AcceptSecurityContext.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1052 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-26 13:11:30 +00:00
Daniel Doubrovkine 0045d31e2d Added Crypt32.CryptProtectData and CryptUnprotectData.
Added WinCrypt, ported from WinCrypt.h.
Added Crypt32Util.cryptProtectData and cryptUnprotectData.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1051 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-24 14:44:30 +00:00
Daniel Doubrovkine caef8f4ebc Added Advapi32Util.registryGetKeys and registryGetValues.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1050 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-24 11:51:53 +00:00
Daniel Doubrovkine 6116c1ae71 Moved definitions from Kernel32 into WinNT where they belong.
Added Advapi32.RegOpenKeyEx, RegQueryValueEx, RegCloseKey, RegDeleteValue, RegSetValueEx, RegCreateKeyEx, RegDeleteKey, RegEnumKeyEx, RegEnumValue, RegQueryInfoKey.
Added Advapi32Util.registryKeyExists, registryValueExists, registryGetStringValue, registryGetIntValue, registryCreateKey, registrySetIntValue, registrySetStringValue, registryDeleteKey, registryDeleteValue.
Added missing documentation in Kernel32.
Added Wdm, NtDll.ZwQueryKey and NtDllUtil.getKeyName.
Added WinReg and REG* definitions from WinNT.h.


git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1049 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-23 18:05:45 +00:00
Timothy Wall 03ecf2b0bb use 1.4-compatible URI generation
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1048 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-23 02:43:55 +00:00
Daniel Doubrovkine d4a5005273 Wrong comment.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1047 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-21 15:17:32 +00:00
Daniel Doubrovkine 7522f29f0a Commented out impersonation test. Wild guess on which one's failing.
Fixed warnings with function parameter names.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1046 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-21 14:59:18 +00:00
Daniel Doubrovkine 09f0a2e4a6 Added Advapi32.ImpersonateLoggedOnUser and RevertToSelf.
Added Advapi32Util.GetTokenGroups, GetTokenAccount.


git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1045 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-18 03:52:45 +00:00
Daniel Doubrovkine aa846929f3 Added LMAccess GROUP_USERS_INFO_*, LOCALGROUP_USERS_INFO_*, GROUP_INFO_* and USE_PRIV* masks.
Added Netapi32.NetGroupEnum, NetUserEnum, NetUserGetGroups, NetUserGetLocalGroups, NetUserAdd, NetUserDel and NetUserChangePassword.
Added Netapi32Util.getGlobalGroups, getUsers, getUserLocalGroups, getCurrentUserGroups, getUserGroups.
Fixed tmp location to try to get windows tmp for File monitor test.


git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1044 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-16 21:59:16 +00:00
Daniel Doubrovkine b378af7cb1 Refactored Advapi32Util getAccount* functions to getAccountByName and getAccountBySid returning an Account structure.
Added Advapi32Util.getCurrentUserGroups.
Added LMAccess LOCALGROUP_INFO_1, USER_INFO_0 and USER_INFO_1.
Refactored Netapi32Util.getLocalGroups to return a Group structure.
Added WinNT TOKEN_GROUPS, SID_NAME_USE and SID_AND_ATTRIBUTES.
 

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1043 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-16 12:19:14 +00:00
Anthony Green 59a259f4d3 Remove junk file 2010-03-15 05:57:51 -04:00
Anthony Green 3de1eb36d3 fix-comments patch 2010-03-15 05:57:24 -04:00
Daniel Doubrovkine 8b549a487f Replaced SID references by PSID, PSIDByReference and PSID.ByReference.
Added Advapi32.IsValidSid, OpenProcessToken, DuplicateToken and GetTokenInformation.
Added WinNT.SECURITY_IMPERSONATION_LEVEL, TOKEN_INFORMATION_CLASS, SID_AND_ATTRIBUTES, TOKEN_OWNER, PSID, PSID_BY_REFERENCE, TOKEN_USER.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1042 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-12 23:11:17 +00:00
Daniel Doubrovkine 005f659eaa Renamed jnacontrib-*.jars to demo-*.jar for demos.
Added Advapi32.OpenThreadToken.
Added Kernel32.OpenThread, OpenProcess and some documentation for tested functions.
Added WinNT.java, ported from winnt.h for thread and token access defitions.


git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1041 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-10 17:09:03 +00:00
Daniel Doubrovkine a5aad94f24 Build break: chicken-and-egg problem of depending on dist/jna.jar.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1040 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-10 14:41:48 +00:00
Daniel Doubrovkine 52a6926da3 Added eclipse and ANT projects for all contrib folders. All build and run.
JnaContrib projects drop a jnacontrib-*.jar into dist.
Deleted leftover private settings in ntservice.
Added Advapi32.LogonUser.
Removed throws Exception in Advapi32Util.
Got rid of obsolete w32util.jar.


git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1039 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-10 14:12:28 +00:00
Daniel Doubrovkine b3c0f003bb Don't run win32 tests on unix.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1038 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-09 23:48:54 +00:00
Daniel Doubrovkine 3d2360bc56 Merged platformutil and jna.platform into a contrib/platform package.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1037 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-09 23:17:55 +00:00
Daniel Doubrovkine 1267f51d8c Fixed typo in build.xml.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1036 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-09 18:15:34 +00:00
Daniel Doubrovkine e7328001a4 Got rid of w32util and moved its code to platformutil...win32.
Now platformutil is all of specific and cross-platform APIs.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1035 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-09 18:12:14 +00:00
Daniel Doubrovkine fc7b53e809 Got rid of examples.jar, split into several packages.
# platform apis - com.sun.jna.platform.*, part of jna.jar.
# platform wrappers and utilities (FileMonitor, KeyboardUtils, etc.) - contrib/com.sun.jna.platformutil, new platformutil.jar.
# demo and sample code - contrib/<new project for each demo>


git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1034 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-09 17:56:58 +00:00
Daniel Doubrovkine 50637cb3c2 - Advapi32Util.getAccountName now always returns a fully qualified name.
- Added Kernel32Util with getComputerName.
- Added Netapi32Util.getDCName and getJoinStatus.
- Added Kernel32.GetComputerName
- Doc-ed some functions in Kernel32
- Added Netapi32.NetGetDCName
- Added Winbase with MAX_COMPUTER_NAME
- Added Kernel32.WaitForMultipleObjects

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1033 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-03-09 12:31:25 +00:00
Daniel Doubrovkine 11b4203874 Fixed w32util.jar distribution.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1032 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-02-24 22:37:53 +00:00
Daniel Doubrovkine 60beb432eb Running tests on windows only.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1031 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-02-24 21:00:21 +00:00
Daniel Doubrovkine 64331c9cf0 - Fixed eclipse build by adding an eclipse .project for contrib/src/w32util.
- Added W32util standalone build.xml, invoked from jna build.xml.
- Made all example.win32-s UNICODE.
- Ported Advapi32.LookupAccountName, LookupAccountSid from the NT service example to examples.win32 (pinvoke) and contrib.win32util (wrappers). Added tests for both pinvoke functions and wrappers.
- Renamed utility functions to lowercase for consistency in contrib.w32util.
- Added w32util.getAccountSid, getAccountName, convertSidStringToSid, 
convertSidToStringSid, etc. Fixed a crash in the converts.
- Added Netapi32Util.getLocalGroups.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1030 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-02-24 19:59:16 +00:00
Timothy Wall 00088d4093 add 'int' version of Pointer.createConstant
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1029 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-02-23 20:16:19 +00:00
Timothy Wall 472f3660e0 add test for INVALID_HANDLE_VALUE, add explicit long value
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1028 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-02-23 20:11:50 +00:00
Daniel Doubrovkine 3c13cc8c4d Added contrib folder to build, moved source into src and added test. Tests run in test targets.
Added w32util jar.
Fixed crash in Netapi32Test.
Fixed comment in Advapi32.java.
Moved baloontips into a package.

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1027 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-02-23 16:01:30 +00:00
Timothy Wall 0792ac8eee fix INVALID_HANDLE_VALUE (64-bit)
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1026 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-02-23 14:17:13 +00:00
Timothy Wall 4952af4ffe Fix INVALID_HANDLE_VALUE
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1025 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-02-23 14:14:54 +00:00
Daniel Doubrovkine 3fcca7ef56 Tentative fix for the broken Secur32Test UT: looks like on some OSs GetUserNAmeEx returns true when passed a null buffer and a size? Also fixed documentation warnings.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1024 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-02-22 23:50:01 +00:00
Daniel Doubrovkine e93244fef2 Advapi32:
GetUserNameW
 LookupAccountNameW
 ConvertSidToStringSidW
 ConvertStringSidToSidW
 GetLengthSid

Netapi32:
 NetGetJoinInformation
 NetApiBufferFree

Secur32:
 GetUserNameExW

W32Errors:
 Almost full port of winerror.h

Advapi32Util:
 GetUserName
 LookupAccountName
 ConvertSidToStringSid

Netapi32Util:
 GetDomainName

Secur32Util
 GetUserNameEx

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1023 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-02-22 22:54:09 +00:00
Anthony Green c3813b6d7f Rebuild Makefiles with automake 1.11.1 for CVE-2009-4029. 2010-01-26 16:48:56 -05:00
Anthony Green 8d27f68baa Mention recent changes in README 2010-01-15 11:35:37 -05:00
Anthony Green ff3cd68b8c Add msvc.sh wrapper 2010-01-15 11:27:24 -05:00
Anthony Green cadeba6cb5 Microsoft Visual C port 2010-01-15 10:46:51 -05:00
Anthony Green 0739e7dc00 Add x86 Sun Studio compiler support 2010-01-15 09:48:33 -05:00
Anthony Green edfdfd2e85 Add closure example doc 2010-01-13 02:56:19 -05:00
Anthony Green 7b7a42f221 Rebase from GCC 2010-01-12 09:14:14 -05:00
Timothy Wall acf75ce7fe fix read of NIO Buffer fields within structure
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1022 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2010-01-05 01:46:27 +00:00
Anthony Green 4b18d1f73d Add x86-64 MingW to README 2010-01-01 10:24:27 -05:00
Anthony Green c3042afaf3 Reset quilt patches post 3.0.9 merge with GCC 2010-01-01 08:08:02 -05:00
Anthony Green b0304e9679 Update version 2009-12-31 11:32:40 -05:00
Anthony Green 2e7e03d014 Final updates before 3.0.9 2009-12-31 07:43:22 -05:00
Anthony Green aea706c528 really 3.0.9rc12 2009-12-29 10:09:31 -05:00
Anthony Green 0cfe60e9d1 3.0.9rc12 2009-12-29 10:06:04 -05:00
Anthony Green 14e2e92e86 3.0.9rc11 2009-12-27 21:03:33 -05:00
Anthony Green 884402787b HPUX support and avr32 test fixes. 2009-12-26 12:57:23 -05:00
Anthony Green 01c78756af 3.0.9rc9 2009-12-26 10:05:18 -05:00
Anthony Green 7086846465 Remove xfails for mips and arm 2009-12-26 09:58:03 -05:00
Anthony Green 838d4ad920 Remove a bunch of xfails. 2009-12-26 09:57:27 -05:00
Anthony Green 7e37eaaf77 Fix huge_struct for solaris 2009-12-26 07:46:50 -05:00
Anthony Green 07cc7a3719 3.0.9rc8 2009-12-26 07:23:04 -05:00
Anthony Green 2b9be16ffa 3.0.9rc8 2009-12-26 07:04:45 -05:00
Anthony Green 9458d88f67 Rebase from GCC 2009-12-26 07:02:27 -05:00
Anthony Green 6a34124175 Add Andreas Schwab's powerpc fix 2009-12-26 06:51:33 -05:00
Anthony Green 39c8792ece 3.0.9rc7 2009-12-25 21:52:28 -05:00
Anthony Green 1d04af52e3 Updated some mips XFAILs 2009-12-25 09:50:36 -05:00
Anthony Green 26e9509c9b Clean up ChangeLog.libffi for older patches. 2009-12-25 02:19:23 -05:00
Anthony Green 9c157d3215 Clean up undefine_AC_ARG_VAR_PRECIOUS patch. 2009-12-25 02:15:40 -05:00
Anthony Green d22de05b0b Fix patches 2009-12-25 02:04:23 -05:00
Anthony Green 1fe3dc7c20 Add windows support patch. 2009-12-25 01:39:00 -05:00
Anthony Green f7c0bc613a 3.0.9rc6 2009-12-25 01:22:11 -05:00
Anthony Green c7fa2da826 3.0.9rc6 2009-12-24 07:22:44 -05:00
Anthony Green da11bece0f Release 3.0.9rc5 2009-12-24 05:34:46 -05:00
Anthony Green e3399b11ed Update README 2009-12-24 01:09:32 -05:00
Anthony Green 115ab36fce Update missing changes for 3.0.9r4. 2009-12-24 00:22:00 -05:00
Anthony Green f8c7a245bf Switch to quilt. Rebase to latest GCC. 2009-12-23 23:46:22 -05:00
philke 7560b6e53d added import java.util.Date;
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1021 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2009-12-21 18:57:12 +00:00
philke f5346bbec2 Removed @Override annotation to comply with 1.4 source code level
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1020 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2009-12-21 17:31:22 +00:00
philke 41958889fb Added FILETIME
Added functions for File Mapping
Added functions for Event handling
Added LocalAlloc

git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1019 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2009-12-21 16:48:44 +00:00
Timothy Wall d439a7811d avoid auto-allocating structure memory if memory already provided
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1018 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2009-12-18 15:55:59 +00:00
Timothy Wall 4951c00d23 Ensure inherited structure fields are properly ordered
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1017 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2009-12-04 14:38:19 +00:00
Timothy Wall 202cd0d45e update javadoc
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1015 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2009-11-20 13:57:19 +00:00
Timothy Wall 1502db6095 build 3.2.4
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1014 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2009-11-20 13:55:41 +00:00
Timothy Wall e8eea9e68e Fix issue 135
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1013 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2009-10-29 13:24:51 +00:00
Timothy Wall 396eb9f283 add linux/ia64
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1012 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2009-10-29 13:15:22 +00:00
Dan Rollo 378f400226 increase ServerSocket timeout again. Further testing on pokey machine shows jnlp download time ~30secs, and verify/launch time also ~30secs. Two minutes should be plenty, even on the worst of days.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1011 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2009-10-25 01:23:06 +00:00
Dan Rollo 37e02dfbd5 increase ServerSocket timeout in attempt to make test tolerant of very slow machine.
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1010 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2009-10-25 00:31:11 +00:00
Dan Rollo dce66ec8ec remove unused variables and unused imports
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1009 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2009-10-25 00:29:53 +00:00
Timothy Wall 2fef67a08d provide easier mapping from native pointer to Function object
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1008 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2009-10-24 15:43:53 +00:00
Timothy Wall 50a17583c7 include clover.jar in full source zip
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1007 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2009-10-20 14:54:18 +00:00
Timothy Wall bfe2c7df83 add COM to FAQ
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1006 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2009-10-16 13:08:02 +00:00
Timothy Wall b3186dde12 update javadoc
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1005 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2009-10-08 19:14:59 +00:00
Timothy Wall 628a33eb76 update javadoc
git-svn-id: https://svn.java.net/svn/jna~svn/trunk@1004 2f8a963e-d2e4-e7d0-97bf-ccb7fcea9d80
2009-10-08 19:12:24 +00:00
Anthony Green ce806772f0 Merge branch 'master' of git@github.com:atgreen/libffi 2009-10-05 00:41:35 -04:00
Anthony Green dcc1f6b4f1 More clean up. 2009-10-05 00:29:33 -04:00
Anthony Green 2829f5941a Clean up 2009-10-05 00:28:03 -04:00
Anthony Green cd98813de5 From Jens Rehsack. Fix for 64-bit AIX. 2009-10-05 00:25:29 -04:00
Anthony Green e4a91de766 From Abdulaziz Ghuloum. Adds special case for Snow Leopard. 2009-10-05 00:16:17 -04:00
Anthony Green 3425a763bc Fix detection of free/openbsd. From Alexis Ballier. 2009-10-04 23:57:29 -04:00
Anthony Green 2340e7a777 AVR support 2009-10-04 23:53:17 -04:00
Anthony Green 5cbe2058c1 Initial stand-alone patch. 2009-10-04 23:53:11 -04:00
Anthony Green c6dddbd02b Initial commit 2009-10-04 08:11:33 -04:00
Anthony Green 5ffc0c3748 Update version to 3.0.9rc1. Add more useful things to .gitignore. 2009-10-04 07:58:22 -04:00
Anthony Green bd29f83ee9 Add .gitignore 2009-09-29 12:07:26 -04:00
Anthony Green 9474f853f8 Remove old CVSROOT files. 2009-09-29 11:13:02 -04:00
twall 0c25275ec2 Apply Dave Korn's cygwin/GCC changes 2009-08-19 12:57:34 +00:00
aph 39228c27ed 2009-06-16 Wim Lewis <wiml@hhhh.org>
* src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are
	supposed to be callee-saved.
	* src/powerpc/sysv.S (small_struct_return_value): Fix overrun of
	return buffer for odd-size structs.
2009-06-16 18:00:47 +00:00
aph 5e93cc704d 2009-06-16 Andreas Tobler <a.tobler@schweiz.org>
PR libffi/40444
	* testsuite/lib/libffi-dg.exp (libffi_target_compile): Add
	allow_stack_execute for Darwin.
2009-06-16 17:41:47 +00:00
aph b509af8959 2009-06-16 Andrew Haley <aph@redhat.com>
* configure.ac (TARGETDIR): Add missing blank lines.
	* configure: Regenerate.
2009-06-16 16:17:52 +00:00
aph d57e96dc56 2009-06-16 Andrew Haley <aph@redhat.com>
* testsuite/libffi.call/cls_align_sint64.c,
        testsuite/libffi.call/cls_align_uint64.c,
        testsuite/libffi.call/cls_longdouble_va.c,
        testsuite/libffi.call/cls_ulonglong.c,
        testsuite/libffi.call/return_ll1.c,
        testsuite/libffi.call/stret_medium2.c: Fix printf format
        specifiers.
        * testsuite/libffi.call/huge_struct.c: Ad x86 XFAILs.
        * testsuite/libffi.call/float2.c: Fix dg-excess-errors.
        * testsuite/libffi.call/ffitest.h,
        testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define.
2009-06-16 09:59:02 +00:00
aph b01d6d1982 2009-06-16 Andrew Haley <aph@redhat.com>
* testsuite/libffi.call/err_bad_typedef.c: xfail everywhere.
	* testsuite/libffi.call/err_bad_abi.c: Likewise.
2009-06-16 09:44:54 +00:00
aph 35b6ded138 2009-06-11 Kaz Kojima <kkojima@gcc.gnu.org>
* testsuite/libffi.call/cls_longdouble_va.c: Add xfail sh*-*-linux-*.
        * testsuite/libffi.call/err_bad_abi.c: Add xfail sh*-*-*.
        * testsuite/libffi.call/err_bad_typedef.c: Likewise.
2009-06-12 15:29:20 +00:00
aph acc46605f2 2009-06-12 Andrew Haley <aph@redhat.com>
* ChangeLog.libffi: testsuite/libffi.call/cls_align_sint64.c,
        testsuite/libffi.call/cls_align_uint64.c,
        testsuite/libffi.call/cls_ulonglong.c,
        testsuite/libffi.call/return_ll1.c,
        testsuite/libffi.call/stret_medium2.c: Fix printf format
        specifiers.
        testsuite/libffi.special/unwindtest.cc: include stdint.h.
2009-06-12 14:21:28 +00:00
twall 16d1996ed0 update changelog 2009-06-11 14:27:42 +00:00
twall 92a515c33e use ffi_closure_alloc instead of stack-based closure 2009-06-11 14:27:28 +00:00
twall e4363160ba remove unused extern 2009-06-11 14:26:23 +00:00
twall 1dc2781d2b remove not-yet-applied changelog entries 2009-06-11 11:36:16 +00:00
twall bb27735fe6 add win64 support 2009-06-10 10:42:36 +00:00
aph b2a54c100c 2009-06-08 Andrew Haley <aph@redhat.com>
* testsuite/libffi.call/err_bad_abi.c: Add xfails.
	* testsuite/libffi.call/cls_longdouble_va.c: Add xfails.
	* testsuite/libffi.call/cls_dbls_struct.c: Add xfail x86_64-*-linux-*.
	* testsuite/libffi.call/err_bad_typedef.c: Add xfails.

	* testsuite/libffi.call/stret_medium2.c: Add __UNUSED__ to args.
	* testsuite/libffi.call/stret_medium.c: Likewise.
	* testsuite/libffi.call/stret_large2.c: Likewise.
	* testsuite/libffi.call/stret_large.c:  Likewise.
2009-06-08 16:50:49 +00:00
aph 25723e7141 2009-06-05 Andrew Haley <aph@redhat.com>
* src/x86/win32.S (_ffi_closure_STDCALL): Import from gcc.
2009-06-05 13:03:40 +00:00
aph 70758199c7 2009-06-04 Andrew Haley <aph@redhat.com>
* src/powerpc/ffitarget.h: Fix misapplied merge from gcc.
2009-06-04 16:29:58 +00:00
aph e8bb12563f 2009-06-04 Andrew Haley <aph@redhat.com>
* src/mips/o32.S,
	src/mips/n32.S: Fix licence formatting.
2009-06-04 14:59:18 +00:00
aph d66a8e32c3 2009-06-04 Andrew Haley <aph@redhat.com>
* src/x86/darwin.S: Fix licence formatting.
	src/x86/win32.S: Likewise.
	src/sh64/sysv.S: Likewise.
	src/sh/sysv.S: Likewise.
2009-06-04 14:43:40 +00:00
aph 7c3b7fd6b5 2009-06-04 Andrew Haley <aph@redhat.com>
* src/sh64/ffi.c: Remove lint directives.  Was missing from merge
	of Andreas Tobler's patch from 2006-04-22.
2009-06-04 14:39:20 +00:00
aph 1a2f93a8b3 2009-06-04 Andrew Haley <aph@redhat.com>
* src/sh/ffi.c: Apply missing hunk from Alexandre Oliva's patch of
        2007-03-07.
2009-06-04 10:45:51 +00:00
aph 944c95cf7a 2009-05-22 Dave Korn <dave.korn.cygwin@gmail.com>
* src/x86/win32.S (_ffi_closure_STDCALL):  New function.
       (.eh_frame):  Add FDE for it.

2009-05-22  Dave Korn  <dave.korn.cygwin@gmail.com>

       * configure.ac:  Also check if assembler supports pc-relative
       relocs on X86_WIN32 targets.
       * configure:  Regenerate.
       * src/x86/win32.S (ffi_prep_args):  Declare extern, not global.
       (_ffi_call_SYSV):  Add missing function type symbol .def and
       add EH markup labels.
       (_ffi_call_STDCALL):  Likewise.
       (_ffi_closure_SYSV):  Likewise.
       (_ffi_closure_raw_SYSV):  Likewise.
       (.eh_frame):  Add hand-crafted EH data.

2008-11-21  Eric Botcazou  <ebotcazou@adacore.com>

       * src/sparc/ffi.c (ffi_prep_cif_machdep): Add support for
       signed/unsigned int8/16 return values.
       * src/sparc/v8.S (ffi_call_v8): Likewise.
       (ffi_closure_v8): Likewise.

2008-03-26  Kaz Kojima  <kkojima@gcc.gnu.org>

       * src/sh/sysv.S: Add .note.GNU-stack on Linux.
       * src/sh64/sysv.S: Likewise.

2008-03-26  Daniel Jacobowitz  <dan@debian.org>

       * src/arm/sysv.S: Fix ARM comment marker.
2009-06-03 17:42:56 +00:00
twall 00fa972430 properly glob-match 2008-12-27 16:59:05 +00:00
twall f5179e6794 Mark XFAIL on longdouble tests for x86_64/mingw 2008-12-26 19:06:28 +00:00
twall 80e2b5a749 clean up tests for win64 use 2008-12-22 15:21:15 +00:00
green 7063d9996f Version 3.0.8 with x86-solaris support 2008-12-19 16:13:46 +00:00
green bdfeb13f0d Bump to 3.0.7 2008-12-19 15:47:44 +00:00
green 69205de17d Many test fixes (failures due to excessive compiler warnings). 2008-07-24 18:03:48 +00:00
green 260d513fea Version 3.0.6. sh/sh64 fixes. 2008-07-17 13:13:52 +00:00
green 3704031875 Rev 3.0.5. 2008-04-03 18:57:57 +00:00
green 8406f5f48f 3.0.5 2008-04-03 18:57:34 +00:00
green 23a9e73212 2008-03-04 Anthony Green <green@redhat.com>
Blake Chaffin
            hos@tamanegi.org

        * testsuite/libffi.call/cls_align_longdouble_split2.c
          testsuite/libffi.call/cls_align_longdouble_split.c
          testsuite/libffi.call/cls_dbls_struct.c
          testsuite/libffi.call/cls_double_va.c
          testsuite/libffi.call/cls_longdouble.c
          testsuite/libffi.call/cls_longdouble_va.c
          testsuite/libffi.call/cls_pointer.c
          testsuite/libffi.call/cls_pointer_stack.c
          testsuite/libffi.call/err_bad_abi.c
          testsuite/libffi.call/err_bad_typedef.c
          testsuite/libffi.call/huge_struct.c
          testsuite/libffi.call/stret_large2.c
          testsuite/libffi.call/stret_large.c
          testsuite/libffi.call/stret_medium2.c
          testsuite/libffi.call/stret_medium.c: New tests from Apple.
2008-03-05 00:07:02 +00:00
green 429e37d3ad clicky 2008-02-28 04:50:19 +00:00
green 51e79c4283 getclicky 2008-02-28 04:47:35 +00:00
green affcab04e2 2008-02-26 Jakub Jelinek <jakub@redhat.com>
Anthony Green  <green@redhat.com>

        * src/alpha/osf.S: Add .note.GNU-stack on Linux.
        * src/s390/sysv.S: Likewise.
        * src/powerpc/linux64.S: Likewise.
        * src/powerpc/linux64_closure.S: Likewise.
        * src/powerpc/ppc_closure.S: Likewise.
        * src/powerpc/sysv.S: Likewise.
        * src/x86/unix64.S: Likewise.
        * src/x86/sysv.S: Likewise.
        * src/sparc/v8.S: Likewise.
        * src/sparc/v9.S: Likewise.
        * src/m68k/sysv.S: Likewise.
        * src/ia64/unix.S: Likewise.
        * src/arm/sysv.S: Likewise.
2008-02-26 19:01:53 +00:00
green 59689d5522 2008-02-26 Anthony Green <green@redhat.com>
Thomas Heller  <theller@ctypes.org>

        * src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C
        comment.
2008-02-26 17:40:51 +00:00
green b13c84cf46 2008-02-26 Anthony Green <green@redhat.org>
Thomas Heller <theller@ctypes.org>

        * include/ffi.h.in: Change void (*)() to void (*)(void).
2008-02-26 17:38:15 +00:00
green 265289f679 2008-02-26 Anthony Green <green@spindazzle.org>
* src/alpha/ffi.c: Change void (*)() to void (*)(void).
        src/alpha/osf.S, src/arm/ffi.c, src/frv/ffi.c, src/ia64/ffi.c,
        src/ia64/unix.S, src/java_raw_api.c, src/m32r/ffi.c,
        src/mips/ffi.c, src/pa/ffi.c, src/pa/hpux32.S, src/pa/linux.S,
        src/powerpc/ffi.c, src/powerpc/ffi_darwin.c, src/raw_api.c,
        src/s390/ffi.c, src/sh/ffi.c, src/sh64/ffi.c, src/sparc/ffi.c,
        src/x86/ffi.c, src/x86/unix64.S, src/x86/darwin64.S,>         src/x86/ffi64.c: Ditto.
2008-02-26 17:34:36 +00:00
green fb5036cd6d fix date 2008-02-24 17:25:25 +00:00
green 40bec108e7 New release 2008-02-24 17:25:02 +00:00
green b922048fa8 2008-02-24 Anthony Green <green@spindazzle.org>
* configure.ac: Accept openbsd*, not just openbsd.
        Bump version to 3.0.4.
        * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
        * libtool-version: Increment revision.
        * README: Update for new release.
2008-02-24 17:24:00 +00:00
green affca4b92d sync readme with web page. 2008-02-22 21:53:29 +00:00
green 3e53d8752e New release 2008-02-22 21:52:38 +00:00
green 4d92f6c8e7 2008-02-22 Anthony Green <green@redhat.com>
* configure.ac: Bump version to 3.0.3.
        * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
        * libtool-version: Increment revision.
        * README: Update for new release.  Clean up test docs.
2008-02-22 21:49:46 +00:00
green 0e185fa11a Update configure script. 2008-02-22 21:43:18 +00:00
green f73986bd21 2008-02-22 Bjoern Koenig <bkoenig@alpha-tierchen.de>
Andreas Tobler  <a.tobler@schweiz.org>

        * configure.ac: Add amd64-*-freebsd* target.
        * configure: Regenerate.
2008-02-22 21:40:53 +00:00
green 0208f68fe5 2008-02-22 Thomas Heller <theller@ctypes.org>
* configure.ac: Add x86 OpenBSD support.
        * configure: Rebuilt.
2008-02-22 21:15:44 +00:00
green 01adb0e638 Fix README. 2008-02-21 16:17:26 +00:00
green 1edd456322 3.0.2 2008-02-21 13:39:01 +00:00
green c9b5428008 add missing file 2008-02-21 13:36:43 +00:00
green d5fa5633d5 2008-02-21 Anthony Green <green@redhat.com>
* configure.ac: Bump version to 3.0.2.
        * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
        * libtool-version: Increment revision.
        * README: Update for new release.

2008-02-21  Björn König <bkoenig@alpha-tierchen.de>

        * src/x86/freebsd.S: New file.
        * configure.ac: Add x86 FreeBSD support.
        * Makefile.am: Ditto.
2008-02-21 13:36:19 +00:00
green ac35bfc6fc Updated 2008-02-16 01:03:56 +00:00
green f7942975fe 2008-02-15 Anthony Green <green@redhat.com>
* configure.ac: Bump version to 3.0.1.
        * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
        * libtool-version: Increment revision.
        * README: Update for new release.

2008-02-15  David Daney  <ddaney@avtrex.com>

        * src/mips/ffi.c: Remove extra '>' from include directive.
        (ffi_prep_closure_loc): Use clear_location instead of tramp.
2008-02-16 01:02:00 +00:00
green 59aa6bb1bf Add more platforms. 2008-02-15 20:52:26 +00:00
green 45a45ab990 3.0 notes 2008-02-15 19:16:36 +00:00
green 4db74cbea8 Update 2008-02-15 19:10:26 +00:00
green c3e1101ffa 2008-02-15 Anthony Green <green@redhat.com>
* configure.ac: Bump version to 3.0.0,
        * configure, doc/stamp-vti, doc/version.texi: Rebuilt.

2008-02-15  David Daney  <ddaney@avtrex.com>

        * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE):
        Define (conditionally), and use it to include cachectl.h.
        (ffi_prep_closure_loc): Fix cache flushing.
        * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define.
2008-02-15 18:43:40 +00:00
green 7e0cc12e92 New release 2008-02-15 15:51:03 +00:00
green 2d7dc885ec * man/ffi_call.3, man/ffi_prep_cif.3, man/ffi.3:
Update dates and remove all references to ffi_prep_closure.
        * configure.ac: Bump version to 2.99.9.
        * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
2008-02-15 15:30:26 +00:00
green a0525f03ee New release. 2008-02-15 15:14:30 +00:00
green 2b30dfb314 * man/ffi_prep_closure.3: Delete.
* man/Makefile.am (EXTRA_DIST): Remove ffi_prep_closure.3.
        (man_MANS): Ditto.
        * man/Makefile.in: Rebuilt.
        * configure.ac: Bump version to 2.99.8.
        * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
2008-02-15 15:12:43 +00:00
green bf41e64840 Update. 2008-02-15 01:56:50 +00:00
green 4d39ddee67 * configure.ac: Bump version to 2.99.7.
* configure, doc/stamp-vti, doc/version.texi: Rebuilt.
        * include/ffi.h.in LICENSE src/debug.c src/closures.c
          src/ffitest.c src/s390/sysv.S src/s390/ffitarget.h
          src/types.c src/m68k/ffitarget.h src/raw_api.c src/frv/ffi.c
          src/frv/ffitarget.h src/sh/ffi.c src/sh/sysv.S
          src/sh/ffitarget.h src/powerpc/ffitarget.h src/pa/ffi.c
          src/pa/ffitarget.h src/pa/linux.S src/java_raw_api.c
          src/cris/ffitarget.h src/x86/ffi.c src/x86/sysv.S
          src/x86/unix64.S src/x86/win32.S src/x86/ffitarget.h
          src/x86/ffi64.c src/x86/darwin.S src/ia64/ffi.c
          src/ia64/ffitarget.h src/ia64/ia64_flags.h src/ia64/unix.S
          src/sparc/ffi.c src/sparc/v9.S src/sparc/ffitarget.h
          src/sparc/v8.S src/alpha/ffi.c src/alpha/ffitarget.h
          src/alpha/osf.S src/sh64/ffi.c src/sh64/sysv.S
          src/sh64/ffitarget.h src/mips/ffi.c src/mips/ffitarget.h
          src/mips/n32.S src/mips/o32.S src/arm/ffi.c src/arm/sysv.S
          src/arm/ffitarget.h src/prep_cif.c: Update license text.
2008-02-15 01:24:06 +00:00
green d58b032b41 New release 2008-02-15 00:59:25 +00:00
green 91e5478df6 Update supported platforms. Bump version. 2008-02-15 00:50:30 +00:00
green bd0768f877 * configure.ac: Bump version to 2.99.5.
* configure: Rebuilt.
        * Makefile.am (EXTRA_DIST): Add darwin64.S
        * Makefile.in: Rebuilt.
        * testsuite/lib/libffi-dg.exp: Remove libstdc++ bits from GCC tree.
        * LICENSE: Update WARRANTY.
2008-02-15 00:45:33 +00:00
green 49d345f767 update license reference 2008-02-14 23:43:27 +00:00
green 12ac48fc79 Update WARRANTY 2008-02-14 23:42:08 +00:00
green 6b91c41da8 fix tarball reference 2008-02-14 23:38:27 +00:00
green 2b59579e35 First update in 5 years! 2008-02-14 23:35:58 +00:00
green 6cbdf3f3a3 Fix .pc file bug and bump version 2008-02-14 22:44:06 +00:00
green 1d1dc81104 Add man files and info file. Update README. Tag as 2.99.3. 2008-02-14 22:03:37 +00:00
tromey f045a2367f Move entry from ChangeLog to ChangeLog.libffi 2008-02-14 20:46:57 +00:00
tromey 6257f07d1a * aclocal.m4, Makefile.in, configure, fficonfig.h.in: Rebuilt.
* mdate-sh, texinfo.tex: New files.
	* Makefile.am (info_TEXINFOS): New variable.
	* doc/libffi.texi: New file.
	* doc/version.texi: Likewise.
2008-02-14 20:33:17 +00:00
green 4232af563c * Makefile.am (AM_CFLAGS): Don't compile with -D.
(lib_LTLIBRARIES): Define.
        (toolexeclib_LIBRARIES): Undefine.
        * Makefile.in: Rebuilt.
        * configure.ac: Reset version to 2.99.1.
        * configure.in: Rebuilt.
2008-02-14 16:19:21 +00:00
green 961543615c Fix typo. 2008-02-14 15:57:40 +00:00
green aeb0abab87 * libffi.pc.in: Usse @PACKAGE_NAME@ and @PACKAGE_VERSION@.
* configure.ac: Reset version to 2.99.1.
        * configure.in: Rebuilt.
        * Makefile.am (EXTRA_DIST): Add ChangeLog.libffi.
        * Makefile.in: Rebuilt.
        * LICENSE: Update copyright notice.
2008-02-14 15:54:27 +00:00
green 77fe243556 Fix make dist again 2008-02-14 15:37:00 +00:00
green d4970cf452 Fix make dist 2008-02-14 15:18:56 +00:00
green f0b1462f2d Use pkgconfig. Increment libtool CURRENT version. 2008-02-14 15:01:41 +00:00
green 27e52f33ba Fix header installs when using DESTDIR. 2008-02-03 13:59:48 +00:00
twall fadab28eb6 update changelog 2008-02-03 12:32:22 +00:00
twall b5e44c8dfa offset from code base address, not data base address 2008-02-03 01:12:32 +00:00
green f359848d1a Fix header installs. 2008-02-01 21:29:43 +00:00
green c30df49e15 Revert my broken changes to twall's patch. 2008-02-01 21:13:55 +00:00
green 675561bb9a Fix make dist . 2008-01-31 13:44:25 +00:00
green abc0bbf381 Add Tim Wall's x86 windows patch. 2008-01-31 11:58:57 +00:00
green e332366d15 Add HJ's -fomit-frame-pointer struct return fix 2008-01-30 13:21:02 +00:00
green d420424039 Clean up for new automake. 2008-01-30 12:42:34 +00:00
green f4932dd020 Fixes to run testsuite 2008-01-30 12:40:25 +00:00
green 085520ddc8 New files from gcc tree. 2008-01-29 15:16:43 +00:00
green 77175b3f72 Latest gcc svn sources 2008-01-29 15:15:20 +00:00
green 2544e45a0b Install ffitarget.h in $prefix/include. 2008-01-29 14:28:13 +00:00
green 6002211b1c Add new files. 2008-01-29 12:30:10 +00:00
green ccabd2b16b Merge from gcc 2008-01-29 12:28:15 +00:00
tromey e680ecfbfc Pulled in libffi from gcc trunk.
Fixed build and install for standalone use.
2006-12-24 23:12:15 +00:00
root e7ba089659 sourcware.org 2006-06-04 23:22:24 +00:00
root 0cd4aa24e2 Add LockDir 2004-05-30 01:51:57 +00:00
green 5826120fbd Add link to Gianni's web site. 2003-11-04 06:09:08 +00:00
jsm 220aa4b27d Newer, better, increased from before! (list of acceptable anon usernames) 2003-01-21 08:07:42 +00:00
green 1c3adc892c Fixed Cygnus references. 2002-12-06 01:28:03 +00:00
green 4af66bb62f Testsuite fixes. 2001-10-21 19:18:42 +00:00
green 5435965f90 * include/ffi_common.h: Delete, after moving contents to...
* include/ffi_private.h: Subsume contents of ffi_common.h.
        * include/Makefile.am (noinst_HEADERS): Remove ffi_common.h.
        * include/Makefile.in: Rebuilt.
        * arm/ffi.c, m68k/ffi.c, mips/ffi.c, powerpc/ffi.c, s390/ffi.c,
        ia64/ffi.c: Include ffi_private.h, not ffi_common.h.
        * alpha/ffi.c, sparc/ffi.c, x86/ffi.c: Don't include ffi_common.h.
        * types.c, raw_api.c, java_raw_api.c, prep_cif.c: Don't include
        ffi_common.h.
        * debug.c: Include ffi_private.h instead of ffi_common.h.

        * mips/ffi.c (calc_n32_struct_flags): Make static.
        (FIX_ARGP): Remove call to debugging routine ffi_stop_here.

        * mips/n32.S: Include ffi_private.h.
        * mips/o32.S: Include ffi_private.h.
2001-04-23 00:32:03 +00:00
green 6fdb7de0fe * README: Update some comments.
* Makefile.am (SUBDIRS): Add include so ffi.h gets installed.
        * Makefile.in: Rebuilt.

        * include/ffi.h: Change ALPHA to __alpha__ and SPARC to __sparc__.
        * types.c: Ditto.
        * prep_cif.c (ffi_prep_cif): Ditto.

        * alpha/ffi.c, alpha/osf.S, sparc/ffi.c, sparc/v8.S, sparc/v9.S:
        Include ffi_private.h.

        * include/ffi_private.h (FFI_TYPE_LAST): Define.
2001-04-22 19:38:34 +00:00
green bc7144b01b Moved files from old home 2001-04-22 18:28:36 +00:00
green e57279831e These are dead. 2001-04-22 18:23:47 +00:00
green 7247436b5f All these files live somewhere else now. 2001-04-22 18:22:43 +00:00
green a8b0d40ff9 Many changes. Not quite there yet. 2001-04-22 18:17:14 +00:00
green f893d22733 Moved m68k files 2001-04-22 18:13:22 +00:00
green 688ddfeced New, target indepentent, header 2001-04-22 18:12:33 +00:00
green f9e40776d4 Many changes. 2001-04-22 18:11:57 +00:00
green 8c1d2eb47f Many changes 2001-04-22 18:10:47 +00:00
green 1359dfc658 Moved ia64 files 2001-04-22 18:10:20 +00:00
green 6e2de5eee3 Moved arm files 2001-04-22 18:08:11 +00:00
green 8807355af3 Many many updates. Merge from gcc and then some. 2001-04-09 00:58:38 +00:00
green f7e9f91ade Mnay fixes. 2000-04-17 03:32:37 +00:00
green c4860de618 Merge from libgcj. Merged patches from net. See ChangeLog for details. 2000-04-17 03:18:46 +00:00
jsm c578b58314 1999-10-09 Jason Molenda (jsm@bugshack.cygnus.com)
* CVSROOT/auto_checkout, CVSROOT/commit_prep, CVSROOT/log_accum:
	Deleted; generic versions now used for all repositories.

	* CVSROOT/commitinfo, CVSROOT/loginfo:  Change pathnames to
	generic versions.

        * CVSROOT/checkoutlist:  Don't try to check out the removed
        files any longer.
1999-10-09 20:18:16 +00:00
jsm acdb200512 1999-10-09 Jason Molenda (jsm@bugshack.cygnus.com)
* CVSROOT/auto_checkout, CVSROOT/commit_prep, CVSROOT/log_accum:
	Deleted; generic versions now used for all repositories.

	* CVSROOT/commitinfo, CVSROOT/loginfo:  Change pathnames to
	generic versions.

        * CVSROOT/checkoutlist:  Don't try to check out the removed
        files any longer.
1999-10-09 20:18:15 +00:00
green e75be655ce New configury 1999-08-08 13:16:41 +00:00
green d6669a0dd5 * include/ffi.h.in: Try to work around messy header problem
with PACKAGE and VERSION.

	* configure: Rebuilt.
	* configure.in: Change version to 2.00-beta.

        * fficonfig.h.in: Rebuilt.
	* acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define.

	* src/x86/ffi.c (ffi_raw_call): Rename.
1999-08-08 13:05:12 +00:00
green 4819d52b00 New file for Kresten's closure work 1999-08-04 18:02:34 +00:00
green 2dbf801eb4 Kresten's closure work. Initial checkin. 1999-08-04 18:00:05 +00:00
green d170961701 * configure.in: Add x86 and powerpc BeOS configurations.
From Makoto Kato <m_kato@ga2.so-net.ne.jp>.
1999-07-08 14:36:52 +00:00
jsm c7747d9769 1999-05-12 Jason Molenda (jsm@bugshack.cygnus.com)
* index.html: Add links to libffi* mail list archives.
1999-05-12 23:32:16 +00:00
green dd2aa9a8de * configure.in: Add warning about this being beta code.
Remove src/Makefile.am from the picture.
	* configure: Rebuilt.
	* Makefile.am: Move logic from src/Makefile.am.  Add changes
	to support libffi as a target library.
	* Makefile.in: Rebuilt.
	* aclocal.m4, config.guess, config.sub, ltconfig, ltmain.sh:
	Upgraded to new autoconf, automake, libtool.
	* README: Tweaks.
	* LICENSE: Update copyright date.
	* src/Makefile.am, src/Makefile.in: Removed.
1999-05-06 05:34:36 +00:00
green 4e9452abed Updated to new automake, libtool, autoconf - nothing works :-) 1999-05-05 22:06:13 +00:00
jsm 6d3b2bddaf 1999-04-26 Jason Molenda (jsm@bugshack.cygnus.com)
* index.html: Missed a reference to libffi-discuss@cygnus.com.  Fixed.
1999-04-26 15:55:28 +00:00
jsm ebc6a9c28a 1999-04-26 Jason Molenda (jsm@bugshack.cygnus.com)
* index.html: Change links to ftp directory to point to sourceware
        directory.
        Change mailing list subscription forms to point to sourceware lists.
1999-04-26 15:53:29 +00:00
jsm 78ffc52a8b Standard sourceware setup. 1999-04-18 01:33:21 +00:00
jsm b4d77e827d Small typeo. (I wouldn't bother except that it made the sentence hard
for me to parse on a casual read.)
1998-11-30 11:11:25 +00:00
jsm bfb73f08fd A few cleanups. Most notably, point to the correct subscribe cgi-bin
script.
1998-11-30 10:44:55 +00:00
green af8b7f037c * index.html: Reformatted and updated to reflect hosting on
sourceware.cygnus.com (new mailing lists, etc).
1998-11-30 06:20:05 +00:00
green 334f0b0609 initial snapshot of documentation 1998-11-29 16:56:12 +00:00
green 3ab5cb4a1d Initial revision 1998-11-29 16:56:10 +00:00
green d2a9eb5a8b This commit was generated by cvs2svn to compensate for changes in r7, which
included commits to RCS files with non-trunk default branches.
1998-11-29 16:48:16 +00:00
green bc75c54bd3 Import of v1 code. 1998-11-29 16:48:16 +00:00
jsm d3782ec816 Send commit messages to mailing lists. 1998-11-20 20:18:00 +00:00
jsm 8d8d3843c4 initial checkin 1998-10-01 22:08:36 +00:00
jsm 49634f3bf2 Add standard setup. 1998-10-01 22:08:35 +00:00
jsm c64a84c769 Add readers and standard modules file. 1998-10-01 22:08:34 +00:00
jsm 9813273b07 initial checkin 1998-10-01 22:08:33 +00:00
1476 arquivos alterados com 649355 adições e 88805 exclusões
+2
Ver Arquivo
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" output="jna/build.eclipse/test-classes" path="contrib/platform/test"/>
<classpathentry kind="src" path="contrib/platform/src"/>
<classpathentry kind="src" output="build.eclipse/test-classes" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
+17
Ver Arquivo
@@ -0,0 +1,17 @@
build
build-d64
build.eclipse
build.number
.metadata
.DS_Store
bin
contrib/ntservice/dist
contrib/platform/dist
doc
*~
**/*~
dist/*.asc
dist/*-sources.jar
dist/*-javadoc.jar
dist/src-mvn.zip
dist/out-of-date.jar
Arquivo executável
+17
Ver Arquivo
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>jnalib</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Arquivo executável
+602
Ver Arquivo
@@ -0,0 +1,602 @@
Release 3.5.1
====================
Bug Fixes
---------
* [#145](https://github.com/twall/jna/pull/145): Fix `Netapi32Util.getDomainTrusts()` returns "empty" domain object - [@aikidojohn](https://github.com/aikidojohn).
* [#145](https://github.com/twall/jna/pull/145): Fix `Netapi32.getDC()` - added missing fields in `DOMAIN_CONTROLLER_INFO` - [@aikidojohn](https://github.com/aikidojohn).
* [#151] 'platform.jar' in the dist directory was not updated for release 3.5.0. (The 'platform.jar' published to maven central was correct.)
Release 3.5.0
=============
Features
--------
* `Structure.getFieldOrder()` supersedes `Structure.setFieldOrder()` and is now required - [@twall](https://github.com/twall).
* Search `~/Library/Frameworks` and `/Library/Frameworks` on OSX - [@shaneholloway](https://github.com/shaneholloway).
* Automatic cleanup of native threads (based on suggestions from neil smith) - [@twall](https://github.com/twall).
* Add `android-arm` target - [@ochafik](https://github.com/ochafik), [@twall](https://github.com/twall).
* Add `jna.tmpdir` to override temporary JNA storage location - [@twall](https://github.com/twall).
* Add `EXTRA_MAKE_OPTS` ant property to override make variables - [@twall](https://github.com/twall).
* Add `Library.OPTION_OPEN_FLAGS` to customize dlopen behavior - [@twall](https://github.com/twall).
* [#113](https://github.com/twall/jna/issues/113), [#114](https://github.com/twall/jna/issues/114): Add support for GNU/kFreeBSD and debian multi-arch distros - [@twall](https://github.com/twall).
Bug Fixes
---------
* Fix `Advapi32Util.registryGetValues()` tried to allocate memory for a zero-length `REG_BINARY` value - [@phailwhale22](https://github.com/phailwhale22).
* Fix crash in direct mode callbacks with certain type conversions - [@twall](https://github.com/twall).
* More thoroughly propagate unexpected exceptions generated in jnidispatch - [@twall](https://github.com/twall).
* Cleanup maven poms and publishing to central repo - [@bhamail](https://github.com/bhamail).
* [#129](https://github.com/twall/jna/issues/129): Allow `Memory` field in structure - [@twall](https://github.com/twall).
* Preserve `PointerType` fields on `Structure.read()` if unchanged - [@twall](https://github.com/twall).
* [#128](https://github.com/twall/jna/issues/128): Fix masking extracting DWORD upper and lower WORD values - [@twall](https://github.com/twall).
* [#135](https://github.com/twall/jna/issues/135): Fix for `Advapi32Util.registryGetValues()` when reading zero length values - [@danwi](https://github.com/danwi).
Release 3.4.2
=============
Features
--------
* Add `platform.win32.Kernel32.GetEnvironmentVariable` and `platform.win32.Kernel32Util.getEnvironmentVariable` - [@dblock](https://github.com/dblock).
* Moved `Kernel32.dll` function definitions from `WinNT.java` into `Kernel32.java` - [@dblock](https://github.com/dblock).
* Provide `toPointer()` methods on all `_PTR` types (platform win32) - [@twall](https://github.com/twall).
* Provide `ant -Dskip-native` to skip platform native build - [@twall](https://github.com/twall).
* Provide `ant -Dheadless=true` to run unit tests headless - [@twall](https://github.com/twall).
* Added Windows dev environment instructions - [@twall](https://github.com/twall).
Bug Fixes
---------
* Ensure platform win32 classes use unsigned where appropriate (`ULONG_PTR`, `UINT_PTR`, `ULONGLONG`, `WORD`, `DWORDLONG`) - [@twall](https://github.com/twall).
* [#71](https://github.com/twall/jna/issues/71), [#73](https://github.com/twall/jna/issues/73): Fix OSGI entries in manifest - [@twall](https://github.com/twall).
* [#78](https://github.com/twall/jna/issues/78): Fix NPE in `platform.win32.Netapi32Util.getDomainTrusts` - [@dblock](https://github.com/dblock).
* Fix: auto-sync memory for `struct**` arguments (array of struct pointers) - [@twall](https://github.com/twall).
* Fix: `platform.win32.Secur32.AcquireCredentialsHandle`, `InitializeSecurityContext` and `AcceptSecurityContext` on Win32 64-bit - [@dblock](https://github.com/dblock).
* Fix: avoid overwriting native `char *` or `wchar_t *` fields within structures when unmodified (similar to current operation with pointers) - [@twall](https://github.com/twall).
* Fix: `platform.win32.DsGetDC.DS_DOMAIN_TRUSTS` and `DsEnumerateDomainTrusts` on Win32 64-bit - [@trejkaz](https://github.com/trejkaz).
* Fix: Crash freeing the wrong pointer in `Netapi32Util.getDomainTrusts` - [@trejkaz](https://github.com/trejkaz).
* [#100](https://github.com/twall/jna/issues/100): Fix `platform.win32.W32FileMonitor` - [@dblock](https://github.com/dblock).
* Return INT_PTR from `platform.win32.Shell32.ShellExecute`, since returning
`HINSTANCE` is useless.
* Fix runtime error in some instances where Structure.setFieldOrder is used (never return self when sharing AutoAllocated memory).
* [#107](https://github.com/twall/jna/issues/107): `Structure.clear()` always calls `ensureAllocated()` to avoid NPE.
* Ensure internal memory pointer is *always* allocated when calling `Structure.useMemory()`, even if layout is not yet determined.
Release 3.4.1
=============
Features
--------
* Add 'unsigned' modifier to IntegerType.
* Add to `platform.win32.User32`: `GetLastInputInfo`.
* Add `platform.win32.WinNT.GetFileType` and `platform.win32.Kernel32Util.getFileType`.
* Add to `platform.win32.Kernel32Util`: `getFileType`.
Bug Fixes
---------
* Re-build linux-amd and linux-i386 against older versions of glibc (2.2.5 and
2.1.3 respectively).
* Properly initialize first printer info struct in winspool library.
* Properly support getting and setting zero-array-length `REG_MULTI_SZ` values on Win32.
* Fixed SID in Win32 `USER_INFO_23` and `GROUP_INFO_3`.
* Fixed passing domain name into Win32 `Netapi32Util.getUserInfo`.
Release 3.4.0
=============
Features
--------
* Provide `jna.nosys=true` to avoid loading any system-provided JNA (useful for local build/development).
* Allow override of default jnidispatch library name with `jna.boot.library.name` system property.
* Throw an Error if a system install of JNA is incompatible or if JNA's JNI library does not match.
* Disable automatic jnidispatch unpacking with `jna.nounpack=true`.
* Automatically look up system error messages for LastErrorException.
* Improved callback thread-mapping support; re-use, rename, and group callback
threads.
* Cache structure layout results, improving performance of structure creation.
* linux/arm 32-bit support (hardware provided by Alex Lam).
* linux/ppc 32-bit support (hardware provided by Fritiof Hedman).
* Preliminary linux/ia64, linux/ppc64 support (thanks to Laurent Guerby and the GCC compile farm).
* Windows CE/Mobile support (w32ce-arm) (resources provided by andrea antonello and Hydrologis SRL).
* linux multi-arch support (kohsuke).
* Added REG_QWORD registry type support
* Add to `platform.unix.x11`: `XGrabKey`, `XUngrabKey`, `XSetErrorHandler`.
* Add to `platform.mac.Carbon`: `GetEventDispatcherTarget`, `InstallEventHandler`, `RegisterEventHotKey`, `GetEventParameter`, `RemoveEventHandler`, `UnregisterEventHotKey`.
* Add to `platform.win32.Kernel32`: `CopyFile`, `MoveFile`, `MoveFileEx`, `CreateProcess`, `SetEnvironmentVariables`, `GetFileTime`, `SetFileTime`, `SetFileAttributes`, `DeviceIoControl`, `GetDiskFreeSpaceEx`, `CreateToolhelp32Snapshot`, `Process32First`, `Process32Next`.
* Add to `platform.win32.Msi`: `MsiGetComponentPath`, `MsiLocateComponent`, `MsiGetProductCode`, `MsiEnumComponents`.
* Add to `platform.win32.User32`: `RegisterHotKey`, `UnregisterHotKey`
* Add to `platform.win32.SetupApi`: `SetupDiGetClassDevs`, `SetupDiDestroyDeviceInfoList`, `SetupDiEnumDeviceInterfaces`, `SetupDiGetDeviceInterfaceDetail`, `SetupDiGetDeviceRegistryProperty`.
* Add `platform.win32.Shell32.ShellExecute`.
* Add to `platform.win32.User32`: `SetParent`, `IsWindowVisible`, `MoveWindow`, `SetWindowPos`, `AttachInputThread`, `SetForegroundWindow`, `GetForegroundWindow`, `SetFocus`, `SendInput`, `WaitForInputIdle`, `InvalidateRect`, `RedrawWindow`, `GetWindow`, `UpdateWindow`, `ShowWindow`, `CloseWindow`.
* Add to `platform.win32.Version`: `GetFileVersionInfoSize`, `GetFileVersionInfo`, `VerQueryValue`.
* Add to `platform.win32.Advapi32`: `GetFileSecurity`, `RegQueryValueEx(...Long...)`.
* Add to `platform.win32.Netapi32`: `NetUserGetInfo`.
Bug Fixes
--------
* Revise cleanup of in-use temporary files on win32 (issue 6).
* Fix structure alignment issues on linux/ppc.
* Fix structure alignment issues on linux/arm.
* Account for NIO Buffer position (JIRA issue 185).
* Avoid crash with very long Strings (> 150k in length).
* Fix bug tracking Memory with an associated direct ByteBuffer.
* Fix bug handling structs by value when type mappers are in effect (JIRA issue 188).
Release 3.3.0
=============
Features
--------
* Facilitate `Memory` subclasses (jbellis).
* Allow multiple fields of the same type in Unions (Francis Barber).
* Add `platform.win32.Advapi32.AdjustTokenPrivileges`, `platform.win32.Advapi32.LookupPrivilegeName`, `platform.win32.Advapi32.LookupPrivilegeValue`, `platform.win32.Advapi32.ImpersonateSelf`.
* Add `platform.win32.Advapi32.DuplicateTokenEx`, `platform.win32.Advapi32.CreateProcessAsUser`, `platform.win32.Kernel32.GetExitCodeProcess`, `platform.win32.Kernel32.TerminateProcess`, `platform.win32.Kernel32.ReadFile`, `platform.win32.Kernel32.CreatePipe`, `platform.win32.Kernel32.SetHandleInformation` and related constants / structures in `platform.win32.WinBase` and `platform.win32.WinNT`. Please note that the `SECURITY_ATTRIBUTES` structure has been moved from `platform.win32.WinNT` to `platform.win32.WinBase`.
* Add `platform.win32.Kernel32.DeleteFile` and `platform.win32.Kernel32Util.deleteFile`.
* Add `platform.win32.Kernel32.GetFileAttributes` and `platform.win32.Kernel32Util.getFileAttributes`.
* Add `platform.win32.Kernel32.GetTickCount`.
* Add Win32 Service functions to `platform.win32.Advapi32`.
* Add `platform.win32.W32ServiceManager` and `W32Service`.
* Add Win32 Event Logging functions to `platform.win32.Advapi32` and `platform.win32.Advapi32Util.EventLogIterator`.
* `platform.win32.Advapi32Util.registryCreateKey` returns `true` if key was created, `false` if it already exists.
* Add `REG_BINARY`, `REG_EXPAND_SZ` and `REG_MULTI_SZ` support to `platform.win32.Advapi32Util` registry functions.
* Reduce JNI crossings in a number of native methods, moving object creation out into pure Java code.
Bug Fixes
---------
* Move all native functions into `com.sun.jna.Native`, to ensure that all dependent classes must be disposed before the `Native` class is unloaded. Note that this change is incompatible with all previous JNA native libraries.
* Fix `platform.win32.Kernel32.GetNativeSystemInfo` and `GetSystemInfo` AV on Win64.
* Fix several potential minor bugs as reported by TvT.
* Fix bug in Structure.StructureSet.toString (Blair Zajac), exposed by Tomcat ThreadLocal cleanup.
* Fix several bugs when using Structure(Pointer) ctor and array fields (Samuel Audet).
Release 3.2.7
=============
Features
--------
* Add native peer value accessors for Pointer
* The `jna.library.path` property is now re-evaluated whenever a native library is loaded. Previously this value was cached when the JNA classes loaded.
* `Native.loadLibrary` can now load `.drv` files.
* Refactor `com.sun.jna.platform.win32.WINBASE` into `WinDef`, `WinNT` and `BaseTSD`, matching Windows SDK headers.
* Refactor constants from `com.sun.jna.platform.win32.GDI32` into `WinGDI`, matching Windows SDK headers.
* Refactor constants from `com.sun.jna.platform.win32.User32` into `WinUser`, matching Windows SDK headers.
* Refactor `platform.win32.WinNT.LARGE_INTEGER` into a union.
* Add `platform.win32.ObjBase`, `com.sun.jna.platform.win32.Ole32.CoInitializeEx`, `CoUninitialize`, and `CoCreateInstance`.
* Add `platform.win32.Oleaut32.SysAllocString` and `SysFreeString`.
* Add `platform.win32.Secur32.ImpersonateSecurityContext` and `RevertSecurityContext`.
* Add `platform.win32.WinNT.WELL_KNOWN_SID_TYPE`, `SECURITY_MAX_SID_SIZE` and other related SID-related constants.
* Add `platform.win32.Advapi32.CreateWellKnownSid` and `IsWellKnownSid` and `com.sun.jna.platform.win32.Advapi32Util.isWellKnownSid`.
* Add `platform.win32.Kernel32.GetVersion`, `GetVersionEx`, `GetSystemInfo`, `GetNativeSystemInfo`, `GlobalMemoryStatusEx`, `GetLogicalDriveStrings` and `IsWow64Process`.
* Add `platform.win32.Kernel32Util.getLogicalDriveStrings`.
* Add `platform.win32.User32.GetSystemMetrics`.
* Add `platform.win32.BaseTSD.DWORD_PTR`.
* Add `platform.win32.WinBase.SYSTEM_INFO` and `MEMORYSTATUSEX`.
* Add `platform.win32.WinNT.OSVERSIONINFOEX`, `VER` constants.
* Add `platform.win32.WinDef.ULONGLONG` and `DWORDLONG`.
* Add `platform.win32.Shell32.SHGetDesktopFolder` (prep work for Com4JNA).
* Add `platform.win32.Winspool.GetPrinterInfo`.
* Add `platform.win32.WinspoolUtil.getPrinterInfo1`.
* Add `platform.win32.GDI32.GetDeviceCaps`.
* Add `platform.win32.GDI32.GetDIBits`.
Bug Fixes
---------
* Fix `ClassCastException` in `Structure.equals` (issue 152).
* Fix bug initializing a structure object from existing memory when the structure has initialized fields (issue 133).
* Fix NPE reading an array of string from a pointer when an element of the array is `NULL` (issue 151).
* Avoid calling `UnregisterNatives` in native code (issue 154).
* Compare unpacked library path against canonical (long) filename (issue 156).
* Fix `read()` of uninitialized memory in `platform.win32.Advapi32Util.getTokenGroups` and `getTokenAccount`.
* Fix `com.sun.jna.platform.win32.Secur32.QuerySecurityContextToken` to take a `CtxtHandle` instead of `PSecHandle`.
* Fix definition of BITMAPINFO (platform/win32).
Release 3.2.5
=============
Features
--------
* Split code in examples.jar into a contrib platform.jar package and individual packages for demos.
* Fix Eclipse build and added Eclipse projects for all contrib samples, import projects from jnalib and contrib.
* Ensure Structure fields correctly ordered when inherited.
* Use explicit Structure field whenever provided, regardless of whether the VM requires it.
* Add Win32 mappings for two dozen functions from Kernel32.dll, Advapi32.dll, Netapi32.dll, Secur32.dll, NtDll.dll, Ole32.dll, Shell32.dll and Crypt32.dll to com.sun.jna.platform.win32.
* Port parts of WinError.h, WinNT.h, LMAccess.h, LMCons.h, LMErr.h, LMJoin.h, NTStatus.h, ShlObj.h, WinDef.h, ShellApi.h, Wdm.h, WinReg.h, WinCrypt.h, Sspi.h, Guid.h, NtSecApi.h and DsGetDc.h.
* Add Win32 simplified utility interfaces Kernel32Util, Advapi32Util, Netapi32Util, Crypt32Util, NtDllUtil, Shell32Util, Ole32Util and Secur32Util to com.sun.jna.platform.win32.
* Support unicode paths in W32FileUtils.
* Fix exception during dispose in W32FileMonitor.
Bug Fixes
---------
* Provide String.replace for 1.4 compatibility.
* Avoid allocating memory when Structure is provided a pointer in the ctor.
* Ensure proper value returned in Pointer.getValue() for non-null, unchanged NIO Buffer values.
* Use 1.4-compatible URI generation (issue 149).
Release 3.2.4
=============
Features
--------
* Make Pointer ctor public.
* Provide access to Function objects for arbitrary Pointer values.
* Add linux/ia64 binaries (bpiwowar). See issue 134 patch.
Bug Fixes
---------
* Use a more robust method to decode a file-based URL (issue 135).
Release 3.2.3
=============
Features
--------
* Include version information in code in case package information lost.
Bug Fixes
---------
* Fix WindowUtils exception on mouse over TrayIcon.
* Fix bug toggling windows transparent/opaque (win32/OSX).
* Avoid overwriting unchanged Pointer values in arrays (function calls with Pointer[] and Structure.read).
* Ensure Structure fields marked `final` are never written.
* Fix bug preventing proper population Structure.ByReference fields on Structure read.
* Ensure double buffering is disabled in components added to a transparent window.
* Fix UnsatisfiedLinkError attempting to load system libraries under Web Start.
* Fix loading Web Start-provided libraries on OSX (libraries must have a .jnilib suffix under Web Start).
* Properly include sources in Maven zip file (Issue 129).
Release 3.2.2
=============
Features
--------
* Provide length-specified Pointer.getStringArray()
Bug Fixes
---------
* Fix crash with direct mapping if NULL struct* used (Issue 125).
* Fix case where null-valued Structure fields would get non-null values on write.
* Synch callback Structure/Structure[] arguments on callback return.
* Fix NPE when mapping an interface to the current process.
* Automatically load proper C library version from current process on Linux (avoids crashing bug on Ubuntu with libc-i686 packages active).
* Avoid scanning structure contents in Structure.toString if contents aren't actually used.
Release 3.2.1
==========
Features
--------
* Add HRESULT, LONG mapping to W32API (marc strapetz).
Bug Fixes
---------
* Fix definition of HWND_BROADCAST in W32API.
* Fix memory alignment checking (Issue 121).
* Fix Structure equals/hashCode implementation, based on current Java fields rather than strictly native memory contents. Avoid using equals/hashCode when avoiding recursive reads/writes.
Release 3.2.0
=============
Features
--------
* Handle String, Structure, Callback, Buffer, and primitive arrays in direct mappings. Handle NativeMapped and TypeMapper, with optimized paths for IntegerType and PointerType.
* Optionally throw errno/GetLastError as an exception. This is preferred to (and more efficient than) calling Native.getLastError().
* Unload/delete native library unpacked from jna.jar if Native class is garbage collected. Only install shutdown hook if using the system class loader.
* Auto-write contiguous Structure arrays when first element is written.
* Support NativeMapped[] as function arguments for interface-mapped libraries (Issue 90).
* Enable function lookup within current process on Windows.
Bug Fixes
---------
* Restrict recursive structure reads/writes by thread instead of globally. This avoids potentially missed reads/writes with concurrent access (Issue 120).
* Ensure Memory is not GC'd and freed if direct NIO buffers mapped to it are extant.
* Allow types derived from java.nio.Buffer as Structure fields.
Release 3.1.0
=============
Features
--------
* Add raw JNI mapping of static Java methods. Performance is about 10X that of traditional JNA interface mapping, although with less type conversion functionality.
* Add library option to allow passing/return of Java Objects.
* Allow handling of uncaught callback exceptions (Issue 63).
* Object oriented interface to X server (see contrib/x11)
* Make Memory class more accessible.
* Provide Structure ctor with Pointer argument (issue 102).
* Allow implicit library access to current process on linux (issue 98).
* Open all shared libraries with RTLD_GLOBAL, if applicable. This was the default behavior on OSX and changes the default behavior on linux.
* Allow NIO Buffer as Structure field (with limitations) (Issue 57)
* Add `size_t` size.
Bug Fixes
---------
* Run tests with libjsig.so, if available, which fixes some crashes when running tests on 64-bit platforms.
* Fix Issue 104.
* Fix Issue 94 (Java 1.6 update 10 regression).
* Fix Issue 51 (Java 1.6 update 10 regression).
* Fix Issue 95.
* Fix Issue 101.
* Fix Issue 111, memory leak with String-returning Callback.
* Fix missing storage of union type information (affects usage of struct/union by value as argument and return type).
* Remove non-functional Structure ctors requiring explicit size.
Release 3.0.9
=============
Bug Fixes
---------
* Fix issue 93 by only manually searching jna.library.path, then falling back to passing the mapped library name to dlopen/LoadLibrary. This fixes an issue in JRUBY where the incorrect libc.so.6 was being loaded.
Release 3.0.8
==========
Features
--------
* Auto-map Pointer[]/String[]/WString[] return values.
* Provide utility functions to convert String to primitive array.
* Add jna.library.boot.path property to define the directory that the native stub library is loaded from
Release 3.0.7
==========
Features
--------
* Improve Win32 loading of libraries with dependencies.
Bug Fixes
---------
* Fix bug reading structures with PointerType fields, introduced with Pointer field preservation fix.
Release 3.0.6
=============
Features
--------
* Allow arbitrary callback method names if only one method is defined in the class which implements Callback (colinwalters).
* Allow specification of callback type mappers by using a TYPE_MAPPER field (colinwalters).
* Allow uninitialized (null-valued) boxed primitives in Structures (colinwalters).
* Add convenience methods to set active Union field and value simultaneously (xylo).
* Augment Union read/writeField to set the active field.
* Allow Structure auto-synch across native calls to be disabled.
* Win64 support.
Bug Fixes
---------
* Avoid overwriting unchanged Structure fields of type Pointer.
* Avoid more content dragging on OSX or warn if it's too late.
* Fix UnsatisfiedLinkError using transparent window on Win2K.
* Fix memory leak with callbacks called from native threads with no Java context (johnwallace).
* Defer structure size calculation if type mapper not yet set, allowing type mapper to be set in derived constructors (colinwalters).
* Ensure structure memory is allocated in Structure.read/writeField.
Release 3.0.5
=============
Features
--------
* Allow explicit declaration of field order for VMs which have an unpredictable field order.
* Check for w32 libraries with a "lib" prefix in addition to normal lookup.
* Allow String[]/WString[] as callback argument/return value (assume NULL-terminated array).
* Add Solaris8 compatibility to sunos-sparc build (Corey Puffalt).
* Look up libraries using web start library path, if appropriate (Corey Puffalt).
* Use constants to return integer boolean values.
Bug Fixes
---------
* Properly track cursor on alpha-masked windows.
* Avoid searching /lib or /usr/lib on 64-bit Linux.
* Avoid using incorrect version of a library when both 32- and 64-bit versions are found.
* Avoid transparent window events always dragging window bug on OSX.
* Fix division by zero error calculating structure size on OSX/ppc.
* Avoid overwriting initialized NativeMapped Structure fields when calculating structure size.
* Fix NPE reading back into StringArray.
Release 3.0.4
=============
Features
--------
* Automatically write contents of Structure.ByReference fields on Structure.write().
* Use the actual parameter type in Function invocations if no parameter type information is available (whether method is missing or untyped varargs).
* Augmented X11 library mappings (xylo).
* Support read/write of NativeMapped arrays within Structure (notably NativeLong).
Bug Fixes
---------
* Fix library load error when /usr/lib32 and /usr/lib both exist (linux) (Marek Slama).
* Avoid incorrect matches against libraries named with the same prefix (e.g. libc-client.so vs libc.so) (xylo).
* Properly handle arrays of NativeMapped (e.g. NativeLong) as a Structure field (stefan endrullis).
* Ensure structure size calculated prior to setting union active type.
* XID is 64-bits on 64-bit X clients (xylo).
* Ensure proper arch name is used on Debian (amd64 instead of x86_64).
Release 3.0.3
=============
Features
--------
* Enable build/run using IBM's J9 VM (leonardo).
* Make StdCallFunctionMapper attempt a leading underscore if the simpler mapping doesn't work.
* Allow Structure.read to overwrite final fields (may not work on some 1.4 VMs).
Bug Fixes
---------
* Fix NPE when passing an array of Structure.ByReference.
* Compare entire linux library version when finding a match.
* Don't pass struct by value unless the method signature declares it.
* Restrict custom first element structure alignment to OSX/ppc.
* Improve performance and reduce memory footprint for window masks. Optimize polygon-based masks on w32. Use XFillRectangles on X11.
* Fix linkage settings on sunos-amd64 to avoid relocation errors.
* Fix callback allocation code on w32, solaris, freebsd, darwin (libffi was misconfigured).
* Fix bug when NativeMapped fields are used in a Structure.ByValue instance.
* Fix NPE calling Structure.read() before memory is initialized.
* Fix NPE calling Structure.read/write with uninitialized NativeMapped fields.
Release 3.0.2
=============
Features
--------
* Attempt to force unload of jnidispatch library prior to deleting it (w32).
* Added amd64 targets for OSX, FreeBSD, and Solaris.
Bug Fixes
---------
* Reduce space allocated for invocation arguments.
* Fix NPE when NativeMapped type is used in a Structure.
* Fix some X11 type mappings for 64-bit.
* Fix OSX Leopard/JRE1.5+ window transparency.
* Fix window alpha compositing on X11.
* Fix loading of libraries with unicode names on OSX.
Release 3.0.1
=============
Features
--------
* Improve transparent window drawing performance on w32
* Use closure allocation from libffi
Bug Fixes
---------
* Ensure nested structure arrays initialized with Structure.toArray use the appropriate native memory.
* Ensure structure size is calculated prior to converting to array
* Avoid creating new windows when setting a window mask
* Fix bug in Pointer.setChar.
Release 3.0
===========
Features
--------
* More supported platforms, via GCC's libffi (wmeissner)
* Support struct by value as parameter and return value (duncan)
* Support struct by reference within structures
* Provide access to native peer for java.awt.Component
* Provide access to native peer on OS X.
* Support MINGW32 builds (fullung)
* Allow per-field Structure read/write by field name
* Avoid writing Structure fields marked 'volatile'
* Read and wrap function pointers in Structure fields when read with a Java proxy to allow easy Java-side invocation (Ken Larson)
* Support array-backed Buffers as arguments (wmeissner)
* Auto-conversion of custom types (wmeissner)
* Allow pointer type-safety
* Optional VM crash protection, via Native.setProtected(boolean)
* Auto-convert WString[]
* Provide library synchronization wrapper similar to Collections.synchronizedX
* Support lookup of OSX framework libraries by name
* Explicit access to shared library global data
* Invocation interception to facilitate translation of C preprocessor macros and inline functions
* Provide utility to determine Web Start native library cache location; auto-include this path if jnidispatch is included as a &lt;nativelib&gt; (robertengels)
* Provide access to aligned memory
* Versioning information embedded in jna.jar and native library
Bug Fixes
---------
* Avoid attempts to free native library if it failed to load (wmeissner)
* Explicitly check method signatures for varargs instead of heuristically guessing (wmeissner)
* Disallow declaring Pointer-derived fields in Structures (Function, Memory)
* Ensure Object.toString/hashCode/equals methods are intercepted on proxyied interfaces
* Update X11 library for 64-bit use (wmeissner)
* Properly map arrays of char*/wchar_t* under w32
* Allow Pointer[] as a Structure field and Function argument
* Fix some misleading Structure error messages
* Properly preserve/return GetLastError/errno after native calls
* Allocate executable memory on w32 to avoid errors with hardware-enforced data execution protection (DEP)
* Fix VM crash on w32 stdcall callbacks
* Use long offsets and sizes rather than ints (64-bit safe)
* Properly clean up references and release closure memory on JNI_Unload
* Use simpler AWT/JAWT library loading workaround
* Avoid changing array references within a Structure on read
Release 2.5
===========
Features
--------
* Unions
* Optimized shaped windows (chris deckers & olivier chafik); instantiation time improved by about 2-3 orders of magnitude for large, mostly contiguous shapes
* Provide type mapping in callback arguments/results
* Provide access to ByteBuffer direct address as a Pointer
* Provide customization of native string encoding with jna.encoding system property
Bug Fixes
---------
* Properly handle VMs with reversed Structure member storage
* Avoid making window undecorated when clearing window mask on X11
* Fix structure alignment bug on OSX/PPC when first element is > 4 bytes in size
* Clearing OSX window mask by setting to MASK_NONE now works properly
* Avoid index exceptions if native buffers are not NUL-terminated on string conversions
* Write initialized Structure[] argument memory prior to function calls
* Fix IllegalArgumentException reading WString into a Structure
* Clear memory when allocating a structure block (fixes VM crash)
* Remove versioned JAWT dependency on OSX, allowing use on 10.3/JRE1.4.
Release 2.4
===========
Features
--------
* Explicitly support unaligned structures
* Auto-reallocate structure arrays
* Automatic handling of w32 UNICODE/ASCII variants
* Automatic mapping of decorated w32 stdcall function names
* Customizable, automatic type conversion of arguments and results (wmeissner)
* Support char*[] arguments as Java String[]
* Structure supports Callback members (wmeissner)
* getByteBuffer from Pointer/Memory (wmeissner)
* Allow GC of native libraries
* Facilitate use from non-Java contexts (JRuby et al.) (wmeissner)
* Improve library path searching (wmeissner)
* Handle Structure[] arguments
* Handle native long arguments and return values
* Handle direct and array-based ByteBuffer arguments (wmeissner)
* Change default w32 build to use GCC (it's free, yo)
Bug Fixes
---------
* Structure.toArray failed to initialize members
* Disallow explicit free of Structure/Memory
* Ensure native libraries are only loaded once until released
* Properly handle NULL when the return value is a Structure
* Proper conversion to wchar_t on linux
* Copy full length of Java strings to C strings instead of stopping when a NUL character is encountered
Ver Arquivo
Ver Arquivo
+112
Ver Arquivo
@@ -0,0 +1,112 @@
![Java Native Access - JNA](https://github.com/twall/jna/raw/master/www/images/jnalogo.jpg "Java Native Access - JNA")
Java Native Access (JNA)
========================
The definitive JNA reference (including an overview and usage details) is in the [JavaDoc](http://twall.github.com/jna/3.5.1/javadoc/). Please read the [overview](http://twall.github.com/jna/3.5.1/javadoc/overview-summary.html#overview_description).
JNA provides Java programs easy access to native shared libraries (DLLs on Windows) without writing anything but Java code—no JNI or native code is required. This functionality is comparable to Windows' Platform/Invoke and Python's ctypes. Access is dynamic at runtime without code generation.
JNA allows you to call directly into native functions using natural Java method invocation. The Java call looks just like it does in native code. Most calls require no special handling or configuration; no boilerplate or generated code is required.
The JNA library uses a small native library stub to dynamically invoke native code. The developer uses a Java interface to describe functions and structures in the target native library. This makes it quite easy to take advantage of native platform features without incurring the high overhead of configuring and building JNI code for multiple platforms.
While some attention is paid to performance, correctness and ease of use take priority.
JNA includes a platform library with many native functions already mapped as well as a set of utility interfaces that simplify native access.
Download
========
Version 3.5.1
* [jna.jar](jna/blob/3.5.1/dist/jna.jar?raw=true)
* [platform.jar](jna/blob/3.5.1/dist/platform.jar?raw=true)
Features
========
* Automatic mapping from Java to native functions, with simple mappings for all primitive data types
* Runs on most platforms which support Java
* Automatic conversion between C and Java strings, with customizable encoding/decoding
* Structure and Union arguments/return values, by reference and by value
* Function Pointers, (callbacks from native code to Java) as arguments and/or members of a struct
* Auto-generated Java proxies for native function pointers
* By-reference (pointer-to-type) arguments
* Java array and NIO Buffer arguments (primitive types and pointers) as pointer-to-buffer
* Nested structures and arrays
* Wide (wchar_t-based) strings
* Native long support (32- or 64-bit as appropriate)
* [Demo applications/examples](https://github.com/twall/jna/tree/master/contrib)
* Supported on 1.4 or later JVMs, including JavaME (earlier VMs may work with stubbed NIO support)
* Customizable marshalling/unmarshalling (argument and return value conversions)
* Customizable mapping from Java method to native function name, and customizable invocation to simulate C preprocessor function macros
* Support for automatic Windows ASCII/UNICODE function mappings
* Varargs support
* Type-safety for native pointers
* VM crash protection (optional)
* Optimized direct mapping for high-performance applications.
Community and Support
=====================
All questions should be posted to the [jna-users Google group](http://groups.google.com/group/jna-users). Issues can be submitted [here on Github](https://github.com/twall/jna/issues).
When posting to the mailing list, please include the following:
* What OS/CPU/architecture you're using (e.g. Windows 7 64-bit)
* Reference to your native interface definitions (i.e. C headers), if available
* The JNA mapping you're trying to use
* VM crash logs, if any
* Example native usage, and your attempted Java usage
It's nearly impossible to indicate proper Java usage when there's no native
reference to work from.
For commercial support, please contact twalljava [at] java [dot] net.
Using the Library
=================
* [Getting Started](https://github.com/twall/jna/blob/master/www/GettingStarted.md)
* [Mapping between Java and Native](https://github.com/twall/jna/blob/master/www/Mappings.md)
* [Using Pointers and Arrays](https://github.com/twall/jna/blob/master/www/PointersAndArrays.md)
* [Using Structures and Unions](https://github.com/twall/jna/blob/master/www/StructuresAndUnions.md)
* [Using By-Reference Arguments](https://github.com/twall/jna/blob/master/www/ByRefArguments.md)
* [Customization of Type Mapping](https://github.com/twall/jna/blob/master/www/CustomMappings.md)
* [Callbacks/Function Pointers/Closures](https://github.com/twall/jna/blob/master/www/CallbacksAndClosures.md)
* [Dynamically Typed Languages (JRuby/Jython)](https://github.com/twall/jna/blob/master/www/DynamicallyTypedLanguages.md)
* [Platform Library](https://github.com/twall/jna/blob/master/www/PlatformLibrary.md)
* [Direct Method Mapping](https://github.com/twall/jna/blob/master/www/DirectMapping.md) (Optimization)
* [Frequently Asked Questions (FAQ)](https://github.com/twall/jna/blob/master/www/FrequentlyAskedQuestions.md)
* [Avoiding Crashes](http://twall.github.com/jna/3.5.1/javadoc/overview-summary.html#crash-protection)
Primary Documentation (JavaDoc)
===============================
The definitive JNA reference is in the [JavaDoc](http://twall.github.com/jna/3.5.1/javadoc/).
Developers
==========
* [Contributing to JNA](https://github.com/twall/jna/blob/master/www/Contributing.md).
* [Setting up a Windows Development Environment](https://github.com/twall/jna/blob/master/www/WindowsDevelopmentEnvironment.md)
* [Setting up an Android Development Environment](https://github.com/twall/jna/blob/master/www/AndroidDevelopmentEnvironment.md)
* [Releasing JNA](https://github.com/twall/jna/blob/master/www/ReleasingJNA.md)
* [Publishing to Maven Central](https://github.com/twall/jna/blob/master/www/PublishingToMavenCentral.md)
Contributing
============
You're encouraged to contribute to JNA. Fork the code from [https://github.com/twall/jna](https://github.com/twall/jna) and submit pull requests.
For more information on setting up a development environment see [Contributing to JNA](https://github.com/twall/jna/blob/master/www/Contributing.md).
If you are interested in paid support, feel free to say so on the [jna-users mailing list](http://groups.google.com/group/jna-users). Most simple questions will be answered on the list, but more complicated work, new features or target platforms can be negotiated with any of the JNA developers (this is how several of JNA's features came into being). You may even encounter other users with the same need and be able to cost share the new development.
License
=======
This library is provided under the LGPL, version 2.1 or later. Alternative license arrangements are negotiable.
*NOTE: Oracle is not sponsoring this project, even though the package name (com.sun.jna) might imply otherwise.*
+22 -26
Ver Arquivo
@@ -21,38 +21,32 @@
# TODO
* fix setFieldOrder to *always* apply if used
* cache structure information
* make direct calls call back *once* to Java where conversion is required,
and process all arguments from there (instead of potentially swapping back
and forth multipel times). This also makes it easer to perform conversions
(no native changes required).
* direct/raw non-primitive array arguments (String[], Pointer[], NativeMapped[])
* ppc64 direct/raw failures (multiple)
* direct calls on ppc to varargs (callbacks) with FP args fail; avoid them for
now
* combine direct and interface mapping calling code where possible
* make native dll extraction from jar public, to use with user dlls packaged
in a jar
* dispose memory/callbacks in Native finalizer to ensure they run first
(use referencequeue to run them when they become unreachable)
* make direct calls call back *once* to Java where conversion is required,
and process all arguments from there (instead of potentially swapping back
and forth multiple times). This also makes it easer to perform conversions
(no native changes required).
* use libffi java raw?
* direct/raw non-primitive array arguments (String[], Pointer[], NativeMapped[])
* ppc64 direct/raw failures (multiple)
* direct calls on ppc to varargs (callbacks) with FP args fail; avoid them for
now
* combine direct and interface mapping calling code where possible
* Callback.PostCallWrite.write() cf PostCallRead
* GetPrimitiveArrayCritical: use this if flagged (by annotation? method name?)
* MethodArgument/ReturnMapper: per method mapping of arguments/return type.
Can use annotations as shorthand to initialize a map, but basically set up a
per-NativeLibrary (or per-Function?) map of methods to mappers.
Requires separate compilation of annotation handling.
* ditch type conversion context (?)
* packaging: 'types', 'convert/marshal' subpackages?
note: marshal/unmarshal vs to/fromnative: to/fromnative is more
explicit, since marshal/unmarshal doesn't indicate src/dst.
@@ -100,6 +94,13 @@
# DONE
* cache structure information per-class
* fix setFieldOrder to *always* apply if used
* Make a separate jar file for all OS-specific headers
Maybe make interfaces per-header file (winbase, winnt, stdlib, etc),
aggregated per-library (interface CLibrary extends stdlib, stdio, etc)
(how useful would it really be, or is this just sorting legos?)
o same for windowutils, fileutils, etc. (not useful)
* check Structure "final" fields; should never write back to native memory
* OSX ObjC access (see rococoa)
* do Structure.write for any callback args
@@ -259,11 +260,6 @@ int findNativeWindow(Window w);
exception if the value is out of bounds).
o when used as struct fields, could allow detection of field order by order
of initialization (requires all-or-nothing usage, though)
* Make a separate jar file for all OS-specific headers
Maybe make interfaces per-header file (winbase, winnt, stdlib, etc),
aggregated per-library (interface CLibrary extends stdlib, stdio, etc)
(how useful would it really be, or is this just sorting legos?)
o same for windowutils, fileutils, etc. (not useful)
* StringBuffer/StringBuilder as mutable char*/wchar_t* argument
NOTE: byte[]/char[] is probably better; it's trivial to convert to String
and native code can't change the size anyway
+1090
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+8
Ver Arquivo
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/jnalib/dist/jna.jar"/>
<classpathentry kind="src" path="/platform"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+17
Ver Arquivo
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>alphamaskdemo</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
+66
Ver Arquivo
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="jnacontrib.alphamaskdemo" default="jar" basedir=".">
<description>Builds, tests, and runs the project jnacontrib.alphamaskdemo.</description>
<!-- Locations -->
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-alphamask.jar"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.contrib.demo.AlphaMaskDemo" />
<path id="classpath">
<fileset file="${file.reference.jna.jar}"/>
<fileset dir="../platform/dist" includes="platform.jar"/>
</path>
<!-- Run Demo. -->
<target name="run" depends="compile">
<java classname="${main-class}" fork="true">
<classpath>
<pathelement location="${classes}" />
<path refid="classpath"/>
</classpath>
</java>
</target>
<!-- Delete class and jar files. -->
<target name="clean">
<delete dir="${classes}"/>
<delete file="${jar}"/>
<delete dir="${build}"/>
</target>
<!-- Compile all classes. -->
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.5" source="1.5"
encoding="UTF-8" debug="on" includeantruntime="false">
<classpath>
<path refid="classpath"/>
</classpath>
</javac>
</target>
<!-- Create jar-file. -->
<target name="jar" depends="compile">
<!-- Copy all non-java files to classes. -->
<copy todir="${classes}/com">
<fileset dir="${src}/com">
<exclude name="**/*.java"/>
</fileset>
</copy>
<jar jarfile="${jar}" basedir="${classes}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
<!-- platform -->
<fileset dir="../platform/build/classes/com"/>
<!-- jna -->
<zipfileset src="${file.reference.jna.jar}"/>
</jar>
</target>
</project>
@@ -10,9 +10,9 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package com.sun.jna.examples;
import java.awt.event.*;
package com.sun.jna.contrib.demo;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics;
@@ -26,6 +26,7 @@ import java.awt.Window;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
@@ -38,6 +39,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JFrame;
@@ -52,23 +54,26 @@ import javax.swing.border.EmptyBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.MouseInputAdapter;
import com.sun.jna.Native;
import com.sun.jna.NativeLong;
import com.sun.jna.Pointer;
import com.sun.jna.examples.unix.X11;
import com.sun.jna.examples.unix.X11.Display;
import com.sun.jna.examples.unix.X11.GC;
import com.sun.jna.examples.unix.X11.XSetWindowAttributes;
import com.sun.jna.examples.win32.GDI32;
import com.sun.jna.examples.win32.User32;
import com.sun.jna.examples.win32.GDI32.BITMAPINFO;
import com.sun.jna.examples.win32.User32.BLENDFUNCTION;
import com.sun.jna.examples.win32.User32.POINT;
import com.sun.jna.examples.win32.User32.SIZE;
import com.sun.jna.examples.win32.W32API.HANDLE;
import com.sun.jna.examples.win32.W32API.HBITMAP;
import com.sun.jna.examples.win32.W32API.HDC;
import com.sun.jna.examples.win32.W32API.HWND;
import com.sun.jna.platform.WindowUtils;
import com.sun.jna.platform.unix.X11;
import com.sun.jna.platform.unix.X11.Display;
import com.sun.jna.platform.unix.X11.GC;
import com.sun.jna.platform.win32.GDI32;
import com.sun.jna.platform.win32.User32;
import com.sun.jna.platform.win32.WinGDI;
import com.sun.jna.platform.win32.WinUser;
import com.sun.jna.platform.win32.WinDef.HBITMAP;
import com.sun.jna.platform.win32.WinDef.HDC;
import com.sun.jna.platform.win32.WinDef.HWND;
import com.sun.jna.platform.win32.WinGDI.BITMAPINFO;
import com.sun.jna.platform.win32.WinNT.HANDLE;
import com.sun.jna.platform.win32.WinUser.BLENDFUNCTION;
import com.sun.jna.platform.win32.WinUser.POINT;
import com.sun.jna.platform.win32.WinUser.SIZE;
import com.sun.jna.ptr.PointerByReference;
// TODO: put this into a reasonable API; right now this is pretty much
@@ -124,7 +129,7 @@ public class AlphaMaskDemo implements Runnable {
private com.sun.jna.Memory buffer;
private int[] pixels;
private void updateX11(boolean a, boolean i) {
private void updateX11(boolean a, boolean i) {
X11 x11 = X11.INSTANCE;
X11.Window win = X11.Window.None;
Display dpy = x11.XOpenDisplay(null);
@@ -227,9 +232,9 @@ public class AlphaMaskDemo implements Runnable {
if (!alphaWindow.isDisplayable()) {
alphaWindow.pack();
hWnd = getHwnd(alphaWindow);
int flags = user.GetWindowLong(hWnd, User32.GWL_EXSTYLE);
flags |= User32.WS_EX_LAYERED;
user.SetWindowLong(hWnd, User32.GWL_EXSTYLE, flags);
int flags = user.GetWindowLong(hWnd, WinUser.GWL_EXSTYLE);
flags |= WinUser.WS_EX_LAYERED;
user.SetWindowLong(hWnd, WinUser.GWL_EXSTYLE, flags);
Window parent = alphaWindow.getOwner();
Point where = parent.getLocationOnScreen();
where.translate(parent.getWidth(), 0);
@@ -257,11 +262,11 @@ public class AlphaMaskDemo implements Runnable {
bmi.bmiHeader.biHeight = h;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 32;
bmi.bmiHeader.biCompression = GDI32.BI_RGB;
bmi.bmiHeader.biCompression = WinGDI.BI_RGB;
bmi.bmiHeader.biSizeImage = w * h * 4;
PointerByReference ppbits = new PointerByReference();
hBitmap = gdi.CreateDIBSection(memDC, bmi, GDI32.DIB_RGB_COLORS,
hBitmap = gdi.CreateDIBSection(memDC, bmi, WinGDI.DIB_RGB_COLORS,
ppbits, null, 0);
oldBitmap = gdi.SelectObject(memDC, hBitmap);
Pointer pbits = ppbits.getValue();
@@ -290,9 +295,9 @@ public class AlphaMaskDemo implements Runnable {
POINT srcLoc = new POINT();
BLENDFUNCTION blend = new BLENDFUNCTION();
blend.SourceConstantAlpha = (byte)(alpha * 255);
blend.AlphaFormat = User32.AC_SRC_ALPHA;
blend.AlphaFormat = WinUser.AC_SRC_ALPHA;
user.UpdateLayeredWindow(hWnd, screenDC, loc, size, memDC, srcLoc,
0, blend, User32.ULW_ALPHA);
0, blend, WinUser.ULW_ALPHA);
}
finally {
user.ReleaseDC(null, screenDC);
@@ -306,9 +311,9 @@ public class AlphaMaskDemo implements Runnable {
else if (a) {
BLENDFUNCTION blend = new BLENDFUNCTION();
blend.SourceConstantAlpha = (byte)(alpha * 255);
blend.AlphaFormat = User32.AC_SRC_ALPHA;
blend.AlphaFormat = WinUser.AC_SRC_ALPHA;
user.UpdateLayeredWindow(hWnd, null, null, null, null, null,
0, blend, User32.ULW_ALPHA);
0, blend, WinUser.ULW_ALPHA);
}
if (!alphaWindow.isVisible()) {
@@ -383,8 +388,9 @@ public class AlphaMaskDemo implements Runnable {
JPanel p = new JPanel(new BorderLayout(8, 8));
p.setBorder(new EmptyBorder(8, 8, 8, 8));
p.setTransferHandler(new TransferHandler() {
private static final long serialVersionUID = 1L;
public boolean canImport(JComponent comp, DataFlavor[] transferFlavors) {
List list = Arrays.asList(transferFlavors);
List<DataFlavor> list = Arrays.asList(transferFlavors);
if (list.contains(URL_FLAVOR)
|| list.contains(URI_LIST_FLAVOR)
|| list.contains(DataFlavor.imageFlavor)
@@ -421,8 +427,8 @@ public class AlphaMaskDemo implements Runnable {
return true;
}
if (t.isDataFlavorSupported(DataFlavor.javaFileListFlavor)){
List files = (List)t.getTransferData(DataFlavor.javaFileListFlavor);
File f = (File)files.get(0);
List<File> files = (List<File>) t.getTransferData(DataFlavor.javaFileListFlavor);
File f = files.get(0);
URL url = new URL("file://" + f.toURI().toURL().getPath());
Image image = Toolkit.getDefaultToolkit().getImage(url);
setImage(image);
@@ -8,10 +8,10 @@
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more details.
*/
package com.sun.jna.examples;
package com.sun.jna.contrib.demo;
import java.awt.Cursor;
import java.awt.BorderLayout;
import java.awt.Cursor;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsEnvironment;
import java.awt.Image;
@@ -52,6 +52,8 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.MouseInputAdapter;
import com.sun.jna.platform.WindowUtils;
public class AlphaMaskDemo2 implements Runnable {
private static final DataFlavor URL_FLAVOR =
new DataFlavor("application/x-java-url; class=java.net.URL", "URL");
@@ -143,9 +145,10 @@ public class AlphaMaskDemo2 implements Runnable {
JPanel p = new JPanel(new BorderLayout(8, 8));
p.setBorder(new EmptyBorder(8, 8, 8, 8));
p.setTransferHandler(new TransferHandler() {
public boolean canImport(JComponent comp,
private static final long serialVersionUID = 1L;
public boolean canImport(JComponent comp,
DataFlavor[] transferFlavors) {
List list = Arrays.asList(transferFlavors);
List<DataFlavor> list = Arrays.asList(transferFlavors);
if (list.contains(URL_FLAVOR) || list.contains(URI_LIST_FLAVOR)
|| list.contains(DataFlavor.imageFlavor)
|| list.contains(DataFlavor.javaFileListFlavor)) {
@@ -183,9 +186,8 @@ public class AlphaMaskDemo2 implements Runnable {
return true;
}
if (t.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
List files = (List)t
.getTransferData(DataFlavor.javaFileListFlavor);
File f = (File)files.get(0);
List<File> files = (List<File>) t.getTransferData(DataFlavor.javaFileListFlavor);
File f = files.get(0);
URL url = new URL("file://"
+ f.toURI().toURL().getPath());
Image image = Toolkit.getDefaultToolkit().getImage(url);

Antes

Largura:  |  Altura:  |  Tamanho: 18 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 18 KiB

+7
Ver Arquivo
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="/platform"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+17
Ver Arquivo
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>balloonmanagerdemo</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
+68
Ver Arquivo
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="jnacontrib.balloonmanagerdemo" default="jar" basedir=".">
<description>Builds, tests, and runs the project jnacontrib.balloonmanagerdemo.</description>
<!-- Locations -->
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-balloonmanager.jar"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.contrib.demo.BalloonManagerDemo" />
<path id="classpath">
<fileset file="${file.reference.jna.jar}"/>
<fileset dir="../platform/dist" includes="platform.jar"/>
</path>
<!-- Run Demo. -->
<target name="run" depends="compile">
<java classname="${main-class}" fork="true">
<classpath>
<pathelement location="${classes}" />
<path refid="classpath"/>
</classpath>
</java>
</target>
<!-- Delete class and jar files. -->
<target name="clean">
<delete dir="${classes}"/>
<delete file="${jar}"/>
<delete dir="${build}"/>
</target>
<!-- Compile all classes. -->
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.5" source="1.5"
encoding="UTF-8" debug="on" includeantruntime="false">
<classpath>
<path refid="classpath"/>
</classpath>
</javac>
</target>
<!-- Create jar-file. -->
<target name="jar" depends="compile">
<!-- Copy all non-java files to classes. -->
<copy todir="${classes}/com">
<fileset dir="${src}/com">
<exclude name="**/*.java"/>
</fileset>
</copy>
<jar jarfile="${jar}" basedir="${classes}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
<!-- platform -->
<fileset dir="../platform/build/classes/com"/>
<!-- jna -->
<zipfileset src="${file.reference.jna.jar}"/>
</jar>
</target>
</project>
@@ -10,7 +10,7 @@
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for
* more details.
*/
package com.sun.jna.examples;
package com.sun.jna.contrib.demo;
import java.awt.BorderLayout;
import java.awt.Color;
@@ -31,11 +31,14 @@ import java.awt.geom.AffineTransform;
import java.awt.geom.Area;
import java.awt.geom.GeneralPath;
import java.awt.geom.RoundRectangle2D;
import javax.swing.Box;
import javax.swing.JWindow;
import javax.swing.Popup;
import javax.swing.SwingUtilities;
import com.sun.jna.platform.WindowUtils;
/**
* Provides a popup balloon containing an arbitrary component. This provides
* a form of content-specific decoration less transient than a tooltip, and less
@@ -54,6 +57,7 @@ public class BalloonManager {
}
private static class DropShadow extends JWindow {
private static final long serialVersionUID = 1L;
private static final float SHADOW_ALPHA = .25f;
private static final float YSCALE = .80f;
private static final double ANGLE = 2*Math.PI/24;
@@ -146,6 +150,7 @@ public class BalloonManager {
}
private static final class BubbleWindow extends JWindow {
private static final long serialVersionUID = 1L;
private static final int Y_OFFSET = 50;
private static final int ARC = 25;
@@ -10,7 +10,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package com.sun.jna.examples;
package com.sun.jna.contrib.demo;
import java.awt.BasicStroke;
import java.awt.Color;
@@ -24,6 +24,7 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.geom.Rectangle2D;
import javax.swing.Icon;
import javax.swing.JFrame;
import javax.swing.JLabel;
@@ -35,6 +36,8 @@ import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;
import com.sun.jna.platform.WindowUtils;
/** Demonstration of BalloonManager. */
public class BalloonManagerDemo {
private static final int ICON_SIZE = 48;
+7
Ver Arquivo
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="/platform"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+17
Ver Arquivo
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>balloontips</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -1,3 +1,5 @@
An implementation of balloon tips.
Compile the two classes in this directory. Requires Java 1.5+.
javac -cp examples.jar *.java
+68
Ver Arquivo
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="jnacontrib.balloontipsdemo" default="jar" basedir=".">
<description>Builds, tests, and runs the project jnacontrib.balloontipsdemo.</description>
<!-- Locations -->
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-balloontips.jar"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.contrib.demo.FilteredTextField" />
<path id="classpath">
<fileset file="${file.reference.jna.jar}"/>
<fileset dir="../platform/dist" includes="platform.jar"/>
</path>
<!-- Run Demo. -->
<target name="run" depends="compile">
<java classname="${main-class}" fork="true">
<classpath>
<pathelement location="${classes}" />
<path refid="classpath"/>
</classpath>
</java>
</target>
<!-- Delete class and jar files. -->
<target name="clean">
<delete dir="${classes}"/>
<delete file="${jar}"/>
<delete dir="${build}"/>
</target>
<!-- Compile all classes. -->
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.5" source="1.5"
encoding="UTF-8" debug="on" includeantruntime="false">
<classpath>
<path refid="classpath"/>
</classpath>
</javac>
</target>
<!-- Create jar-file. -->
<target name="jar" depends="compile">
<!-- Copy all non-java files to classes. -->
<copy todir="${classes}/com">
<fileset dir="${src}/com">
<exclude name="**/*.java"/>
</fileset>
</copy>
<jar jarfile="${jar}" basedir="${classes}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
<!-- platform -->
<fileset dir="../platform/build/classes/com"/>
<!-- jna -->
<zipfileset src="${file.reference.jna.jar}"/>
</jar>
</target>
</project>
@@ -1,4 +1,4 @@
//package bms.ui.widgets;
package com.sun.jna.contrib.demo;
import java.awt.Color;
import java.awt.Component;
@@ -30,7 +30,7 @@ import javax.swing.Popup;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
import com.sun.jna.examples.WindowUtils;
import com.sun.jna.platform.WindowUtils;
/**
* The BalloonTipManager class handles creation and disposal of balloon style
@@ -61,8 +61,8 @@ public class BalloonTipManager {
/*
* The BalloonTip class defines the look of the BalloonTip object.
*/
@SuppressWarnings("serial")
private static final class BalloonTip extends JWindow {
private static final long serialVersionUID = 1L;
private static final Integer HMARGIN = 10;
private static final Integer VMARGIN = 6;
private static final Integer VSPACER = 4;
@@ -476,7 +476,6 @@ public class BalloonTipManager {
/*
* This class handles events spawned from moving the component.
*/
@SuppressWarnings("serial")
final class ComponentEar extends ComponentAdapter {
/*
* (non-Javadoc)
@@ -491,7 +490,6 @@ public class BalloonTipManager {
/*
* This class handles events spawned when a mouse button is pressed.
*/
@SuppressWarnings("serial")
final class MouseEar extends MouseAdapter {
/*
* (non-Javadoc)
@@ -506,7 +504,6 @@ public class BalloonTipManager {
/*
* This class handles events spawned when the component loses focus.
*/
@SuppressWarnings("serial")
final class FocusEar extends FocusAdapter {
/*
* (non-Javadoc)
@@ -1,4 +1,4 @@
//package bms.ui.widgets;
package com.sun.jna.contrib.demo;
import java.awt.BorderLayout;
import java.awt.Color;
@@ -8,6 +8,7 @@ import java.util.ArrayList;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.Popup;
@@ -398,7 +399,7 @@ public class FilteredTextField extends JTextField {
catch (Exception e) {
e.printStackTrace();
}
JFrame jframe = new JFrame("FilteredTextField Test");
JFrame jframe = new JFrame("Balloon Tips on FilteredTextField");
jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jframe.setSize(400, 75);
jframe.setLocation(400, 400);
@@ -414,6 +415,7 @@ public class FilteredTextField extends JTextField {
"Only lower case letters, hyphens, underscores, and spaces allowed.");
ftfield.setValidRegex("^a+[a-z-_ ]*");
ftfield.setValidError("The string must begin with the letter 'a'.");
jpanel.add(new JLabel("Type some text into either field"), BorderLayout.NORTH);
jpanel.add(ftfield, BorderLayout.CENTER);
jpanel.add(new FilteredTextField(10), BorderLayout.SOUTH);
jframe.getContentPane().add(jpanel);
+8
Ver Arquivo
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/jnalib/dist/jna.jar"/>
<classpathentry kind="src" path="/platform"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+17
Ver Arquivo
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>dnddemo</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
+68
Ver Arquivo
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="jnacontrib.dnddemo" default="jar" basedir=".">
<description>Builds, tests, and runs the project jnacontrib.dnddemo.</description>
<!-- Locations -->
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-dnd.jar"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.contrib.demo.GhostedDragImageDemo" />
<path id="classpath">
<fileset file="${file.reference.jna.jar}"/>
<fileset dir="../platform/dist" includes="platform.jar"/>
</path>
<!-- Run Demo. -->
<target name="run" depends="compile">
<java classname="${main-class}" fork="true">
<classpath>
<pathelement location="${classes}" />
<path refid="classpath"/>
</classpath>
</java>
</target>
<!-- Delete class and jar files. -->
<target name="clean">
<delete dir="${classes}"/>
<delete file="${jar}"/>
<delete dir="${build}"/>
</target>
<!-- Compile all classes. -->
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.5" source="1.5"
encoding="UTF-8" debug="on" includeantruntime="false">
<classpath>
<path refid="classpath"/>
</classpath>
</javac>
</target>
<!-- Create jar-file. -->
<target name="jar" depends="compile">
<!-- Copy all non-java files to classes. -->
<copy todir="${classes}/com">
<fileset dir="${src}/com">
<exclude name="**/*.java"/>
</fileset>
</copy>
<jar jarfile="${jar}" basedir="${classes}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
<!-- platform -->
<fileset dir="../platform/build/classes/com"/>
<!-- jna -->
<zipfileset src="${file.reference.jna.jar}"/>
</jar>
</target>
</project>
@@ -10,7 +10,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package com.sun.jna.examples.dnd;
package com.sun.jna.contrib.demo;
import java.awt.Image;
import java.awt.Point;
@@ -32,6 +32,10 @@ import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.UIManager;
import com.sun.jna.platform.dnd.DragHandler;
import com.sun.jna.platform.dnd.DropHandler;
/** Demonstrate ghosted drag images. Unfortunately, Swing drag support hides
* the hooks we need to move the drag image around, so we don't use it and
* roll our own.
@@ -59,7 +63,8 @@ public class GhostedDragImageDemo {
}
public static class DragLabel extends JLabel {
private boolean dragging;
private static final long serialVersionUID = 1L;
private boolean dragging;
public DragLabel(Icon icon) {
super(icon);
new DragHandler(this, DnDConstants.ACTION_COPY_OR_MOVE) {

Antes

Largura:  |  Altura:  |  Tamanho: 28 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 28 KiB

+10
Ver Arquivo
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" output="build.eclipse/contrib-test-classes" path="test"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/jnalib"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
<classpathentry kind="lib" path="/jnalib/dist/jna.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+17
Ver Arquivo
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ntservice</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -19,7 +19,7 @@ is divided into following sections:
- cleanup
-->
<project name="JnaContrib-impl" default="default" basedir=".." xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:jaxws="http://www.netbeans.org/ns/jax-ws/1">
<project name="ntservice-impl" default="default" basedir=".." xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:jaxws="http://www.netbeans.org/ns/jax-ws/1">
<target name="default" depends="test,jar,javadoc" description="Build and test whole project."/>
<!--
======================
@@ -14,17 +14,18 @@ debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/JnaContrib.jar
dist.jar=${dist.dir}/contrib-ntservice.jar
dist.javadoc.dir=${dist.dir}/javadoc
file.reference.jna.jar=lib/jna.jar
file.reference.jna.jar=../../build/jna.jar
libs.junit.classpath=../../lib/junit.jar
jar.compress=false
javac.classpath=\
${file.reference.jna.jar}
${file.reference.jna.jar};
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.source=1.6
javac.target=1.6
javac.source=1.5
javac.target=1.5
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
@@ -3,7 +3,7 @@
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>JnaContrib</name>
<name>ntservice</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<source-roots>
<root id="src.dir"/>
@@ -0,0 +1,196 @@
/*
* Advapi32.java
*
* Created on 6. August 2007, 11:24
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package jnacontrib.jna;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.WString;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
/**
*
* @author TB
*/
public interface Advapi32 extends StdCallLibrary {
Advapi32 INSTANCE = (Advapi32) Native.loadLibrary("Advapi32",
Advapi32.class, W32APIOptions.UNICODE_OPTIONS);
/*
* SC_HANDLE WINAPI OpenSCManager( LPCTSTR lpMachineName, LPCTSTR
* lpDatabaseName, DWORD dwDesiredAccess );
*/
public Pointer OpenSCManager(String lpMachineName, WString lpDatabaseName,
int dwDesiredAccess);
/*
* BOOL WINAPI CloseServiceHandle( SC_HANDLE hSCObject );
*/
public boolean CloseServiceHandle(Pointer hSCObject);
/*
* SC_HANDLE WINAPI OpenService( SC_HANDLE hSCManager, LPCTSTR
* lpServiceName, DWORD dwDesiredAccess );
*/
public Pointer OpenService(Pointer hSCManager, String lpServiceName,
int dwDesiredAccess);
/*
* BOOL WINAPI StartService( SC_HANDLE hService, DWORD dwNumServiceArgs,
* LPCTSTR* lpServiceArgVectors );
*/
public boolean StartService(Pointer hService, int dwNumServiceArgs,
char[] lpServiceArgVectors);
/*
* BOOL WINAPI ControlService( SC_HANDLE hService, DWORD dwControl,
* LPSERVICE_STATUS lpServiceStatus );
*/
public boolean ControlService(Pointer hService, int dwControl,
SERVICE_STATUS lpServiceStatus);
/*
* BOOL WINAPI StartServiceCtrlDispatcher( const SERVICE_TABLE_ENTRY*
* lpServiceTable );
*/
public boolean StartServiceCtrlDispatcher(Structure[] lpServiceTable);
/*
* SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandler( LPCTSTR
* lpServiceName, LPHANDLER_FUNCTION lpHandlerProc );
*/
public Pointer RegisterServiceCtrlHandler(String lpServiceName,
Handler lpHandlerProc);
/*
* SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerEx( LPCTSTR
* lpServiceName, LPHANDLER_FUNCTION_EX lpHandlerProc, LPVOID lpContext );
*/
public Pointer RegisterServiceCtrlHandlerEx(String lpServiceName,
HandlerEx lpHandlerProc, Pointer lpContext);
/*
* BOOL WINAPI SetServiceStatus( SERVICE_STATUS_HANDLE hServiceStatus,
* LPSERVICE_STATUS lpServiceStatus );
*/
public boolean SetServiceStatus(Pointer hServiceStatus,
SERVICE_STATUS lpServiceStatus);
/*
* SC_HANDLE WINAPI CreateService( SC_HANDLE hSCManager, LPCTSTR
* lpServiceName, LPCTSTR lpDisplayName, DWORD dwDesiredAccess, DWORD
* dwServiceType, DWORD dwStartType, DWORD dwErrorControl, LPCTSTR
* lpBinaryPathName, LPCTSTR lpLoadOrderGroup, LPDWORD lpdwTagId, LPCTSTR
* lpDependencies, LPCTSTR lpServiceStartName, LPCTSTR lpPassword );
*/
public Pointer CreateService(Pointer hSCManager, String lpServiceName,
String lpDisplayName, int dwDesiredAccess, int dwServiceType,
int dwStartType, int dwErrorControl, String lpBinaryPathName,
String lpLoadOrderGroup, IntByReference lpdwTagId,
String lpDependencies, String lpServiceStartName, String lpPassword);
/*
* BOOL WINAPI DeleteService( SC_HANDLE hService );
*/
public boolean DeleteService(Pointer hService);
/*
* BOOL WINAPI ChangeServiceConfig2( SC_HANDLE hService, DWORD dwInfoLevel,
* LPVOID lpInfo );
*/
public boolean ChangeServiceConfig2(Pointer hService, int dwInfoLevel,
ChangeServiceConfig2Info lpInfo);
/*
* LONG WINAPI RegEnumValue( HKEY hKey, DWORD dwIndex, LPTSTR lpValueName,
* LPDWORD lpcchValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE
* lpData, LPDWORD lpcbData );
*/
public int RegEnumValue(int hKey, int dwIndex, char[] lpValueName,
IntByReference lpcchValueName, IntByReference reserved,
IntByReference lpType, byte[] lpData, IntByReference lpcbData);
interface SERVICE_MAIN_FUNCTION extends StdCallCallback {
/*
* VOID WINAPI ServiceMain( DWORD dwArgc, LPTSTR* lpszArgv );
*/
public void callback(int dwArgc, Pointer lpszArgv);
}
interface Handler extends StdCallCallback {
/*
* VOID WINAPI Handler( DWORD fdwControl );
*/
public void callback(int fdwControl);
}
interface HandlerEx extends StdCallCallback {
/*
* DWORD WINAPI HandlerEx( DWORD dwControl, DWORD dwEventType, LPVOID
* lpEventData, LPVOID lpContext );
*/
public int callback(int dwControl, int dwEventType,
Pointer lpEventData, Pointer lpContext);
}
/*
* typedef struct _SERVICE_STATUS { DWORD dwServiceType; DWORD
* dwCurrentState; DWORD dwControlsAccepted; DWORD dwWin32ExitCode; DWORD
* dwServiceSpecificExitCode; DWORD dwCheckPoint; DWORD dwWaitHint; }
* SERVICE_STATUS,LPSERVICE_STATUS;
*/
public static class SERVICE_STATUS extends Structure {
public int dwServiceType;
public int dwCurrentState;
public int dwControlsAccepted;
public int dwWin32ExitCode;
public int dwServiceSpecificExitCode;
public int dwCheckPoint;
public int dwWaitHint;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "dwServiceType", "dwCurrentState", "dwControlsAccepted", "dwWin32ExitCode", "dwServiceSpecificExitCode", "dwCheckPoint", "dwWaitHint" });
}
}
/*
* typedef struct _SERVICE_TABLE_ENTRY { LPTSTR lpServiceName;
* LPSERVICE_MAIN_FUNCTION lpServiceProc; } SERVICE_TABLE_ENTRY,
* LPSERVICE_TABLE_ENTRY;
*/
public static class SERVICE_TABLE_ENTRY extends Structure {
public String lpServiceName;
public SERVICE_MAIN_FUNCTION lpServiceProc;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "lpServiceName", "lpServiceProc" });
}
}
public static abstract class ChangeServiceConfig2Info extends Structure {
}
/*
* typedef struct _SERVICE_DESCRIPTION { LPTSTR lpDescription; }
* SERVICE_DESCRIPTION,LPSERVICE_DESCRIPTION;
*/
public static class SERVICE_DESCRIPTION extends ChangeServiceConfig2Info {
public String lpDescription;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "lpDescription" });
}
}
}
@@ -0,0 +1,36 @@
/*
* WINNT.java
*
* Created on 8. August 2007, 13:41
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package jnacontrib.jna;
/**
*
* @author TB
*/
public interface WINNT {
public final static int DELETE = 0x00010000;
public final static int READ_CONTROL = 0x00020000;
public final static int WRITE_DAC = 0x00040000;
public final static int WRITE_OWNER = 0x00080000;
public final static int SYNCHRONIZE = 0x00100000;
public final static int STANDARD_RIGHTS_REQUIRED = 0x000F0000;
public final static int STANDARD_RIGHTS_READ = READ_CONTROL;
public final static int STANDARD_RIGHTS_WRITE = READ_CONTROL;
public final static int STANDARD_RIGHTS_EXECUTE = READ_CONTROL;
public final static int STANDARD_RIGHTS_ALL = 0x001F0000;
public final static int SPECIFIC_RIGHTS_ALL = 0x0000FFFF;
public final static int GENERIC_EXECUTE = 0x20000000;
public final static int SERVICE_WIN32_OWN_PROCESS = 0x00000010;
}
@@ -9,11 +9,6 @@
package jnacontrib.jna;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.ptr.PointerByReference;
import com.sun.jna.win32.StdCallLibrary.StdCallCallback;
/**
*
@@ -180,7 +180,6 @@ public abstract class Win32Service {
*/
public void init() {
Advapi32 advapi32;
Advapi32.SERVICE_TABLE_ENTRY[] entries = new Advapi32.SERVICE_TABLE_ENTRY[2];
Advapi32.SERVICE_TABLE_ENTRY entry;
serviceMain = new ServiceMain();
+2
Ver Arquivo
@@ -0,0 +1,2 @@
# placeholder
+10
Ver Arquivo
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" output="build.eclipse/contrib-test-classes" path="test"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/jnalib"/>
<classpathentry kind="lib" path="/jnalib/dist/jna.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+17
Ver Arquivo
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>platform</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
+89
Ver Arquivo
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="platform" default="default" basedir=".">
<description>Builds, tests, and runs the project platform.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar-with-manifest: JAR building (if you are using a manifest)
-do-jar-without-manifest: JAR building (if you are not using a manifest)
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="JnaContrib-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
<condition property="tests.platform" value="test-win32">
<os family="windows"/>
</condition>
<condition property="tests.platform" value="test-osx">
<os family="mac"/>
</condition>
<target name="test" depends="init,compile-test" description="Run unit tests." if="tests.platform">
<antcall target="${tests.platform}" />
</target>
<target name="test-report">
<junitreport todir="${build.test.results.dir}">
<fileset dir="${build.test.results.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report todir="${build.test.results.dir}"/>
</junitreport>
<property name="build.test.results.dir.abs" location="${build.test.results.dir}"/>
<echo message="View test report in file://${build.test.results.dir.abs}/index.html" />
</target>
<target name="test-osx">
<echo>No platform tests yet for OSX</echo>
</target>
<target name="test-win32" depends="-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" />
</project>
+541
Ver Arquivo
@@ -0,0 +1,541 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
*** GENERATED FROM project.xml - DO NOT EDIT ***
*** EDIT ../build.xml INSTEAD ***
For the purpose of easier reading the script
is divided into following sections:
- initialization
- compilation
- jar
- execution
- debugging
- javadoc
- junit compilation
- junit execution
- junit debugging
- applet
- cleanup
-->
<project name="platform-impl" default="default" basedir=".." xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:jaxws="http://www.netbeans.org/ns/jax-ws/1">
<target name="default" depends="test,jar,javadoc" description="Build and test whole project."/>
<!--
======================
INITIALIZATION SECTION
======================
-->
<target name="-pre-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-init-private" depends="-pre-init">
<property file="nbproject/private/private.properties"/>
</target>
<target name="-init-user" depends="-pre-init,-init-private">
<property file="${user.properties.file}"/>
<!-- The two properties below are usually overridden -->
<!-- by the active platform. Just a fallback. -->
<property name="default.javac.source" value="1.4"/>
<property name="default.javac.target" value="1.4"/>
</target>
<target name="-init-project" depends="-pre-init,-init-private,-init-user">
<property file="nbproject/project.properties"/>
</target>
<target name="-do-init" depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property">
<available file="${manifest.file}" property="manifest.available"/>
<condition property="manifest.available+main.class">
<and>
<isset property="manifest.available"/>
<isset property="main.class"/>
<not>
<equals arg1="${main.class}" arg2="" trim="true"/>
</not>
</and>
</condition>
<condition property="manifest.available+main.class+mkdist.available">
<and>
<istrue value="${manifest.available+main.class}"/>
<isset property="libs.CopyLibs.classpath"/>
</and>
</condition>
<condition property="have.tests">
<or>
<available file="${test.src.dir}"/>
</or>
</condition>
<condition property="have.sources">
<or>
<available file="${src.dir}"/>
</or>
</condition>
<condition property="netbeans.home+have.tests">
<and>
<isset property="netbeans.home"/>
<isset property="have.tests"/>
</and>
</condition>
<condition property="no.javadoc.preview">
<isfalse value="${javadoc.preview}"/>
</condition>
<property name="run.jvmargs" value=""/>
<property name="javac.compilerargs" value=""/>
<property name="work.dir" value="${basedir}"/>
<condition property="no.deps">
<and>
<istrue value="${no.dependencies}"/>
</and>
</condition>
<property name="javac.debug" value="true"/>
<property name="javadoc.preview" value="true"/>
</target>
<target name="-post-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-init-check" depends="-pre-init,-init-private,-init-user,-init-project,-do-init">
<fail unless="src.dir">Must set src.dir</fail>
<fail unless="test.src.dir">Must set test.src.dir</fail>
<fail unless="build.dir">Must set build.dir</fail>
<fail unless="dist.dir">Must set dist.dir</fail>
<fail unless="build.classes.dir">Must set build.classes.dir</fail>
<fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
<fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
<fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
<fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
<fail unless="dist.jar">Must set dist.jar</fail>
</target>
<target name="-init-macrodef-property">
<macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute name="name"/>
<attribute name="value"/>
<sequential>
<property name="@{name}" value="${@{value}}"/>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-javac">
<macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute name="srcdir" default="${src.dir}"/>
<attribute name="destdir" default="${build.classes.dir}"/>
<attribute name="classpath" default="${javac.classpath}"/>
<attribute name="debug" default="${javac.debug}"/>
<element name="customize" optional="true"/>
<sequential>
<javac srcdir="@{srcdir}" destdir="@{destdir}" debug="@{debug}" deprecation="${javac.deprecation}" source="${javac.source}" target="${javac.target}" includeantruntime="false">
<classpath>
<path path="@{classpath}"/>
</classpath>
<compilerarg line="${javac.compilerargs}"/>
<customize/>
</javac>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-junit">
<macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute name="includes" default="**/*Test.java"/>
<sequential>
<junit showoutput="true" fork="true" dir="${basedir}" failureproperty="tests.failed" errorproperty="tests.failed">
<batchtest todir="${build.test.results.dir}">
<fileset dir="${test.src.dir}" includes="@{includes}"/>
</batchtest>
<classpath>
<path path="${run.test.classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper type="glob" from="test-sys-prop.*" to="*"/>
</syspropertyset>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<jvmarg line="${run.jvmargs}"/>
</junit>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-nbjpda">
<macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute name="name" default="${main.class}"/>
<attribute name="classpath" default="${debug.classpath}"/>
<attribute name="stopclassname" default=""/>
<sequential>
<nbjpdastart transport="dt_socket" addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}">
<classpath>
<path path="@{classpath}"/>
</classpath>
</nbjpdastart>
</sequential>
</macrodef>
<macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute name="dir" default="${build.classes.dir}"/>
<sequential>
<nbjpdareload>
<fileset includes="${fix.includes}*.class" dir="@{dir}"/>
</nbjpdareload>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-debug">
<macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute name="classname" default="${main.class}"/>
<attribute name="classpath" default="${debug.classpath}"/>
<element name="customize" optional="true"/>
<sequential>
<java fork="true" classname="@{classname}" dir="${work.dir}">
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xnoagent"/>
<jvmarg value="-Djava.compiler=none"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
<jvmarg line="${run.jvmargs}"/>
<classpath>
<path path="@{classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="run-sys-prop."/>
<mapper type="glob" from="run-sys-prop.*" to="*"/>
</syspropertyset>
<customize/>
</java>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-java">
<macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute name="classname" default="${main.class}"/>
<element name="customize" optional="true"/>
<sequential>
<java fork="true" classname="@{classname}" dir="${work.dir}">
<jvmarg line="${run.jvmargs}"/>
<classpath>
<path path="${run.classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="run-sys-prop."/>
<mapper type="glob" from="run-sys-prop.*" to="*"/>
</syspropertyset>
<customize/>
</java>
</sequential>
</macrodef>
</target>
<target name="-init-presetdef-jar">
<presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
<jar jarfile="${dist.jar}" compress="${jar.compress}">
<j2seproject1:fileset dir="${build.classes.dir}"/>
</jar>
</presetdef>
</target>
<target name="init" depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar"/>
<!--
===================
COMPILATION SECTION
===================
-->
<target name="deps-jar" depends="init" unless="no.deps"/>
<target name="-pre-pre-compile" depends="init,deps-jar">
<mkdir dir="${build.classes.dir}"/>
</target>
<target name="-pre-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-do-compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile" if="have.sources">
<j2seproject3:javac/>
<copy todir="${build.classes.dir}">
<fileset dir="${src.dir}" excludes="${build.classes.excludes}"/>
</copy>
</target>
<target name="-post-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project."/>
<target name="-pre-compile-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-do-compile-single" depends="init,deps-jar,-pre-pre-compile">
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
<j2seproject3:javac>
<customize>
<patternset includes="${javac.includes}"/>
</customize>
</j2seproject3:javac>
</target>
<target name="-post-compile-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="compile-single" depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single"/>
<!--
====================
JAR BUILDING SECTION
====================
-->
<target name="-pre-pre-jar" depends="init">
<dirname property="dist.jar.dir" file="${dist.jar}"/>
<mkdir dir="${dist.jar.dir}"/>
</target>
<target name="-pre-jar">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-do-jar-without-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" unless="manifest.available">
<j2seproject1:jar/>
</target>
<target name="-do-jar-with-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" unless="manifest.available+main.class">
<j2seproject1:jar manifest="${manifest.file}"/>
</target>
<target name="-do-jar-with-mainclass" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" unless="manifest.available+main.class+mkdist.available">
<j2seproject1:jar manifest="${manifest.file}">
<j2seproject1:manifest>
<j2seproject1:attribute name="Main-Class" value="${main.class}"/>
</j2seproject1:manifest>
</j2seproject1:jar>
<echo>To run this application from the command line without Ant, try:</echo>
<property name="build.classes.dir.resolved" location="${build.classes.dir}"/>
<property name="dist.jar.resolved" location="${dist.jar}"/>
<pathconvert property="run.classpath.with.dist.jar">
<path path="${run.classpath}"/>
<map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
</pathconvert>
<echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
</target>
<target name="-do-jar-with-libraries" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available">
<property name="build.classes.dir.resolved" location="${build.classes.dir}"/>
<pathconvert property="run.classpath.without.build.classes.dir">
<path path="${run.classpath}"/>
<map from="${build.classes.dir.resolved}" to=""/>
</pathconvert>
<pathconvert property="jar.classpath" pathsep=" ">
<path path="${run.classpath.without.build.classes.dir}"/>
<chainedmapper>
<flattenmapper/>
<globmapper from="*" to="lib/*"/>
</chainedmapper>
</pathconvert>
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" name="copylibs" classpath="${libs.CopyLibs.classpath}"/>
<copylibs manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}" jarfile="${dist.jar}" compress="${jar.compress}">
<fileset dir="${build.classes.dir}"/>
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
<attribute name="Class-Path" value="${jar.classpath}"/>
</manifest>
</copylibs>
<echo>To run this application from the command line without Ant, try:</echo>
<property name="dist.jar.resolved" location="${dist.jar}"/>
<echo>java -jar "${dist.jar.resolved}"</echo>
</target>
<target name="-post-jar">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="jar" depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR."/>
<!--
=================
EXECUTION SECTION
=================
-->
<target name="run" depends="init,compile" description="Run a main class.">
<j2seproject1:java>
<customize>
<arg line="${application.args}"/>
</customize>
</j2seproject1:java>
</target>
<target name="run-single" depends="init,compile-single">
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
<j2seproject1:java classname="${run.class}"/>
</target>
<!--
=================
DEBUGGING SECTION
=================
-->
<target name="-debug-start-debugger" if="netbeans.home" depends="init">
<j2seproject1:nbjpdastart name="${debug.class}"/>
</target>
<target name="-debug-start-debuggee" depends="init,compile">
<j2seproject3:debug>
<customize>
<arg line="${application.args}"/>
</customize>
</j2seproject3:debug>
</target>
<target name="debug" if="netbeans.home" depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE."/>
<target name="-debug-start-debugger-stepinto" if="netbeans.home" depends="init">
<j2seproject1:nbjpdastart stopclassname="${main.class}"/>
</target>
<target name="debug-stepinto" if="netbeans.home" depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee"/>
<target name="-debug-start-debuggee-single" if="netbeans.home" depends="init,compile-single">
<fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
<j2seproject3:debug classname="${debug.class}"/>
</target>
<target name="debug-single" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single"/>
<target name="-pre-debug-fix" depends="init">
<fail unless="fix.includes">Must set fix.includes</fail>
<property name="javac.includes" value="${fix.includes}.java"/>
</target>
<target name="-do-debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,compile-single">
<j2seproject1:nbjpdareload/>
</target>
<target name="debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix"/>
<!--
===============
JAVADOC SECTION
===============
-->
<target name="-javadoc-build" depends="init">
<mkdir dir="${dist.javadoc.dir}"/>
<javadoc destdir="${dist.javadoc.dir}" source="${javac.source}" notree="${javadoc.notree}" use="${javadoc.use}" nonavbar="${javadoc.nonavbar}" noindex="${javadoc.noindex}" splitindex="${javadoc.splitindex}" author="${javadoc.author}" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}" private="${javadoc.private}" additionalparam="${javadoc.additionalparam}" failonerror="true" useexternalfile="true">
<classpath>
<path path="${javac.classpath}"/>
</classpath>
<sourcepath>
<pathelement location="${src.dir}"/>
</sourcepath>
<packageset dir="${src.dir}" includes="*/**"/>
<fileset dir="${src.dir}" includes="*.java"/>
</javadoc>
</target>
<target name="-javadoc-browse" if="netbeans.home" unless="no.javadoc.preview" depends="init,-javadoc-build">
<nbbrowse file="${dist.javadoc.dir}/index.html"/>
</target>
<target name="javadoc" depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc."/>
<!--
=========================
JUNIT COMPILATION SECTION
=========================
-->
<target name="-pre-pre-compile-test" if="have.tests" depends="init,compile">
<mkdir dir="${build.test.classes.dir}"/>
</target>
<target name="-pre-compile-test">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-do-compile-test" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test">
<j2seproject3:javac srcdir="${test.src.dir}" destdir="${build.test.classes.dir}" debug="true" classpath="${javac.test.classpath}"/>
<copy todir="${build.test.classes.dir}">
<fileset dir="${test.src.dir}" excludes="**/*.java"/>
</copy>
</target>
<target name="-post-compile-test">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="compile-test" depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test"/>
<target name="-pre-compile-test-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-do-compile-test-single" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single">
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
<j2seproject3:javac srcdir="${test.src.dir}" destdir="${build.test.classes.dir}" debug="true" classpath="${javac.test.classpath}">
<customize>
<patternset includes="${javac.includes}"/>
</customize>
</j2seproject3:javac>
<copy todir="${build.test.classes.dir}">
<fileset dir="${test.src.dir}" excludes="**/*.java"/>
</copy>
</target>
<target name="-post-compile-test-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="compile-test-single" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single"/>
<!--
=======================
JUNIT EXECUTION SECTION
=======================
-->
<target name="-pre-test-run" if="have.tests" depends="init">
<mkdir dir="${build.test.results.dir}"/>
</target>
<target name="-do-test-run" if="have.tests" depends="init,compile-test,-pre-test-run">
<j2seproject3:junit/>
</target>
<target name="-post-test-run" if="have.tests" depends="init,compile-test,-pre-test-run,-do-test-run">
<fail if="tests.failed">Some tests failed; see details above.</fail>
</target>
<target name="test-report" if="have.tests" depends="init"/>
<target name="-test-browse" if="netbeans.home+have.tests" depends="init"/>
<target name="test" depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests."/>
<target name="-pre-test-run-single" if="have.tests" depends="init">
<mkdir dir="${build.test.results.dir}"/>
</target>
<target name="-do-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single">
<fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
<j2seproject3:junit includes="${test.includes}"/>
</target>
<target name="-post-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single">
<fail if="tests.failed">Some tests failed; see details above.</fail>
</target>
<target name="test-single" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test."/>
<!--
=======================
JUNIT DEBUGGING SECTION
=======================
-->
<target name="-debug-start-debuggee-test" if="have.tests" depends="init,compile-test">
<fail unless="test.class">Must select one file in the IDE or set test.class</fail>
<j2seproject3:debug classname="junit.textui.TestRunner" classpath="${debug.test.classpath}">
<customize>
<arg line="${test.class}"/>
</customize>
</j2seproject3:debug>
</target>
<target name="-debug-start-debugger-test" if="netbeans.home+have.tests" depends="init,compile-test">
<j2seproject1:nbjpdastart name="${test.class}" classpath="${debug.test.classpath}"/>
</target>
<target name="debug-test" depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test"/>
<target name="-do-debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,compile-test-single">
<j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
</target>
<target name="debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix-test"/>
<!--
=========================
APPLET EXECUTION SECTION
=========================
-->
<target name="run-applet" depends="init,compile-single">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
<j2seproject1:java classname="sun.applet.AppletViewer">
<customize>
<arg value="${applet.url}"/>
</customize>
</j2seproject1:java>
</target>
<!--
=========================
APPLET DEBUGGING SECTION
=========================
-->
<target name="-debug-start-debuggee-applet" if="netbeans.home" depends="init,compile-single">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
<j2seproject3:debug classname="sun.applet.AppletViewer">
<customize>
<arg value="${applet.url}"/>
</customize>
</j2seproject3:debug>
</target>
<target name="debug-applet" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet"/>
<!--
===============
CLEANUP SECTION
===============
-->
<target name="deps-clean" depends="init" unless="no.deps"/>
<target name="-do-clean" depends="init">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<target name="-post-clean">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="clean" depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products."/>
</project>
@@ -1,67 +1,59 @@
application.args=
application.title=JNA Library
application.vendor=twall
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/jna.jar
dist.javadoc.dir=${dist.dir}/javadoc
excludes=
file.reference.jnalib-src=src
includes=**
jar.compress=false
javac.classpath=
# Space-separated list of extra javac options
javac.compilerargs=-Xlint:unchecked
javac.deprecation=false
javac.source=1.5
javac.target=1.5
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
${libs.junit.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
jnlp.codebase.type=local
jnlp.codebase.url=file:/Users/twall/ws/jna-release/dist/
jnlp.descriptor=application
jnlp.enabled=false
jnlp.offline-allowed=false
jnlp.signed=false
main.class=
meta.inf.dir=${src.dir}/META-INF
platform.active=default_platform
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
# or test-sys-prop.name=value to set system properties for unit tests):
run.jvmargs=-Djna.library.path=./build/native
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
src.dir=${file.reference.jnalib-src}
test.src.dir=test
application.args=
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/platform.jar
dist.javadoc.dir=${dist.dir}/javadoc
file.reference.jna.jar=../../build/jna.jar
libs.junit.classpath=../../lib/junit.jar
jar.compress=false
javac.classpath=\
${file.reference.jna.jar};
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.source=1.5
javac.target=1.5
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
${libs.junit.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
platform.active=default_platform
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
# or test-sys-prop.name=value to set system properties for unit tests):
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
src.dir=src
test.src.dir=test
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>JNA Library</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
</configuration>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>platform</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
</configuration>
</project>
@@ -0,0 +1,135 @@
/* Copyright (c) 2007 Timothy Wall, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* <p/>
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.EventObject;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.sun.jna.platform.win32.W32FileMonitor;
/** Provides notification of file system changes. Actual capabilities may
* vary slightly by platform.
* <p>
* Watched files which are removed from the filesystem are no longer watched.
* @author twall
*/
@SuppressWarnings("serial")
public abstract class FileMonitor {
public static final int FILE_CREATED = 0x1;
public static final int FILE_DELETED = 0x2;
public static final int FILE_MODIFIED = 0x4;
public static final int FILE_ACCESSED = 0x8;
public static final int FILE_NAME_CHANGED_OLD = 0x10;
public static final int FILE_NAME_CHANGED_NEW = 0x20;
public static final int FILE_RENAMED = FILE_NAME_CHANGED_OLD|FILE_NAME_CHANGED_NEW;
public static final int FILE_SIZE_CHANGED = 0x40;
public static final int FILE_ATTRIBUTES_CHANGED = 0x80;
public static final int FILE_SECURITY_CHANGED = 0x100;
public static final int FILE_ANY = 0x1FF;
public interface FileListener {
public void fileChanged(FileEvent e);
}
public class FileEvent extends EventObject {
private final File file;
private final int type;
public FileEvent(File file, int type) {
super(FileMonitor.this);
this.file = file;
this.type = type;
}
public File getFile() { return file; }
public int getType() { return type; }
public String toString() {
return "FileEvent: " + file + ":" + type;
}
}
private final Map<File, Integer> watched = new HashMap<File, Integer>();
private List<FileListener> listeners = new ArrayList<FileListener>();
protected abstract void watch(File file, int mask, boolean recursive) throws IOException ;
protected abstract void unwatch(File file);
public abstract void dispose();
public void addWatch(File dir) throws IOException {
addWatch(dir, FILE_ANY);
}
public void addWatch(File dir, int mask) throws IOException {
addWatch(dir, mask, dir.isDirectory());
}
public void addWatch(File dir, int mask, boolean recursive) throws IOException {
watched.put(dir, new Integer(mask));
watch(dir, mask, recursive);
}
public void removeWatch(File file) {
if (watched.remove(file) != null) {
unwatch(file);
}
}
protected void notify(FileEvent e) {
for (FileListener listener : listeners) {
listener.fileChanged(e);
}
}
public synchronized void addFileListener(FileListener listener) {
List<FileListener> list = new ArrayList<FileListener>(listeners);
list.add(listener);
listeners = list;
}
public synchronized void removeFileListener(FileListener x) {
List<FileListener> list = new ArrayList<FileListener>(listeners);
list.remove(x);
listeners = list;
}
protected void finalize() {
for (File watchedFile : watched.keySet()) {
removeWatch(watchedFile);
}
dispose();
}
/** Canonical lazy loading of a singleton. */
private static class Holder {
public static final FileMonitor INSTANCE;
static {
String os = System.getProperty("os.name");
if (os.startsWith("Windows")) {
INSTANCE = new W32FileMonitor();
}
else {
throw new Error("FileMonitor not implemented for " + os);
}
}
}
public static FileMonitor getInstance() {
return Holder.INSTANCE;
}
}
@@ -10,14 +10,15 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package com.sun.jna.examples;
package com.sun.jna.platform;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.ArrayList;
import com.sun.jna.examples.win32.Shell32;
import com.sun.jna.examples.win32.Shell32.SHFILEOPSTRUCT;
import java.util.List;
import com.sun.jna.platform.mac.MacFileUtils;
import com.sun.jna.platform.win32.W32FileUtils;
/** Miscellaneous file utils not provided for by Java. */
public abstract class FileUtils {
@@ -50,56 +51,7 @@ public abstract class FileUtils {
public static FileUtils getInstance() {
return Holder.INSTANCE;
}
private static class W32FileUtils extends FileUtils {
public boolean hasTrash() { return true; }
public void moveToTrash(File[] files) throws IOException {
Shell32 shell = Shell32.INSTANCE;
SHFILEOPSTRUCT fileop = new SHFILEOPSTRUCT();
fileop.wFunc = Shell32.FO_DELETE;
String[] paths = new String[files.length];
for (int i=0;i < paths.length;i++) {
paths[i] = files[i].getAbsolutePath();
}
fileop.pFrom = fileop.encodePaths(paths);
fileop.fFlags = Shell32.FOF_ALLOWUNDO|Shell32.FOF_NOCONFIRMATION|Shell32.FOF_SILENT;
int ret = shell.SHFileOperation(fileop);
if (ret != 0) {
throw new IOException("Move to trash failed: " + ret);
}
if (fileop.fAnyOperationsAborted) {
throw new IOException("Move to trash aborted");
}
}
}
private static class MacFileUtils extends FileUtils {
public boolean hasTrash() { return true; }
public void moveToTrash(File[] files) throws IOException {
// TODO: use native API for moving to trash (if any)
File home = new File(System.getProperty("user.home"));
File trash = new File(home, ".Trash");
if (!trash.exists()) {
throw new IOException("The Trash was not found in its expected location (" + trash + ")");
}
List failed = new ArrayList();
for (int i=0;i < files.length;i++) {
File src = files[i];
File target = new File(trash, src.getName());
if (!src.renameTo(target)) {
failed.add(src);
}
}
if (failed.size() > 0) {
throw new IOException("The following files could not be trashed: " + failed);
}
}
}
}
private static class DefaultFileUtils extends FileUtils {
@@ -138,7 +90,7 @@ public abstract class FileUtils {
if (!trash.exists()) {
throw new IOException("No trash location found (define fileutils.trash to be the path to the trash)");
}
List failed = new ArrayList();
List<File> failed = new ArrayList<File>();
for (int i=0;i < files.length;i++) {
File src = files[i];
File target = new File(trash, src.getName());
@@ -10,16 +10,17 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package com.sun.jna.examples;
package com.sun.jna.platform;
import java.awt.GraphicsEnvironment;
import java.awt.HeadlessException;
import java.awt.event.KeyEvent;
import com.sun.jna.Platform;
import com.sun.jna.examples.unix.X11;
import com.sun.jna.examples.unix.X11.Display;
import com.sun.jna.examples.win32.User32;
import com.sun.jna.platform.unix.X11;
import com.sun.jna.platform.unix.X11.Display;
import com.sun.jna.platform.win32.User32;
import com.sun.jna.platform.win32.WinUser;
/** Provide access to the local keyboard state. Note that this is meaningless
* on a headless system and some VNC setups.
@@ -71,30 +72,30 @@ public class KeyboardUtils {
}
if (code == KeyEvent.VK_SHIFT) {
if ((loc & KeyEvent.KEY_LOCATION_RIGHT) != 0) {
return User32.VK_RSHIFT;
return WinUser.VK_RSHIFT;
}
if ((loc & KeyEvent.KEY_LOCATION_LEFT) != 0) {
return User32.VK_LSHIFT;
return WinUser.VK_LSHIFT;
}
return User32.VK_SHIFT;
return WinUser.VK_SHIFT;
}
if (code == KeyEvent.VK_CONTROL) {
if ((loc & KeyEvent.KEY_LOCATION_RIGHT) != 0) {
return User32.VK_RCONTROL;
return WinUser.VK_RCONTROL;
}
if ((loc & KeyEvent.KEY_LOCATION_LEFT) != 0) {
return User32.VK_LCONTROL;
return WinUser.VK_LCONTROL;
}
return User32.VK_CONTROL;
return WinUser.VK_CONTROL;
}
if (code == KeyEvent.VK_ALT) {
if ((loc & KeyEvent.KEY_LOCATION_RIGHT) != 0) {
return User32.VK_RMENU;
return WinUser.VK_RMENU;
}
if ((loc & KeyEvent.KEY_LOCATION_LEFT) != 0) {
return User32.VK_LMENU;
return WinUser.VK_LMENU;
}
return User32.VK_MENU;
return WinUser.VK_MENU;
}
return 0;
}
@@ -11,7 +11,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package com.sun.jna.examples;
package com.sun.jna.platform;
import java.awt.Rectangle;
import java.awt.image.DataBuffer;
@@ -44,7 +44,7 @@ public class RasterRangesUtils {
0x0008, 0x0004, 0x0002, 0x0001
};
private static final Comparator COMPARATOR = new Comparator() {
private static final Comparator<Object> COMPARATOR = new Comparator<Object>() {
public int compare(Object o1, Object o2) {
return ((Rectangle)o1).x - ((Rectangle)o2).x;
}
@@ -116,11 +116,11 @@ public class RasterRangesUtils {
* @return true if the output succeeded, false otherwise
*/
public static boolean outputOccupiedRangesOfBinaryPixels(byte[] binaryBits, int w, int h, RangesOutput out) {
Set rects = new HashSet();
Set prevLine = Collections.EMPTY_SET;
Set<Rectangle> rects = new HashSet<Rectangle>();
Set<Rectangle> prevLine = Collections.EMPTY_SET;
int scanlineBytes = binaryBits.length / h;
for (int row = 0; row < h; row++) {
Set curLine = new TreeSet(COMPARATOR);
Set<Rectangle> curLine = new TreeSet<Rectangle>(COMPARATOR);
int rowOffsetBytes = row * scanlineBytes;
int startCol = -1;
// Look at each batch of 8 columns in this row
@@ -163,14 +163,14 @@ public class RasterRangesUtils {
// end of last region
curLine.add(new Rectangle(startCol, row, w - startCol, 1));
}
Set unmerged = mergeRects(prevLine, curLine);
Set<Rectangle> unmerged = mergeRects(prevLine, curLine);
rects.addAll(unmerged);
prevLine = curLine;
}
// Add anything left over
rects.addAll(prevLine);
for (Iterator i=rects.iterator();i.hasNext();) {
Rectangle r = (Rectangle)i.next();
for (Iterator<Rectangle> i=rects.iterator();i.hasNext();) {
Rectangle r = i.next();
if (!out.outputRange(r.x, r.y, r.width, r.height)) {
return false;
}
@@ -189,10 +189,10 @@ public class RasterRangesUtils {
* @return true if the output succeeded, false otherwise
*/
public static boolean outputOccupiedRanges(int[] pixels, int w, int h, int occupationMask, RangesOutput out) {
Set rects = new HashSet();
Set prevLine = Collections.EMPTY_SET;
Set<Rectangle> rects = new HashSet<Rectangle>();
Set<Rectangle> prevLine = Collections.EMPTY_SET;
for (int row = 0; row < h; row++) {
Set curLine = new TreeSet(COMPARATOR);
Set<Rectangle> curLine = new TreeSet<Rectangle>(COMPARATOR);
int idxOffset = row * w;
int startCol = -1;
@@ -213,14 +213,14 @@ public class RasterRangesUtils {
// end of last region of current row
curLine.add(new Rectangle(startCol, row, w-startCol, 1));
}
Set unmerged = mergeRects(prevLine, curLine);
Set<Rectangle> unmerged = mergeRects(prevLine, curLine);
rects.addAll(unmerged);
prevLine = curLine;
}
// Add anything left over
rects.addAll(prevLine);
for (Iterator i=rects.iterator();i.hasNext();) {
Rectangle r = (Rectangle)i.next();
for (Iterator<Rectangle> i=rects.iterator();i.hasNext();) {
Rectangle r = i.next();
if (!out.outputRange(r.x, r.y, r.width, r.height)) {
return false;
}
@@ -228,11 +228,11 @@ public class RasterRangesUtils {
return true;
}
private static Set mergeRects(Set prev, Set current) {
Set unmerged = new HashSet(prev);
private static Set<Rectangle> mergeRects(Set<Rectangle> prev, Set<Rectangle> current) {
Set<Rectangle> unmerged = new HashSet<Rectangle>(prev);
if (!prev.isEmpty() && !current.isEmpty()) {
Rectangle[] pr = (Rectangle[])prev.toArray(new Rectangle[prev.size()]);
Rectangle[] cr = (Rectangle[])current.toArray(new Rectangle[current.size()]);
Rectangle[] pr = prev.toArray(new Rectangle[prev.size()]);
Rectangle[] cr = current.toArray(new Rectangle[current.size()]);
int ipr = 0;
int icr = 0;
while (ipr < pr.length && icr < cr.length) {
@@ -11,12 +11,12 @@
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package com.sun.jna.examples;
package com.sun.jna.platform;
import java.awt.AWTEvent;
import java.awt.AlphaComposite;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dialog;
@@ -31,15 +31,14 @@ import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.Toolkit;
import java.awt.event.AWTEventListener;
import java.awt.event.ContainerEvent;
import java.awt.event.MouseEvent;
import java.awt.AWTEvent;
import java.awt.Window;
import java.awt.event.AWTEventListener;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.ContainerEvent;
import java.awt.event.HierarchyEvent;
import java.awt.event.HierarchyListener;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.geom.Area;
@@ -63,24 +62,26 @@ import com.sun.jna.Native;
import com.sun.jna.NativeLong;
import com.sun.jna.Platform;
import com.sun.jna.Pointer;
import com.sun.jna.examples.unix.X11;
import com.sun.jna.examples.unix.X11.Display;
import com.sun.jna.examples.unix.X11.GC;
import com.sun.jna.examples.unix.X11.Pixmap;
import com.sun.jna.examples.unix.X11.XVisualInfo;
import com.sun.jna.examples.unix.X11.Xext;
import com.sun.jna.examples.unix.X11.Xrender.XRenderPictFormat;
import com.sun.jna.examples.win32.GDI32;
import com.sun.jna.examples.win32.User32;
import com.sun.jna.examples.win32.GDI32.BITMAPINFO;
import com.sun.jna.examples.win32.User32.BLENDFUNCTION;
import com.sun.jna.examples.win32.User32.POINT;
import com.sun.jna.examples.win32.User32.SIZE;
import com.sun.jna.examples.win32.W32API.HANDLE;
import com.sun.jna.examples.win32.W32API.HBITMAP;
import com.sun.jna.examples.win32.W32API.HDC;
import com.sun.jna.examples.win32.W32API.HRGN;
import com.sun.jna.examples.win32.W32API.HWND;
import com.sun.jna.platform.unix.X11;
import com.sun.jna.platform.unix.X11.Display;
import com.sun.jna.platform.unix.X11.GC;
import com.sun.jna.platform.unix.X11.Pixmap;
import com.sun.jna.platform.unix.X11.XVisualInfo;
import com.sun.jna.platform.unix.X11.Xext;
import com.sun.jna.platform.unix.X11.Xrender.XRenderPictFormat;
import com.sun.jna.platform.win32.GDI32;
import com.sun.jna.platform.win32.User32;
import com.sun.jna.platform.win32.WinDef.HBITMAP;
import com.sun.jna.platform.win32.WinDef.HDC;
import com.sun.jna.platform.win32.WinDef.HRGN;
import com.sun.jna.platform.win32.WinDef.HWND;
import com.sun.jna.platform.win32.WinGDI;
import com.sun.jna.platform.win32.WinGDI.BITMAPINFO;
import com.sun.jna.platform.win32.WinNT.HANDLE;
import com.sun.jna.platform.win32.WinUser;
import com.sun.jna.platform.win32.WinUser.BLENDFUNCTION;
import com.sun.jna.platform.win32.WinUser.POINT;
import com.sun.jna.platform.win32.WinUser.SIZE;
import com.sun.jna.ptr.ByteByReference;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.ptr.PointerByReference;
@@ -150,6 +151,7 @@ public class WindowUtils {
* </pre></code>
*/
private static class HeavyweightForcer extends Window {
private static final long serialVersionUID = 1L;
private final boolean packed;
public HeavyweightForcer(Window parent) {
@@ -175,6 +177,7 @@ public class WindowUtils {
* invoked whenever any part of the ancestor window is repainted.
*/
protected static class RepaintTrigger extends JComponent {
private static final long serialVersionUID = 1L;
protected class Listener
extends WindowAdapter
@@ -265,6 +268,7 @@ public class WindowUtils {
public static abstract class NativeWindowUtils {
protected abstract class TransparentContentPane
extends JPanel implements AWTEventListener {
private static final long serialVersionUID = 1L;
private boolean transparent;
public TransparentContentPane(Container oldContent) {
super(new BorderLayout());
@@ -640,27 +644,27 @@ public class WindowUtils {
public void run() {
HWND hWnd = getHWnd(w);
User32 user = User32.INSTANCE;
int flags = user.GetWindowLong(hWnd, User32.GWL_EXSTYLE);
int flags = user.GetWindowLong(hWnd, WinUser.GWL_EXSTYLE);
byte level = (byte)((int)(255 * alpha) & 0xFF);
if (usingUpdateLayeredWindow(w)) {
// If already using UpdateLayeredWindow, continue to
// do so
BLENDFUNCTION blend = new BLENDFUNCTION();
blend.SourceConstantAlpha = level;
blend.AlphaFormat = User32.AC_SRC_ALPHA;
blend.AlphaFormat = WinUser.AC_SRC_ALPHA;
user.UpdateLayeredWindow(hWnd, null, null, null, null,
null, 0, blend,
User32.ULW_ALPHA);
WinUser.ULW_ALPHA);
}
else if (alpha == 1f) {
flags &= ~User32.WS_EX_LAYERED;
user.SetWindowLong(hWnd, User32.GWL_EXSTYLE, flags);
flags &= ~WinUser.WS_EX_LAYERED;
user.SetWindowLong(hWnd, WinUser.GWL_EXSTYLE, flags);
}
else {
flags |= User32.WS_EX_LAYERED;
user.SetWindowLong(hWnd, User32.GWL_EXSTYLE, flags);
flags |= WinUser.WS_EX_LAYERED;
user.SetWindowLong(hWnd, WinUser.GWL_EXSTYLE, flags);
user.SetLayeredWindowAttributes(hWnd, 0, level,
User32.LWA_ALPHA);
WinUser.LWA_ALPHA);
}
setForceHeavyweightPopups(w, alpha != 1f);
storeAlpha(w, level);
@@ -673,6 +677,7 @@ public class WindowUtils {
* when the window is transparent.
*/
private class W32TransparentContentPane extends TransparentContentPane {
private static final long serialVersionUID = 1L;
private HDC memDC;
private HBITMAP hBitmap;
private Pointer pbits;
@@ -729,12 +734,12 @@ public class WindowUtils {
bmi.bmiHeader.biHeight = wh;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 32;
bmi.bmiHeader.biCompression = GDI32.BI_RGB;
bmi.bmiHeader.biCompression = WinGDI.BI_RGB;
bmi.bmiHeader.biSizeImage = ww * wh * 4;
PointerByReference ppbits = new PointerByReference();
hBitmap = gdi.CreateDIBSection(memDC, bmi,
GDI32.DIB_RGB_COLORS,
ppbits, null, 0);
WinGDI.DIB_RGB_COLORS,
ppbits, null, 0);
pbits = ppbits.getValue();
bitmapSize = new Dimension(ww, wh);
}
@@ -770,18 +775,17 @@ public class WindowUtils {
try {
// GetLayeredwindowAttributes supported WinXP and later
if (user.GetLayeredWindowAttributes(hWnd, null, bref, iref)
&& (iref.getValue() & User32.LWA_ALPHA) != 0) {
&& (iref.getValue() & WinUser.LWA_ALPHA) != 0) {
level = bref.getValue();
}
}
catch(UnsatisfiedLinkError e) {
}
blend.SourceConstantAlpha = level;
blend.AlphaFormat = User32.AC_SRC_ALPHA;
blend.AlphaFormat = WinUser.AC_SRC_ALPHA;
user.UpdateLayeredWindow(hWnd, screenDC, winLoc, winSize, memDC,
srcLoc, 0, blend, User32.ULW_ALPHA);
}
finally {
srcLoc, 0, blend, WinUser.ULW_ALPHA);
} finally {
user.ReleaseDC(null, screenDC);
if (memDC != null && oldBitmap != null) {
gdi.SelectObject(memDC, oldBitmap);
@@ -809,7 +813,7 @@ public class WindowUtils {
public void run() {
User32 user = User32.INSTANCE;
HWND hWnd = getHWnd(w);
int flags = user.GetWindowLong(hWnd, User32.GWL_EXSTYLE);
int flags = user.GetWindowLong(hWnd, WinUser.GWL_EXSTYLE);
JRootPane root = ((RootPaneContainer)w).getRootPane();
JLayeredPane lp = root.getLayeredPane();
Container content = root.getContentPane();
@@ -824,12 +828,12 @@ public class WindowUtils {
JLayeredPane.DRAG_LAYER);
}
if (transparent && !usingUpdateLayeredWindow(w)) {
flags |= User32.WS_EX_LAYERED;
user.SetWindowLong(hWnd, User32.GWL_EXSTYLE, flags);
flags |= WinUser.WS_EX_LAYERED;
user.SetWindowLong(hWnd, WinUser.GWL_EXSTYLE, flags);
}
else if (!transparent && usingUpdateLayeredWindow(w)) {
flags &= ~User32.WS_EX_LAYERED;
user.SetWindowLong(hWnd, User32.GWL_EXSTYLE, flags);
flags &= ~WinUser.WS_EX_LAYERED;
user.SetWindowLong(hWnd, WinUser.GWL_EXSTYLE, flags);
}
setLayersTransparent(w, transparent);
setForceHeavyweightPopups(w, transparent);
@@ -870,11 +874,11 @@ public class WindowUtils {
GDI32 gdi = GDI32.INSTANCE;
PathIterator pi = area.getPathIterator(null);
int mode = pi.getWindingRule() == PathIterator.WIND_NON_ZERO
? GDI32.WINDING: GDI32.ALTERNATE;
? WinGDI.WINDING: WinGDI.ALTERNATE;
float[] coords = new float[6];
List points = new ArrayList();
List<POINT> points = new ArrayList<POINT>();
int size = 0;
List sizes = new ArrayList();
List<Integer> sizes = new ArrayList<Integer>();
while (!pi.isDone()) {
int type = pi.currentSegment(coords);
if (type == PathIterator.SEG_MOVETO) {
@@ -894,14 +898,14 @@ public class WindowUtils {
pi.next();
}
POINT[] lppt = (POINT[])new POINT().toArray(points.size());
POINT[] pts = (POINT[])points.toArray(new POINT[points.size()]);
POINT[] pts = points.toArray(new POINT[points.size()]);
for (int i=0;i < lppt.length;i++) {
lppt[i].x = pts[i].x;
lppt[i].y = pts[i].y;
}
int[] counts = new int[sizes.size()];
for (int i=0;i < counts.length;i++) {
counts[i] = ((Integer)sizes.get(i)).intValue();
counts[i] = sizes.get(i).intValue();
}
HRGN hrgn = gdi.CreatePolyPolygonRgn(lppt, counts, counts.length, mode);
setWindowRegion(w, hrgn);
@@ -918,7 +922,7 @@ public class WindowUtils {
public boolean outputRange(int x, int y, int w, int h) {
GDI32 gdi = GDI32.INSTANCE;
gdi.SetRectRgn(tempRgn, x, y, x + w, y + h);
return gdi.CombineRgn(region, region, tempRgn, GDI32.RGN_OR) != GDI32.ERROR;
return gdi.CombineRgn(region, region, tempRgn, WinGDI.RGN_OR) != WinGDI.ERROR;
}
});
}
@@ -1009,7 +1013,7 @@ public class WindowUtils {
fixWindowDragging(w, "setWindowAlpha");
}
whenDisplayable(w, new Runnable() {
public void run() {
public void run() {
Object peer = w.getPeer();
try {
peer.getClass().getMethod("setAlpha", new Class[]{
@@ -1050,6 +1054,7 @@ public class WindowUtils {
* @author Olivier Chafik
*/
private static class OSXMaskingContentPane extends JPanel {
private static final long serialVersionUID = 1L;
private Shape shape;
public OSXMaskingContentPane(Component oldContent) {
@@ -1124,7 +1129,7 @@ public class WindowUtils {
}
x11.XSetForeground(dpy, gc, new NativeLong(0));
x11.XFillRectangle(dpy, pm, gc, 0, 0, width, height);
final List rlist = new ArrayList();
final List<Rectangle> rlist = new ArrayList<Rectangle>();
try {
RasterRangesUtils.outputOccupiedRanges(raster, new RasterRangesUtils.RangesOutput() {
public boolean outputRange(int x, int y, int w, int h) {
@@ -1135,7 +1140,7 @@ public class WindowUtils {
X11.XRectangle[] rects = (X11.XRectangle[])
new X11.XRectangle().toArray(rlist.size());
for (int i=0;i < rects.length;i++) {
Rectangle r = (Rectangle)rlist.get(i);
Rectangle r = rlist.get(i);
rects[i].x = (short)r.x;
rects[i].y = (short)r.y;
rects[i].width = (short)r.width;
@@ -1230,7 +1235,7 @@ public class WindowUtils {
IntByReference pcount = new IntByReference();
info = x11.XGetVisualInfo(dpy, mask, template, pcount);
if (info != null) {
List list = new ArrayList();
List<X11.VisualID> list = new ArrayList<X11.VisualID>();
XVisualInfo[] infos =
(XVisualInfo[])info.toArray(pcount.getValue());
for (int i = 0; i < infos.length; i++) {
@@ -1270,9 +1275,9 @@ public class WindowUtils {
x11.XQueryTree(dpy, win, rootp, parentp, childrenp, countp);
Pointer p = childrenp.getValue();
int[] ids = p.getIntArray(0, countp.getValue());
for (int i=0;i < ids.length;i++) {
for (int id : ids) {
// TODO: more verification of correct window?
X11.Window child = new X11.Window(ids[i]);
X11.Window child = new X11.Window(id);
X11.XWindowAttributes xwa = new X11.XWindowAttributes();
x11.XGetWindowAttributes(dpy, child, xwa);
offset.x = -xwa.x;
@@ -1334,6 +1339,7 @@ public class WindowUtils {
}
private class X11TransparentContentPane extends TransparentContentPane {
private static final long serialVersionUID = 1L;
public X11TransparentContentPane(Container oldContent) {
super(oldContent);
@@ -1345,7 +1351,7 @@ public class WindowUtils {
// Painting directly to the original Graphics
// fails to properly composite unless the destination
// is pure black. Too bad.
protected void paintDirect(BufferedImage buf, Rectangle bounds) {
protected void paintDirect(BufferedImage buf, Rectangle bounds) {
Window window = SwingUtilities.getWindowAncestor(this);
X11 x11 = X11.INSTANCE;
X11.Display dpy = x11.XOpenDisplay(null);
@@ -1357,7 +1363,7 @@ public class WindowUtils {
Raster raster = buf.getData();
int w = bounds.width;
int h = bounds.height;
if (buffer == null || buffer.getSize() != w*h*4) {
if (buffer == null || buffer.size() != w*h*4) {
buffer = new Memory(w*h*4);
pixels = new int[w*h];
}
@@ -10,7 +10,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package com.sun.jna.examples.dnd;
package com.sun.jna.platform.dnd;
import java.awt.AlphaComposite;
import java.awt.Component;
@@ -38,6 +38,7 @@ import java.awt.dnd.DropTargetEvent;
import java.awt.dnd.InvalidDnDOperationException;
import java.awt.event.InputEvent;
import java.awt.image.BufferedImage;
import javax.swing.Icon;
import javax.swing.JColorChooser;
import javax.swing.JFileChooser;
@@ -179,7 +180,7 @@ public abstract class DragHandler
private Component dragSource;
private GhostedDragImage ghost;
private Point imageOffset;
private Dimension maxGhostSize = MAX_GHOST_SIZE;
private Dimension maxGhostSize = MAX_GHOST_SIZE;
private float ghostAlpha = DEFAULT_GHOST_ALPHA;
/** Enable drags from the given component, supporting the actions in
@@ -529,4 +530,4 @@ public abstract class DragHandler
}
updateCursor(e);
}
}
}
@@ -10,7 +10,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package com.sun.jna.examples.dnd;
package com.sun.jna.platform.dnd;
import java.awt.Component;
import java.awt.Point;
@@ -88,7 +88,7 @@ import java.util.Set;
public abstract class DropHandler implements DropTargetListener {
private int acceptedActions;
private List acceptedFlavors;
private List<DataFlavor> acceptedFlavors;
private DropTarget dropTarget;
private boolean active = true;
private DropTargetPainter painter;
@@ -347,7 +347,7 @@ public abstract class DropHandler implements DropTargetListener {
* constructor.
*/
protected boolean isSupported(DataFlavor[] flavors) {
Set set = new HashSet(Arrays.asList(flavors));
Set<DataFlavor> set = new HashSet<DataFlavor>(Arrays.asList(flavors));
set.retainAll(acceptedFlavors);
return !set.isEmpty();
}
@@ -10,7 +10,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package com.sun.jna.examples.dnd;
package com.sun.jna.platform.dnd;
import java.awt.Point;
import java.awt.dnd.DropTargetEvent;
@@ -10,7 +10,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package com.sun.jna.examples.dnd;
package com.sun.jna.platform.dnd;
import java.awt.Component;
import java.awt.Dimension;
@@ -29,7 +29,7 @@ import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
import com.sun.jna.examples.WindowUtils;
import com.sun.jna.platform.WindowUtils;
/** Provide a ghosted drag image for use during drags where
* {@link DragSource#isDragImageSupported} returns false.<p>
@@ -56,6 +56,7 @@ public class GhostedDragImage {
// FIXME ensure gc is compatible (X11)
GraphicsConfiguration gc = parent.getGraphicsConfiguration();
dragImage = new Window(JOptionPane.getRootFrame(), gc) {
private static final long serialVersionUID = 1L;
public void paint(Graphics g) {
icon.paintIcon(this, g, 0, 0);
}
@@ -0,0 +1,14 @@
<html>
<head>
<!--
Copyright (c) 2010 Timothy Wall
-->
</head>
<body bgcolor="white">
<!-- One sentence summary -->
Provides integrated, extended drag and drop functionality,
allowing ghosted drag images to be used on all platforms.
</body>
</html>
@@ -0,0 +1,91 @@
/*
* Copyright (c) 2011 Denis Tulskiy
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
*/
package com.sun.jna.platform.mac;
import java.nio.IntBuffer;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Callback;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.ptr.PointerByReference;
/**
* Author: Denis Tulskiy
* Date: 7/25/11
*/
public interface Carbon {
public static Carbon INSTANCE = (Carbon) Native.loadLibrary("Carbon", Carbon.class);
public static final int cmdKey = 0x0100;
public static final int shiftKey = 0x0200;
public static final int optionKey = 0x0800;
public static final int controlKey = 0x1000;
/**
* Obtains the event target reference for the standard toolbox dispatcher
*/
public Pointer GetEventDispatcherTarget();
/**
* Installs an event handler on a specified event target.
*/
public int InstallEventHandler(Pointer inTarget, EventHandlerProcPtr inHandler, int inNumTypes, EventTypeSpec[] inList, Pointer inUserData, PointerByReference outRef);
/**
* Registers a global hot key.
*/
public int RegisterEventHotKey(int inHotKeyCode, int inHotKeyModifiers, EventHotKeyID.ByValue inHotKeyID, Pointer inTarget, int inOptions, PointerByReference outRef);
/**
* Obtains a parameter from the specified event.
*/
public int GetEventParameter(Pointer inEvent, int inName, int inDesiredType, Pointer outActualType, int inBufferSize, IntBuffer outActualSize, EventHotKeyID outData);
/**
* Removes the specified event handler
*/
public int RemoveEventHandler(Pointer inHandlerRef);
/**
* Unregisters a global hot key.
*/
public int UnregisterEventHotKey(Pointer inHotKey);
public class EventTypeSpec extends Structure {
public int eventClass;
public int eventKind;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "eventClass", "eventKind" }); }
}
public static class EventHotKeyID extends Structure {
public int signature;
public int id;
public static class ByValue extends EventHotKeyID implements Structure.ByValue { }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "signature", "id" }); }
}
public static interface EventHandlerProcPtr extends Callback {
public int callback(Pointer inHandlerCallRef, Pointer inEvent, Pointer inUserData);
}
}
@@ -0,0 +1,57 @@
/* Copyright (c) 2007 Timothy Wall, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.mac;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.ptr.PointerByReference;
import com.sun.jna.platform.FileUtils;
public class MacFileUtils extends FileUtils {
public boolean hasTrash() { return true; }
public interface FileManager extends Library {
int kFSFileOperationDefaultOptions = 0;
int kFSFileOperationsOverwrite = 0x01;
int kFSFileOperationsSkipSourcePermissionErrors = 0x02;
int kFSFileOperationsDoNotMoveAcrossVolumes = 0x04;
int kFSFileOperationsSkipPreflight = 0x08;
public FileManager INSTANCE = (FileManager)Native.loadLibrary("CoreServices", FileManager.class);
int FSPathMoveObjectToTrashSync(String src, PointerByReference target, int options);
}
public void moveToTrash(File[] files) throws IOException {
File home = new File(System.getProperty("user.home"));
File trash = new File(home, ".Trash");
if (!trash.exists()) {
throw new IOException("The Trash was not found in its expected location (" + trash + ")");
}
List<File> failed = new ArrayList<File>();
for (int i=0;i < files.length;i++) {
File src = files[i];
if (FileManager.INSTANCE.FSPathMoveObjectToTrashSync(src.getAbsolutePath(), null, 0) != 0) {
failed.add(src);
}
}
if (failed.size() > 0) {
throw new IOException("The following files could not be trashed: " + failed);
}
}
}
@@ -1,13 +1,13 @@
<html>
<head>
<!--
Copyright (c) 2007 Timothy Wall
Copyright (c) 2010 Timothy Wall
-->
</head>
<body bgcolor="white">
<!-- One sentence summary -->
Provides examples of w32 library mappings.
Provides common library mappings for the OS X platform.
</body>
</html>
@@ -0,0 +1,13 @@
<html>
<head>
<!--
Copyright (c) 2010 Timothy Wall
-->
</head>
<body bgcolor="white">
<!-- One sentence summary -->
Provides cross-platform utilities based on platform-specific libraries.
</body>
</html>
@@ -10,21 +10,37 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package com.sun.jna.examples.unix;
package com.sun.jna.platform.unix;
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Callback;
import com.sun.jna.FromNativeContext;
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.NativeLong;
import com.sun.jna.Pointer;
import com.sun.jna.PointerType;
import com.sun.jna.Structure;
import com.sun.jna.Union;
import com.sun.jna.ptr.ByReference;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.ptr.NativeLongByReference;
import com.sun.jna.ptr.PointerByReference;
/** Definition (incomplete) of the X library. */
public interface X11 extends Library {
class VisualID extends NativeLong {
public VisualID() { }
private static final long serialVersionUID = 1L;
public VisualID() { }
public VisualID(long value) { super(value); }
}
class XID extends NativeLong {
public static final XID None = null;
private static final long serialVersionUID = 1L;
public static final XID None = null;
public XID() { this(0); }
public XID(long id) { super(id); }
protected boolean isNone(Object o) {
@@ -42,6 +58,7 @@ public interface X11 extends Library {
}
}
class Atom extends XID {
private static final long serialVersionUID = 1L;
public static final Atom None = null;
public Atom() { }
public Atom(long id) { super(id); }
@@ -133,6 +150,7 @@ public interface X11 extends Library {
}
}
class Colormap extends XID {
private static final long serialVersionUID = 1L;
public static final Colormap None = null;
public Colormap() { }
public Colormap(long id) { super(id); }
@@ -143,6 +161,7 @@ public interface X11 extends Library {
}
}
class Font extends XID {
private static final long serialVersionUID = 1L;
public static final Font None = null;
public Font() { }
public Font(long id) { super(id); }
@@ -153,6 +172,7 @@ public interface X11 extends Library {
}
}
class Cursor extends XID {
private static final long serialVersionUID = 1L;
public static final Cursor None = null;
public Cursor() { }
public Cursor(long id) { super(id); }
@@ -163,6 +183,7 @@ public interface X11 extends Library {
}
}
class KeySym extends XID {
private static final long serialVersionUID = 1L;
public static final KeySym None = null;
public KeySym() { }
public KeySym(long id) { super(id); }
@@ -173,6 +194,7 @@ public interface X11 extends Library {
}
}
class Drawable extends XID {
private static final long serialVersionUID = 1L;
public static final Drawable None = null;
public Drawable() { }
public Drawable(long id) { super(id); }
@@ -183,7 +205,8 @@ public interface X11 extends Library {
}
}
class Window extends Drawable {
public static final Window None = null;
private static final long serialVersionUID = 1L;
public static final Window None = null;
public Window() { }
public Window(long id) { super(id); }
public Object fromNative(Object nativeValue, FromNativeContext context) {
@@ -201,7 +224,8 @@ public interface X11 extends Library {
}
}
class Pixmap extends Drawable {
public static final Pixmap None = null;
private static final long serialVersionUID = 1L;
public static final Pixmap None = null;
public Pixmap() { }
public Pixmap(long id) { super(id); }
public Object fromNative(Object nativeValue, FromNativeContext context) {
@@ -256,8 +280,12 @@ public interface X11 extends Library {
public short green, greenMask;
public short blue, blueMask;
public short alpha, alphaMask;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "red", "redMask", "green", "greenMask", "blue", "blueMask", "alpha", "alphaMask" });
}
}
class PictFormat extends NativeLong {
private static final long serialVersionUID = 1L;
public PictFormat(long value) { super(value); }
public PictFormat() { }
}
@@ -267,6 +295,9 @@ public interface X11 extends Library {
public int depth;
public XRenderDirectFormat direct;
public Colormap colormap;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "id", "type", "depth", "direct", "colormap" });
}
}
int PictTypeIndexed = 0x0;
int PictTypeDirect = 0x1;
@@ -315,12 +346,18 @@ public interface X11 extends Library {
class XInputClassInfoByReference extends Structure implements Structure.ByReference {
public byte input_class;
public byte event_type_base;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "input_class", "event_type_base" });
}
}
class XDeviceByReference extends Structure implements Structure.ByReference {
public XID device_id;
public int num_classes;
public XInputClassInfoByReference classes;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "device_id", "num_classes", "classes" });
}
}
X11 INSTANCE = (X11)Native.loadLibrary("X11", X11.class);
@@ -348,6 +385,9 @@ public interface X11 extends Library {
public int icon_x, icon_y;
public Pixmap icon_mask;
public XID window_group;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "flags", "input", "initial_state", "icon_pixmap", "icon_window", "icon_x", "icon_y", "icon_mask", "window_group" });
}
}
/*
@@ -363,6 +403,9 @@ public interface X11 extends Library {
public Atom encoding;
public int format;
public NativeLong nitems;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "value", "encoding", "format", "nitems" });
}
}
/*
@@ -391,10 +434,14 @@ public interface X11 extends Library {
public static class Aspect extends Structure {
public int x; // numerator
public int y; // denominator
protected List getFieldOrder() {
return Arrays.asList(new String[] { "x", "y" }); }
}
public Aspect min_aspect, max_aspect;
public int base_width, base_height;
public int win_gravity;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "flags", "x", "y", "width", "height", "min_width", "min_height", "max_width", "max_height", "width_inc", "height_inc", "min_aspect", "max_aspect", "base_width", "base_height", "win_gravity" }); }
}
/*
@@ -448,6 +495,9 @@ public interface X11 extends Library {
public NativeLong do_not_propagate_mask;
public boolean override_redirect;
public Screen screen;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "x", "y", "width", "height", "border_width", "depth", "visual", "root", "c_class", "bit_gravity", "win_gravity", "backing_store", "backing_planes", "backing_pixel", "save_under", "colormap", "map_installed", "map_state", "all_event_masks", "your_event_mask", "do_not_propagate_mask", "override_redirect", "screen" });
}
}
/*
@@ -485,6 +535,9 @@ public interface X11 extends Library {
public boolean override_redirect;
public Colormap colormap;
public Cursor cursor;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "background_pixmap", "background_pixel", "border_pixmap", "border_pixel", "bit_gravity", "win_gravity", "backing_store", "backing_planes", "backing_pixel", "save_under", "event_mask", "do_not_propagate_mask", "override_redirect", "colormap", "cursor" });
}
}
int XK_0 = 0x30;
@@ -527,10 +580,16 @@ public interface X11 extends Library {
public NativeLong blue_mask;
public int colormap_size;
public int bits_per_rgb;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "visual", "visualid", "screen", "depth", "c_class", "red_mask", "green_mask", "blue_mask", "colormap_size", "bits_per_rgb" });
}
}
class XPoint extends Structure {
public short x, y;
public XPoint() { }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "x", "y" });
}
public XPoint() { this((short)0, (short)0); }
public XPoint(short x, short y) {
this.x = x;
this.y = y;
@@ -539,7 +598,10 @@ public interface X11 extends Library {
class XRectangle extends Structure {
public short x, y;
public short width, height;
public XRectangle() { }
protected List getFieldOrder() {
return Arrays.asList(new String[] { "x", "y", "width", "height" });
}
public XRectangle() { this((short)0, (short)0, (short)0, (short)0); }
public XRectangle(short x, short y, short width, short height) {
this.x = x; this.y = y;
this.width = width; this.height = height;
@@ -683,6 +745,9 @@ public interface X11 extends Library {
public Pixmap clip_mask; /* bitmap clipping; other calls for rects */
public int dash_offset; /* patterned/dashed line information */
public byte dashes;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "function", "plane_mask", "foreground", "background", "line_width", "line_style", "cap_style", "join_style", "fill_style", "fill_rule", "arc_mode", "tile", "stipple", "ts_x_origin", "ts_y_origin", "font", "subwindow_mode", "graphics_exposures", "clip_x_origin", "clip_y_origin", "clip_mask", "dash_offset", "dashes" });
}
}
GC XCreateGC(Display display, Drawable drawable, NativeLong mask, XGCValues values);
int XSetFillRule(Display display, GC gc, int fill_rule);
@@ -921,8 +986,8 @@ public interface X11 extends Library {
int SyncBoth = 7;
/* Used in SetInputFocus, GetInputFocus */
int RevertToNone = (int)None;
int RevertToPointerRoot = (int)PointerRoot;
int RevertToNone = None;
int RevertToPointerRoot = PointerRoot;
int RevertToParent = 2;
/*****************************************************************
@@ -1308,6 +1373,9 @@ public interface X11 extends Library {
public int send_event; // true if this came from a SendEvent request
public Display display; // Display the event was read from
public Window window; // window on which event was requested in event mask
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window" });
}
}
class XKeyEvent extends Structure {
@@ -1324,6 +1392,9 @@ public interface X11 extends Library {
public int state; // key or button mask
public int keycode; // detail
public int same_screen; // same screen flag
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "root", "subwindow", "time", "x", "y", "x_root", "y_root", "state", "keycode", "same_screen" });
}
}
class XButtonEvent extends Structure {
@@ -1340,6 +1411,9 @@ public interface X11 extends Library {
public int state; // key or button mask
public int button; // detail
public int same_screen; // same screen flag
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "root", "subwindow", "time", "x", "y", "x_root", "y_root", "state", "button", "same_screen" });
}
}
class XButtonPressedEvent extends XButtonEvent {
@@ -1357,6 +1431,9 @@ public interface X11 extends Library {
public Atom message_type;
public int format;
public Data data;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "message_type", "format", "data" });
}
public static class Data extends Union {
public byte b[] = new byte[20];
@@ -1379,6 +1456,9 @@ public interface X11 extends Library {
public int state; // key or button mask
public byte is_hint; // detail
public int same_screen; // same screen flag
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "root", "subwindow", "time", "x", "y", "x_root", "y_root", "state", "is_hint", "same_screen" });
}
}
class XPointerMovedEvent extends XMotionEvent {
@@ -1402,8 +1482,11 @@ public interface X11 extends Library {
* NotifyNonlinear,NotifyNonlinearVirtual
*/
public int same_screen; // same screen flag
public int focus; // intean focus
public int focus; // boolean focus
public int state; // key or button mask
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "root", "subwindow", "time", "x", "y", "x_root", "y_root", "mode", "detail", "same_screen", "focus", "state" });
}
}
class XEnterWindowEvent extends XCrossingEvent {
@@ -1425,6 +1508,9 @@ public interface X11 extends Library {
* NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer,
* NotifyPointerRoot, NotifyDetailNone
*/
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "mode", "detail" });
}
}
class XFocusInEvent extends XFocusChangeEvent {
@@ -1442,6 +1528,9 @@ public interface X11 extends Library {
public int x, y;
public int width, height;
public int count; // if non-zero, at least this many more
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "x", "y", "width", "height", "count" });
}
}
class XGraphicsExposeEvent extends Structure {
@@ -1455,6 +1544,9 @@ public interface X11 extends Library {
public int count; // if non-zero, at least this many more
public int major_code; // core is CopyArea or CopyPlane
public int minor_code; // not defined in the core
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "drawable", "x", "y", "width", "height", "count", "major_code", "minor_code" });
}
}
class XNoExposeEvent extends Structure {
@@ -1465,6 +1557,9 @@ public interface X11 extends Library {
public Drawable drawable;
public int major_code; // core is CopyArea or CopyPlane
public int minor_code; // not defined in the core
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "drawable", "major_code", "minor_code" });
}
}
class XVisibilityEvent extends Structure {
@@ -1474,6 +1569,9 @@ public interface X11 extends Library {
public Display display; // Display the event was read from
public Window window;
public int state; // Visibility state
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "state" });
}
}
class XCreateWindowEvent extends Structure {
@@ -1487,6 +1585,9 @@ public interface X11 extends Library {
public int width, height; // size of window
public int border_width; // border width
public int override_redirect; // creation should be overridden
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "parent", "window", "x", "y", "width", "height", "border_width", "override_redirect" });
}
}
class XDestroyWindowEvent extends Structure {
@@ -1496,6 +1597,8 @@ public interface X11 extends Library {
public Display display; // Display the event was read from
public Window event;
public Window window;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window" }); }
}
class XUnmapEvent extends Structure {
@@ -1506,6 +1609,9 @@ public interface X11 extends Library {
public Window event;
public Window window;
public int from_configure;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "from_configure" });
}
}
class XMapEvent extends Structure {
@@ -1515,7 +1621,10 @@ public interface X11 extends Library {
public Display display; // Display the event was read from
public Window event;
public Window window;
public int override_redirect; // intean, is override set...
public int override_redirect; // boolean, is override set...
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "override_redirect" });
}
}
class XMapRequestEvent extends Structure {
@@ -1525,6 +1634,9 @@ public interface X11 extends Library {
public Display display; // Display the event was read from
public Window parent;
public Window window;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window" });
}
}
class XReparentEvent extends Structure {
@@ -1537,6 +1649,9 @@ public interface X11 extends Library {
public Window parent;
public int x, y;
public int override_redirect;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "x", "y", "override_redirect" });
}
}
class XConfigureEvent extends Structure {
@@ -1551,6 +1666,9 @@ public interface X11 extends Library {
public int border_width;
public Window above;
public int override_redirect;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "x", "y", "width", "height", "border_width", "above", "override_redirect" });
}
}
class XGravityEvent extends Structure {
@@ -1561,6 +1679,9 @@ public interface X11 extends Library {
public Window event;
public Window window;
public int x, y;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "x", "y" });
}
}
class XResizeRequestEvent extends Structure {
@@ -1570,6 +1691,9 @@ public interface X11 extends Library {
public Display display; // Display the event was read from
public Window window;
public int width, height;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "width", "height" });
}
}
class XConfigureRequestEvent extends Structure {
@@ -1585,6 +1709,9 @@ public interface X11 extends Library {
public Window above;
public int detail; // Above, Below, TopIf, BottomIf, Opposite
public NativeLong value_mask;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "x", "y", "width", "height", "above", "detail", "value_mask" });
}
}
class XCirculateEvent extends Structure {
@@ -1595,6 +1722,9 @@ public interface X11 extends Library {
public Window event;
public Window window;
public int place; // PlaceOnTop, PlaceOnBottom
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "event", "window", "place" });
}
}
class XCirculateRequestEvent extends Structure {
@@ -1605,6 +1735,9 @@ public interface X11 extends Library {
public Window parent;
public Window window;
public int place; // PlaceOnTop, PlaceOnBottom
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "parent", "window", "place" });
}
}
class XPropertyEvent extends Structure {
@@ -1616,6 +1749,9 @@ public interface X11 extends Library {
public Atom atom;
public NativeLong time;
public int state; // NewValue, Deleted
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "atom", "time", "state" });
}
}
class XSelectionClearEvent extends Structure {
@@ -1626,6 +1762,9 @@ public interface X11 extends Library {
public Window window;
public Atom selection;
public NativeLong time;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "selection", "time" });
}
}
class XSelectionRequestEvent extends Structure {
@@ -1637,8 +1776,11 @@ public interface X11 extends Library {
public Window requestor;
public Atom selection;
public Atom target;
Atom property;
public Atom property;
public NativeLong time;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "owner", "requestor", "selection", "target", "property", "time" });
}
}
class XSelectionEvent extends Structure {
@@ -1651,6 +1793,9 @@ public interface X11 extends Library {
public Atom target;
public Atom property; // ATOM or None
public NativeLong time;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "requestor", "selection", "target", "property", "time" });
}
}
class XColormapEvent extends Structure {
@@ -1662,6 +1807,9 @@ public interface X11 extends Library {
public Colormap colormap; // COLORMAP or None
public int c_new; // C++
public int state; // ColormapInstalled, ColormapUninstalled
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "colormap", "c_new", "state" });
}
}
class XMappingEvent extends Structure {
@@ -1673,16 +1821,22 @@ public interface X11 extends Library {
public int request; // one of MappingModifier, MappingKeyboard, MappingPointer
public int first_keycode; // first keycode
public int count; // defines range of change w. first_keycode*/
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "request", "first_keycode", "count" });
}
}
class XErrorEvent extends Structure {
public int type;
public Display display; // Display the event was read from
public XID resourceid; // resource id
public NativeLong serial; // serial number of failed request
public byte error_code; // error code of failed request
public byte request_code; // Major op-code of failed request
public byte minor_code; // Minor op-code of failed request
public XID resourceid; // resource id
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "display", "serial", "error_code", "request_code", "minor_code", "resourceid" });
}
}
// generated on EnterWindow and FocusIn when KeyMapState selected
@@ -1693,6 +1847,9 @@ public interface X11 extends Library {
public Display display; // Display the event was read from
public Window window;
public byte key_vector[] = new byte[32];
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "key_vector" });
}
}
int XSelectInput(Display display, Window window, NativeLong eventMask);
@@ -1747,6 +1904,18 @@ public interface X11 extends Library {
int width, int height);
int XDestroyImage(XImage image);
/**
* Installs an error handler
*
* @param handler Specifies the program's supplied error handler
* @return The previous error handler
*/
XErrorHandler XSetErrorHandler(XErrorHandler handler);
public interface XErrorHandler extends Callback {
public int apply(Display display, XErrorEvent errorEvent);
}
/*****************************************************************
* KeySyms, Keycodes, Keymaps
@@ -1757,6 +1926,33 @@ public interface X11 extends Library {
byte XKeysymToKeycode(Display display, KeySym keysym);
KeySym XKeycodeToKeysym(Display display, byte keycode, int index);
/**
* Establishes a passive grab on the keyboard
*
* @param display Specifies the connection to the X server.
* @param keyCode Specifies the KeyCode or {@link #AnyKey}.
* @param modifiers Specifies the set of keymasks or {@link #AnyModifier}.
* The mask is the bitwise inclusive OR of the valid keymask bits.
* @param grab_window Specifies the grab window.
* @param ownerEvents Specifies a Boolean value that indicates whether the keyboard events are to be reported as usual.
* @param pointerMode Specifies further processing of pointer events. You can pass {@link #GrabModeSync} or {@link #GrabModeAsync}.
* @param keyBoardMode Specifies further processing of keyboard events. You can pass {@link #GrabModeSync} or {@link #GrabModeAsync}.
* @return nothing
*/
int XGrabKey(Display display, int keyCode, int modifiers, Window grab_window, int ownerEvents, int pointerMode, int keyBoardMode);
/**
* The XUngrabKey() function releases the key combination on the specified window if it was grabbed by this client.
*
* @param display Specifies the connection to the X server.
* @param keyCode Specifies the KeyCode or {@link #AnyKey}.
* @param modifiers Specifies the set of keymasks or {@link #AnyModifier}.
* The mask is the bitwise inclusive OR of the valid keymask bits
* @param grab_window Specifies the grab window.
* @return nothing
*/
int XUngrabKey(Display display, int keyCode, int modifiers, Window grab_window);
//int XChangeKeyboardMapping(Display display, int first_keycode, int keysyms_per_keycode, KeySym *keysyms, int num_codes);
/** Defines the symbols for the specified number of KeyCodes starting with first_keycode. The symbols for KeyCodes outside this range remain unchanged. The number of elements in keysyms must be: num_codes * keysyms_per_keycode. The specified first_keycode must be greater than or equal to min_keycode returned by XDisplayKeycodes, or a BadValue error results. In addition, the following expression must be less than or equal to max_keycode as returned by XDisplayKeycodes, or a BadValue error results: first_keycode + num_codes - 1. */
int XChangeKeyboardMapping(Display display, int first_keycode, int keysyms_per_keycode, KeySym[] keysyms, int num_codes);
@@ -1798,6 +1994,9 @@ public interface X11 extends Library {
class XModifierKeymapRef extends Structure implements Structure.ByReference{
public int max_keypermod; /* The server's max # of keys per modifier */
public Pointer modifiermap; /* An 8 by max_keypermod array of modifiers */
protected List getFieldOrder() {
return Arrays.asList(new String[] { "max_keypermod", "modifiermap" });
}
}
class XKeyboardControlRef extends Structure implements Structure.ByReference {
@@ -1818,6 +2017,10 @@ public interface X11 extends Library {
/** AutoRepeatModeOff, AutoRepeatModeOn, AutoRepeatModeDefault. */
public int auto_repeat_mode;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "key_click_percent", "bell_percent", "bell_pitch", "bell_duration", "led", "led_mode", "key", "auto_repeat_mode" });
}
public String toString() {
return "XKeyboardControlByReference{" +
"key_click_percent=" + key_click_percent +
@@ -1848,6 +2051,10 @@ public interface X11 extends Library {
/** Bit vector. Each bit set to 1 indicates that auto-repeat is enabled for the corresponding key. The vector is represented as 32 bytes. Byte N (from 0) contains the bits for keys 8N to 8N + 7 with the least significant bit in the byte representing key 8N. */
public byte auto_repeats[] = new byte[32];
protected List getFieldOrder() {
return Arrays.asList(new String[] { "key_click_percent", "bell_percent", "bell_pitch", "bell_duration", "led_mask", "global_auto_repeat", "auto_repeats" });
}
public String toString() {
return "XKeyboardStateByReference{" +
"key_click_percent=" + key_click_percent +
@@ -0,0 +1,13 @@
<html>
<head>
<!--
Copyright (c) 2010 Timothy Wall
-->
</head>
<body bgcolor="white">
<!-- One sentence summary -->
Provides common library mappings for Unix and X11-based platforms.
</body>
</html>
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
@@ -0,0 +1,127 @@
/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import com.sun.jna.IntegerType;
import com.sun.jna.Pointer;
import com.sun.jna.ptr.ByReference;
import com.sun.jna.win32.StdCallLibrary;
/**
* Based on basetsd.h (various types)
* @author dblock[at]dblock[dot]org
*/
@SuppressWarnings("serial")
public interface BaseTSD extends StdCallLibrary {
/**
* Signed long type for pointer precision.
* Use when casting a pointer to a long to perform pointer arithmetic.
*/
public static class LONG_PTR extends IntegerType {
public LONG_PTR() {
this(0);
}
public LONG_PTR(long value) {
super(Pointer.SIZE, value);
}
public Pointer toPointer() {
return Pointer.createConstant(longValue());
}
}
/**
* Signed SIZE_T.
*/
public static class SSIZE_T extends LONG_PTR {
public SSIZE_T() {
this(0);
}
public SSIZE_T(long value) {
super(value);
}
}
/**
* Unsigned LONG_PTR.
*/
public static class ULONG_PTR extends IntegerType {
public ULONG_PTR() {
this(0);
}
public ULONG_PTR(long value) {
super(Pointer.SIZE, value, true);
}
public Pointer toPointer() {
return Pointer.createConstant(longValue());
}
}
/**
* PULONG_PTR
*/
public static class ULONG_PTRByReference extends ByReference {
public ULONG_PTRByReference() {
this(new ULONG_PTR(0));
}
public ULONG_PTRByReference(ULONG_PTR value) {
super(Pointer.SIZE);
setValue(value);
}
public void setValue(ULONG_PTR value) {
if (Pointer.SIZE == 4) {
getPointer().setInt(0, value.intValue());
}
else {
getPointer().setLong(0, value.longValue());
}
}
public ULONG_PTR getValue() {
return new ULONG_PTR(Pointer.SIZE == 4
? getPointer().getInt(0)
: getPointer().getLong(0));
}
}
/**
* Unsigned DWORD_PTR.
*/
public static class DWORD_PTR extends IntegerType {
public DWORD_PTR() {
this(0);
}
public DWORD_PTR(long value) {
super(Pointer.SIZE, value);
}
}
/**
* The maximum number of bytes to which a pointer can point.
* Use for a count that must span the full range of a pointer.
*/
public static class SIZE_T extends ULONG_PTR {
public SIZE_T() {
this(0);
}
public SIZE_T(long value) {
super(value);
}
}
}
@@ -0,0 +1,112 @@
/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.WinCrypt.CRYPTPROTECT_PROMPTSTRUCT;
import com.sun.jna.platform.win32.WinCrypt.DATA_BLOB;
import com.sun.jna.ptr.PointerByReference;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
/**
* Crypt32.dll Interface.
* @author dblock[at]dblock.org
*/
public interface Crypt32 extends StdCallLibrary {
Crypt32 INSTANCE = (Crypt32) Native.loadLibrary("Crypt32",
Crypt32.class, W32APIOptions.UNICODE_OPTIONS);
/**
* The CryptProtectData function performs encryption on the data in a DATA_BLOB
* structure. Typically, only a user with the same logon credential as the encrypter
* can decrypt the data. In addition, the encryption and decryption usually must be
* done on the same computer.
* @param pDataIn
* Pointer to a DATA_BLOB structure that contains the plaintext to be encrypted.
* @param szDataDescr
* String with a readable description of the data to be encrypted. This description
* string is included with the encrypted data. This parameter is optional and can
* be set to NULL, except on Windows 2000.
* @param pOptionalEntropy
* Pointer to a DATA_BLOB structure that contains a password or other additional
* entropy used to encrypt the data. The DATA_BLOB structure used in the encryption
* phase must also be used in the decryption phase. This parameter can be set to NULL
* for no additional entropy.
* @param pvReserved
* Reserved for future use and must be set to NULL.
* @param pPromptStruct
* Pointer to a CRYPTPROTECT_PROMPTSTRUCT structure that provides information about
* where and when prompts are to be displayed and what the content of those prompts
* should be. This parameter can be set to NULL in both the encryption and decryption
* phases.
* @param dwFlags
* One of CRYPTPROTECT_LOCAL_MACHINE, CRYPTPROTECT_UI_FORBIDDEN, CRYPTPROTECT_AUDIT,
* CRYPTPROTECT_VERIFY_PROTECTION.
* @param pDataOut
* Pointer to a DATA_BLOB structure that receives the encrypted data. When you have
* finished using the DATA_BLOB structure, free its pbData member by calling the
* LocalFree function.
* @return
* If the function succeeds, the function returns TRUE. If the function fails,
* it returns FALSE. For extended error information, call GetLastError.
*/
public boolean CryptProtectData(DATA_BLOB pDataIn, String szDataDescr,
DATA_BLOB pOptionalEntropy, Pointer pvReserved,
CRYPTPROTECT_PROMPTSTRUCT pPromptStruct,
int dwFlags,
DATA_BLOB pDataOut);
/**
* The CryptUnprotectData function decrypts and does an integrity check of the data in
* a DATA_BLOB structure. Usually, only a user with the same logon credentials as the
* encrypter can decrypt the data. In addition, the encryption and decryption must be
* done on the same computer.
* @param pDataIn
* Pointer to a DATA_BLOB structure that holds the encrypted data. The DATA_BLOB
* structure's cbData member holds the length of the pbData member's byte string that
* contains the text to be encrypted.
* @param szDataDescr
* Pointer to a string-readable description of the encrypted data included with the
* encrypted data. This parameter can be set to NULL. When you have finished using
* ppszDataDescr, free it by calling the LocalFree function.
* @param pOptionalEntropy
* Pointer to a DATA_BLOB structure that contains a password or other additional
* entropy used when the data was encrypted. This parameter can be set to NULL;
* however, if an optional entropy DATA_BLOB structure was used in the encryption
* phase, that same DATA_BLOB structure must be used for the decryption phase.
* @param pvReserved
* Reserved for future use; must be set to NULL.
* @param pPromptStruct
* Pointer to a CRYPTPROTECT_PROMPTSTRUCT structure that provides information about
* where and when prompts are to be displayed and what the content of those prompts
* should be. This parameter can be set to NULL.
* @param dwFlags
* DWORD value that specifies options for this function. This parameter can be zero,
* in which case no option is set, or CRYPTPROTECT_UI_FORBIDDEN.
* @param pDataOut
* Pointer to a DATA_BLOB structure where the function stores the decrypted data.
* When you have finished using the DATA_BLOB structure, free its pbData member by
* calling the LocalFree function.
* @return
* If the function succeeds, the return value is TRUE. If the function fails, the
* return value is FALSE.
*/
public boolean CryptUnprotectData(DATA_BLOB pDataIn, PointerByReference szDataDescr,
DATA_BLOB pOptionalEntropy, Pointer pvReserved,
CRYPTPROTECT_PROMPTSTRUCT pPromptStruct,
int dwFlags,
DATA_BLOB pDataOut);
}
@@ -0,0 +1,140 @@
/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import com.sun.jna.platform.win32.WinCrypt.CRYPTPROTECT_PROMPTSTRUCT;
import com.sun.jna.platform.win32.WinCrypt.DATA_BLOB;
import com.sun.jna.ptr.PointerByReference;
/**
* Crypt32 utility API.
* @author dblock[at]dblock.org
*/
public abstract class Crypt32Util {
/**
* Protect a blob of data.
* @param data
* Data to protect.
* @return
* Protected data.
*/
public static byte[] cryptProtectData(byte[] data) {
return cryptProtectData(data, 0);
}
/**
* Protect a blob of data with optional flags.
* @param data
* Data to protect.
* @param flags
* Optional flags, eg. CRYPTPROTECT_LOCAL_MACHINE | CRYPTPROTECT_UI_FORBIDDEN.
* @return
* Protected data.
*/
public static byte[] cryptProtectData(byte[] data, int flags) {
return cryptProtectData(data, null, flags, "", null);
}
/**
* Protect a blob of data.
* @param data
* Data to protect.
* @param entropy
* Optional entropy.
* @param flags
* Optional flags.
* @param description
* Optional description.
* @param prompt
* Prompt structure.
* @return
* Protected bytes.
*/
public static byte[] cryptProtectData(byte[] data, byte[] entropy, int flags,
String description, CRYPTPROTECT_PROMPTSTRUCT prompt) {
DATA_BLOB pDataIn = new DATA_BLOB(data);
DATA_BLOB pDataProtected = new DATA_BLOB();
DATA_BLOB pEntropy = (entropy == null) ? null : new DATA_BLOB(entropy);
try {
if (! Crypt32.INSTANCE.CryptProtectData(pDataIn, description,
pEntropy, null, prompt, flags, pDataProtected)) {
throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
}
return pDataProtected.getData();
} finally {
if (pDataProtected.pbData != null) {
Kernel32.INSTANCE.LocalFree(pDataProtected.pbData);
}
}
}
/**
* Unprotect a blob of data.
* @param data
* Data to unprotect.
* @return
* Unprotected blob of data.
*/
public static byte[] cryptUnprotectData(byte[] data) {
return cryptUnprotectData(data, 0);
}
/**
* Unprotect a blob of data.
* @param data
* Data to unprotect.
* @param flags
* Optional flags, eg. CRYPTPROTECT_UI_FORBIDDEN.
* @return
* Unprotected blob of data.
*/
public static byte[] cryptUnprotectData(byte[] data, int flags) {
return cryptUnprotectData(data, null, flags, null);
}
/**
* Unprotect a blob of data.
* @param data
* Data to unprotect.
* @param entropy
* Optional entropy.
* @param flags
* Optional flags.
* @param prompt
* Optional prompt structure.
* @return
* Unprotected blob of data.
*/
public static byte[] cryptUnprotectData(byte[] data, byte[] entropy, int flags,
CRYPTPROTECT_PROMPTSTRUCT prompt) {
DATA_BLOB pDataIn = new DATA_BLOB(data);
DATA_BLOB pDataUnprotected = new DATA_BLOB();
DATA_BLOB pEntropy = (entropy == null) ? null : new DATA_BLOB(entropy);
PointerByReference pDescription = new PointerByReference();
try {
if (! Crypt32.INSTANCE.CryptUnprotectData(pDataIn, pDescription,
pEntropy, null, prompt, flags, pDataUnprotected)) {
throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
}
return pDataUnprotected.getData();
} finally {
if (pDataUnprotected.pbData != null) {
Kernel32.INSTANCE.LocalFree(pDataUnprotected.pbData);
}
if (pDescription.getValue() != null) {
Kernel32.INSTANCE.LocalFree(pDescription.getValue());
}
}
}
}
@@ -0,0 +1,220 @@
/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.WString;
import com.sun.jna.platform.win32.Guid.GUID;
import com.sun.jna.platform.win32.WinNT.PSID;
import com.sun.jna.win32.StdCallLibrary;
/**
* Ported from DsGetDC.h.
* Windows SDK 6.0a
* @author dblock[at]dblock.org
*/
public interface DsGetDC extends StdCallLibrary {
/**
* The DOMAIN_CONTROLLER_INFO structure is used with the DsGetDcName
* function to receive data about a domain controller.
*/
public static class DOMAIN_CONTROLLER_INFO extends Structure {
public static class ByReference extends DOMAIN_CONTROLLER_INFO implements Structure.ByReference { }
public DOMAIN_CONTROLLER_INFO() { }
public DOMAIN_CONTROLLER_INFO(Pointer memory) {
super(memory);
read();
}
/**
* Pointer to a null-terminated WString that specifies the computer name
* of the discovered domain controller. The returned computer name is
* prefixed with "\\". The DNS-style name, for example, "\\phoenix.fabrikam.com",
* is returned, if available. If the DNS-style name is not available, the
* flat-style name (for example, "\\phoenix") is returned. This example would apply
* if the domain is a Windows NT 4.0 domain or if the domain does not support the
* IP family of protocols.
*/
public WString DomainControllerName;
/**
* Pointer to a null-terminated WString that specifies the address of the discovered
* domain controller. The address is prefixed with "\\". This WString is one of the
* types defined by the DomainControllerAddressType member.
*/
public WString DomainControllerAddress;
/**
* Indicates the type of WString that is contained in the DomainControllerAddress member.
*/
public int DomainControllerAddressType;
/**
* The GUID of the domain. This member is zero if the domain controller does not have
* a Domain GUID; for example, the domain controller is not a Windows 2000 domain
* controller.
*/
public GUID DomainGuid;
/**
* Pointer to a null-terminated WString that specifies the name of the domain. The
* DNS-style name, for example, "fabrikam.com", is returned if available. Otherwise,
* the flat-style name, for example, "fabrikam", is returned. This name may be different
* than the requested domain name if the domain has been renamed.
*/
public WString DomainName;
/**
* Pointer to a null-terminated WString that specifies the name of the domain at the root
* of the DS tree. The DNS-style name, for example, "fabrikam.com", is returned if
* available. Otherwise, the flat-style name, for example, "fabrikam" is returned.
*/
public WString DnsForestName;
/**
* Contains a set of flags that describe the domain controller.
*/
public int Flags;
/**
* Pointer to a null-terminated WString that specifies the name of the site where the
* domain controller is located. This member may be NULL if the domain controller is
* not in a site; for example, the domain controller is a Windows NT 4.0 domain
* controller.
*/
public WString DcSiteName;
/**
* Pointer to a null-terminated WString that specifies the name of the site that the
* computer belongs to. The computer is specified in the ComputerName parameter passed
* to DsGetDcName. This member may be NULL if the site that contains the computer
* cannot be found; for example, if the DS administrator has not associated the
* subnet that the computer is in with a valid site.
*/
public WString ClientSiteName;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "DomainControllerName", "DomainControllerAddress", "DomainControllerAddressType", "DomainGuid", "DomainName", "DnsForestName", "Flags", "DcSiteName", "ClientSiteName"});
}
}
/**
* Pointer to DOMAIN_CONTROLLER_INFO.
*/
public static class PDOMAIN_CONTROLLER_INFO extends Structure {
public static class ByReference extends PDOMAIN_CONTROLLER_INFO implements Structure.ByReference {
}
public DOMAIN_CONTROLLER_INFO.ByReference dci;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "dci" });
}
}
/**
* Domain is a member of the forest.
*/
int DS_DOMAIN_IN_FOREST = 0x0001;
/**
* Domain is directly trusted.
*/
int DS_DOMAIN_DIRECT_OUTBOUND = 0x0002;
/**
* Domain is root of a tree in the forest.
*/
int DS_DOMAIN_TREE_ROOT = 0x0004;
/**
* Domain is the primary domain of queried server.
*/
int DS_DOMAIN_PRIMARY = 0x0008;
/**
* Primary domain is running in native mode.
*/
int DS_DOMAIN_NATIVE_MODE = 0x0010;
/**
* Domain is directly trusting.
*/
int DS_DOMAIN_DIRECT_INBOUND = 0x0020;
/**
* Valid domain flags.
*/
int DS_DOMAIN_VALID_FLAGS =
DS_DOMAIN_IN_FOREST |
DS_DOMAIN_DIRECT_OUTBOUND |
DS_DOMAIN_TREE_ROOT |
DS_DOMAIN_PRIMARY |
DS_DOMAIN_NATIVE_MODE |
DS_DOMAIN_DIRECT_INBOUND;
/**
* The DS_DOMAIN_TRUSTS structure is used with the DsEnumerateDomainTrusts function to
* contain trust data for a domain.
*/
public static class DS_DOMAIN_TRUSTS extends Structure {
public static class ByReference extends DS_DOMAIN_TRUSTS implements Structure.ByReference {
}
/**
* Pointer to a null-terminated string that contains the NetBIOS name of the domain.
*/
public WString NetbiosDomainName;
/**
* Pointer to a null-terminated string that contains the DNS name of the domain. This member may be NULL.
*/
public WString DnsDomainName;
/**
* Contains a set of flags that specify more data about the domain trust.
*/
public int Flags;
/**
* Contains the index in the Domains array returned by the DsEnumerateDomainTrusts function that
* corresponds to the parent domain of the domain represented by this structure.
*/
public int ParentIndex;
/**
* Contains a value that indicates the type of trust represented by this structure.
*/
public int TrustType;
/**
* Contains a value that indicates the attributes of the trust represented by this structure.
*/
public int TrustAttributes;
/**
* Contains the security identifier of the domain represented by this structure.
*/
public PSID.ByReference DomainSid;
/**
* Contains the GUID of the domain represented by this structure.
*/
public GUID DomainGuid;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "NetbiosDomainName", "DnsDomainName", "Flags", "ParentIndex", "TrustType", "TrustAttributes", "DomainSid", "DomainGuid" });
}
public DS_DOMAIN_TRUSTS() {
}
public DS_DOMAIN_TRUSTS(Pointer p) {
super(p);
read();
}
};
}
@@ -0,0 +1,316 @@
/* Copyright (c) 2007 Timothy Wall, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* <p/>
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.WinDef.HBITMAP;
import com.sun.jna.platform.win32.WinDef.HDC;
import com.sun.jna.platform.win32.WinDef.HRGN;
import com.sun.jna.platform.win32.WinGDI.BITMAPINFO;
import com.sun.jna.platform.win32.WinGDI.BITMAPINFOHEADER;
import com.sun.jna.platform.win32.WinGDI.RGNDATA;
import com.sun.jna.platform.win32.WinNT.HANDLE;
import com.sun.jna.ptr.PointerByReference;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
/** Definition (incomplete) of <code>gdi32.dll</code>. */
public interface GDI32 extends StdCallLibrary {
GDI32 INSTANCE = (GDI32) Native.loadLibrary("gdi32", GDI32.class,
W32APIOptions.DEFAULT_OPTIONS);
/**
* The ExtCreateRegion function creates a region from the specified region and transformation data.
* @param lpXform
* Pointer to an XFORM structure that defines the transformation to be performed on the region. If this pointer is NULL,
* the identity transformation is used.
* @param nCount
* Specifies the number of bytes pointed to by lpRgnData.
* @param lpRgnData
* Pointer to a RGNDATA structure that contains the region data in logical units.
* @return
* If the function succeeds, the return value is the value of the region.
* If the function fails, the return value is NULL.
* To get extended error information, call GetLastError.
*/
public HRGN ExtCreateRegion(Pointer lpXform, int nCount, RGNDATA lpRgnData);
/**
* The CombineRgn function combines two regions and stores the result in a third region.
* The two regions are combined according to the specified mode.
* @param hrgnDest
* Handle to a new region with dimensions defined by combining two other regions.
* @param hrgnSrc1
* Handle to the first of two regions to be combined.
* @param hrgnSrc2
* Handle to the second of two regions to be combined.
* @param fnCombineMode
* Specifies a mode indicating how the two regions will be combined.
* @return
* The return value specifies the type of the resulting region.
*/
int CombineRgn(HRGN hrgnDest, HRGN hrgnSrc1, HRGN hrgnSrc2,
int fnCombineMode);
/**
* The CreateRectRgn function creates a rectangular region.
* @param nLeftRect
* Specifies the x-coordinate of the upper-left corner of the region in logical units.
* @param nTopRect
* Specifies the y-coordinate of the upper-left corner of the region in logical units.
* @param nRightRect
* Specifies the x-coordinate of the lower-right corner of the region in logical units.
* @param nBottomRect
* Specifies the y-coordinate of the lower-right corner of the region in logical units.
* @return
* If the function succeeds, the return value is the handle to the region.
* If the function fails, the return value is NULL.
* To get extended error information, call GetLastError.
*/
HRGN CreateRectRgn(int nLeftRect, int nTopRect, int nRightRect,
int nBottomRect);
/**
* The CreateRoundRectRgn function creates a rectangular region with rounded corners.
* @param nLeftRect
* Specifies the x-coordinate of the upper-left corner of the region in logical units.
* @param nTopRect
* Specifies the y-coordinate of the upper-left corner of the region in logical units.
* @param nRightRect
* Specifies the x-coordinate of the lower-right corner of the region in logical units.
* @param nBottomRect
* Specifies the y-coordinate of the lower-right corner of the region in logical units.
* @param nWidthEllipse
* Specifies the width of the ellipse used to create the rounded corners in logical units.
* @param nHeightEllipse
* Specifies the height of the ellipse used to create the rounded corners in logical units.
* @return
* If the function succeeds, the return value is the handle to the region.
* If the function fails, the return value is NULL.
* To get extended error information, call GetLastError.
*/
HRGN CreateRoundRectRgn(int nLeftRect, int nTopRect, int nRightRect,
int nBottomRect, int nWidthEllipse, int nHeightEllipse);
/**
* The CreatePolyPolygonRgn function creates a region consisting of a series
* of polygons. The polygons can overlap.
* @param lppt
* Pointer to an array of POINT structures that define the vertices of the polygons in logical units.
* The polygons are specified consecutively. Each polygon is presumed closed and each vertex is
* specified only once.
* @param lpPolyCounts
* Pointer to an array of integers, each of which specifies the number of points in one of the polygons
* in the array pointed to by lppt.
* @param nCount
* Specifies the total number of integers in the array pointed to by lpPolyCounts.
* @param fnPolyFillMode
* Specifies the fill mode used to determine which pixels are in the region.
* @return
* If the function succeeds, the return value is the handle to the region.
* If the function fails, the return value is zero.
* To get extended error information, call GetLastError.
*/
HRGN CreatePolyPolygonRgn(WinUser.POINT[] lppt, int[] lpPolyCounts,
int nCount, int fnPolyFillMode);
/**
* The SetRectRgn function converts a region into a rectangular region with the specified coordinates.
* @param hrgn
* Handle to the region.
* @param nLeftRect
* Specifies the x-coordinate of the upper-left corner of the rectangular region in logical units.
* @param nTopRect
* Specifies the y-coordinate of the upper-left corner of the rectangular region in logical units.
* @param nRightRect
* Specifies the x-coordinate of the lower-right corner of the rectangular region in logical units.
* @param nBottomRect
* Specifies the y-coordinate of the lower-right corner of the rectangular region in logical units.
* @return
* If the function succeeds, the return value is nonzero.
* If the function fails, the return value is zero.
* To get extended error information, call GetLastError.
*/
boolean SetRectRgn(HRGN hrgn, int nLeftRect, int nTopRect, int nRightRect,
int nBottomRect);
/**
* The SetPixel function sets the pixel at the specified coordinates to the specified color.
* @param hDC
* Handle to the device context.
* @param x
* Specifies the x-coordinate, in logical units, of the point to be set.
* @param y
* Specifies the y-coordinate, in logical units, of the point to be set.
* @param crColor
* Specifies the color to be used to paint the point. To create a COLORREF color value, use the RGB macro.
* @return
* If the function succeeds, the return value is the RGB value that the function sets the pixel to.
* This value may differ from the color specified by crColor; that occurs when an exact match for the
* specified color cannot be found. If the function fails, the return value is 1. To get extended error
* information, call GetLastError. This can be the following value.
*/
int SetPixel(HDC hDC, int x, int y, int crColor);
/**
* The CreateCompatibleDC function creates a memory device context (DC) compatible with the specified device.
* @param hDC
* Handle to an existing DC. If this handle is NULL, the function creates a memory DC compatible with the
* application's current screen.
* @return
* If the function succeeds, the return value is the handle to a memory DC.
* If the function fails, the return value is NULL.
* To get extended error information, call GetLastError.
*/
HDC CreateCompatibleDC(HDC hDC);
/**
* The DeleteDC function deletes the specified device context (DC).
* @param hDC
* Handle to the device context.
* @return
* If the function succeeds, the return value is nonzero.
* If the function fails, the return value is zero.
* To get extended error information, call GetLastError.
*/
boolean DeleteDC(HDC hDC);
/**
* The CreateDIBitmap function creates a compatible bitmap (DDB) from a DIB and, optionally,
* sets the bitmap bits.
* @param hDC
* Handle to a device context.
* @param lpbmih
* Pointer to a bitmap information header structure, which may be one of those shown in the following table.
* @param fdwInit
* Specifies how the system initializes the bitmap bits.
* @param lpbInit
* Pointer to an array of bytes containing the initial bitmap data.
* @param lpbmi
* Pointer to a BITMAPINFO structure that describes the dimensions and color format of
* the array pointed to by the lpbInit parameter.
* @param fuUsage
* Specifies whether the bmiColors member of the BITMAPINFO structure was initialized and, if so,
* whether bmiColors contains explicit red, green, blue (RGB) values or palette indexes. The
* fuUsage parameter must be one of the following values.
* @return
* If the function succeeds, the return value is a handle to the compatible bitmap.
* If the function fails, the return value is NULL.
* To get extended error information, call GetLastError.
*/
HBITMAP CreateDIBitmap(HDC hDC, BITMAPINFOHEADER lpbmih, int fdwInit,
Pointer lpbInit, BITMAPINFO lpbmi, int fuUsage);
/**
* The CreateDIBSection function creates a DIB that applications can write to directly.
* The function gives you a pointer to the location of the bitmap bit values. You can supply
* a handle to a file-mapping object that the function will use to create the bitmap, or you
* can let the system allocate the memory for the bitmap.
* @param hDC
* Handle to a device context. If the value of iUsage is DIB_PAL_COLORS, the function uses this
* device context's logical palette to initialize the DIB colors.
* @param pbmi
* Pointer to a BITMAPINFO structure that specifies various attributes of the DIB, including
* the bitmap dimensions and colors.
* @param iUsage
* Specifies the type of data contained in the bmiColors array member of the BITMAPINFO structure
* pointed to by pbmi (either logical palette indexes or literal RGB values).
* @param ppvBits
* Pointer to a variable that receives a pointer to the location of the DIB bit values.
* @param hSection
* Handle to a file-mapping object that the function will use to create the DIB. This parameter can be NULL.
* @param dwOffset
* Specifies the offset from the beginning of the file-mapping object referenced by hSection where storage
* for the bitmap bit values is to begin.
* @return
* Specifies the offset from the beginning of the file-mapping object referenced by hSection where storage
* for the bitmap bit values is to begin.
*/
HBITMAP CreateDIBSection(HDC hDC, BITMAPINFO pbmi, int iUsage,
PointerByReference ppvBits, Pointer hSection, int dwOffset);
/**
* The CreateCompatibleBitmap function creates a bitmap compatible with the device that is
* associated with the specified device context.
* @param hDC
* Handle to a device context.
* @param width
* Specifies the bitmap width, in pixels.
* @param height
* Specifies the bitmap height, in pixels.
* @return
* If the function succeeds, the return value is a handle to the compatible bitmap (DDB).
* If the function fails, the return value is NULL.
* To get extended error information, call GetLastError.
*/
HBITMAP CreateCompatibleBitmap(HDC hDC, int width, int height);
/**
* The SelectObject function selects an object into the specified device context (DC).
* The new object replaces the previous object of the same type.
* @param hDC
* Handle to the DC.
* @param hGDIObj
* Handle to the object to be selected.
* @return
* If the selected object is not a region and the function succeeds, the return value
* is a handle to the object being replaced. If the selected object is a region and the
* function succeeds, the return value is one of the REGION values.
*/
HANDLE SelectObject(HDC hDC, HANDLE hGDIObj);
/**
* The DeleteObject function deletes a logical pen, brush, font, bitmap, region, or palette,
* freeing all system resources associated with the object. After the object is deleted, the
* specified handle is no longer valid.
* @param hObject
* Handle to a logical pen, brush, font, bitmap, region, or palette.
* @return
* If the function succeeds, the return value is nonzero.
* If the specified handle is not valid or is currently selected into a DC, the return value is zero.
* To get extended error information, call GetLastError.
*/
boolean DeleteObject(HANDLE hObject);
/** The GetDeviceCaps function retrieves device-specific information for
* the specified device.
* @param hdc A handle to the DC.
* @param nIndex The item to be returned.
* @return
* The return value specifies the value of the desired item. When
* <i>nIndex</i> is <code>BITSPIXEL</code> and the device has 15bpp or
* 16bpp, the return value is 16.
*/
int GetDeviceCaps(HDC hdc, int nIndex);
/** The GetDIBits function retrieves the bits fo the specified compatible
* bitmap and copies them into a buffer as a DIB using the specified
* format.
* @param hdc A handle to the device context.
* @param hbmp A handle to the bitmap. This must be a compatible bitmap
* (DDB).
* @param uStartScan The first scan line to retrieve
* @param cScanLines The number of scan lines to retrieve.
* @param lpvBits A pointer to a buffer to receive the bitmap data. If
* this parameter is <code>null</code>, the function passes the dimensions
* and format of the bitmap to the {@link BITMAPINFO} structure pointed to
* by the <i>lpbi</i> parameter.
* @param lpbi A pointer to a {@link BITMAPINFO} structure that specifies
* the desired format for the DIB data.
* @param uUsage The format of the bmiColors member of the {@link
* BITMAPINFO} structure.
*/
int GetDIBits(HDC hdc, HBITMAP hbmp, int uStartScan, int cScanLines, Pointer lpvBits, BITMAPINFO lpbi, int uUsage);
}
@@ -0,0 +1,100 @@
/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
/**
* Ported from Guid.h.
* Microsoft Windows SDK 6.0A.
* @author dblock[at]dblock.org
*/
public interface Guid {
public static class GUID extends Structure {
public static class ByReference extends GUID implements Structure.ByReference {
public ByReference() {
}
public ByReference(GUID guid) {
super(guid.getPointer());
Data1 = guid.Data1;
Data2 = guid.Data2;
Data3 = guid.Data3;
Data4 = guid.Data4;
}
public ByReference(Pointer memory) {
super(memory);
}
}
public GUID() {
}
public GUID(Pointer memory) {
super(memory);
read();
}
public GUID(byte[] data) {
if (data.length != 16) {
throw new IllegalArgumentException("Invalid data length: " + data.length);
}
long data1Temp = data[3] & 0xff;
data1Temp <<= 8;
data1Temp |= data[2] & 0xff;
data1Temp <<= 8;
data1Temp |= data[1] & 0xff;
data1Temp <<= 8;
data1Temp |= data[0] & 0xff;
Data1 = (int) data1Temp;
int data2Temp = data[5] & 0xff;
data2Temp <<= 8;
data2Temp |= data[4] & 0xff;
Data2 = (short) data2Temp;
int data3Temp = data[7] & 0xff;
data3Temp <<= 8;
data3Temp |= data[6] & 0xff;
Data3 = (short) data3Temp;
Data4[0] = data[8];
Data4[1] = data[9];
Data4[2] = data[10];
Data4[3] = data[11];
Data4[4] = data[12];
Data4[5] = data[13];
Data4[6] = data[14];
Data4[7] = data[15];
}
public int Data1;
public short Data2;
public short Data3;
public byte[] Data4 = new byte[8];
protected List getFieldOrder() {
return Arrays.asList(new String[] { "Data1", "Data2", "Data3", "Data4" });
}
}
}
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
@@ -0,0 +1,228 @@
/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
import com.sun.jna.LastErrorException;
import com.sun.jna.Native;
import com.sun.jna.platform.win32.WinNT.HANDLE;
import com.sun.jna.platform.win32.WinNT.HANDLEByReference;
import com.sun.jna.platform.win32.WinNT.HRESULT;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.ptr.PointerByReference;
/**
* Kernel32 utility API.
* @author dblock[at]dblock.org
*/
public abstract class Kernel32Util implements WinDef {
/**
* Get current computer NetBIOS name.
* @return
* Netbios name.
*/
public static String getComputerName() {
char buffer[] = new char[WinBase.MAX_COMPUTERNAME_LENGTH + 1];
IntByReference lpnSize = new IntByReference(buffer.length);
if (! Kernel32.INSTANCE.GetComputerName(buffer, lpnSize)) {
throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
}
return Native.toString(buffer);
}
/**
* Format a message from an HRESULT.
* @param code
* HRESULT
* @return
* Formatted message.
*/
public static String formatMessageFromHR(HRESULT code) {
PointerByReference buffer = new PointerByReference();
if (0 == Kernel32.INSTANCE.FormatMessage(
WinBase.FORMAT_MESSAGE_ALLOCATE_BUFFER
| WinBase.FORMAT_MESSAGE_FROM_SYSTEM
| WinBase.FORMAT_MESSAGE_IGNORE_INSERTS,
null,
code.intValue(),
0, // TODO: MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)
buffer,
0,
null)) {
throw new LastErrorException(Kernel32.INSTANCE.GetLastError());
}
String s = buffer.getValue().getString(0, ! Boolean.getBoolean("w32.ascii"));
Kernel32.INSTANCE.LocalFree(buffer.getValue());
return s.trim();
}
/**
* Format a system message from an error code.
* @param code
* Error code, typically a result of GetLastError.
* @return
* Formatted message.
*/
public static String formatMessageFromLastErrorCode(int code) {
return formatMessageFromHR(W32Errors.HRESULT_FROM_WIN32(code));
}
/**
* Return the path designated for temporary files.
* @return
* Path.
*/
public static String getTempPath() {
DWORD nBufferLength = new DWORD(WinDef.MAX_PATH);
char[] buffer = new char[nBufferLength.intValue()];
if (Kernel32.INSTANCE.GetTempPath(nBufferLength, buffer).intValue() == 0) {
throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
}
return Native.toString(buffer);
}
public static void deleteFile(String filename) {
if (! Kernel32.INSTANCE.DeleteFile(filename)) {
throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
}
}
/**
* Returns valid drives in the system.
* @return
* An array of valid drives.
*/
public static String[] getLogicalDriveStrings() {
DWORD dwSize = Kernel32.INSTANCE.GetLogicalDriveStrings(new DWORD(0), null);
if (dwSize.intValue() <= 0) {
throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
}
char buf[] = new char[dwSize.intValue()];
dwSize = Kernel32.INSTANCE.GetLogicalDriveStrings(dwSize, buf);
if (dwSize.intValue() <= 0) {
throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
}
List<String> drives = new ArrayList<String>();
String drive = "";
// the buffer is double-null-terminated
for(int i = 0; i < buf.length - 1; i++) {
if (buf[i] == 0) {
drives.add(drive);
drive = "";
} else {
drive += buf[i];
}
}
return drives.toArray(new String[0]);
}
/**
* Retrieves file system attributes for a specified file or directory.
* @param fileName
* The name of the file or directory.
* @return
* The attributes of the specified file or directory.
*/
public static int getFileAttributes(String fileName) {
int fileAttributes = Kernel32.INSTANCE.GetFileAttributes(fileName);
if (fileAttributes == WinBase.INVALID_FILE_ATTRIBUTES) {
throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
}
return fileAttributes;
}
/**
* Retrieves the result of GetFileType, provided the file exists.
*/
public static int getFileType(String fileName) throws FileNotFoundException {
File f = new File(fileName);
if (!f.exists()) {
throw new FileNotFoundException(fileName);
}
HANDLE hFile = null;
try {
hFile = Kernel32.INSTANCE.CreateFile(fileName,
WinNT.GENERIC_READ,
WinNT.FILE_SHARE_READ,
new WinBase.SECURITY_ATTRIBUTES(),
WinNT.OPEN_EXISTING,
WinNT.FILE_ATTRIBUTE_NORMAL,
new HANDLEByReference().getValue());
if (WinBase.INVALID_HANDLE_VALUE.equals(hFile)) {
throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
}
int type = Kernel32.INSTANCE.GetFileType(hFile);
switch(type) {
case WinNT.FILE_TYPE_UNKNOWN:
int err = Kernel32.INSTANCE.GetLastError();
switch(err) {
case W32Errors.NO_ERROR:
break;
default:
throw new Win32Exception(err);
}
// fall-thru
default:
return type;
}
} finally {
if (hFile != null) {
if (! Kernel32.INSTANCE.CloseHandle(hFile)) {
throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
}
}
}
}
/**
* @return One of the WinBase.DRIVE_* constants.
*/
public static int getDriveType(String rootName) {
return Kernel32.INSTANCE.GetDriveType(rootName);
}
/**
* Get the value of an environment variable.
* @param name
* Name of the environment variable.
* @return
* Value of an environment variable.
*/
public static String getEnvironmentVariable(String name) {
// obtain the buffer size
int size = Kernel32.INSTANCE.GetEnvironmentVariable(name, null, 0);
if (size == 0) {
return null;
} else if (size < 0) {
throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
}
// obtain the value
char[] buffer = new char[size];
size = Kernel32.INSTANCE.GetEnvironmentVariable(name, buffer, buffer.length);
if (size <= 0) {
throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
}
return Native.toString(buffer);
}
}
@@ -0,0 +1,426 @@
/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.WString;
import com.sun.jna.platform.win32.WinNT.PSID;
import com.sun.jna.win32.StdCallLibrary;
/**
* Ported from LMAccess.h.
* Windows SDK 6.0A.
* @author dblock[at]dblock.org
*/
public interface LMAccess extends StdCallLibrary {
public static class LOCALGROUP_INFO_0 extends Structure {
public LOCALGROUP_INFO_0() {
super();
}
public LOCALGROUP_INFO_0(Pointer memory) {
super(memory);
read();
}
public WString lgrui0_name;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "lgrui0_name" });
}
}
public static class LOCALGROUP_INFO_1 extends Structure {
public LOCALGROUP_INFO_1() {
super();
}
public LOCALGROUP_INFO_1(Pointer memory) {
super(memory);
read();
}
public WString lgrui1_name;
public WString lgrui1_comment;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "lgrui1_name", "lgrui1_comment" });
}
}
//
// bit masks for the NetUserEnum filter parameter.
//
int FILTER_TEMP_DUPLICATE_ACCOUNT = 0x0001;
int FILTER_NORMAL_ACCOUNT = 0x0002;
// int FILTER_PROXY_ACCOUNT = 0x0004;
int FILTER_INTERDOMAIN_TRUST_ACCOUNT = 0x0008;
int FILTER_WORKSTATION_TRUST_ACCOUNT = 0x0010;
int FILTER_SERVER_TRUST_ACCOUNT = 0x0020;
/**
* The USER_INFO_0 structure contains a user account name.
*/
public static class USER_INFO_0 extends Structure {
public USER_INFO_0() {
super();
}
public USER_INFO_0(Pointer memory) {
super(memory);
read();
}
/**
* Pointer to a Unicode string that specifies the name of the user account.
*/
public WString usri0_name;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "usri0_name" });
}
}
/**
* The USER_INFO_1 structure contains information about a user account, including
* account name, password data, privilege level, and the path to the user's home
* directory.
*/
public static class USER_INFO_1 extends Structure {
public USER_INFO_1() {
super();
}
public USER_INFO_1(Pointer memory) {
super(memory);
read();
}
/**
* Pointer to a Unicode string that specifies the name of the user
* account.
*/
public WString usri1_name;
/**
* Pointer to a Unicode string that specifies the password of the user
* indicated by the usri1_name member.
*/
public WString usri1_password;
/**
* Specifies a DWORD value that indicates the number of seconds that have
* elapsed since the usri1_password member was last changed.
*/
public int usri1_password_age;
/**
* Specifies a DWORD value that indicates the level of privilege assigned
* to the usri1_name member.
*/
public int usri1_priv;
/**
* Pointer to a Unicode string specifying the path of the home directory
* for the user specified in the usri1_name member.
*/
public WString usri1_home_dir;
/**
* Pointer to a Unicode string that contains a comment to associate with
* the user account.
*/
public WString usri1_comment;
/**
* Specifies a DWORD value that determines several features.
*/
public int usri1_flags;
/**
* Pointer to a Unicode string specifying the path for the user's
* logon script file.
*/
public WString usri1_script_path;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "usri1_name", "usri1_password", "usri1_password_age", "usri1_priv", "usri1_home_dir", "usri1_comment", "usri1_flags", "usri1_script_path" });
}
}
/**
* The USER_INFO_23 structure contains information about a user account,
* including the account name, the user's full name, a comment associated with the account,
* and the user's security identifier (SID).
*
* Note :
* The USER_INFO_23 structure supersedes the USER_INFO_20 structure.
* It is recommended that applications use the USER_INFO_23 structure instead of the USER_INFO_20 structure.
*/
public static class USER_INFO_23 extends Structure {
public USER_INFO_23() {
super();
}
public USER_INFO_23(Pointer memory) {
useMemory(memory);
read();
}
/**
* A pointer to a Unicode string that specifies the name of the user account.
* Calls to the NetUserSetInfo function ignore this member.
*/
public WString usri23_name;
/**
* A pointer to a Unicode string that contains the full name of the user.
* This string can be a null string, or it can have any number of characters before the terminating null character.
*/
public WString usri23_full_name;
/**
* A pointer to a Unicode string that contains a comment associated with the user account.
* This string can be a null string, or it can have any number of characters before the terminating null character.
*/
public WString usri23_comment;
/**
* This member can be one or more of the following values.
* Note that setting user account control flags may require certain privileges and control access rights.
* For more information, see the Remarks section of the NetUserSetInfo function.
* Value Meaning
* UF_SCRIPT The logon script executed. This value must be set.
* UF_ACCOUNTDISABLE The user's account is disabled.
* UF_HOMEDIR_REQUIRED The home directory is required. This value is ignored.
* UF_PASSWD_NOTREQD No password is required.
* UF_PASSWD_CANT_CHANGE The user cannot change the password.
* UF_LOCKOUT The account is currently locked out. You can call the NetUserSetInfo function to clear this value and unlock a previously locked account. You cannot use this value to lock a previously unlocked account.
* UF_DONT_EXPIRE_PASSWD The password should never expire on the account.
* UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED The user's password is stored under reversible encryption in the Active Directory.
* UF_NOT_DELEGATED Marks the account as "sensitive"; other users cannot act as delegates of this user account.
* UF_SMARTCARD_REQUIRED Requires the user to log on to the user account with a smart card.
* UF_USE_DES_KEY_ONLY Restrict this principal to use only Data Encryption Standard (DES) encryption types for keys.
* UF_DONT_REQUIRE_PREAUTH This account does not require Kerberos preauthentication for logon.
* UF_TRUSTED_FOR_DELEGATION The account is enabled for delegation. This is a security-sensitive setting; accounts with this option enabled should be tightly controlled. This setting allows a service running under the account to assume a client's identity and authenticate as that user to other remote servers on the network.
* UF_PASSWORD_EXPIRED The user's password has expired. Windows 2000: This value is not supported.
* UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION The account is trusted to authenticate a user outside of the Kerberos security package and delegate that user through constrained delegation. This is a security-sensitive setting; accounts with this option enabled should be tightly controlled. This setting allows a service running under the account to assert a client's identity and authenticate as that user to specifically configured services on the network. Windows XP/2000: This value is not supported.
*
* The following values describe the account type. Only one value can be set. You cannot change the account type using the NetUserSetInfo function.
* Value Meaning
* UF_NORMAL_ACCOUNT This is a default account type that represents a typical user.
* UF_TEMP_DUPLICATE_ACCOUNT This is an account for users whose primary account is in another domain. This account provides user access to this domain, but not to any domain that trusts this domain. The User Manager refers to this account type as a local user account.
* UF_WORKSTATION_TRUST_ACCOUNT This is a computer account for a computer that is a member of this domain.
* UF_SERVER_TRUST_ACCOUNT This is a computer account for a backup domain controller that is a member of this domain.
* UF_INTERDOMAIN_TRUST_ACCOUNT This is a permit to trust account for a domain that trusts other domains.
*/
public int usri23_flags;
/**
* A pointer to a SID structure that contains the security identifier (SID)
* that uniquely identifies the user. The NetUserAdd and NetUserSetInfo functions ignore this member.
*/
public PSID.ByReference usri23_user_sid;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "usri23_name", "usri23_full_name", "usri23_comment", "usri23_flags", "usri23_user_sid" });
}
}
/**
* The GROUP_USERS_INFO_0 structure contains global group member information.
*/
public static class GROUP_USERS_INFO_0 extends Structure {
public GROUP_USERS_INFO_0() {
super();
}
public GROUP_USERS_INFO_0(Pointer memory) {
super(memory);
read();
}
/**
* Pointer to a null-terminated Unicode character string that specifies a name.
*/
public WString grui0_name;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "grui0_name" });
}
}
/**
* The LOCALGROUP_USERS_INFO_0 structure contains local group member information.
*/
public static class LOCALGROUP_USERS_INFO_0 extends Structure {
public LOCALGROUP_USERS_INFO_0() {
super();
}
public LOCALGROUP_USERS_INFO_0(Pointer memory) {
super(memory);
read();
}
/**
* Pointer to a Unicode string specifying the name of a local group to which the user belongs.
*/
public WString lgrui0_name;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "lgrui0_name" });
}
}
/**
* The GROUP_INFO_0 structure contains the name of a global group in the security
* database, which is the security accounts manager (SAM) database or, in the case
* of domain controllers, the Active Directory.
*/
public static class GROUP_INFO_0 extends Structure {
public GROUP_INFO_0() {
super();
}
public GROUP_INFO_0(Pointer memory) {
super(memory);
read();
}
/**
* Pointer to a null-terminated Unicode character string that specifies
* the name of the global group.
*/
public WString grpi0_name;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "grpi0_name" });
}
}
/**
* The GROUP_INFO_1 structure contains a global group name and a comment to
* associate with the group.
*/
public static class GROUP_INFO_1 extends Structure {
public GROUP_INFO_1() {
super();
}
public GROUP_INFO_1(Pointer memory) {
super(memory);
read();
}
/**
* Pointer to a null-terminated Unicode character string that specifies
* the name of the global group.
*/
public WString grpi1_name;
/**
* Pointer to a null-terminated Unicode character string that specifies
* a remark associated with the global group. This member can be a null
* string. The comment can contain MAXCOMMENTSZ characters.
*/
public WString grpi1_comment;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "grpi1_name", "grpi1_comment" });
}
}
/**
* The GROUP_INFO_2 structure contains information about a global group, including
* name, identifier, and resource attributes.
*/
public static class GROUP_INFO_2 extends Structure {
public GROUP_INFO_2() {
super();
}
public GROUP_INFO_2(Pointer memory) {
super(memory);
read();
}
/**
* Pointer to a null-terminated Unicode character string that
* specifies the name of the global group.
*/
public WString grpi2_name;
/**
* Pointer to a null-terminated Unicode character string that contains a
* remark associated with the global group. This member can be a null string.
* The comment can contain MAXCOMMENTSZ characters.
*/
public WString grpi2_comment;
/**
* Specifies a DWORD value that contains the relative identifier (RID) of
* the global group.
*/
public int grpi2_group_id;
/**
* These attributes are hard-coded to SE_GROUP_MANDATORY, SE_GROUP_ENABLED,
* and SE_GROUP_ENABLED_BY_DEFAULT.
*/
public int grpi2_attributes;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "grpi2_name", "grpi2_comment", "grpi2_group_id", "grpi2_attributes" });
}
}
/**
* The GROUP_INFO_3 structure contains information about a global group, including
* name, security identifier (SID), and resource attributes.
*/
public static class GROUP_INFO_3 extends Structure {
public GROUP_INFO_3() {
super();
}
public GROUP_INFO_3(Pointer memory) {
super(memory);
read();
}
/**
* Pointer to a null-terminated Unicode character string that
* specifies the name of the global group.
*/
public WString grpi3_name;
/**
* Pointer to a null-terminated Unicode character string that
* contains a remark associated with the global group. This member can be
* a null string. The comment can contain MAXCOMMENTSZ characters.
*/
public WString grpi3_comment;
/**
* Pointer to a SID structure that contains the security identifier (SID) that
* uniquely identifies the global group.
*/
public PSID.ByReference grpi3_group_sid;
/**
* These attributes are hard-coded to SE_GROUP_MANDATORY, SE_GROUP_ENABLED, and
* SE_GROUP_ENABLED_BY_DEFAULT.
*/
public int grpi3_attributes;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "grpi3_name", "grpi3_comment", "grpi3_group_id", "grpi3_attributes" });
}
}
//
// Privilege levels (USER_INFO_X field usriX_priv (X = 0/1)).
//
int USER_PRIV_MASK = 3;
int USER_PRIV_GUEST = 0;
int USER_PRIV_USER = 1;
int USER_PRIV_ADMIN = 2;
}
@@ -0,0 +1,30 @@
/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import com.sun.jna.win32.StdCallLibrary;
/**
* Ported from LMCons.h.
* @author dblock[at]dblock.org
* Windows SDK 6.0A
*/
public interface LMCons extends StdCallLibrary {
int NETBIOS_NAME_LEN = 16; // NetBIOS net name (bytes)
/**
* Value to be used with APIs which have a "preferred maximum length" parameter.
* This value indicates that the API should just allocate "as much as it takes."
*/
int MAX_PREFERRED_LENGTH = -1;
}
@@ -0,0 +1,567 @@
/* Copyright (c) 2007 Timothy Wall, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import com.sun.jna.win32.StdCallLibrary;
/**
* Ported from LMErr.h.
* @author dblock[at]dblock.org
* Windows SDK 6.0A
*/
public interface LMErr extends StdCallLibrary {
int NERR_Success = 0;
int NERR_BASE = 2100;
int NERR_NetNotStarted = NERR_BASE + 2; /* The workstation driver is not installed. */
int NERR_UnknownServer = NERR_BASE + 3; /* The server could not be located. */
int NERR_ShareMem = NERR_BASE + 4; /* An internal error occurred. The network cannot access a shared memory segment. */
int NERR_NoNetworkResource = NERR_BASE + 5; /* A network resource shortage occurred . */
int NERR_RemoteOnly = NERR_BASE + 6; /* This operation is not supported on workstations. */
int NERR_DevNotRedirected = NERR_BASE + 7; /* The device is not connected. */
/* NERR_BASE + 8 is used for ERROR_CONNECTED_OTHER_PASSWORD */
/* NERR_BASE + 9 is used for ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT */
/* UNUSED BASE + 10 */
/* UNUSED BASE + 11 */
/* UNUSED BASE + 12 */
/* UNUSED BASE + 13 */
int NERR_ServerNotStarted = NERR_BASE + 14; /* The Server service is not started. */
int NERR_ItemNotFound = NERR_BASE + 15; /* The queue is empty. */
int NERR_UnknownDevDir = NERR_BASE + 16; /* The device or directory does not exist. */
int NERR_RedirectedPath = NERR_BASE + 17; /* The operation is invalid on a redirected resource. */
int NERR_DuplicateShare = NERR_BASE + 18; /* The name has already been shared. */
int NERR_NoRoom = NERR_BASE + 19; /* The server is currently out of the requested resource. */
/* UNUSED BASE + 20 */
int NERR_TooManyItems = NERR_BASE + 21; /* Requested addition of items exceeds the maximum allowed. */
int NERR_InvalidMaxUsers = NERR_BASE + 22; /* The Peer service supports only two simultaneous users. */
int NERR_BufTooSmall = NERR_BASE + 23; /* The API return buffer is too small. */
/* UNUSED BASE + 24 */
/* UNUSED BASE + 25 */
/* UNUSED BASE + 26 */
int NERR_RemoteErr = NERR_BASE + 27; /* A remote API error occurred. */
/* UNUSED BASE + 28 */
/* UNUSED BASE + 29 */
/* UNUSED BASE + 30 */
int NERR_LanmanIniError = NERR_BASE + 31; /* An error occurred when opening or reading the configuration file. */
/* UNUSED BASE + 32 */
/* UNUSED BASE + 33 */
/* UNUSED BASE + 34 */
/* UNUSED BASE + 35 */
int NERR_NetworkError = NERR_BASE + 36; /* A general network error occurred. */
int NERR_WkstaInconsistentState = NERR_BASE + 37;
/* The Workstation service is in an inconsistent state. Restart the computer before restarting the Workstation service. */
int NERR_WkstaNotStarted = NERR_BASE + 38; /* The Workstation service has not been started. */
int NERR_BrowserNotStarted = NERR_BASE + 39; /* The requested information is not available. */
int NERR_InternalError = NERR_BASE + 40; /* An internal Windows error occurred.*/
int NERR_BadTransactConfig = NERR_BASE + 41; /* The server is not configured for transactions. */
int NERR_InvalidAPI = NERR_BASE + 42; /* The requested API is not supported on the remote server. */
int NERR_BadEventName = NERR_BASE + 43; /* The event name is invalid. */
int NERR_DupNameReboot = NERR_BASE + 44; /* The computer name already exists on the network. Change it and restart the computer. */
/*
* Config API related
* Error codes from BASE + 45 to BASE + 49
*/
/* UNUSED BASE + 45 */
int NERR_CfgCompNotFound = NERR_BASE + 46; /* The specified component could not be found in the configuration information. */
int NERR_CfgParamNotFound = NERR_BASE + 47; /* The specified parameter could not be found in the configuration information. */
int NERR_LineTooLong = NERR_BASE + 49; /* A line in the configuration file is too long. */
/*
* Spooler API related
* Error codes from BASE + 50 to BASE + 79
*/
int NERR_QNotFound = NERR_BASE + 50; /* The printer does not exist. */
int NERR_JobNotFound = NERR_BASE + 51; /* The print job does not exist. */
int NERR_DestNotFound = NERR_BASE + 52; /* The printer destination cannot be found. */
int NERR_DestExists = NERR_BASE + 53; /* The printer destination already exists. */
int NERR_QExists = NERR_BASE + 54; /* The printer queue already exists. */
int NERR_QNoRoom = NERR_BASE + 55; /* No more printers can be added. */
int NERR_JobNoRoom = NERR_BASE + 56; /* No more print jobs can be added. */
int NERR_DestNoRoom = NERR_BASE + 57; /* No more printer destinations can be added. */
int NERR_DestIdle = NERR_BASE + 58; /* This printer destination is idle and cannot accept control operations. */
int NERR_DestInvalidOp = NERR_BASE + 59; /* This printer destination request contains an invalid control function. */
int NERR_ProcNoRespond = NERR_BASE + 60; /* The print processor is not responding. */
int NERR_SpoolerNotLoaded = NERR_BASE + 61; /* The spooler is not running. */
int NERR_DestInvalidState = NERR_BASE + 62; /* This operation cannot be performed on the print destination in its current state. */
int NERR_QInvalidState = NERR_BASE + 63; /* This operation cannot be performed on the printer queue in its current state. */
int NERR_JobInvalidState = NERR_BASE + 64; /* This operation cannot be performed on the print job in its current state. */
int NERR_SpoolNoMemory = NERR_BASE + 65; /* A spooler memory allocation failure occurred. */
int NERR_DriverNotFound = NERR_BASE + 66; /* The device driver does not exist. */
int NERR_DataTypeInvalid = NERR_BASE + 67; /* The data type is not supported by the print processor. */
int NERR_ProcNotFound = NERR_BASE + 68; /* The print processor is not installed. */
/*
* Service API related
* Error codes from BASE + 80 to BASE + 99
*/
int NERR_ServiceTableLocked = NERR_BASE + 80; /* The service database is locked. */
int NERR_ServiceTableFull = NERR_BASE + 81; /* The service table is full. */
int NERR_ServiceInstalled = NERR_BASE + 82; /* The requested service has already been started. */
int NERR_ServiceEntryLocked = NERR_BASE + 83; /* The service does not respond to control actions. */
int NERR_ServiceNotInstalled = NERR_BASE + 84; /* The service has not been started. */
int NERR_BadServiceName = NERR_BASE + 85; /* The service name is invalid. */
int NERR_ServiceCtlTimeout = NERR_BASE + 86; /* The service is not responding to the control function. */
int NERR_ServiceCtlBusy = NERR_BASE + 87; /* The service control is busy. */
int NERR_BadServiceProgName = NERR_BASE + 88; /* The configuration file contains an invalid service program name. */
int NERR_ServiceNotCtrl = NERR_BASE + 89; /* The service could not be controlled in its present state. */
int NERR_ServiceKillProc = NERR_BASE + 90; /* The service ended abnormally. */
int NERR_ServiceCtlNotValid = NERR_BASE + 91; /* The requested pause, continue, or stop is not valid for this service. */
int NERR_NotInDispatchTbl = NERR_BASE + 92; /* The service control dispatcher could not find the service name in the dispatch table. */
int NERR_BadControlRecv = NERR_BASE + 93; /* The service control dispatcher pipe read failed. */
int NERR_ServiceNotStarting = NERR_BASE + 94; /* A thread for the new service could not be created. */
/*
* Wksta and Logon API related
* Error codes from BASE + 100 to BASE + 118
*/
int NERR_AlreadyLoggedOn = NERR_BASE + 100; /* This workstation is already logged on to the local-area network. */
int NERR_NotLoggedOn = NERR_BASE + 101; /* The workstation is not logged on to the local-area network. */
int NERR_BadUsername = NERR_BASE + 102; /* The user name or group name parameter is invalid. */
int NERR_BadPassword = NERR_BASE + 103; /* The password parameter is invalid. */
int NERR_UnableToAddName_W = NERR_BASE + 104; /* @W The logon processor did not add the message alias. */
int NERR_UnableToAddName_F = NERR_BASE + 105; /* The logon processor did not add the message alias. */
int NERR_UnableToDelName_W = NERR_BASE + 106; /* @W The logoff processor did not delete the message alias. */
int NERR_UnableToDelName_F = NERR_BASE + 107; /* The logoff processor did not delete the message alias. */
/* UNUSED BASE + 108 */
int NERR_LogonsPaused = NERR_BASE + 109; /* Network logons are paused. */
int NERR_LogonServerConflict = NERR_BASE + 110;/* A centralized logon-server conflict occurred. */
int NERR_LogonNoUserPath = NERR_BASE + 111; /* The server is configured without a valid user path. */
int NERR_LogonScriptError = NERR_BASE + 112; /* An error occurred while loading or running the logon script. */
/* UNUSED BASE + 113 */
int NERR_StandaloneLogon = NERR_BASE + 114; /* The logon server was not specified. Your computer will be logged on as STANDALONE. */
int NERR_LogonServerNotFound = NERR_BASE + 115; /* The logon server could not be found. */
int NERR_LogonDomainExists = NERR_BASE + 116; /* There is already a logon domain for this computer. */
int NERR_NonValidatedLogon = NERR_BASE + 117; /* The logon server could not validate the logon. */
/*
* ACF API related = access, user, group;
* Error codes from BASE + 119 to BASE + 149
*/
int NERR_ACFNotFound = NERR_BASE + 119; /* The security database could not be found. */
int NERR_GroupNotFound = NERR_BASE + 120; /* The group name could not be found. */
int NERR_UserNotFound = NERR_BASE + 121; /* The user name could not be found. */
int NERR_ResourceNotFound = NERR_BASE + 122; /* The resource name could not be found. */
int NERR_GroupExists = NERR_BASE + 123; /* The group already exists. */
int NERR_UserExists = NERR_BASE + 124; /* The account already exists. */
int NERR_ResourceExists = NERR_BASE + 125; /* The resource permission list already exists. */
int NERR_NotPrimary = NERR_BASE + 126; /* This operation is only allowed on the primary domain controller of the domain. */
int NERR_ACFNotLoaded = NERR_BASE + 127; /* The security database has not been started. */
int NERR_ACFNoRoom = NERR_BASE + 128; /* There are too many names in the user accounts database. */
int NERR_ACFFileIOFail = NERR_BASE + 129; /* A disk I/O failure occurred.*/
int NERR_ACFTooManyLists = NERR_BASE + 130; /* The limit of 64 entries per resource was exceeded. */
int NERR_UserLogon = NERR_BASE + 131; /* Deleting a user with a session is not allowed. */
int NERR_ACFNoParent = NERR_BASE + 132; /* The parent directory could not be located. */
int NERR_CanNotGrowSegment = NERR_BASE + 133; /* Unable to add to the security database session cache segment. */
int NERR_SpeGroupOp = NERR_BASE + 134; /* This operation is not allowed on this special group. */
int NERR_NotInCache = NERR_BASE + 135; /* This user is not cached in user accounts database session cache. */
int NERR_UserInGroup = NERR_BASE + 136; /* The user already belongs to this group. */
int NERR_UserNotInGroup = NERR_BASE + 137; /* The user does not belong to this group. */
int NERR_AccountUndefined = NERR_BASE + 138; /* This user account is undefined. */
int NERR_AccountExpired = NERR_BASE + 139; /* This user account has expired. */
int NERR_InvalidWorkstation = NERR_BASE + 140; /* The user is not allowed to log on from this workstation. */
int NERR_InvalidLogonHours = NERR_BASE + 141; /* The user is not allowed to log on at this time. */
int NERR_PasswordExpired = NERR_BASE + 142; /* The password of this user has expired. */
int NERR_PasswordCantChange = NERR_BASE + 143; /* The password of this user cannot change. */
int NERR_PasswordHistConflict = NERR_BASE + 144; /* This password cannot be used now. */
int NERR_PasswordTooShort = NERR_BASE + 145; /* The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements. */
int NERR_PasswordTooRecent = NERR_BASE + 146; /* The password of this user is too recent to change. */
int NERR_InvalidDatabase = NERR_BASE + 147; /* The security database is corrupted. */
int NERR_DatabaseUpToDate = NERR_BASE + 148; /* No updates are necessary to this replicant network/local security database. */
int NERR_SyncRequired = NERR_BASE + 149; /* This replicant database is outdated; synchronization is required. */
/*
* Use API related
* Error codes from BASE + 150 to BASE + 169
*/
int NERR_UseNotFound = NERR_BASE + 150; /* The network connection could not be found. */
int NERR_BadAsgType = NERR_BASE + 151; /* This asg_type is invalid. */
int NERR_DeviceIsShared = NERR_BASE + 152; /* This device is currently being shared. */
int NERR_SameAsComputerName = NERR_BASE + 153; /* The user name may not be same as computer name. */
/*
* Message Server related
* Error codes BASE + 170 to BASE + 209
*/
int NERR_NoComputerName = NERR_BASE + 170; /* The computer name could not be added as a message alias. The name may already exist on the network. */
int NERR_MsgAlreadyStarted = NERR_BASE + 171; /* The Messenger service is already started. */
int NERR_MsgInitFailed = NERR_BASE + 172; /* The Messenger service failed to start. */
int NERR_NameNotFound = NERR_BASE + 173; /* The message alias could not be found on the network. */
int NERR_AlreadyForwarded = NERR_BASE + 174; /* This message alias has already been forwarded. */
int NERR_AddForwarded = NERR_BASE + 175; /* This message alias has been added but is still forwarded. */
int NERR_AlreadyExists = NERR_BASE + 176; /* This message alias already exists locally. */
int NERR_TooManyNames = NERR_BASE + 177; /* The maximum number of added message aliases has been exceeded. */
int NERR_DelComputerName = NERR_BASE + 178; /* The computer name could not be deleted.*/
int NERR_LocalForward = NERR_BASE + 179; /* Messages cannot be forwarded back to the same workstation. */
int NERR_GrpMsgProcessor = NERR_BASE + 180; /* An error occurred in the domain message processor. */
int NERR_PausedRemote = NERR_BASE + 181; /* The message was sent, but the recipient has paused the Messenger service. */
int NERR_BadReceive = NERR_BASE + 182; /* The message was sent but not received. */
int NERR_NameInUse = NERR_BASE + 183; /* The message alias is currently in use. Try again later. */
int NERR_MsgNotStarted = NERR_BASE + 184; /* The Messenger service has not been started. */
int NERR_NotLocalName = NERR_BASE + 185; /* The name is not on the local computer. */
int NERR_NoForwardName = NERR_BASE + 186; /* The forwarded message alias could not be found on the network. */
int NERR_RemoteFull = NERR_BASE + 187; /* The message alias table on the remote station is full. */
int NERR_NameNotForwarded = NERR_BASE + 188; /* Messages for this alias are not currently being forwarded. */
int NERR_TruncatedBroadcast = NERR_BASE + 189; /* The broadcast message was truncated. */
int NERR_InvalidDevice = NERR_BASE + 194; /* This is an invalid device name. */
int NERR_WriteFault = NERR_BASE + 195; /* A write fault occurred. */
/* UNUSED BASE + 196 */
int NERR_DuplicateName = NERR_BASE + 197; /* A duplicate message alias exists on the network. */
int NERR_DeleteLater = NERR_BASE + 198; /* @W This message alias will be deleted later. */
int NERR_IncompleteDel = NERR_BASE + 199; /* The message alias was not successfully deleted from all networks. */
int NERR_MultipleNets = NERR_BASE + 200; /* This operation is not supported on computers with multiple networks. */
/*
* Server API related
* Error codes BASE + 210 to BASE + 229
*/
int NERR_NetNameNotFound = NERR_BASE + 210; /* This shared resource does not exist.*/
int NERR_DeviceNotShared = NERR_BASE + 211; /* This device is not shared. */
int NERR_ClientNameNotFound = NERR_BASE + 212; /* A session does not exist with that computer name. */
int NERR_FileIdNotFound = NERR_BASE + 214; /* There is not an open file with that identification number. */
int NERR_ExecFailure = NERR_BASE + 215; /* A failure occurred when executing a remote administration command. */
int NERR_TmpFile = NERR_BASE + 216; /* A failure occurred when opening a remote temporary file. */
int NERR_TooMuchData = NERR_BASE + 217; /* The data returned from a remote administration command has been truncated to 64K. */
int NERR_DeviceShareConflict = NERR_BASE + 218; /* This device cannot be shared as both a spooled and a non-spooled resource. */
int NERR_BrowserTableIncomplete = NERR_BASE + 219; /* The information in the list of servers may be incorrect. */
int NERR_NotLocalDomain = NERR_BASE + 220; /* The computer is not active in this domain. */
int NERR_IsDfsShare = NERR_BASE + 221; /* The share must be removed from the Distributed File System before it can be deleted. */
/*
* CharDev API related
* Error codes BASE + 230 to BASE + 249
*/
/* UNUSED BASE + 230 */
int NERR_DevInvalidOpCode = NERR_BASE + 231; /* The operation is invalid for this device. */
int NERR_DevNotFound = NERR_BASE + 232; /* This device cannot be shared. */
int NERR_DevNotOpen = NERR_BASE + 233; /* This device was not open. */
int NERR_BadQueueDevString = NERR_BASE + 234; /* This device name list is invalid. */
int NERR_BadQueuePriority = NERR_BASE + 235; /* The queue priority is invalid. */
int NERR_NoCommDevs = NERR_BASE + 237; /* There are no shared communication devices. */
int NERR_QueueNotFound = NERR_BASE + 238; /* The queue you specified does not exist. */
int NERR_BadDevString = NERR_BASE + 240; /* This list of devices is invalid. */
int NERR_BadDev = NERR_BASE + 241; /* The requested device is invalid. */
int NERR_InUseBySpooler = NERR_BASE + 242; /* This device is already in use by the spooler. */
int NERR_CommDevInUse = NERR_BASE + 243; /* This device is already in use as a communication device. */
/*
* NetICanonicalize and NetIType and NetIMakeLMFileName
* NetIListCanon and NetINameCheck
* Error codes BASE + 250 to BASE + 269
*/
int NERR_InvalidComputer = NERR_BASE + 251; /* This computer name is invalid. */
/* UNUSED BASE + 252 */
/* UNUSED BASE + 253 */
int NERR_MaxLenExceeded = NERR_BASE + 254; /* The string and prefix specified are too long. */
/* UNUSED BASE + 255 */
int NERR_BadComponent = NERR_BASE + 256; /* This path component is invalid. */
int NERR_CantType = NERR_BASE + 257; /* Could not determine the type of input. */
/* UNUSED BASE + 258 */
/* UNUSED BASE + 259 */
int NERR_TooManyEntries = NERR_BASE + 262; /* The buffer for types is not big enough. */
/*
* NetProfile
* Error codes BASE + 270 to BASE + 276
*/
int NERR_ProfileFileTooBig = NERR_BASE + 270; /* Profile files cannot exceed 64K. */
int NERR_ProfileOffset = NERR_BASE + 271; /* The start offset is out of range. */
int NERR_ProfileCleanup = NERR_BASE + 272; /* The system cannot delete current connections to network resources. */
int NERR_ProfileUnknownCmd = NERR_BASE + 273; /* The system was unable to parse the command line in this file.*/
int NERR_ProfileLoadErr = NERR_BASE + 274; /* An error occurred while loading the profile file. */
int NERR_ProfileSaveErr = NERR_BASE + 275; /* @W Errors occurred while saving the profile file. The profile was partially saved. */
/*
* NetAudit and NetErrorLog
* Error codes BASE + 277 to BASE + 279
*/
int NERR_LogOverflow = NERR_BASE + 277; /* Log file %1 is full. */
int NERR_LogFileChanged = NERR_BASE + 278; /* This log file has changed between reads. */
int NERR_LogFileCorrupt = NERR_BASE + 279; /* Log file %1 is corrupt. */
/*
* NetRemote
* Error codes BASE + 280 to BASE + 299
*/
int NERR_SourceIsDir = NERR_BASE + 280; /* The source path cannot be a directory. */
int NERR_BadSource = NERR_BASE + 281; /* The source path is illegal. */
int NERR_BadDest = NERR_BASE + 282; /* The destination path is illegal. */
int NERR_DifferentServers = NERR_BASE + 283; /* The source and destination paths are on different servers. */
/* UNUSED BASE + 284 */
int NERR_RunSrvPaused = NERR_BASE + 285; /* The Run server you requested is paused. */
/* UNUSED BASE + 286 */
/* UNUSED BASE + 287 */
/* UNUSED BASE + 288 */
int NERR_ErrCommRunSrv = NERR_BASE + 289; /* An error occurred when communicating with a Run server. */
/* UNUSED BASE + 290 */
int NERR_ErrorExecingGhost = NERR_BASE + 291; /* An error occurred when starting a background process. */
int NERR_ShareNotFound = NERR_BASE + 292; /* The shared resource you are connected to could not be found.*/
/* UNUSED BASE + 293 */
/* UNUSED BASE + 294 */
/*
* NetWksta.sys = redir; returned error codes.
*
* NERR_BASE + = 300-329;
*/
int NERR_InvalidLana = NERR_BASE + 300; /* The LAN adapter number is invalid. */
int NERR_OpenFiles = NERR_BASE + 301; /* There are open files on the connection. */
int NERR_ActiveConns = NERR_BASE + 302; /* Active connections still exist. */
int NERR_BadPasswordCore = NERR_BASE + 303; /* This share name or password is invalid. */
int NERR_DevInUse = NERR_BASE + 304; /* The device is being accessed by an active process. */
int NERR_LocalDrive = NERR_BASE + 305; /* The drive letter is in use locally. */
/*
* Alert error codes.
*
* NERR_BASE + = 330-339;
*/
int NERR_AlertExists = NERR_BASE + 330; /* The specified client is already registered for the specified event. */
int NERR_TooManyAlerts = NERR_BASE + 331; /* The alert table is full. */
int NERR_NoSuchAlert = NERR_BASE + 332; /* An invalid or nonexistent alert name was raised. */
int NERR_BadRecipient = NERR_BASE + 333; /* The alert recipient is invalid.*/
int NERR_AcctLimitExceeded = NERR_BASE + 334; /* A user's session with this server has been deleted
* because the user's logon hours are no longer valid. */
/*
* Additional Error and Audit log codes.
*
* NERR_BASE + (340-343;
*/
int NERR_InvalidLogSeek = NERR_BASE + 340; /* The log file does not contain the requested record number. */
/* UNUSED BASE + 341 */
/* UNUSED BASE + 342 */
/* UNUSED BASE + 343 */
/*
* Additional UAS and NETLOGON codes
*
* NERR_BASE + (350-359;
*/
int NERR_BadUasConfig = NERR_BASE + 350; /* The user accounts database is not configured correctly. */
int NERR_InvalidUASOp = NERR_BASE + 351; /* This operation is not permitted when the Netlogon service is running. */
int NERR_LastAdmin = NERR_BASE + 352; /* This operation is not allowed on the last administrative account. */
int NERR_DCNotFound = NERR_BASE + 353; /* Could not find domain controller for this domain. */
int NERR_LogonTrackingError = NERR_BASE + 354; /* Could not set logon information for this user. */
int NERR_NetlogonNotStarted = NERR_BASE + 355; /* The Netlogon service has not been started. */
int NERR_CanNotGrowUASFile = NERR_BASE + 356; /* Unable to add to the user accounts database. */
int NERR_TimeDiffAtDC = NERR_BASE + 357; /* This server's clock is not synchronized with the primary domain controller's clock. */
int NERR_PasswordMismatch = NERR_BASE + 358; /* A password mismatch has been detected. */
/*
* Server Integration error codes.
*
* NERR_BASE + (360-369;
*/
int NERR_NoSuchServer = NERR_BASE + 360; /* The server identification does not specify a valid server. */
int NERR_NoSuchSession = NERR_BASE + 361; /* The session identification does not specify a valid session. */
int NERR_NoSuchConnection = NERR_BASE + 362; /* The connection identification does not specify a valid connection. */
int NERR_TooManyServers = NERR_BASE + 363; /* There is no space for another entry in the table of available servers. */
int NERR_TooManySessions = NERR_BASE + 364; /* The server has reached the maximum number of sessions it supports. */
int NERR_TooManyConnections = NERR_BASE + 365; /* The server has reached the maximum number of connections it supports. */
int NERR_TooManyFiles = NERR_BASE + 366; /* The server cannot open more files because it has reached its maximum number. */
int NERR_NoAlternateServers = NERR_BASE + 367; /* There are no alternate servers registered on this server. */
/* UNUSED BASE + 368 */
/* UNUSED BASE + 369 */
int NERR_TryDownLevel = NERR_BASE + 370; /* Try down-level = remote admin protocol; version of API instead. */
/*
* UPS error codes.
*
* NERR_BASE + = 380-384;
*/
int NERR_UPSDriverNotStarted = NERR_BASE + 380; /* The UPS driver could not be accessed by the UPS service. */
int NERR_UPSInvalidConfig = NERR_BASE + 381; /* The UPS service is not configured correctly. */
int NERR_UPSInvalidCommPort = NERR_BASE + 382; /* The UPS service could not access the specified Comm Port. */
int NERR_UPSSignalAsserted = NERR_BASE + 383; /* The UPS indicated a line fail or low battery situation. Service not started. */
int NERR_UPSShutdownFailed = NERR_BASE + 384; /* The UPS service failed to perform a system shut down. */
/*
* Remoteboot error codes.
*
* NERR_BASE + = 400-419;
* Error codes 400 - 405 are used by RPLBOOT.SYS.
* Error codes 403, 407 - 416 are used by RPLLOADR.COM,
* Error code 417 is the alerter message of REMOTEBOOT = RPLSERVR.EXE;.
* Error code 418 is for when REMOTEBOOT can't start
* Error code 419 is for a disallowed 2nd rpl connection
*
*/
int NERR_BadDosRetCode = NERR_BASE + 400; /* The program below returned an MS-DOS error code:*/
int NERR_ProgNeedsExtraMem = NERR_BASE + 401; /* The program below needs more memory:*/
int NERR_BadDosFunction = NERR_BASE + 402; /* The program below called an unsupported MS-DOS function:*/
int NERR_RemoteBootFailed = NERR_BASE + 403; /* The workstation failed to boot.*/
int NERR_BadFileCheckSum = NERR_BASE + 404; /* The file below is corrupt.*/
int NERR_NoRplBootSystem = NERR_BASE + 405; /* No loader is specified in the boot-block definition file.*/
int NERR_RplLoadrNetBiosErr = NERR_BASE + 406; /* NetBIOS returned an error: The NCB and SMB are dumped above.*/
int NERR_RplLoadrDiskErr = NERR_BASE + 407; /* A disk I/O error occurred.*/
int NERR_ImageParamErr = NERR_BASE + 408; /* Image parameter substitution failed.*/
int NERR_TooManyImageParams = NERR_BASE + 409; /* Too many image parameters cross disk sector boundaries.*/
int NERR_NonDosFloppyUsed = NERR_BASE + 410; /* The image was not generated from an MS-DOS diskette formatted with /S.*/
int NERR_RplBootRestart = NERR_BASE + 411; /* Remote boot will be restarted later.*/
int NERR_RplSrvrCallFailed = NERR_BASE + 412; /* The call to the Remoteboot server failed.*/
int NERR_CantConnectRplSrvr = NERR_BASE + 413; /* Cannot connect to the Remoteboot server.*/
int NERR_CantOpenImageFile = NERR_BASE + 414; /* Cannot open image file on the Remoteboot server.*/
int NERR_CallingRplSrvr = NERR_BASE + 415; /* Connecting to the Remoteboot server...*/
int NERR_StartingRplBoot = NERR_BASE + 416; /* Connecting to the Remoteboot server...*/
int NERR_RplBootServiceTerm = NERR_BASE + 417; /* Remote boot service was stopped; check the error log for the cause of the problem.*/
int NERR_RplBootStartFailed = NERR_BASE + 418; /* Remote boot startup failed; check the error log for the cause of the problem.*/
int NERR_RPL_CONNECTED = NERR_BASE + 419; /* A second connection to a Remoteboot resource is not allowed.*/
/*
* FTADMIN API error codes
*
* NERR_BASE + = 425-434;
*
* = Currently not used in NT;
*
*/
/*
* Browser service API error codes
*
* NERR_BASE + = 450-475;
*
*/
int NERR_BrowserConfiguredToNotRun = NERR_BASE + 450; /* The browser service was configured with MaintainServerList = No. */
/*
* Additional Remoteboot error codes.
*
* NERR_BASE + = 510-550;
*/
int NERR_RplNoAdaptersStarted = NERR_BASE + 510; /*Service failed to start since none of the network adapters started with this service.*/
int NERR_RplBadRegistry = NERR_BASE + 511; /*Service failed to start due to bad startup information in the registry.*/
int NERR_RplBadDatabase = NERR_BASE + 512; /*Service failed to start because its database is absent or corrupt.*/
int NERR_RplRplfilesShare = NERR_BASE + 513; /*Service failed to start because RPLFILES share is absent.*/
int NERR_RplNotRplServer = NERR_BASE + 514; /*Service failed to start because RPLUSER group is absent.*/
int NERR_RplCannotEnum = NERR_BASE + 515; /*Cannot enumerate service records.*/
int NERR_RplWkstaInfoCorrupted = NERR_BASE + 516; /*Workstation record information has been corrupted.*/
int NERR_RplWkstaNotFound = NERR_BASE + 517; /*Workstation record was not found.*/
int NERR_RplWkstaNameUnavailable = NERR_BASE + 518; /*Workstation name is in use by some other workstation.*/
int NERR_RplProfileInfoCorrupted = NERR_BASE + 519; /*Profile record information has been corrupted.*/
int NERR_RplProfileNotFound = NERR_BASE + 520; /*Profile record was not found.*/
int NERR_RplProfileNameUnavailable = NERR_BASE + 521; /*Profile name is in use by some other profile.*/
int NERR_RplProfileNotEmpty = NERR_BASE + 522; /*There are workstations using this profile.*/
int NERR_RplConfigInfoCorrupted = NERR_BASE + 523; /*Configuration record information has been corrupted.*/
int NERR_RplConfigNotFound = NERR_BASE + 524; /*Configuration record was not found.*/
int NERR_RplAdapterInfoCorrupted = NERR_BASE + 525; /*Adapter id record information has been corrupted.*/
int NERR_RplInternal = NERR_BASE + 526; /*An internal service error has occurred.*/
int NERR_RplVendorInfoCorrupted = NERR_BASE + 527; /*Vendor id record information has been corrupted.*/
int NERR_RplBootInfoCorrupted = NERR_BASE + 528; /*Boot block record information has been corrupted.*/
int NERR_RplWkstaNeedsUserAcct = NERR_BASE + 529; /*The user account for this workstation record is missing.*/
int NERR_RplNeedsRPLUSERAcct = NERR_BASE + 530; /*The RPLUSER local group could not be found.*/
int NERR_RplBootNotFound = NERR_BASE + 531; /*Boot block record was not found.*/
int NERR_RplIncompatibleProfile = NERR_BASE + 532; /*Chosen profile is incompatible with this workstation.*/
int NERR_RplAdapterNameUnavailable = NERR_BASE + 533; /*Chosen network adapter id is in use by some other workstation.*/
int NERR_RplConfigNotEmpty = NERR_BASE + 534; /*There are profiles using this configuration.*/
int NERR_RplBootInUse = NERR_BASE + 535; /*There are workstations, profiles or configurations using this boot block.*/
int NERR_RplBackupDatabase = NERR_BASE + 536; /*Service failed to backup Remoteboot database.*/
int NERR_RplAdapterNotFound = NERR_BASE + 537; /*Adapter record was not found.*/
int NERR_RplVendorNotFound = NERR_BASE + 538; /*Vendor record was not found.*/
int NERR_RplVendorNameUnavailable = NERR_BASE + 539; /*Vendor name is in use by some other vendor record.*/
int NERR_RplBootNameUnavailable = NERR_BASE + 540; /*(boot name, vendor id; is in use by some other boot block record.*/
int NERR_RplConfigNameUnavailable = NERR_BASE + 541; /*Configuration name is in use by some other configuration.*/
/**INTERNAL_ONLY**/
/*
* Dfs API error codes.
*
* NERR_BASE + = 560-590;
*/
int NERR_DfsInternalCorruption = NERR_BASE + 560; /*The internal database maintained by the DFS service is corrupt*/
int NERR_DfsVolumeDataCorrupt = NERR_BASE + 561; /*One of the records in the internal DFS database is corrupt*/
int NERR_DfsNoSuchVolume = NERR_BASE + 562; /*There is no DFS name whose entry path matches the input Entry Path*/
int NERR_DfsVolumeAlreadyExists = NERR_BASE + 563; /*A root or link with the given name already exists*/
int NERR_DfsAlreadyShared = NERR_BASE + 564; /*The server share specified is already shared in the DFS*/
int NERR_DfsNoSuchShare = NERR_BASE + 565; /*The indicated server share does not support the indicated DFS namespace*/
int NERR_DfsNotALeafVolume = NERR_BASE + 566; /*The operation is not valid on this portion of the namespace*/
int NERR_DfsLeafVolume = NERR_BASE + 567; /*The operation is not valid on this portion of the namespace*/
int NERR_DfsVolumeHasMultipleServers = NERR_BASE + 568; /*The operation is ambiguous because the link has multiple servers*/
int NERR_DfsCantCreateJunctionPoint = NERR_BASE + 569; /*Unable to create a link*/
int NERR_DfsServerNotDfsAware = NERR_BASE + 570; /*The server is not DFS Aware*/
int NERR_DfsBadRenamePath = NERR_BASE + 571; /*The specified rename target path is invalid*/
int NERR_DfsVolumeIsOffline = NERR_BASE + 572; /*The specified DFS link is offline*/
int NERR_DfsNoSuchServer = NERR_BASE + 573; /*The specified server is not a server for this link*/
int NERR_DfsCyclicalName = NERR_BASE + 574; /*A cycle in the DFS name was detected*/
int NERR_DfsNotSupportedInServerDfs = NERR_BASE + 575; /*The operation is not supported on a server-based DFS*/
int NERR_DfsDuplicateService = NERR_BASE + 576; /*This link is already supported by the specified server-share*/
int NERR_DfsCantRemoveLastServerShare = NERR_BASE + 577; /*Can't remove the last server-share supporting this root or link*/
int NERR_DfsVolumeIsInterDfs = NERR_BASE + 578; /*The operation is not supported for an Inter-DFS link*/
int NERR_DfsInconsistent = NERR_BASE + 579; /*The internal state of the DFS Service has become inconsistent*/
int NERR_DfsServerUpgraded = NERR_BASE + 580; /*The DFS Service has been installed on the specified server*/
int NERR_DfsDataIsIdentical = NERR_BASE + 581; /*The DFS data being reconciled is identical*/
int NERR_DfsCantRemoveDfsRoot = NERR_BASE + 582; /*The DFS root cannot be deleted - Uninstall DFS if required*/
int NERR_DfsChildOrParentInDfs = NERR_BASE + 583; /*A child or parent directory of the share is already in a DFS*/
int NERR_DfsInternalError = NERR_BASE + 590; /*DFS internal error*/
/*
* Net setup error codes.
*
* NERR_BASE + = 591-600;
*/
int NERR_SetupAlreadyJoined = NERR_BASE + 591; /*This machine is already joined to a domain.*/
int NERR_SetupNotJoined = NERR_BASE + 592; /*This machine is not currently joined to a domain.*/
int NERR_SetupDomainController = NERR_BASE + 593; /*This machine is a domain controller and cannot be unjoined from a domain.*/
int NERR_DefaultJoinRequired = NERR_BASE + 594; /*The destination domain controller does not support creating machine accounts in OUs.*/
int NERR_InvalidWorkgroupName = NERR_BASE + 595; /*The specified workgroup name is invalid.*/
int NERR_NameUsesIncompatibleCodePage = NERR_BASE + 596; /*The specified computer name is incompatible with the default language used on the domain controller.*/
int NERR_ComputerAccountNotFound = NERR_BASE + 597; /*The specified computer account could not be found. Contact an administrator to verify the account is in the domain. If the account has been deleted unjoin, reboot, and rejoin the domain.*/
int NERR_PersonalSku = NERR_BASE + 598; /*This version of Windows cannot be joined to a domain.*/
int NERR_SetupCheckDNSConfig = NERR_BASE + 599; /*An attempt to resolve the DNS name of a DC in the domain being joined has failed. Please verify this client is configured to reach a DNS server that can resolve DNS names in the target domain.*/
/*
* Some Password and account error results
*
* NERR_BASE + = 601 - 608;
*/
int NERR_PasswordMustChange = NERR_BASE + 601; /* Password must change at next logon */
int NERR_AccountLockedOut = NERR_BASE + 602; /* Account is locked out */
int NERR_PasswordTooLong = NERR_BASE + 603; /* Password is too long */
int NERR_PasswordNotComplexEnough = NERR_BASE + 604; /* Password doesn't meet the complexity policy */
int NERR_PasswordFilterError = NERR_BASE + 605; /* Password doesn't meet the requirements of the filter dll's */
/***********WARNING ****************
*The range 2750-2799 has been *
*allocated to the IBM LAN Server *
***********************************/
/***********WARNING ****************
*The range 2900-2999 has been *
*reserved for Microsoft OEMs *
***********************************/
int MAX_NERR = NERR_BASE + 899; /* This is the last error in NERR range. */
}
@@ -0,0 +1,34 @@
/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import com.sun.jna.win32.StdCallLibrary;
/**
* Ported from LMJoin.h.
* Windows SDK 6.0A.
* @author dblock[at]dblock.org
*/
public interface LMJoin extends StdCallLibrary {
/**
* Status of a workstation.
*/
public abstract class NETSETUP_JOIN_STATUS {
public static final int NetSetupUnknownStatus = 0;
public static final int NetSetupUnjoined = 1;
public static final int NetSetupWorkgroupName = 2;
public static final int NetSetupDomainName = 3;
};
}
@@ -0,0 +1,210 @@
/* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import com.sun.jna.Native;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
/**
* Provides access to the w32 MSI installer library.
*/
public interface Msi extends StdCallLibrary {
Msi INSTANCE = (Msi)
Native.loadLibrary("msi", Msi.class, W32APIOptions.UNICODE_OPTIONS);
/**
* The component being requested is disabled on the computer.
*/
static int INSTALLSTATE_NOTUSED = -7;
/**
* The configuration data is corrupt.
*/
static int INSTALLSTATE_BADCONFIG = -6;
/**
* The installation is suspended or in progress.
*/
static int INSTALLSTATE_INCOMPLETE = -5;
/**
* The feature must run from the source, and the source is unavailable.
*/
static int INSTALLSTATE_SOURCEABSENT = -4;
/**
* The return buffer is full.
*/
static int INSTALLSTATE_MOREDATA = -3;
/**
* An invalid parameter was passed to the function.
*/
static int INSTALLSTATE_INVALIDARG = -2;
/**
* An unrecognized product or feature was specified.
*/
static int INSTALLSTATE_UNKNOWN = -1;
/**
* The feature is broken.
*/
static int INSTALLSTATE_BROKEN = 0;
/**
* The advertised feature.
*/
static int INSTALLSTATE_ADVERTISED = 1;
/**
* The component is being removed.
*/
static int INSTALLSTATE_REMOVED = 1;
/**
* The feature was uninstalled.
*/
static int INSTALLSTATE_ABSENT = 2;
/**
* The feature was installed on the local drive.
*/
static int INSTALLSTATE_LOCAL = 3;
/**
* The feature must run from the source, CD-ROM, or network.
*/
static int INSTALLSTATE_SOURCE = 4;
/**
* The feature is installed in the default location: local or source.
*/
static int INSTALLSTATE_DEFAULT = 5;
/**
* The MsiGetComponentPath function returns the full path to an installed component. If the key path for the
* component is a registry key then the registry key is returned.
*
* @param szProduct
* Specifies the product code for the client product.
*
* @param szComponent
* Specifies the component ID of the component to be located.
*
* @param lpPathBuf
* Pointer to a variable that receives the path to the component. This parameter can be null. If the component is
* a registry key, the registry roots are represented numerically. If this is a registry subkey path, there is a
* backslash at the end of the Key Path. If this is a registry value key path, there is no backslash at the end.
* For example, a registry path on a 32-bit operating system of HKEY_CURRENT_USER\SOFTWARE\Microsoft is returned
* as "01:\SOFTWARE\Microsoft\".
*
* @param pcchBuf
* Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the lpPathBuf
* parameter. On input, this is the full size of the buffer, including a space for a terminating null character.
* If the buffer passed in is too small, the count returned does not include the terminating null character.
*
* If lpPathBuf is null, pcchBuf can be null.
*
* @return
* The MsiGetComponentPath function returns the following values.
* INSTALLSTATE_NOTUSED - The component being requested is disabled on the computer.
* INSTALLSTATE_ABSENT - The component is not installed.
* INSTALLSTATE_INVALIDARG - One of the function parameters is invalid.
* INSTALLSTATE_LOCAL - The component is installed locally.
* INSTALLSTATE_SOURCE - The component is installed to run from source.
* INSTALLSTATE_SOURCEABSENT - The component source is inaccessible.
* INSTALLSTATE_UNKNOWN - The product code or component ID is unknown.
*/
int MsiGetComponentPath(String szProduct, String szComponent, char[] lpPathBuf, IntByReference pcchBuf);
/**
* The MsiLocateComponent function returns the full path to an installed component without a product code. This
* function attempts to determine the product using MsiGetProductCode, but is not guaranteed to find the correct
* product for the caller. MsiGetComponentPath should always be called when possible.
*
* @param szComponent
* Specifies the component ID of the component to be located.
*
* @param lpPathBuf
* Pointer to a variable that receives the path to the component. The variable includes the terminating null
* character.
*
* @param pcchBuf
* Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the lpPathBuf
* parameter. On input, this is the full size of the buffer, including a space for a terminating null character.
* Upon success of the MsiLocateComponent function, the variable pointed to by pcchBuf contains the count of
* characters not including the terminating null character. If the size of the buffer passed in is too small, the
* function returns INSTALLSTATE_MOREDATA.
*
* If lpPathBuf is null, pcchBuf can be null.
*
* @return
* The MsiGetComponentPath function returns the following values.
* INSTALLSTATE_NOTUSED - The component being requested is disabled on the computer.
* INSTALLSTATE_ABSENT - The component is not installed.
* INSTALLSTATE_INVALIDARG - One of the function parameters is invalid.
* INSTALLSTATE_LOCAL - The component is installed locally.
* INSTALLSTATE_MOREDATA - The buffer provided was too small.
* INSTALLSTATE_SOURCE - The component is installed to run from source.
* INSTALLSTATE_SOURCEABSENT - The component source is inaccessible.
* INSTALLSTATE_UNKNOWN - The product code or component ID is unknown.
*/
int MsiLocateComponent(String szComponent, char[] lpPathBuf, IntByReference pcchBuf);
/**
* The MsiGetProductCode function returns the product code of an application by using the component code of an
* installed or advertised component of the application. During initialization, an application must determine under
* which product code it has been installed or advertised.
*
* @param szComponent
* This parameter specifies the component code of a component that has been installed by the application. This
* will be typically the component code of the component containing the executable file of the application.
*
* @param lpProductBuf
* Pointer to a buffer that receives the product code. This buffer must be 39 characters long. The first 38
* characters are for the GUID, and the last character is for the terminating null character.
*
* @return
* ERROR_BAD_CONFIGURATION - The configuration data is corrupt.
* ERROR_INSTALL_FAILURE - The product code could not be determined.
* ERROR_INVALID_PARAMETER - An invalid parameter was passed to the function.
* ERROR_SUCCESS - The function completed successfully.
* ERROR_UNKNOWN_COMPONENT - The specified component is unknown.
*/
int MsiGetProductCode(String szComponent, char[] lpProductBuf);
/**
* The MsiEnumComponents function enumerates the installed components for all products. This function retrieves one
* component code each time it is called.
*
* @param iComponentIndex
* Specifies the index of the component to retrieve. This parameter should be zero for the first call to the
* MsiEnumComponents function and then incremented for subsequent calls. Because components are not ordered, any
* new component has an arbitrary index. This means that the function can return components in any order.
*
* @param lpComponentBuf
* Pointer to a buffer that receives the component code. This buffer must be 39 characters long. The first 38
* characters are for the GUID, and the last character is for the terminating null character.
*
* @return
* ERROR_BAD_CONFIGURATION - The configuration data is corrupt.
* ERROR_INVALID_PARAMETER - An invalid parameter was passed to the function.
* ERROR_NO_MORE_ITEMS - There are no components to return.
* ERROR_NOT_ENOUGH_MEMORY - The system does not have enough memory to complete the operation. Available with
* Windows Server 2003.
* ERROR_SUCCESS - A value was enumerated.
*/
int MsiEnumComponents(WinDef.DWORD iComponentIndex, char[] lpComponentBuf);
}
@@ -0,0 +1,244 @@
/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Memory;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.Union;
import com.sun.jna.platform.win32.WinNT.LARGE_INTEGER;
import com.sun.jna.platform.win32.WinNT.PSID;
import com.sun.jna.win32.StdCallLibrary;
/**
* Ported from NTSecApi.h
* Windows SDK 6.0A.
* @author dblock[at]dblock.org
*/
public interface NTSecApi extends StdCallLibrary {
/**
* The LSA_UNICODE_STRING structure is used by various Local Security Authority (LSA)
* functions to specify a Unicode string.
*/
public static class LSA_UNICODE_STRING extends Structure {
public static class ByReference extends LSA_UNICODE_STRING implements Structure.ByReference {
}
/**
* Specifies the length, in bytes, of the string pointed to by the Buffer member,
* not including the terminating null character, if any.
*/
public short Length;
/**
* Specifies the total size, in bytes, of the memory allocated for Buffer. Up to
* MaximumLength bytes can be written into the buffer without trampling memory.
*/
public short MaximumLength;
/**
* Pointer to a wide character string. Note that the strings returned by the
* various LSA functions might not be null terminated.
*/
public Pointer Buffer;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "Length", "MaximumLength", "Buffer" });
}
/**
* String representation of the buffer.
* @return
* Unicode string.
*/
public String getString() {
byte[] data = Buffer.getByteArray(0, Length);
if (data.length < 2 || data[data.length - 1] != 0) {
Memory newdata = new Memory(data.length + 2);
newdata.write(0, data, 0, data.length);
return newdata.getString(0, true);
}
return Buffer.getString(0, true);
}
}
/**
* Pointer to an LSA_UNICODE_STRING.
*/
public static class PLSA_UNICODE_STRING {
public static class ByReference extends PLSA_UNICODE_STRING
implements Structure.ByReference {
}
public LSA_UNICODE_STRING.ByReference s;
}
/**
* Record contains an included top-level name.
*/
int ForestTrustTopLevelName = 0;
/**
* Record contains an excluded top-level name.
*/
int ForestTrustTopLevelNameEx = 1;
/**
* Record contains an LSA_FOREST_TRUST_DOMAIN_INFO structure.
*/
int ForestTrustDomainInfo = 2;
public static class LSA_FOREST_TRUST_DOMAIN_INFO extends Structure {
public PSID.ByReference Sid;
public LSA_UNICODE_STRING DnsName;
public LSA_UNICODE_STRING NetbiosName;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "Sid", "DnsName", "NetbiosName" });
}
}
public static class LSA_FOREST_TRUST_BINARY_DATA extends Structure {
public int Length;
public Pointer Buffer;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "Length", "Buffer" });
}
}
public static class LSA_FOREST_TRUST_RECORD extends Structure {
public static class ByReference extends LSA_FOREST_TRUST_RECORD implements Structure.ByReference {
}
public static class UNION extends Union {
public static class ByReference extends UNION implements Structure.ByReference {
}
public LSA_UNICODE_STRING TopLevelName;
public LSA_FOREST_TRUST_DOMAIN_INFO DomainInfo;
public LSA_FOREST_TRUST_BINARY_DATA Data;
}
/**
* Flags that control the behavior of the operation.
*/
public int Flags;
/**
* LSA_FOREST_TRUST_RECORD_TYPE enumeration that indicates the type of the record.
* The following table shows the possible values.
* ForestTrustTopLevelName
* Record contains an included top-level name.
* ForestTrustTopLevelNameEx
* Record contains an excluded top-level name.
* ForestTrustDomainInfo
* Record contains an LSA_FOREST_TRUST_DOMAIN_INFO structure.
* ForestTrustRecordTypeLast
* Marks the end of an enumeration.
*/
public int ForestTrustType;
public LARGE_INTEGER Time;
/**
* Data type depending on ForestTrustType.
*/
public UNION u;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "Flags", "ForestTrustType", "Time", "u" });
}
public void read() {
super.read();
switch(ForestTrustType) {
case NTSecApi.ForestTrustTopLevelName:
case NTSecApi.ForestTrustTopLevelNameEx:
u.setType(LSA_UNICODE_STRING.class);
break;
case NTSecApi.ForestTrustDomainInfo:
u.setType(LSA_FOREST_TRUST_DOMAIN_INFO.class);
break;
default:
u.setType(LSA_FOREST_TRUST_BINARY_DATA.class);
break;
}
u.read();
}
}
public static class PLSA_FOREST_TRUST_RECORD extends Structure {
public static class ByReference extends PLSA_FOREST_TRUST_RECORD implements Structure.ByReference {
}
public LSA_FOREST_TRUST_RECORD.ByReference tr;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "tr" });
}
}
public static class LSA_FOREST_TRUST_INFORMATION extends Structure {
public static class ByReference extends LSA_FOREST_TRUST_INFORMATION implements Structure.ByReference {
}
/**
* Number of LSA_FOREST_TRUST_RECORD structures in the array pointed to by the
* Entries member.
*/
public int RecordCount;
/**
* Pointer to a pointer to an array of LSA_FOREST_TRUST_RECORD structures,
* each of which contains one piece of forest trust information.
*/
public PLSA_FOREST_TRUST_RECORD.ByReference Entries;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "RecordCount", "Entries" });
}
/**
* Get an array of LSA_FOREST_TRUST_RECORD entries.
* @return
* An array of forest trust records.
*/
public PLSA_FOREST_TRUST_RECORD[] getEntries() {
return (PLSA_FOREST_TRUST_RECORD[]) Entries.toArray(RecordCount);
}
}
/**
* The LSA_FOREST_TRUST_INFORMATION structure contains Local Security Authority
* forest trust information.
*/
public static class PLSA_FOREST_TRUST_INFORMATION extends Structure {
public static class ByReference extends PLSA_FOREST_TRUST_INFORMATION implements Structure.ByReference {
}
public LSA_FOREST_TRUST_INFORMATION.ByReference fti;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "fti" });
}
}
}
@@ -0,0 +1,89 @@
/* Copyright (c) 2007 Timothy Wall, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
public interface NTStatus {
int STATUS_SUCCESS = 0x00000000; // ntsubauth
int STATUS_BUFFER_TOO_SMALL = 0xC0000023;
//
// MessageId: STATUS_WAIT_0
//
// MessageText:
//
// STATUS_WAIT_0
//
int STATUS_WAIT_0 = 0x00000000; // winnt
//
// MessageId: STATUS_WAIT_1
//
// MessageText:
//
// STATUS_WAIT_1
//
int STATUS_WAIT_1 = 0x00000001;
//
// MessageId: STATUS_WAIT_2
//
// MessageText:
//
// STATUS_WAIT_2
//
int STATUS_WAIT_2 = 0x00000002;
//
// MessageId: STATUS_WAIT_3
//
// MessageText:
//
// STATUS_WAIT_3
//
int STATUS_WAIT_3 = 0x00000003;
//
// MessageId: STATUS_WAIT_63
//
// MessageText:
//
// STATUS_WAIT_63
//
int STATUS_WAIT_63 = 0x0000003F;
//
// The success status codes 128 - 191 are reserved for wait completion
// status with an abandoned mutant object.
//
int STATUS_ABANDONED = 0x00000080;
//
// MessageId: STATUS_ABANDONED_WAIT_0
//
// MessageText:
//
// STATUS_ABANDONED_WAIT_0
//
int STATUS_ABANDONED_WAIT_0 = 0x00000080; // winnt
//
// MessageId: STATUS_ABANDONED_WAIT_63
//
// MessageText:
//
// STATUS_ABANDONED_WAIT_63
//
int STATUS_ABANDONED_WAIT_63 = 0x000000BF;
}
@@ -0,0 +1,431 @@
/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.platform.win32.DsGetDC.PDOMAIN_CONTROLLER_INFO;
import com.sun.jna.platform.win32.Guid.GUID;
import com.sun.jna.platform.win32.NTSecApi.PLSA_FOREST_TRUST_INFORMATION;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.ptr.PointerByReference;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
/**
* Netapi32.dll Interface.
* @author dblock[at]dblock.org
*/
public interface Netapi32 extends StdCallLibrary {
Netapi32 INSTANCE = (Netapi32) Native.loadLibrary("Netapi32",
Netapi32.class, W32APIOptions.UNICODE_OPTIONS);
/**
* Retrieves join status information for the specified computer.
*
* @param lpServer
* Specifies the DNS or NetBIOS name of the computer on which to
* call the function.
* @param lpNameBuffer
* Receives the NetBIOS name of the domain or workgroup to which
* the computer is joined.
* @param BufferType
* Join status of the specified computer.
* @return If the function succeeds, the return value is NERR_Success. If
* the function fails, the return value is a system error code.
*/
public int NetGetJoinInformation(String lpServer,
PointerByReference lpNameBuffer, IntByReference BufferType);
/**
* Frees the memory that the NetApiBufferAllocate function allocates.
*
* @param buffer
* @return If the function succeeds, the return value is NERR_Success. If
* the function fails, the return value is a system error code.
*/
public int NetApiBufferFree(Pointer buffer);
/**
* Returns information about each local group account on the specified
* server.
*
* @param serverName
* Specifies the DNS or NetBIOS name of the remote server on
* which the function is to execute. If this parameter is NULL,
* the local computer is used.
* @param level
* Specifies the information level of the data.
* @param bufptr
* Pointer to the address of the buffer that receives the
* information structure.
* @param prefmaxlen
* Specifies the preferred maximum length of returned data, in
* bytes.
* @param entriesread
* Pointer to a value that receives the count of elements
* actually enumerated.
* @param totalentries
* Pointer to a value that receives the approximate total number
* of entries that could have been enumerated from the current
* resume position.
* @param resume_handle
* Pointer to a value that contains a resume handle that is used
* to continue an existing local group search.
* @return If the function succeeds, the return value is NERR_Success.
*/
public int NetLocalGroupEnum(String serverName, int level,
PointerByReference bufptr, int prefmaxlen,
IntByReference entriesread, IntByReference totalentries,
IntByReference resume_handle);
/**
* Returns the name of the primary domain controller (PDC).
*
* @param serverName
* Specifies the DNS or NetBIOS name of the remote server on which the function is
* to execute. If this parameter is NULL, the local computer is used.
* @param domainName
* Specifies the name of the domain.
* @param bufptr
* Receives a string that specifies the server name of the PDC of the domain.
* @return
* If the function succeeds, the return value is NERR_Success.
*/
public int NetGetDCName(String serverName, String domainName,
PointerByReference bufptr);
/**
* The NetGroupEnum function retrieves information about each global group
* in the security database, which is the security accounts manager (SAM) database or,
* in the case of domain controllers, the Active Directory.
* @param servername
* Pointer to a constant string that specifies the DNS or NetBIOS name of the
* remote server on which the function is to execute. If this parameter is NULL,
* the local computer is used.
* @param level
* Specifies the information level of the data.
* @param bufptr
* Pointer to the buffer to receive the global group information structure.
* The format of this data depends on the value of the level parameter.
* @param prefmaxlen
* Specifies the preferred maximum length of the returned data, in bytes.
* If you specify MAX_PREFERRED_LENGTH, the function allocates the amount of
* memory required to hold the data. If you specify another value in this
* parameter, it can restrict the number of bytes that the function returns.
* If the buffer size is insufficient to hold all entries, the function
* returns ERROR_MORE_DATA.
* @param entriesread
* Pointer to a value that receives the count of elements actually enumerated.
* @param totalentries
* Pointer to a value that receives the total number of entries that could have
* been enumerated from the current resume position. The total number of entries
* is only a hint.
* @param resume_handle
* Pointer to a variable that contains a resume handle that is used to continue
* the global group enumeration. The handle should be zero on the first call and
* left unchanged for subsequent calls. If resume_handle is NULL, no resume handle
* is stored.
* @return
* If the function succeeds, the return value is NERR_Success.
*/
public int NetGroupEnum(String servername, int level, PointerByReference bufptr,
int prefmaxlen, IntByReference entriesread, IntByReference totalentries,
IntByReference resume_handle);
/**
* The NetUserEnum function provides information about all user accounts on a server.
* @param servername
* Pointer to a constant string that specifies the DNS or NetBIOS name of the
* remote server on which the function is to execute. If this parameter is NULL,
* the local computer is used.
* @param level
* Specifies the information level of the data.
* @param filter
* Specifies a value that filters the account types for enumeration.
* @param bufptr
* Pointer to the buffer that receives the data. The format of this data depends
* on the value of the level parameter. This buffer is allocated by the system and
* must be freed using the NetApiBufferFree function. Note that you must free the
* buffer even if the function fails with ERROR_MORE_DATA.
* @param prefmaxlen
* Specifies the preferred maximum length, in 8-bit bytes of returned data. If you
* specify MAX_PREFERRED_LENGTH, the function allocates the amount of memory
* required for the data. If you specify another value in this parameter, it can
* restrict the number of bytes that the function returns. If the buffer size is
* insufficient to hold all entries, the function returns ERROR_MORE_DATA.
* @param entriesread
* Pointer to a value that receives the count of elements actually enumerated.
* @param totalentries
* Pointer to a value that receives the total number of entries that could have
* been enumerated from the current resume position. Note that applications should
* consider this value only as a hint.
* @param resume_handle
* Pointer to a value that contains a resume handle which is used to continue an
* existing user search. The handle should be zero on the first call and left
* unchanged for subsequent calls. If resume_handle is NULL, then no resume
* handle is stored.
* @return
* If the function succeeds, the return value is NERR_Success.
*/
public int NetUserEnum(String servername, int level, int filter, PointerByReference bufptr,
int prefmaxlen, IntByReference entriesread, IntByReference totalentries,
IntByReference resume_handle);
/**
* The NetUserGetGroups function retrieves a list of global groups to which a
* specified user belongs.
* @param servername
* Pointer to a constant string that specifies the DNS or NetBIOS name of the
* remote server on which the function is to execute. If this parameter is NULL,
* the local computer is used.
* @param username
* Pointer to a constant string that specifies the name of the user to search for
* in each group account. For more information, see the following Remarks section.
* @param level
* Specifies the information level of the data.
* @param bufptr
* Pointer to the buffer that receives the data. This buffer is allocated by the
* system and must be freed using the NetApiBufferFree function. Note that you must
* free the buffer even if the function fails with ERROR_MORE_DATA.
* @param prefmaxlen
* Specifies the preferred maximum length of returned data, in bytes. If you specify
* MAX_PREFERRED_LENGTH, the function allocates the amount of memory required for the
* data. If you specify another value in this parameter, it can restrict the number
* of bytes that the function returns. If the buffer size is insufficient to hold
* all entries, the function returns ERROR_MORE_DATA.
* @param entriesread
* Pointer to a value that receives the count of elements actually retrieved.
* @param totalentries
* Pointer to a value that receives the total number of entries that could have been retrieved.
* @return
* If the function succeeds, the return value is NERR_Success.
*/
public int NetUserGetGroups(String servername, String username, int level,
PointerByReference bufptr, int prefmaxlen,
IntByReference entriesread, IntByReference totalentries);
/**
* The NetUserGetLocalGroups function retrieves a list of local groups to which a
* specified user belongs.
* @param servername
* Pointer to a constant string that specifies the DNS or NetBIOS name of the remote
* server on which the function is to execute. If this parameter is NULL, the local
* computer is used.
* @param username
* Pointer to a constant string that specifies the name of the user for which to return
* local group membership information. If the string is of the form DomainName\UserName
* the user name is expected to be found on that domain. If the string is of the form
* UserName, the user name is expected to be found on the server specified by the
* servername parameter.
* @param level
* Specifies the information level of the data.
* @param flags
* Specifies a bitmask of flags. Currently, only the value LG_INCLUDE_INDIRECT is
* defined. If this bit is set, the function also returns the names of the local
* groups in which the user is indirectly a member (that is, the user has membership
* in a global group that is itself a member of one or more local groups).
* @param bufptr
* Pointer to the buffer that receives the data. The format of this data depends on
* the value of the level parameter. This buffer is allocated by the system and must
* be freed using the NetApiBufferFree function. Note that you must free the buffer
* even if the function fails with ERROR_MORE_DATA.
* @param prefmaxlen
* Specifies the preferred maximum length of returned data, in bytes. If you specify
* MAX_PREFERRED_LENGTH, the function allocates the amount of memory required for the
* data. If you specify another value in this parameter, it can restrict the number of
* bytes that the function returns. If the buffer size is insufficient to hold all
* entries, the function returns ERROR_MORE_DATA. For more information, see Network
* Management Function Buffers and Network Management Function Buffer Lengths.
* @param entriesread
* Pointer to a value that receives the count of elements actually enumerated.
* @param totalentries
* Pointer to a value that receives the total number of entries that could have been enumerated.
* @return
* If the function succeeds, the return value is NERR_Success.
*/
public int NetUserGetLocalGroups(String servername, String username, int level,
int flags, PointerByReference bufptr, int prefmaxlen,
IntByReference entriesread, IntByReference totalentries);
/**
* The NetUserAdd function adds a user account and assigns a password and privilege level.
* @param servername
* Pointer to a constant string that specifies the DNS or NetBIOS name of the remote server
* on which the function is to execute.
* @param level
* Specifies the information level of the data.
* @param buf
* Pointer to the buffer that specifies the data. The format of this data depends on the
* value of the level parameter.
* @param parm_err
* Pointer to a value that receives the index of the first member of the user information
* structure that causes ERROR_INVALID_PARAMETER. If this parameter is NULL, the index is
* not returned on error.
* @return
* If the function succeeds, the return value is NERR_Success.
*/
public int NetUserAdd(String servername, int level,
Structure buf, IntByReference parm_err);
/**
* The NetUserDel function deletes a user account from a server.
* @param servername
* Pointer to a constant string that specifies the DNS or NetBIOS name of the remote
* server on which the function is to execute. If this parameter is NULL, the local
* computer is used.
* @param username
* Pointer to a constant string that specifies the name of the user account to delete.
* @return
* If the function succeeds, the return value is NERR_Success.
*/
public int NetUserDel(String servername, String username);
/**
* The NetUserChangePassword function changes a user's password for a specified
* network server or domain.
* @param domainname
* Pointer to a constant string that specifies the DNS or NetBIOS name of a remote
* server or domain on which the function is to execute. If this parameter is NULL,
* the logon domain of the caller is used.
* @param username
* Pointer to a constant string that specifies a user name. The NetUserChangePassword
* function changes the password for the specified user. If this parameter is NULL,
* the logon name of the caller is used.
* @param oldpassword
* Pointer to a constant string that specifies the user's old password.
* @param newpassword
* Pointer to a constant string that specifies the user's new password.
* @return
* If the function succeeds, the return value is NERR_Success.
*/
public int NetUserChangePassword(String domainname, String username,
String oldpassword, String newpassword);
/**
* The DsGetDcName function returns the name of a domain controller in a specified domain.
* This function accepts additional domain controller selection criteria to indicate
* preference for a domain controller with particular characteristics.
* @param ComputerName
* Pointer to a null-terminated string that specifies the name of the server to process
* this function. Typically, this parameter is NULL, which indicates that the local
* computer is used.
* @param DomainName
* Pointer to a null-terminated string that specifies the name of the domain or application
* partition to query. This name can either be a DNS style name, for example, fabrikam.com,
* or a flat-style name, for example, Fabrikam. If a DNS style name is specified, the name
* may be specified with or without a trailing period.
* @param DomainGuid
* Pointer to a GUID structure that specifies the GUID of the domain queried. If DomainGuid
* is not NULL and the domain specified by DomainName or ComputerName cannot be found,
* DsGetDcName attempts to locate a domain controller in the domain having the GUID specified
* by DomainGuid.
* @param SiteName
* Pointer to a null-terminated string that specifies the name of the site where the returned
* domain controller should physically exist. If this parameter is NULL, DsGetDcName attempts
* to return a domain controller in the site closest to the site of the computer specified by
* ComputerName. This parameter should be NULL, by default.
* @param Flags
* Contains a set of flags that provide additional data used to process the request.
* @param DomainControllerInfo
* Pointer to a PDOMAIN_CONTROLLER_INFO value that receives a pointer to a
* DOMAIN_CONTROLLER_INFO structure that contains data about the domain controller selected.
* This structure is allocated by DsGetDcName. The caller must free the structure using
* the NetApiBufferFree function when it is no longer required.
* @return
* If the function returns domain controller data, the return value is ERROR_SUCCESS.
* If the function fails, the return code is one of ERROR_* values.
*/
public int DsGetDcName(String ComputerName, String DomainName, GUID DomainGuid,
String SiteName, int Flags, PDOMAIN_CONTROLLER_INFO.ByReference DomainControllerInfo);
/**
* The DsGetForestTrustInformationW function obtains forest trust data for a specified domain.
* @param serverName
* Contains the name of the domain controller that DsGetForestTrustInformationW
* is connected to remotely. The caller must be an authenticated user on this server.
* If this parameter is NULL, the local server is used.
* @param trustedDomainName
* Contains the NETBIOS or DNS name of the trusted domain that the forest trust data
* is to be retrieved for. This domain must have the TRUST_ATTRIBUTE_FOREST_TRANSITIVE
* trust attribute. If this parameter is NULL, the forest trust data for the domain
* hosted by ServerName is retrieved.
* @param Flags
* Contains a set of flags that modify the behavior of this function.
* DS_GFTI_UPDATE_TDO: If this flag is set, DsGetForestTrustInformationW will update the
* forest trust data of the trusted domain identified by the TrustedDomainName parameter.
* @param ForestTrustInfo
* Pointer to an LSA_FOREST_TRUST_INFORMATION structure pointer that receives the forest
* trust data that describes the namespaces claimed by the domain specified by
* TrustedDomainName. The Time member of all returned records will be zero.
* @return
* Returns NO_ERROR if successful or a Win32 error code otherwise.
*/
public int DsGetForestTrustInformation(String serverName, String trustedDomainName, int Flags,
PLSA_FOREST_TRUST_INFORMATION.ByReference ForestTrustInfo);
/**
* The DsEnumerateDomainTrusts function obtains domain trust data for a specified domain.
* @param serverName
* Pointer to a null-terminated string that specifies the name of a computer in the domain to
* obtain the trust information for. This computer must be running the Windows 2000 or later
* operating system. If this parameter is NULL, the name of the local computer is used.
* The caller must be an authenticated user in this domain.
* @param Flags
* Contains a set of flags that determines which domain trusts to enumerate.
* @param Domains
* Receives a pointer which points to an array of DS_DOMAIN_TRUSTS structures.
* Each structure in this array contains trust data about a domain. The caller must free this
* memory when it is no longer required by calling NetApiBufferFree.
* @param DomainCount
* Pointer to a ULONG value that receives the number of elements returned in the Domains array.
* @return
* Returns ERROR_SUCCESS if successful or a Win32 error code otherwise.
*/
public int DsEnumerateDomainTrusts(String serverName, int Flags,
PointerByReference Domains, IntByReference DomainCount);
/**
* The NetUserGetInfo function retrieves information about a particular user account on a server.
* @param servername
* A pointer to a constant string that specifies the DNS or NetBIOS name of the remote server on
* which the function is to execute. If this parameter is NULL, the local computer is used.
* @param username
* A pointer to a constant string that specifies the name of the user account for which to return information.
* For more information, see the following Remarks section.
* @param level
* The information level of the data. This parameter can be one of the following values.
* Value Meaning
* 0 Return the user account name. The bufptr parameter points to a USER_INFO_0 structure.
* 1 Return detailed information about the user account. The bufptr parameter points to a USER_INFO_1 structure.
* 2 Return detailed information and additional attributes about the user account. The bufptr parameter points to a USER_INFO_2 structure.
* 3 Return detailed information and additional attributes about the user account. This level is valid only on servers. The bufptr parameter points to a USER_INFO_3 structure. Note that it is recommended that you use USER_INFO_4 instead.
* 4 Return detailed information and additional attributes about the user account. This level is valid only on servers. The bufptr parameter points to a USER_INFO_4 structure. Windows 2000: This level is not supported.
* 10 Return user and account names and comments. The bufptr parameter points to a USER_INFO_10 structure.
* 11 Return detailed information about the user account. The bufptr parameter points to a USER_INFO_11 structure.
* 20 Return the user's name and identifier and various account attributes. The bufptr parameter points to a USER_INFO_20 structure. Note that on Windows XP and later, it is recommended that you use USER_INFO_23 instead.
* 23 Return the user's name and identifier and various account attributes. The bufptr parameter points to a USER_INFO_23 structure. Windows 2000: This level is not supported.
* @param bufptr
* A pointer to the buffer that receives the data.
* The format of this data depends on the value of the level parameter.
* This buffer is allocated by the system and must be freed using the NetApiBufferFree function.
* For more information, see Network Management Function Buffers and Network Management Function Buffer Lengths.
* @return
* If the function succeeds, the return value is NERR_Success.
*/
public int NetUserGetInfo( String servername, String username, int level, PointerByReference bufptr );
}
@@ -0,0 +1,695 @@
/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import java.util.ArrayList;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.DsGetDC.DS_DOMAIN_TRUSTS;
import com.sun.jna.platform.win32.DsGetDC.PDOMAIN_CONTROLLER_INFO;
import com.sun.jna.platform.win32.Guid.GUID;
import com.sun.jna.platform.win32.LMAccess.GROUP_USERS_INFO_0;
import com.sun.jna.platform.win32.LMAccess.LOCALGROUP_INFO_1;
import com.sun.jna.platform.win32.LMAccess.LOCALGROUP_USERS_INFO_0;
import com.sun.jna.platform.win32.LMAccess.USER_INFO_23;
import com.sun.jna.platform.win32.Secur32.EXTENDED_NAME_FORMAT;
import com.sun.jna.platform.win32.WinNT.PSID;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.ptr.PointerByReference;
/**
* Netapi32 Utility API.
* @author dblock[at]dblock.org
*/
public abstract class Netapi32Util {
/**
* A group.
*/
public static class Group {
/**
* Group name.
*/
public String name;
}
/**
* A user.
*/
public static class User {
/**
* The name of the user account.
*/
public String name;
/**
* Contains a comment associated with the user account.
*/
public String comment;
}
public static class UserInfo extends User {
/**
* The full name belonging to the user account
*/
public String fullName;
/**
* The SID of the user account
*/
public String sidString;
/**
* The SID of the user account
*/
public PSID sid;
/**
* The flags of the user account
*/
public int flags;
}
/**
* A local group.
*/
public static class LocalGroup extends Group {
/**
* Group comment.
*/
public String comment;
}
/**
* Returns the name of the primary domain controller (PDC) on the current computer.
* @return The name of the primary domain controller.
*/
public static String getDCName() {
return getDCName(null, null);
}
/**
* Returns the name of the primary domain controller (PDC).
* @param serverName
* Specifies the DNS or NetBIOS name of the remote server on which the function is
* to execute.
* @param domainName
* Specifies the name of the domain.
* @return
* Name of the primary domain controller.
*/
public static String getDCName(String serverName, String domainName) {
PointerByReference bufptr = new PointerByReference();
try {
int rc = Netapi32.INSTANCE.NetGetDCName(domainName, serverName, bufptr);
if (LMErr.NERR_Success != rc) {
throw new Win32Exception(rc);
}
return bufptr.getValue().getString(0, true);
} finally {
if (W32Errors.ERROR_SUCCESS != Netapi32.INSTANCE.NetApiBufferFree(bufptr.getValue())) {
throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
}
}
}
/**
* Return the domain/workgroup join status for a computer.
* @return Join status.
*/
public static int getJoinStatus() {
return getJoinStatus(null);
}
/**
* Return the domain/workgroup join status for a computer.
* @param computerName Computer name.
* @return Join status.
*/
public static int getJoinStatus(String computerName) {
PointerByReference lpNameBuffer = new PointerByReference();
IntByReference bufferType = new IntByReference();
try {
int rc = Netapi32.INSTANCE.NetGetJoinInformation(computerName, lpNameBuffer, bufferType);
if (LMErr.NERR_Success != rc) {
throw new Win32Exception(rc);
}
return bufferType.getValue();
} finally {
if (lpNameBuffer.getPointer() != null) {
int rc = Netapi32.INSTANCE.NetApiBufferFree(lpNameBuffer.getValue());
if (LMErr.NERR_Success != rc) {
throw new Win32Exception(rc);
}
}
}
}
/**
* Get information about a computer.
* @param computerName
* @return Domain or workgroup name.
*/
public static String getDomainName(String computerName) {
PointerByReference lpNameBuffer = new PointerByReference();
IntByReference bufferType = new IntByReference();
try {
int rc = Netapi32.INSTANCE.NetGetJoinInformation(computerName, lpNameBuffer, bufferType);
if (LMErr.NERR_Success != rc) {
throw new Win32Exception(rc);
}
// type of domain: bufferType.getValue()
return lpNameBuffer.getValue().getString(0, true);
} finally {
if (lpNameBuffer.getPointer() != null) {
int rc = Netapi32.INSTANCE.NetApiBufferFree(lpNameBuffer.getValue());
if (LMErr.NERR_Success != rc) {
throw new Win32Exception(rc);
}
}
}
}
/**
* Get the names of local groups on the current computer.
* @return An array of local group names.
*/
public static LocalGroup[] getLocalGroups() {
return getLocalGroups(null);
}
/**
* Get the names of local groups on a computer.
* @param serverName Name of the computer.
* @return An array of local group names.
*/
public static LocalGroup[] getLocalGroups(String serverName) {
PointerByReference bufptr = new PointerByReference();
IntByReference entriesRead = new IntByReference();
IntByReference totalEntries = new IntByReference();
try {
int rc = Netapi32.INSTANCE.NetLocalGroupEnum(serverName, 1, bufptr, LMCons.MAX_PREFERRED_LENGTH, entriesRead, totalEntries, null);
if (LMErr.NERR_Success != rc || bufptr.getValue() == Pointer.NULL) {
throw new Win32Exception(rc);
}
LMAccess.LOCALGROUP_INFO_1 group = new LMAccess.LOCALGROUP_INFO_1(bufptr.getValue());
LMAccess.LOCALGROUP_INFO_1[] groups = (LOCALGROUP_INFO_1[]) group.toArray(entriesRead.getValue());
ArrayList<LocalGroup> result = new ArrayList<LocalGroup>();
for(LOCALGROUP_INFO_1 lgpi : groups) {
LocalGroup lgp = new LocalGroup();
if (lgpi.lgrui1_name != null) {
lgp.name = lgpi.lgrui1_name.toString();
}
if (lgpi.lgrui1_comment != null) {
lgp.comment = lgpi.lgrui1_comment.toString();
}
result.add(lgp);
}
return result.toArray(new LocalGroup[0]);
} finally {
if (bufptr.getValue() != Pointer.NULL) {
int rc = Netapi32.INSTANCE.NetApiBufferFree(bufptr.getValue());
if (LMErr.NERR_Success != rc) {
throw new Win32Exception(rc);
}
}
}
}
/**
* Get the names of global groups on a computer.
* @return An array of group names.
*/
public static Group[] getGlobalGroups() {
return getGlobalGroups(null);
}
/**
* Get the names of global groups on a computer.
* @param serverName Name of the computer.
* @return An array of group names.
*/
public static Group[] getGlobalGroups(String serverName) {
PointerByReference bufptr = new PointerByReference();
IntByReference entriesRead = new IntByReference();
IntByReference totalEntries = new IntByReference();
try {
int rc = Netapi32.INSTANCE.NetGroupEnum(serverName, 1, bufptr,
LMCons.MAX_PREFERRED_LENGTH, entriesRead,
totalEntries, null);
if (LMErr.NERR_Success != rc || bufptr.getValue() == Pointer.NULL) {
throw new Win32Exception(rc);
}
LMAccess.GROUP_INFO_1 group = new LMAccess.GROUP_INFO_1(bufptr.getValue());
LMAccess.GROUP_INFO_1[] groups = (LMAccess.GROUP_INFO_1[]) group.toArray(entriesRead.getValue());
ArrayList<LocalGroup> result = new ArrayList<LocalGroup>();
for(LMAccess.GROUP_INFO_1 lgpi : groups) {
LocalGroup lgp = new LocalGroup();
if (lgpi.grpi1_name != null) {
lgp.name = lgpi.grpi1_name.toString();
}
if (lgpi.grpi1_comment != null) {
lgp.comment = lgpi.grpi1_comment.toString();
}
result.add(lgp);
}
return result.toArray(new LocalGroup[0]);
} finally {
if (bufptr.getValue() != Pointer.NULL) {
int rc = Netapi32.INSTANCE.NetApiBufferFree(bufptr.getValue());
if (LMErr.NERR_Success != rc) {
throw new Win32Exception(rc);
}
}
}
}
/**
* Get the names of users on a local computer.
* @return Users.
*/
public static User[] getUsers() {
return getUsers(null);
}
/**
* Get the names of users on a computer.
* @param serverName Name of the computer.
* @return An array of users.
*/
public static User[] getUsers(String serverName) {
PointerByReference bufptr = new PointerByReference();
IntByReference entriesRead = new IntByReference();
IntByReference totalEntries = new IntByReference();
try {
int rc = Netapi32.INSTANCE.NetUserEnum(
serverName, 1, 0, bufptr,
LMCons.MAX_PREFERRED_LENGTH, entriesRead,
totalEntries, null);
if (LMErr.NERR_Success != rc || bufptr.getValue() == Pointer.NULL) {
throw new Win32Exception(rc);
}
LMAccess.USER_INFO_1 user = new LMAccess.USER_INFO_1(bufptr.getValue());
LMAccess.USER_INFO_1[] users = (LMAccess.USER_INFO_1[]) user.toArray(entriesRead.getValue());
ArrayList<User> result = new ArrayList<User>();
for(LMAccess.USER_INFO_1 lu : users) {
User auser = new User();
if (lu.usri1_name != null) {
auser.name = lu.usri1_name.toString();
}
result.add(auser);
}
return result.toArray(new User[0]);
} finally {
if (bufptr.getValue() != Pointer.NULL) {
int rc = Netapi32.INSTANCE.NetApiBufferFree(bufptr.getValue());
if (LMErr.NERR_Success != rc) {
throw new Win32Exception(rc);
}
}
}
}
/**
* Get local groups of the current user.
* @return Local groups.
*/
public static Group[] getCurrentUserLocalGroups() {
return getUserLocalGroups(Secur32Util.getUserNameEx(EXTENDED_NAME_FORMAT.NameSamCompatible));
}
/**
* Get local groups of a given user.
* @param userName User name.
* @return Local groups.
*/
public static Group[] getUserLocalGroups(String userName) {
return getUserLocalGroups(userName, null);
}
/**
* Get local groups of a given user on a given system.
* @param userName User name.
* @param serverName Server name.
* @return Local groups.
*/
public static Group[] getUserLocalGroups(String userName, String serverName) {
PointerByReference bufptr = new PointerByReference();
IntByReference entriesread = new IntByReference();
IntByReference totalentries = new IntByReference();
try {
int rc = Netapi32.INSTANCE.NetUserGetLocalGroups(
serverName, userName,
0, 0, bufptr, LMCons.MAX_PREFERRED_LENGTH, entriesread, totalentries);
if (rc != LMErr.NERR_Success) {
throw new Win32Exception(rc);
}
LOCALGROUP_USERS_INFO_0 lgroup = new LOCALGROUP_USERS_INFO_0(bufptr.getValue());
LOCALGROUP_USERS_INFO_0[] lgroups = (LOCALGROUP_USERS_INFO_0[]) lgroup.toArray(entriesread.getValue());
ArrayList<Group> result = new ArrayList<Group>();
for (LOCALGROUP_USERS_INFO_0 lgpi : lgroups) {
LocalGroup lgp = new LocalGroup();
if (lgpi.lgrui0_name != null) {
lgp.name = lgpi.lgrui0_name.toString();
}
result.add(lgp);
}
return result.toArray(new Group[0]);
} finally {
if (bufptr.getValue() != Pointer.NULL) {
int rc = Netapi32.INSTANCE.NetApiBufferFree(bufptr.getValue());
if (LMErr.NERR_Success != rc) {
throw new Win32Exception(rc);
}
}
}
}
/**
* Get groups of a given user.
* @param userName User name.
* @return Groups.
*/
public static Group[] getUserGroups(String userName) {
return getUserGroups(userName, null);
}
/**
* Get groups of a given user on a given system.
* @param userName User name.
* @param serverName Server name.
* @return Groups.
*/
public static Group[] getUserGroups(String userName, String serverName) {
PointerByReference bufptr = new PointerByReference();
IntByReference entriesread = new IntByReference();
IntByReference totalentries = new IntByReference();
try {
int rc = Netapi32.INSTANCE.NetUserGetGroups(
serverName, userName,
0, bufptr, LMCons.MAX_PREFERRED_LENGTH, entriesread, totalentries);
if (rc != LMErr.NERR_Success) {
throw new Win32Exception(rc);
}
GROUP_USERS_INFO_0 lgroup = new GROUP_USERS_INFO_0(bufptr.getValue());
GROUP_USERS_INFO_0[] lgroups = (GROUP_USERS_INFO_0[]) lgroup.toArray(entriesread.getValue());
ArrayList<Group> result = new ArrayList<Group>();
for (GROUP_USERS_INFO_0 lgpi : lgroups) {
Group lgp = new Group();
if (lgpi.grui0_name != null) {
lgp.name = lgpi.grui0_name.toString();
}
result.add(lgp);
}
return result.toArray(new Group[0]);
} finally {
if (bufptr.getValue() != Pointer.NULL) {
int rc = Netapi32.INSTANCE.NetApiBufferFree(bufptr.getValue());
if (LMErr.NERR_Success != rc) {
throw new Win32Exception(rc);
}
}
}
}
/**
* A domain controller.
*/
public static class DomainController {
/**
* Specifies the computer name of the discovered domain controller.
*/
public String name;
/**
* Specifies the address of the discovered domain controller.
*/
public String address;
/**
* Indicates the type of string that is contained in the
* DomainControllerAddress member.
*/
public int addressType;
/**
* The GUID of the domain.
*/
public GUID domainGuid;
/**
* Pointer to a null-terminated string that specifies the name of the domain.
*/
public String domainName;
/**
* Pointer to a null-terminated string that specifies the name of the domain at the root
* of the DS tree.
*/
public String dnsForestName;
/**
* Contains a set of flags that describe the domain controller.
*/
public int flags;
/**
* The name of the site that the computer belongs to.
*/
public String clientSiteName;
}
/**
* Return the domain controller for a current computer.
* @return
* Domain controller information.
*/
public static DomainController getDC() {
PDOMAIN_CONTROLLER_INFO.ByReference pdci = new PDOMAIN_CONTROLLER_INFO.ByReference();
int rc = Netapi32.INSTANCE.DsGetDcName(null, null, null, null, 0, pdci);
if (W32Errors.ERROR_SUCCESS != rc) {
throw new Win32Exception(rc);
}
DomainController dc = new DomainController();
if (pdci.dci.DomainControllerAddress != null) {
dc.address = pdci.dci.DomainControllerAddress.toString();
}
dc.addressType = pdci.dci.DomainControllerAddressType;
if (pdci.dci.ClientSiteName != null) {
dc.clientSiteName = pdci.dci.ClientSiteName.toString();
}
if (pdci.dci.DnsForestName != null) {
dc.dnsForestName = pdci.dci.DnsForestName.toString();
}
dc.domainGuid = pdci.dci.DomainGuid;
if (pdci.dci.DomainName != null) {
dc.domainName = pdci.dci.DomainName.toString();
}
dc.flags = pdci.dci.Flags;
if (pdci.dci.DomainControllerName != null) {
dc.name = pdci.dci.DomainControllerName.toString();
}
rc = Netapi32.INSTANCE.NetApiBufferFree(pdci.dci.getPointer());
if (LMErr.NERR_Success != rc) {
throw new Win32Exception(rc);
}
return dc;
}
/**
* A domain trust relationship.
*/
public static class DomainTrust {
/**
* NetBIOS name of the domain.
*/
public String NetbiosDomainName;
/**
* DNS name of the domain.
*/
public String DnsDomainName;
/**
* Contains the security identifier of the domain represented by this structure.
*/
public PSID DomainSid;
/**
* Contains the string representation of the security identifier of the domain
* represented by this structure.
*/
public String DomainSidString;
/**
* Contains the GUID of the domain represented by this structure.
*/
public GUID DomainGuid;
/**
* Contains the string representation of the GUID of the domain represented by
* this structure.
*/
public String DomainGuidString;
/**
* Contains a set of flags that specify more data about the domain trust.
*/
private int flags;
/**
* The domain represented by this structure is a member of the same forest
* as the server specified in the ServerName parameter of the
* DsEnumerateDomainTrusts function.
* @return
* True or false.
*/
public boolean isInForest() {
return (flags & DsGetDC.DS_DOMAIN_IN_FOREST) != 0;
}
/**
* The domain represented by this structure is directly trusted by the domain
* that the server specified in the ServerName parameter of the
* DsEnumerateDomainTrusts function is a member of.
* @return
* True or false.
*/
public boolean isOutbound() {
return (flags & DsGetDC.DS_DOMAIN_DIRECT_OUTBOUND) != 0;
}
/**
* The domain represented by this structure is the root of a tree and a member
* of the same forest as the server specified in the ServerName parameter of the
* DsEnumerateDomainTrusts function.
* @return
* True or false.
*/
public boolean isRoot() {
return (flags & DsGetDC.DS_DOMAIN_TREE_ROOT) != 0;
}
/**
* The domain represented by this structure is the primary domain of the server
* specified in the ServerName parameter of the DsEnumerateDomainTrusts function.
* @return
* True or false.
*/
public boolean isPrimary() {
return (flags & DsGetDC.DS_DOMAIN_PRIMARY) != 0;
}
/**
* The domain represented by this structure is running in the Windows 2000 native mode.
* @return
* True or false.
*/
public boolean isNativeMode() {
return (flags & DsGetDC.DS_DOMAIN_NATIVE_MODE) != 0;
}
/**
* The domain represented by this structure directly trusts the domain that
* the server specified in the ServerName parameter of the DsEnumerateDomainTrusts
* function is a member of.
* @return
* True or false.
*/
public boolean isInbound() {
return (flags & DsGetDC.DS_DOMAIN_DIRECT_INBOUND) != 0;
}
}
/**
* Retrieve all domain trusts.
* @return
* An array of domain trusts.
*/
public static DomainTrust[] getDomainTrusts() {
return getDomainTrusts(null);
}
/**
* Retrieve all domain trusts for a given server.
* @param serverName
* Server name.
* @return
* An array of domain trusts.
*/
public static DomainTrust[] getDomainTrusts(String serverName) {
IntByReference domainTrustCount = new IntByReference();
PointerByReference domainsPointerRef = new PointerByReference();
int rc = Netapi32.INSTANCE.DsEnumerateDomainTrusts(serverName,
DsGetDC.DS_DOMAIN_VALID_FLAGS, domainsPointerRef, domainTrustCount);
if(W32Errors.NO_ERROR != rc) {
throw new Win32Exception(rc);
}
try {
DS_DOMAIN_TRUSTS domainTrustRefs = new DS_DOMAIN_TRUSTS(domainsPointerRef.getValue());
DS_DOMAIN_TRUSTS[] domainTrusts = (DS_DOMAIN_TRUSTS[]) domainTrustRefs.toArray(new DS_DOMAIN_TRUSTS[domainTrustCount.getValue()]);
ArrayList<DomainTrust> trusts = new ArrayList<DomainTrust>(domainTrustCount.getValue());
for(DS_DOMAIN_TRUSTS domainTrust : domainTrusts) {
DomainTrust t = new DomainTrust();
if (domainTrust.DnsDomainName != null) {
t.DnsDomainName = domainTrust.DnsDomainName.toString();
}
if (domainTrust.NetbiosDomainName != null) {
t.NetbiosDomainName = domainTrust.NetbiosDomainName.toString();
}
t.DomainSid = domainTrust.DomainSid;
if (domainTrust.DomainSid != null) {
t.DomainSidString = Advapi32Util.convertSidToStringSid(domainTrust.DomainSid);
}
t.DomainGuid = domainTrust.DomainGuid;
if (domainTrust.DomainGuid != null) {
t.DomainGuidString = Ole32Util.getStringFromGUID(domainTrust.DomainGuid);
}
t.flags = domainTrust.Flags;
trusts.add(t);
}
return trusts.toArray(new DomainTrust[0]);
} finally {
rc = Netapi32.INSTANCE.NetApiBufferFree(domainsPointerRef.getValue());
if(W32Errors.NO_ERROR != rc) {
throw new Win32Exception(rc);
}
}
}
public static UserInfo getUserInfo(String accountName) {
return getUserInfo(accountName, Netapi32Util.getDCName());
}
public static UserInfo getUserInfo(String accountName, String domainName) {
PointerByReference bufptr = new PointerByReference();
int rc = -1;
try {
rc = Netapi32.INSTANCE.NetUserGetInfo(domainName, accountName, (short)23, bufptr);
if (rc == LMErr.NERR_Success) {
USER_INFO_23 info_23 = new USER_INFO_23(bufptr.getValue());
UserInfo userInfo = new UserInfo();
if (info_23.usri23_comment != null) {
userInfo.comment = info_23.usri23_comment.toString();
}
userInfo.flags = info_23.usri23_flags;
if (info_23.usri23_full_name != null) {
userInfo.fullName = info_23.usri23_full_name.toString();
}
if (info_23.usri23_name != null) {
userInfo.name = info_23.usri23_name.toString();
}
if (info_23.usri23_user_sid != null) {
userInfo.sidString = Advapi32Util.convertSidToStringSid(info_23.usri23_user_sid);
}
userInfo.sid = info_23.usri23_user_sid;
return userInfo;
} else {
throw new Win32Exception(rc);
}
} finally {
if (bufptr.getValue() != Pointer.NULL) {
Netapi32.INSTANCE.NetApiBufferFree(bufptr.getValue());
}
}
}
}
@@ -0,0 +1,55 @@
/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import com.sun.jna.Native;
import com.sun.jna.Structure;
import com.sun.jna.platform.win32.WinNT.HANDLE;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
/**
* ntdll.dll Interface.
* @author dblock[at]dblock.org
*/
public interface NtDll extends StdCallLibrary {
NtDll INSTANCE = (NtDll) Native.loadLibrary("NtDll",
NtDll.class, W32APIOptions.UNICODE_OPTIONS);
/**
* The ZwQueryKey routine provides information about the class of a registry key,
* and the number and sizes of its subkeys.
* @param KeyHandle
* Handle to the registry key to obtain information about. This handle is created by
* a successful call to ZwCreateKey or ZwOpenKey.
* @param KeyInformationClass
* Specifies a KEY_INFORMATION_CLASS value that determines the type of information
* returned in the KeyInformation buffer.
* @param KeyInformation
* Pointer to a caller-allocated buffer that receives the requested information.
* @param Length
* Specifies the size, in bytes, of the KeyInformation buffer.
* @param ResultLength
* Pointer to a variable that receives the size, in bytes, of the requested key
* information. If ZwQueryKey returns STATUS_SUCCESS, the variable contains the amount
* of data returned. If ZwQueryKey returns STATUS_BUFFER_OVERFLOW or
* STATUS_BUFFER_TOO_SMALL, you can use the value of the variable to determine the
* required buffer size.
* @return
* ZwQueryKey returns STATUS_SUCCESS on success, or the appropriate error code on failure.
*/
public int ZwQueryKey(HANDLE KeyHandle, int KeyInformationClass,
Structure KeyInformation, int Length, IntByReference ResultLength);
}
@@ -0,0 +1,47 @@
/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import com.sun.jna.platform.win32.Wdm.KEY_BASIC_INFORMATION;
import com.sun.jna.platform.win32.Wdm.KEY_INFORMATION_CLASS;
import com.sun.jna.platform.win32.WinReg.HKEY;
import com.sun.jna.ptr.IntByReference;
/**
* NtDll Utility API.
* @author dblock[at]dblock.org
*/
public abstract class NtDllUtil {
/**
* Retrieve the name of an opened registry key.
* @param hkey Opened registry key.
* @return Basic key name, not including node information.
*/
public static String getKeyName(HKEY hkey) {
IntByReference resultLength = new IntByReference();
int rc = NtDll.INSTANCE.ZwQueryKey(hkey, KEY_INFORMATION_CLASS.KeyBasicInformation,
null, 0, resultLength);
if (rc != NTStatus.STATUS_BUFFER_TOO_SMALL || resultLength.getValue() <= 0) {
throw new Win32Exception(rc);
}
KEY_BASIC_INFORMATION keyInformation = new KEY_BASIC_INFORMATION(
resultLength.getValue());
rc = NtDll.INSTANCE.ZwQueryKey(hkey, KEY_INFORMATION_CLASS.KeyBasicInformation,
keyInformation, resultLength.getValue(), resultLength);
if (rc != NTStatus.STATUS_SUCCESS) {
throw new Win32Exception(rc);
}
return keyInformation.getName();
}
}
@@ -0,0 +1,37 @@
/*
* Copyright 2010 Digital Rapids Corp.
*/
/* Copyright (c) 2010 Timothy Wall, All Rights Reserved
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import com.sun.jna.platform.win32.WTypes;
/**
* Definitions from ObjBase.h
* @author scott.palmer
*/
public interface ObjBase {
int CLSCTX_INPROC = (WTypes.CLSCTX_INPROC_SERVER | WTypes.CLSCTX_INPROC_HANDLER);
// With DCOM, CLSCTX_REMOTE_SERVER should be included
int CLSCTX_ALL = (WTypes.CLSCTX_INPROC_SERVER
| WTypes.CLSCTX_INPROC_HANDLER
| WTypes.CLSCTX_LOCAL_SERVER
| WTypes.CLSCTX_REMOTE_SERVER);
int CLSCTX_SERVER = (WTypes.CLSCTX_INPROC_SERVER
| WTypes.CLSCTX_LOCAL_SERVER
| WTypes.CLSCTX_REMOTE_SERVER);
}
@@ -0,0 +1,106 @@
/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.Guid.GUID;
import com.sun.jna.platform.win32.WinNT.HRESULT;
import com.sun.jna.ptr.PointerByReference;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
/**
* Ole32.dll Interface.
* @author dblock[at]dblock.org
*/
public interface Ole32 extends StdCallLibrary {
Ole32 INSTANCE = (Ole32) Native.loadLibrary(
"Ole32", Ole32.class, W32APIOptions.UNICODE_OPTIONS);
/**
* Creates a GUID, a unique 128-bit integer used for CLSIDs and interface identifiers.
* @param pguid
* A pointer to the requested GUID.
* @return
* S_OK if the GUID was successfully created.
*/
HRESULT CoCreateGuid(GUID.ByReference pguid);
/**
* Converts a globally unique identifier (GUID) into a string of printable characters.
* @param rguid
* The GUID to be converted.
* @param lpsz
* A pointer to a caller-allocated string variable to receive the resulting string.
* @param cchMax
* The number of characters available in the lpsz buffer.
* @return
* If the function succeeds, the return value is the number of characters in the
* returned string, including the null terminator. If the buffer is too small to contain
* the string, the return value is 0.
*/
int StringFromGUID2(GUID.ByReference rguid, char[] lpsz, int cchMax);
/**
* Converts a string generated by the StringFromIID function back into the
* original interface identifier (IID).
* @param lpsz
* A pointer to the string representation of the IID.
* @param lpiid
* A pointer to the requested IID on return.
* @return
* This function can return the standard return values E_INVALIDARG, E_OUTOFMEMORY,
* and S_OK.
*/
HRESULT IIDFromString(String lpsz, GUID.ByReference lpiid);
/**
* Initializes the COM library for use by the calling thread, sets the thread's
* concurrency model, and creates a new apartment for the thread if one is required.
* @param reserved This parameter is reserved and must be NULL.
* @param dwCoInit The concurrency model and initialization options for the
* thread. Values for this parameter are taken from the COINIT enumeration.
* Any combination of values from COINIT can be used, except that the
* COINIT_APARTMENTTHREADED and COINIT_MULTITHREADED flags cannot both be
* set. The default (and only sane choice) is COINIT_MULTITHREADED.
* @return This function can return the standard return values E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following values. S_OK, S_FALSE, RPC_E_CHANGED_MODE
*/
HRESULT CoInitializeEx(Pointer reserved, int dwCoInit);
/**
* Closes the COM library on the current thread, unloads all DLLs loaded by
* the thread, frees any other resources that the thread maintains, and
* forces all RPC connections on the thread to close.
*
*/
void CoUninitialize();
/**
* Creates a single uninitialized object of the class associated with a specified CLSID.
* @param rclsid The CLSID associated with the data and code that will be used to create the object.
* @param pUnkOuter If NULL, indicates that the object is not being created as part of an aggregate. If non-NULL, pointer to the aggregate object's IUnknown interface (the controlling IUnknown).
* @param dwClsContext Context in which the code that manages the newly created object will run. The values are taken from the enumeration CLSCTX defined in WTypes.
* @param riid A reference to the identifier of the interface to be used to communicate with the object.
* @param ppv Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, *ppv contains the requested interface pointer. Upon failure, *ppv contains NULL.
* @return an HRESULT
*/
HRESULT CoCreateInstance(
GUID rclsid,
Pointer pUnkOuter,
int dwClsContext,
GUID riid,
PointerByReference ppv);
}
@@ -0,0 +1,73 @@
/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import com.sun.jna.Native;
import com.sun.jna.platform.win32.Guid.GUID;
import com.sun.jna.platform.win32.WinNT.HRESULT;
/**
* Ole32 Utility API.
* @author dblock[at]dblock.org
*/
public abstract class Ole32Util {
/**
* Convert a string to a GUID.
* @param guidString
* String representation of a GUID, including { }.
* @return
* A GUID.
*/
public static GUID getGUIDFromString(String guidString) {
GUID.ByReference lpiid = new GUID.ByReference();
HRESULT hr = Ole32.INSTANCE.IIDFromString(guidString, lpiid);
if (! hr.equals(W32Errors.S_OK)) {
throw new RuntimeException(hr.toString());
}
return lpiid;
}
/**
* Convert a GUID into a string.
* @param guid
* GUID.
* @return
* String representation of a GUID.
*/
public static String getStringFromGUID(GUID guid) {
GUID.ByReference pguid = new GUID.ByReference(guid.getPointer());
int max = 39;
char[] lpsz = new char[max];
int len = Ole32.INSTANCE.StringFromGUID2(pguid, lpsz, max);
if (len == 0) {
throw new RuntimeException("StringFromGUID2");
}
lpsz[len - 1] = 0;
return Native.toString(lpsz);
}
/**
* Generate a new GUID.
* @return
* New GUID.
*/
public static GUID generateGUID() {
GUID.ByReference pguid = new GUID.ByReference();
HRESULT hr = Ole32.INSTANCE.CoCreateGuid(pguid);
if (! hr.equals(W32Errors.S_OK)) {
throw new RuntimeException(hr.toString());
}
return pguid;
}
}
@@ -0,0 +1,51 @@
/*
* Copyright (c) 2010 Digital Rapids Corp., All rights reserved.
*/
/* Copyright (c) 2010 Timothy Wall, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
/**
* Oleaut32.dll Interface.
* @author scott.palmer
*/
public interface Oleaut32 extends StdCallLibrary {
Oleaut32 INSTANCE = (Oleaut32) Native.loadLibrary(
"Oleaut32", Oleaut32.class, W32APIOptions.UNICODE_OPTIONS);
/**
* This function allocates a new string and copies the passed string into it.
* @param sz
* Null-terminated UNICODE string to copy.
* @return
* Null if there is insufficient memory or if a null pointer is passed in.
*/
Pointer SysAllocString(String sz);
/**
* This function frees a string allocated previously by SysAllocString,
* SysAllocStringByteLen, SysReAllocString, SysAllocStringLen, or
* SysReAllocStringLen.
* @param bstr
* Unicode string that was allocated previously, or NULL. Setting this parameter
* to NULL causes the function to simply return.
*/
void SysFreeString(Pointer bstr);
}
@@ -0,0 +1,313 @@
/* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*/
package com.sun.jna.platform.win32;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.Sspi.CredHandle;
import com.sun.jna.platform.win32.Sspi.CtxtHandle;
import com.sun.jna.platform.win32.Sspi.PSecPkgInfo;
import com.sun.jna.platform.win32.Sspi.SecBufferDesc;
import com.sun.jna.platform.win32.Sspi.TimeStamp;
import com.sun.jna.platform.win32.WinNT.HANDLEByReference;
import com.sun.jna.platform.win32.WinNT.LUID;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
/**
* Secur32.dll Interface.
* @author dblock[at]dblock.org
*/
public interface Secur32 extends StdCallLibrary {
Secur32 INSTANCE = (Secur32) Native.loadLibrary("Secur32", Secur32.class, W32APIOptions.UNICODE_OPTIONS);
/**
* Specifies a format for a directory service object name.
* http://msdn.microsoft.com/en-us/library/ms724268(VS.85).aspx
*/
public abstract class EXTENDED_NAME_FORMAT {
public static final int NameUnknown = 0;
public static final int NameFullyQualifiedDN = 1;
public static final int NameSamCompatible = 2;
public static final int NameDisplay = 3;
public static final int NameUniqueId = 6;
public static final int NameCanonical = 7;
public static final int NameUserPrincipal = 8;
public static final int NameCanonicalEx = 9;
public static final int NameServicePrincipal = 10;
public static final int NameDnsDomain = 12;
};
/**
* Retrieves the name of the user or other security principal associated with
* the calling thread. You can specify the format of the returned name.
* @param nameFormat The format of the name.
* @param lpNameBuffer A pointer to a buffer that receives the name in the specified format.
* @param len On input, the size of the buffer, on output the number of characters copied into the buffer, not including the terminating null character.
* @return True if the function succeeds. False otherwise.
*/
public boolean GetUserNameEx(int nameFormat, char[] lpNameBuffer, IntByReference len);
/**
* The AcquireCredentialsHandle function acquires a handle to preexisting credentials
* of a security principal. This handle is required by the AcceptSecurityContext
* and InitializeSecurityContext functions. These can be either preexisting credentials,
* which are established through a system logon that is not described here, or the
* caller can provide alternative credentials.
* @param pszPrincipal
* A pointer to a null-terminated string that specifies the name of the principal whose
* credentials the handle will reference.
* @param pszPackage
* A pointer to a null-terminated string that specifies the name of the security package
* with which these credentials will be used.
* @param fCredentialUse
* A flag that indicates how these credentials will be used.
* @param pvLogonID
* A pointer to a locally unique identifier (LUID) that identifies the user.
* @param pAuthData
* A pointer to package-specific data. This parameter can be NULL, which indicates
* that the default credentials for that package must be used. To use supplied
* credentials, pass a SEC_WINNT_AUTH_IDENTITY structure that includes those credentials
* in this parameter.
* @param pGetKeyFn
* This parameter is not used and should be set to NULL.
* @param pvGetKeyArgument
* This parameter is not used and should be set to NULL.
* @param phCredential
* A pointer to a CredHandle structure to receive the credential handle.
* @param ptsExpiry
* A pointer to a TimeStamp structure that receives the time at which the returned
* credentials expire. The value returned in this TimeStamp structure depends on
* the security package. The security package must return this value in local time.
* @return
* If the function succeeds, the function returns one of the SEC_I_ success codes.
* If the function fails, the function returns one of the SEC_E_ error codes.
*/
public int AcquireCredentialsHandle(String pszPrincipal, String pszPackage,
int fCredentialUse, LUID pvLogonID,
Pointer pAuthData, Pointer pGetKeyFn, // TODO: SEC_GET_KEY_FN
Pointer pvGetKeyArgument, CredHandle phCredential,
TimeStamp ptsExpiry);
/**
* The InitializeSecurityContext function initiates the client side, outbound security
* context from a credential handle. The function is used to build a security context
* between the client application and a remote peer. InitializeSecurityContext returns
* a token that the client must pass to the remote peer, which the peer in turn submits
* to the local security implementation through the AcceptSecurityContext call. The
* token generated should be considered opaque by all callers.
*
* Typically, the InitializeSecurityContext function is called in a loop until a
* sufficient security context is established.
*
* @param phCredential
* A handle to the credentials returned by AcquireCredentialsHandle. This handle is
* used to build the security context. The InitializeSecurityContext function requires
* at least OUTBOUND credentials.
* @param phContext
* A pointer to a CtxtHandle structure. On the first call to InitializeSecurityContext,
* this pointer is NULL. On the second call, this parameter is a pointer to the handle
* to the partially formed context returned in the phNewContext parameter by the first
* call.
* @param pszTargetName
* A pointer to a null-terminated string that indicates the target of the context.
* The string contents are security-package specific.
* @param fContextReq
* Bit flags that indicate requests for the context. Not all packages can support all
* requirements. Flags used for this parameter are prefixed with ISC_REQ_, for example,
* ISC_REQ_DELEGATE.
* @param Reserved1
* This parameter is reserved and must be set to zero.
* @param TargetDataRep
* The data representation, such as byte ordering, on the target. This parameter can be
* either SECURITY_NATIVE_DREP or SECURITY_NETWORK_DREP.
* @param pInput
* A pointer to a SecBufferDesc structure that contains pointers to the buffers supplied
* as input to the package. The pointer must be NULL on the first call to the function.
* On subsequent calls to the function, it is a pointer to a buffer allocated with enough
* memory to hold the token returned by the remote peer.
* @param Reserved2
* This parameter is reserved and must be set to zero.
* @param phNewContext
* A pointer to a CtxtHandle structure. On the first call to InitializeSecurityContext,
* this pointer receives the new context handle. On the second call, phNewContext can be
* the same as the handle specified in the phContext parameter.
* @param pOutput
* A pointer to a SecBufferDesc structure that contains pointers to the SecBuffer structure
* that receives the output data. If a buffer was typed as SEC_READWRITE in the input, it
* will be there on output. The system will allocate a buffer for the security token if
* requested (through ISC_REQ_ALLOCATE_MEMORY) and fill in the address in the buffer
* descriptor for the security token.
* @param pfContextAttr
* A pointer to a variable to receive a set of bit flags that indicate the attributes of
* the established context. Flags used for this parameter are prefixed with ISC_RET,
* such as ISC_RET_DELEGATE.
* @param ptsExpiry
* A pointer to a TimeStamp structure that receives the expiration time of the context.
* It is recommended that the security package always return this value in local time.
* This parameter is optional and NULL should be passed for short-lived clients.
* @return
* If the function succeeds, the function returns one of the SEC_I_ success codes.
* If the function fails, the function returns one of the SEC_E_ error codes.
*/
public int InitializeSecurityContext(CredHandle phCredential, CtxtHandle phContext,
String pszTargetName, int fContextReq, int Reserved1,
int TargetDataRep, SecBufferDesc pInput, int Reserved2,
CtxtHandle phNewContext, SecBufferDesc pOutput, IntByReference pfContextAttr,
TimeStamp ptsExpiry);
/**
* The DeleteSecurityContext function deletes the local data structures associated
* with the specified security context.
* @param phContext
* Handle of the security context to delete.
* @return
* If the function succeeds, the return value is SEC_E_OK.
* If the function fails, the return value is SEC_E_INVALID_HANDLE;
*/
public int DeleteSecurityContext(CtxtHandle phContext);
/**
* The FreeCredentialsHandle function notifies the security system that the
* credentials are no longer needed. An application calls this function to free
* the credential handle acquired in the call to the AcquireCredentialsHandle
* function. When all references to this credential set have been removed, the
* credentials themselves can be removed.
* @param phCredential
* A pointer to the credential handle obtained by using the AcquireCredentialsHandle
* function.
* @return
* If the function succeeds, the return value is SEC_E_OK.
* If the function fails, the return value is SEC_E_INVALID_HANDLE;
*/
public int FreeCredentialsHandle(CredHandle phCredential);
/**
* The AcceptSecurityContext function enables the server component of a transport
* application to establish a security context between the server and a remote client.
* The remote client uses the InitializeSecurityContext function to start the process
* of establishing a security context. The server can require one or more reply tokens
* from the remote client to complete establishing the security context.
* @param phCredential
* A handle to the credentials of the server. The server calls the AcquireCredentialsHandle
* function with either the SECPKG_CRED_INBOUND or SECPKG_CRED_BOTH flag set to retrieve
* this handle.
* @param phContext
* A pointer to a CtxtHandle structure. On the first call to AcceptSecurityContext,
* this pointer is NULL. On subsequent calls, phContext is the handle to the partially
* formed context that was returned in the phNewContext parameter by the first call.
* @param pInput
* A pointer to a SecBufferDesc structure generated by a client call to
* InitializeSecurityContext that contains the input buffer descriptor.
* @param fContextReq
* Bit flags that specify the attributes required by the server to establish the
* context. Bit flags can be combined by using bitwise-OR operations.
* @param TargetDataRep
* The data representation, such as byte ordering, on the target. This parameter can
* be either SECURITY_NATIVE_DREP or SECURITY_NETWORK_DREP.
* @param phNewContext
* A pointer to a CtxtHandle structure. On the first call to AcceptSecurityContext,
* this pointer receives the new context handle. On subsequent calls, phNewContext
* can be the same as the handle specified in the phContext parameter.
* @param pOutput
* A pointer to a SecBufferDesc structure that contains the output buffer descriptor.
* This buffer is sent to the client for input into additional calls to
* InitializeSecurityContext. An output buffer may be generated even if the function
* returns SEC_E_OK. Any buffer generated must be sent back to the client application.
* @param pfContextAttr
* A pointer to a variable that receives a set of bit flags that indicate the
* attributes of the established context. For a description of the various attributes,
* see Context Requirements. Flags used for this parameter are prefixed with ASC_RET,
* for example, ASC_RET_DELEGATE.
* @param ptsTimeStamp
* A pointer to a TimeStamp structure that receives the expiration time of the context.
* @return
* This function returns one of SEC_* values.
*/
public int AcceptSecurityContext(CredHandle phCredential, CtxtHandle phContext,
SecBufferDesc pInput, int fContextReq, int TargetDataRep,
CtxtHandle phNewContext, SecBufferDesc pOutput, IntByReference pfContextAttr,
TimeStamp ptsTimeStamp);
/**
* The EnumerateSecurityPackages function returns an array of SecPkgInfo structures that
* describe the security packages available to the client.
* @param pcPackages
* A pointer to a int variable that receives the number of packages returned.
* @param ppPackageInfo
* A pointer to a variable that receives a pointer to an array of SecPkgInfo structures.
* Each structure contains information from the security support provider (SSP) that
* describes a security package that is available within that SSP.
* @return
* If the function succeeds, the function returns SEC_E_OK.
* If the function fails, it returns a nonzero error code.
*/
public int EnumerateSecurityPackages(IntByReference pcPackages,
PSecPkgInfo.ByReference ppPackageInfo);
/**
* The FreeContextBuffer function enables callers of security package functions to free a memory
* buffer that was allocated by the security package as a result of calls to InitializeSecurityContext
* and AcceptSecurityContext.
* @param buffer
* A pointer to memory allocated by the security package.
* @return
* If the function succeeds, the function returns SEC_E_OK.
* If the function fails, it returns a nonzero error code.
*/
public int FreeContextBuffer(Pointer buffer);
/**
* The QuerySecurityContextToken function obtains the access token for a client security context
* and uses it directly.
* @param phContext
* Handle of the context to query.
* @param phToken
* Returned handle to the access token.
* @return
* If the function succeeds, the function returns SEC_E_OK.
* If the function fails, it returns a nonzero error code. One possible error code return is
* SEC_E_INVALID_HANDLE.
*/
public int QuerySecurityContextToken(CtxtHandle phContext,
HANDLEByReference phToken);
/**
* The ImpersonateSecurityContext function allows a server to impersonate a client by using
* a token previously obtained by a call to AcceptSecurityContext or QuerySecurityContextToken.
* This function allows the application server to act as the client, and thus all necessary
* access controls are enforced.
* @param phContext
* The handle of the context to impersonate. This handle must have been obtained by a call
* to the AcceptSecurityContext function.
* @return
* If the function succeeds, the function returns SEC_E_OK.
* If the function fails, it returns a SEC_E_INVALID_HANDLE, SEC_E_NO_IMPERSONATION or
* SEC_E_UNSUPPORTED_FUNCTION error code.
*/
public int ImpersonateSecurityContext(CtxtHandle phContext);
/**
* Allows a security package to discontinue the impersonation of the caller and restore its
* own security context.
* @param phContext
* Handle of the security context being impersonated. This handle must have been obtained in
* the call to the AcceptSecurityContext function and used in the call to the
* ImpersonateSecurityContext function.
* @return
* If the function succeeds, the return value is SEC_E_OK.
* If the function fails, the return value can be either SEC_E_INVALID_HANDLE or SEC_E_UNSUPPORTED_FUNCTION.
*/
public int RevertSecurityContext(CtxtHandle phContext);
}

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais