// Copyright (C) 1997 Microsoft Corporation All Rights Reserved
// This software is a preview release of the Windows Api Access classes
// for Java. These classes provide direct, low-overhead access to commonly used
// Windows api. These classes use the new J/Direct feature and therefore
// require either Internet Explorer 4.0 beta-2, or the Microsoft SDK for Java 2.0.
//
// WARNING: These classes are still in development and are incomplete.
// This preview release is being provided as-is in order to solicit feedback
// and to assist developers in the use of J/Direct by providing a library
// of prewritten declarations for the most common Win32 api. As with all
// prerelease software, it is subject to significant change without notice before
// shipping.
//
// Information on how to use J/Direct to write your own declarations
// can be found in the Microsoft SDK for Java 2.0.
package com.ms.win32;
class Advapi32 {
/** @dll.import("ADVAPI32", auto) */
/* explicitly excluded */ // public native static boolean AccessCheckAndAuditAlarm (String SubsystemName, int HandleId, String ObjectTypeName, String ObjectName, int SecurityDescriptor, int DesiredAccess, GENERIC_MAPPING GenericMapping, boolean ObjectCreation, int[] GrantedAccess, int[] AccessStatus, int[] pfGenerateOnClose);
/** @dll.import("ADVAPI32", auto) */
public native static boolean BackupEventLog (int hEventLog, String lpBackupFileName);
/** @dll.import("ADVAPI32", auto) */
public native static boolean ClearEventLog (int hEventLog, String lpBackupFileName);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CloseEventLog (int hEventLog);
/** @dll.import("ADVAPI32", auto) */
public native static boolean CreateProcessAsUser (int hToken, String lpApplicationName, String lpCommandLine, SECURITY_ATTRIBUTES lpProcessAttributes, SECURITY_ATTRIBUTES lpThreadAttributes, boolean bInheritHandles, int dwCreationFlags, int lpEnvironment, String lpCurrentDirectory, STARTUPINFO lpStartupInfo, PROCESS_INFORMATION lpProcessInformation);
/** @dll.import("ADVAPI32", auto) */
public native static boolean CryptAcquireContext (int[] phProv, String pszContainer, String pszProvider, int dwProvType, int dwFlags);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptCreateHash (int hProv, int Algid, int hKey, int dwFlags, int[] phHash);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptDecrypt (int hKey, int hHash, boolean Final, int dwFlags, byte[] pbData, int[] pdwDataLen);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptDeriveKey (int hProv, int Algid, int hBaseData, int dwFlags, int[] phKey);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptDestroyHash (int hHash);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptDestroyKey (int hKey);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptEncrypt (int hKey, int hHash, boolean Final, int dwFlags, byte[] pbData, int[] pdwDataLen, int dwBufLen);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptExportKey (int hKey, int hExpKey, int dwBlobType, int dwFlags, byte[] pbData, int[] pdwDataLen);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptGenKey (int hProv, int Algid, int dwFlags, int[] phKey);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptGenRandom (int hProv, int dwLen, byte[] pbBuffer);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptGetHashParam (int hHash, int dwParam, byte[] pbData, int[] pdwDataLen, int dwFlags);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptGetKeyParam (int hKey, int dwParam, byte[] pbData, int[] pdwDataLen, int dwFlags);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptGetProvParam (int hProv, int dwParam, byte[] pbData, int[] pdwDataLen, int dwFlags);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptGetUserKey (int hProv, int dwKeySpec, int[] phUserKey);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptHashData (int hHash, byte[] pbData, int dwDataLen, int dwFlags);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptHashSessionKey (int hHash, int hKey, int dwFlags);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptImportKey (int hProv, byte[] pbData, int dwDataLen, int hPubKey, int dwFlags, int[] phKey);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptReleaseContext (int hProv, int dwFlags);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptSetHashParam (int hHash, int dwParam, byte[] pbData, int dwFlags);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptSetKeyParam (int hKey, int dwParam, byte[] pbData, int dwFlags);
/** @dll.import("ADVAPI32",auto) */
public native static boolean CryptSetProvParam (int hProv, int dwParam, byte[] pbData, int dwFlags);
/** @dll.import("ADVAPI32", auto) */
public native static boolean CryptSetProvider (String pszProvName, int dwProvType);
/** @dll.import("ADVAPI32", auto) */
public native static boolean CryptSignHash (int hHash, int dwKeySpec, String sDescription, int dwFlags, byte[] pbSignature, int[] pdwSigLen);
/** @dll.import("ADVAPI32", auto) */
public native static boolean CryptVerifySignature (int hHash, byte[] pbSignature, int dwSigLen, int hPubKey, String sDescription, int dwFlags);
/** @dll.import("ADVAPI32",auto) */
public native static boolean DeregisterEventSource (int hEventLog);
/** @dll.import("ADVAPI32",auto) */
public native static boolean DuplicateTokenEx (int hExistingToken, int dwDesiredAccess, SECURITY_ATTRIBUTES lpTokenAttributes, int ImpersonationLevel, int TokenType, int[] phNewToken);
/** @dll.import("ADVAPI32",auto) */
public native static boolean GetCurrentHwProfile (HW_PROFILE_INFO lpHwProfileInfo);
/** @dll.import("ADVAPI32", auto) */
/* explicitly excluded */ // public native static boolean GetFileSecurity (String lpFileName, int RequestedInformation, int pSecurityDescriptor, int nLength, int[] lpnLengthNeeded);
/** @dll.import("ADVAPI32",auto) */
public native static boolean GetNumberOfEventLogRecords (int hEventLog, int[] NumberOfRecords);
/** @dll.import("ADVAPI32",auto) */
public native static boolean GetOldestEventLogRecord (int hEventLog, int[] OldestRecord);
/** @dll.import("ADVAPI32", auto) */
public native static boolean GetUserName (StringBuffer lpBuffer, int[] nSize);
/** @dll.import("ADVAPI32",auto) */
public native static boolean ImpersonateLoggedOnUser (int hToken);
/** @dll.import("ADVAPI32",auto) */
public native static boolean IsTextUnicode (int lpBuffer, int cb, int[] lpi);
/** @dll.import("ADVAPI32", auto) */
public native static boolean LogonUser (String lpszUsername, String lpszDomain, String lpszPassword, int dwLogonType, int dwLogonProvider, int[] phToken);
public native static boolean NotifyChangeEventLog (int hEventLog, int hEvent);
/** @dll.import("ADVAPI32", auto) */
/* explicitly excluded */ // public native static boolean ObjectCloseAuditAlarm (String SubsystemName, int HandleId, boolean GenerateOnClose);
/** @dll.import("ADVAPI32", auto) */
/* explicitly excluded */ // public native static boolean ObjectDeleteAuditAlarm (String SubsystemName, int HandleId, boolean GenerateOnClose);
/** @dll.import("ADVAPI32", auto) */
/* explicitly excluded */ // public native static boolean ObjectOpenAuditAlarm (String SubsystemName, int HandleId, String ObjectTypeName, String ObjectName, int pSecurityDescriptor, int ClientToken, int DesiredAccess, int GrantedAccess, PRIVILEGE_SET Privileges, boolean ObjectCreation, boolean AccessGranted, int[] GenerateOnClose);
/** @dll.import("ADVAPI32", auto) */
/* explicitly excluded */ // public native static boolean ObjectPrivilegeAuditAlarm (String SubsystemName, int HandleId, int ClientToken, int DesiredAccess, PRIVILEGE_SET Privileges, boolean AccessGranted);
/** @dll.import("ADVAPI32", auto) */
public native static int OpenBackupEventLog (String lpUNCServerName, String lpFileName);
/** @dll.import("ADVAPI32", auto) */
public native static int OpenEventLog (String lpUNCServerName, String lpSourceName);
/** @dll.import("ADVAPI32", auto) */
/* explicitly excluded */ // public native static boolean PrivilegedServiceAuditAlarm (String SubsystemName, String ServiceName, int ClientToken, PRIVILEGE_SET Privileges, boolean AccessGranted);
/** @dll.import("ADVAPI32",auto) */
public native static boolean ReadEventLog (int hEventLog, int dwReadFlags, int dwRecordOffset, int lpBuffer, int nNumberOfBytesToRead, int[] pnBytesRead, int[] pnMinNumberOfBytesNeeded);
/** @dll.import("ADVAPI32", auto) */
public native static int RegisterEventSource (String lpUNCServerName, String lpSourceName);
/** @dll.import("ADVAPI32",auto) */
public native static boolean ReportEvent (int hEventLog, short wType, short wCategory, int dwEventID, int lpUserSid, short wNumStrings, int dwDataSize, int lpStrings, int lpRawData);
/** @dll.import("ADVAPI32", auto) */
/* explicitly excluded */ // public native static boolean SetFileSecurity (String lpFileName, int SecurityInformation, int pSecurityDescriptor);
/** @dll.import("ADVAPI32",auto) */
public native static boolean SetThreadToken (int[] Thread, int Token);
}
class Shell32 {
/** @dll.import("SHELL32", auto) */
public native static int CommandLineToArgvW (String lpCmdLine, int[] pNumArgs);
/** @dll.import("SHELL32",auto) */
public native static void DragAcceptFiles (int anonymous0, boolean anonymous1);
/** @dll.import("SHELL32",auto) */
public native static void DragFinish (int anonymous0);
/** @dll.import("SHELL32", auto) */
public native static int DragQueryFile (int anonymous0, int anonymous1, StringBuffer anonymous2, int anonymous3);
/** @dll.import("SHELL32",auto) */
public native static boolean DragQueryPoint (int anonymous0, POINT anonymous1);
/** @dll.import("SHELL32", auto) */
public native static int ExtractAssociatedIcon (int hInst, StringBuffer lpIconPath, short[] lpiIcon);
/** @dll.import("SHELL32", auto) */
public native static int ExtractIconEx (String lpszFile, int nIconIndex, int[] phiconLarge, int[] phiconSmall, int nIcons);
/** @dll.import("SHELL32", auto) */
public native static int ExtractIcon (int hInst, String lpszExeFileName, int nIconIndex);
/** @dll.import("SHELL32", auto) */
public native static int FindExecutable (String lpFile, String lpDirectory, StringBuffer lpResult);
/** @dll.import("SHELL32",auto) */
public native static int SHAppBarMessage (int dwMessage, APPBARDATA pData);
/** @dll.import("SHELL32",auto) */
public native static int SHFileOperation (SHFILEOPSTRUCT lpFileOp);
/** @dll.import("SHELL32",auto) */
public native static void SHFreeNameMappings (int hNameMappings);
/** @dll.import("SHELL32", auto) */
public native static int SHGetFileInfo (String pszPath, int dwFileAttributes, SHFILEINFO psfi, int cbFileInfo, int uFlags);
/** @dll.import("SHELL32", auto) */
public native static int ShellAbout (int hWnd, String szApp, String szOtherStuff, int hIcon);
/** @dll.import("SHELL32",auto) */
public native static boolean ShellExecuteEx (SHELLEXECUTEINFO lpExecInfo);
/** @dll.import("SHELL32", auto) */
public native static int ShellExecute (int hwnd, String lpOperation, String lpFile, String lpParameters, String lpDirectory, int nShowCmd);
/** @dll.import("SHELL32",auto) */
public native static boolean Shell_NotifyIcon (int dwMessage, NOTIFYICONDATA lpData);
}
class Spoolss {
/** @dll.import("SPOOLSS",auto) */
public native static boolean AbortPrinter (int hPrinter);
/** @dll.import("SPOOLSS",auto) */
public native static boolean AddForm (int hPrinter, int Level, byte[] pForm);
/** @dll.import("SPOOLSS",auto) */
public native static boolean AddJob (int hPrinter, int Level, byte[] pData, int cbBuf, int[] pcbNeeded);
/** @dll.import("SPOOLSS", auto) */
public native static boolean AddMonitor (String pName, int Level, byte[] pMonitors);
/** @dll.import("SPOOLSS", auto) */
public native static boolean AddPort (String pName, int hWnd, String pMonitorName);
public native static boolean EndDocPrinter (int hPrinter);
/** @dll.import("SPOOLSS",auto) */
public native static boolean EndPagePrinter (int hPrinter);
/** @dll.import("SPOOLSS",auto) */
public native static boolean EnumForms (int hPrinter, int Level, byte[] pForm, int cbBuf, int[] pcbNeeded, int[] pcReturned);
/** @dll.import("SPOOLSS",auto) */
public native static boolean EnumJobs (int hPrinter, int FirstJob, int NoJobs, int Level, byte[] pJob, int cbBuf, int[] pcbNeeded, int[] pcReturned);
/** @dll.import("SPOOLSS", auto) */
public native static boolean EnumMonitors (String pName, int Level, byte[] pMonitors, int cbBuf, int[] pcbNeeded, int[] pcReturned);
/** @dll.import("SPOOLSS", auto) */
public native static boolean EnumPorts (String pName, int Level, byte[] pPorts, int cbBuf, int[] pcbNeeded, int[] pcReturned);
/** @dll.import("SPOOLSS", auto) */
public native static boolean EnumPrintProcessorDatatypes (String pName, String pPrintProcessorName, int Level, byte[] pDatatypes, int cbBuf, int[] pcbNeeded, int[] pcReturned);
/** @dll.import("SPOOLSS", auto) */
public native static boolean EnumPrintProcessors (String pName, String pEnvironment, int Level, byte[] pPrintProcessorInfo, int cbBuf, int[] pcbNeeded, int[] pcReturned);
/** @dll.import("SPOOLSS", auto) */
public native static int EnumPrinterData (int hPrinter, int dwIndex, String pValueName, int cbValueName, int[] pcbValueName, int[] pType, byte[] pData, int cbData, int[] pcbData);
/** @dll.import("SPOOLSS", auto) */
public native static boolean EnumPrinterDrivers (String pName, String pEnvironment, int Level, byte[] pDriverInfo, int cbBuf, int[] pcbNeeded, int[] pcReturned);
/** @dll.import("SPOOLSS", auto) */
public native static boolean EnumPrinters (int Flags, String Name, int Level, byte[] pPrinterEnum, int cbBuf, int[] pcbNeeded, int[] pcReturned);
/** @dll.import("SPOOLSS",auto) */
public native static boolean FindClosePrinterChangeNotification (int hChange);
/** @dll.import("SPOOLSS", auto) */
public native static boolean GetForm (int hPrinter, String pFormName, int Level, byte[] pForm, int cbBuf, int[] pcbNeeded);
/** @dll.import("SPOOLSS",auto) */
public native static boolean GetJob (int hPrinter, int JobId, int Level, byte[] pJob, int cbBuf, int[] pcbNeeded);
/** @dll.import("SPOOLSS", auto) */
public native static boolean GetPrintProcessorDirectory (String pName, String pEnvironment, int Level, byte[] pPrintProcessorInfo, int cbBuf, int[] pcbNeeded);
/** @dll.import("SPOOLSS", auto) */
public native static int GetPrinterData (int hPrinter, String pValueName, int[] pType, byte[] pData, int nSize, int[] pcbNeeded);
/** @dll.import("SPOOLSS", auto) */
public native static boolean GetPrinterDriverDirectory (String pName, String pEnvironment, int Level, byte[] pDriverDirectory, int cbBuf, int[] pcbNeeded);
/** @dll.import("SPOOLSS", auto) */
public native static boolean GetPrinterDriver (int hPrinter, String pEnvironment, int Level, byte[] pDriverInfo, int cbBuf, int[] pcbNeeded);
/** @dll.import("SPOOLSS",auto) */
public native static boolean GetPrinter (int hPrinter, int Level, byte[] pPrinter, int cbBuf, int[] pcbNeeded);