本文整理匯總了Java中com.sun.jna.Structure.size方法的典型用法代碼示例。如果您正苦於以下問題:Java Structure.size方法的具體用法?Java Structure.size怎麽用?Java Structure.size使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sun.jna.Structure
的用法示例。
在下文中一共展示了Structure.size方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: readVirtualMemoryToStructure
import com.sun.jna.Structure; //導入方法依賴的package包/類
/**
* Read virtual memory to structure.
*
* @param baseAddress
* the base address
* @param goal
* the goal
*
* @return true, if successful
*/
boolean readVirtualMemoryToStructure(Pointer baseAddress, Structure goal)
{
int size = goal.size();
// System.out.println("readVirtualMemoryToStructure "+size);
int ret = Ntdll.INSTANCE.ZwReadVirtualMemory(
_processInformation.hProcess.getPointer(), baseAddress,
goal.getPointer(), size, null);
if (ret != 0)
log("pid " + _pid + " ZwReadVirtualMemory returns "
+ Integer.toHexString(ret));
goal.read();
return ret == 0;
}
示例2: setDeviceConfig
import com.sun.jna.Structure; //導入方法依賴的package包/類
@Override
public SDKErrorCode setDeviceConfig(String deviceCode, int configType, Object dataBuffer)
{
SDKErrorCode sdkResult = new SDKErrorCode();
int sessionId = getIVSSessionId();
Structure southDataBuffer = deviceMgrCabilityConvert.setDeviceConfigModel2South(configType, dataBuffer);
if (null == southDataBuffer)
{
sdkResult.setErrCode(ErrInfo.DATA_ERRORCODE);
return sdkResult;
}
int bufferSize = southDataBuffer.size();
int result =
super.getBaseCablilityJNA().IVS_SDK_SetDeviceConfig(sessionId,
deviceCode,
configType,
southDataBuffer,
bufferSize);
sdkResult.setErrCode(result);
return sdkResult;
}