本文整理汇总了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;
}