当前位置: 首页>>代码示例>>C++>>正文


C++ IPC_MakeHeader函数代码示例

本文整理汇总了C++中IPC_MakeHeader函数的典型用法代码示例。如果您正苦于以下问题:C++ IPC_MakeHeader函数的具体用法?C++ IPC_MakeHeader怎么用?C++ IPC_MakeHeader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了IPC_MakeHeader函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PS_EncryptSignDecryptVerifyAesCcm

Result PS_EncryptSignDecryptVerifyAesCcm(u8* in, u32 in_size, u8* out, u32 out_size, u32 data_len, u32 mac_data_len, u32 mac_len, PS_AESAlgorithm aes_algo, PS_AESKeyType key_type, u8* nonce)
{
	Result ret = 0;
	u32 *cmdbuf = getThreadCommandBuffer();

	u32 *_nonce = (u32*)nonce;

	cmdbuf[0] = IPC_MakeHeader(0x5,10,4); // 0x50284
	cmdbuf[1] = in_size;
	cmdbuf[2] = mac_data_len;
	cmdbuf[3] = data_len;
	cmdbuf[4] = out_size;
	cmdbuf[5] = mac_len;
	memcpy(&cmdbuf[6], _nonce, 12);
	cmdbuf[9] = aes_algo;
	cmdbuf[10] = key_type;
	cmdbuf[11] = IPC_Desc_Buffer(in_size, IPC_BUFFER_R);
	cmdbuf[12] = (u32)in;
	cmdbuf[13] = IPC_Desc_Buffer(out_size, IPC_BUFFER_W);
	cmdbuf[14] = (u32)out;

	if(R_FAILED(ret = svcSendSyncRequest(psHandle)))return ret;

	return (Result)cmdbuf[1];
}
开发者ID:TuxSH,项目名称:ctrulib,代码行数:25,代码来源:ps.c

示例2: socListen

int socListen(int sockfd, int max_connections)
{
    Result ret = 0;
    u32 *cmdbuf = getThreadCommandBuffer();

    cmdbuf[0] = IPC_MakeHeader(0x3,2,2); // 0x30082
    cmdbuf[1] = (u32)sockfd;
    cmdbuf[2] = (u32)max_connections;
    cmdbuf[3] = IPC_Desc_CurProcessHandle();

    ret = svcSendSyncRequest(SOCU_handle);
    if(ret != 0)
    {
        //errno = SYNC_ERROR;
        return ret;
    }

    ret = (int)cmdbuf[1];
    if(ret == 0)
        ret = _net_convert_error(cmdbuf[2]);

    if(ret < 0) {
        //errno = -ret;
        return -1;
    }

    return 0;
}
开发者ID:TemplarsCreed,项目名称:Luma3DS,代码行数:28,代码来源:minisoc.c

示例3: soc_close

static int
soc_close(struct _reent *r,
          int           fd)
{
	Handle sockfd = *(Handle*)fd;

	int ret = 0;
	u32 *cmdbuf = getThreadCommandBuffer();

	cmdbuf[0] = IPC_MakeHeader(0xB,1,2); // 0xB0042
	cmdbuf[1] = (u32)sockfd;
	cmdbuf[2] = IPC_Desc_CurProcessHandle();

	ret = svcSendSyncRequest(SOCU_handle);
	if(ret != 0) {
		errno = SYNC_ERROR;
		return ret;
	}

	ret = (int)cmdbuf[1];
	if(ret == 0)
		ret =_net_convert_error(cmdbuf[2]);

	if(ret < 0) {
		errno = -ret;
		return -1;
	}

	return 0;
}
开发者ID:vtsingaras,项目名称:ctrulib,代码行数:30,代码来源:soc_init.c

示例4: PS_EncryptDecryptAes

Result PS_EncryptDecryptAes(u32 size, u8* in, u8* out, PS_AESAlgorithm aes_algo, PS_AESKeyType key_type, u8* iv)
{
	Result ret = 0;
	u32 *cmdbuf = getThreadCommandBuffer();

	u32 *_iv = (u32*)iv;

	cmdbuf[0] = IPC_MakeHeader(0x4,7,4); // 0x401C4
	cmdbuf[1] = size;
	cmdbuf[2] = _iv[0];
	cmdbuf[3] = _iv[1];
	cmdbuf[4] = _iv[2];
	cmdbuf[5] = _iv[3];
	cmdbuf[6] = aes_algo;
	cmdbuf[7] = key_type;
	cmdbuf[8] = IPC_Desc_PXIBuffer(size,0,false);
	cmdbuf[9] = (u32)in;
	cmdbuf[10] = IPC_Desc_PXIBuffer(size,1,false);
	cmdbuf[11] = (u32)out;

	if(R_FAILED(ret = svcSendSyncRequest(psHandle)))return ret;

	_iv[0] = cmdbuf[2] & 0xFF;
	_iv[1] = cmdbuf[3] & 0xFF;
	_iv[2] = cmdbuf[4] & 0xFF;
	_iv[3] = cmdbuf[5] & 0xFF;

	return (Result)cmdbuf[1];
}
开发者ID:Bownairo,项目名称:ctrulib,代码行数:29,代码来源:ps.c

示例5: udsGetApplicationData

Result udsGetApplicationData(void *buf, size_t size, size_t *actual_size)
{
	u32* cmdbuf=getThreadCommandBuffer();
	u32 saved_threadstorage[2];

	cmdbuf[0]=IPC_MakeHeader(0x11,1,0); // 0x110040
	cmdbuf[1]=size;

	u32 * staticbufs = getThreadStaticBuffers();
	saved_threadstorage[0] = staticbufs[0];
	saved_threadstorage[1] = staticbufs[1];

	staticbufs[0] = IPC_Desc_StaticBuffer(size,0);
	staticbufs[1] = (u32)buf;

	Result ret=0;
	ret=svcSendSyncRequest(__uds_servhandle);

	staticbufs[0] = saved_threadstorage[0];
	staticbufs[1] = saved_threadstorage[1];

	if(R_FAILED(ret))return ret;

	ret = cmdbuf[1];

	if(R_SUCCEEDED(ret))
	{
		if(actual_size)*actual_size = cmdbuf[2];
	}

	return ret;
}
开发者ID:Caboosium,项目名称:ctrulib,代码行数:32,代码来源:uds.c

示例6: udsipc_DecryptBeaconData

static Result udsipc_DecryptBeaconData(udsNetworkStruct *network, u8 *tag0, u8 *tag1, udsNodeInfo *out)
{
	u32* cmdbuf=getThreadCommandBuffer();
	u32 tagsize = 0xfe;

	u32 saved_threadstorage[2];

	cmdbuf[0]=IPC_MakeHeader(0x1F,0,6); // 0x1F0006
	cmdbuf[1]=IPC_Desc_StaticBuffer(sizeof(udsNetworkStruct), 1);
	cmdbuf[2]=(u32)network;
	cmdbuf[3]=IPC_Desc_StaticBuffer(tagsize, 2);
	cmdbuf[4]=(u32)tag0;
	cmdbuf[5]=IPC_Desc_StaticBuffer(tagsize, 3);
	cmdbuf[6]=(u32)tag1;

	u32 * staticbufs = getThreadStaticBuffers();
	saved_threadstorage[0] = staticbufs[0];
	saved_threadstorage[1] = staticbufs[1];

	staticbufs[0] = IPC_Desc_StaticBuffer(0x280,0);
	staticbufs[1] = (u32)out;

	Result ret=0;
	ret=svcSendSyncRequest(__uds_servhandle);

	staticbufs[0] = saved_threadstorage[0];
	staticbufs[1] = saved_threadstorage[1];

	if(R_FAILED(ret))return ret;

	return cmdbuf[1];
}
开发者ID:Caboosium,项目名称:ctrulib,代码行数:32,代码来源:uds.c

示例7: sockatmark

int sockatmark(int sockfd)
{
	int ret = 0;
	u32 *cmdbuf = getThreadCommandBuffer();

	sockfd = soc_get_fd(sockfd);
	if(sockfd < 0) {
		errno = -sockfd;
		return -1;
	}

	cmdbuf[0] = IPC_MakeHeader(0x15,1,2); // 0x150042
	cmdbuf[1] = (u32)sockfd;
	cmdbuf[2] = IPC_Desc_CurProcessHandle();

	ret = svcSendSyncRequest(SOCU_handle);
	if(ret != 0) {
		errno = SYNC_ERROR;
		return -1;
	}

	ret = (int)cmdbuf[1];
	if(ret == 0)
		ret = _net_convert_error(cmdbuf[2]);

	if(ret < 0) {
		errno = -ret;
		return -1;
	}

	return ret;
}
开发者ID:Bownairo,项目名称:ctrulib,代码行数:32,代码来源:soc_sockatmark.c

示例8: FSLDR_OpenFileDirectly

Result FSLDR_OpenFileDirectly(Handle* out, FS_Archive archive, FS_Path path, u32 openFlags, u32 attributes)
{
  u32 *cmdbuf = getThreadCommandBuffer();

  cmdbuf[0] = IPC_MakeHeader(0x803,8,4); // 0x8030204
  cmdbuf[1] = 0;
  cmdbuf[2] = archive.id;
  cmdbuf[3] = archive.lowPath.type;
  cmdbuf[4] = archive.lowPath.size;
  cmdbuf[5] = path.type;
  cmdbuf[6] = path.size;
  cmdbuf[7] = openFlags;
  cmdbuf[8] = attributes;
  cmdbuf[9] = IPC_Desc_StaticBuffer(archive.lowPath.size, 2);
  cmdbuf[10] = (u32) archive.lowPath.data;
  cmdbuf[11] = IPC_Desc_StaticBuffer(path.size, 0);
  cmdbuf[12] = (u32) path.data;

  Result ret = 0;
  if(R_FAILED(ret = svcSendSyncRequest(fsldrHandle))) return ret;

  if(out) *out = cmdbuf[3];

  return cmdbuf[1];
}
开发者ID:Reisyukaku,项目名称:loader,代码行数:25,代码来源:fsldr.c

示例9: socSetsockopt

int socSetsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen)
{
    int ret = 0;
    u32 *cmdbuf = getThreadCommandBuffer();

    cmdbuf[0] = IPC_MakeHeader(0x12,4,4); // 0x120104
    cmdbuf[1] = (u32)sockfd;
    cmdbuf[2] = (u32)level;
    cmdbuf[3] = (u32)optname;
    cmdbuf[4] = (u32)optlen;
    cmdbuf[5] = IPC_Desc_CurProcessHandle();
    cmdbuf[7] = IPC_Desc_StaticBuffer(optlen,9);
    cmdbuf[8] = (u32)optval;

    ret = svcSendSyncRequest(SOCU_handle);
    if(ret != 0) {
        return ret;
    }

    ret = (int)cmdbuf[1];
    if(ret == 0)
        ret = _net_convert_error(cmdbuf[2]);

    if(ret < 0) {
        //errno = -ret;
        return -1;
    }

    return ret;
}
开发者ID:TemplarsCreed,项目名称:Luma3DS,代码行数:30,代码来源:minisoc.c

示例10: APT_ReceiveDeliverArg_

Result APT_ReceiveDeliverArg_(void* param, size_t param_size, void* hmac, size_t hmac_size, u64* source_pid, bool* received)
{
	u32 cmdbuf[16];
	cmdbuf[0]=IPC_MakeHeader(0x35,2,0);
	cmdbuf[1]=param_size;
	cmdbuf[2]=hmac_size;

	u32 saved_threadstorage[4];
	u32* staticbufs = getThreadStaticBuffers();
   saved_threadstorage[0]=staticbufs[0];
	saved_threadstorage[1]=staticbufs[1];
   saved_threadstorage[2]=staticbufs[2];
	saved_threadstorage[3]=staticbufs[3];
   staticbufs[0]=IPC_Desc_StaticBuffer(param_size, 0);
	staticbufs[1]=(u32)param;
   staticbufs[2]=IPC_Desc_StaticBuffer(hmac_size, 2);
	staticbufs[3]=(u32)hmac;

	Result ret = aptSendCommand(cmdbuf);
   staticbufs[0]=saved_threadstorage[0];
	staticbufs[1]=saved_threadstorage[1];
   staticbufs[2]=saved_threadstorage[2];
	staticbufs[3]=saved_threadstorage[3];

   if(R_FAILED(ret))
      return ret;

   if(source_pid)
      *source_pid = ((u64*)cmdbuf)[1];
   if(received)
      *received = ((bool*)cmdbuf)[16];

	return cmdbuf[1];
}
开发者ID:DSkywalk,项目名称:RetroArch,代码行数:34,代码来源:ctr_system.c

示例11: APT_AppletUtility

Result APT_AppletUtility(u32* out, u32 a, u32 size1, u8* buf1, u32 size2, u8* buf2)
{
	u32 saved_threadstorage[2];
	
	u32* cmdbuf=getThreadCommandBuffer();
	cmdbuf[0]=IPC_MakeHeader(0x4B,3,2); // 0x4B00C2
	cmdbuf[1]=a;
	cmdbuf[2]=size1;
	cmdbuf[3]=size2;
	cmdbuf[4]=IPC_Desc_StaticBuffer(size1,1);
	cmdbuf[5]=(u32)buf1;

	u32 *staticbufs = getThreadStaticBuffers();
	saved_threadstorage[0]=staticbufs[0];
	saved_threadstorage[1]=staticbufs[1];
	
	staticbufs[0]=IPC_Desc_StaticBuffer(size2,0);
	staticbufs[1]=(u32)buf2;
	
	Result ret=svcSendSyncRequest(aptuHandle);
	
	staticbufs[0]=saved_threadstorage[0];
	staticbufs[1]=saved_threadstorage[1];
	
	if(R_FAILED(ret))return ret;
	
	if(out)*out=cmdbuf[2];

	return cmdbuf[1];
}
开发者ID:botanyaki,项目名称:ctrulib,代码行数:30,代码来源:apt.c

示例12: CAMU_DriverFinalize

Result CAMU_DriverFinalize(void) {
	Result ret = 0;
	u32* cmdbuf = getThreadCommandBuffer();
	cmdbuf[0] = IPC_MakeHeader(0x3A,0,0); // 0x3A0000

	if (R_FAILED(ret = svcSendSyncRequest(camHandle))) return ret;
	return cmdbuf[1];
}
开发者ID:Findus79,项目名称:ctrulib,代码行数:8,代码来源:cam.c

示例13: CAMU_SetBrightnessSynchronization

Result CAMU_SetBrightnessSynchronization(bool brightnessSynchronization) {
	Result ret = 0;
	u32* cmdbuf = getThreadCommandBuffer();
	cmdbuf[0] = IPC_MakeHeader(0x3E,1,0); // 0x3E0040
	cmdbuf[1] = brightnessSynchronization;

	if (R_FAILED(ret = svcSendSyncRequest(camHandle))) return ret;
	return cmdbuf[1];
}
开发者ID:Findus79,项目名称:ctrulib,代码行数:9,代码来源:cam.c

示例14: Y2RU_DriverInitialize

Result Y2RU_DriverInitialize(void)
{
	Result ret = 0;
	u32* cmdbuf = getThreadCommandBuffer();
	cmdbuf[0] = IPC_MakeHeader(0x2B,0,0); // 0x2B0000

	if (R_FAILED(ret = svcSendSyncRequest(y2rHandle))) return ret;
	return cmdbuf[1];
}
开发者ID:Bownairo,项目名称:ctrulib,代码行数:9,代码来源:y2r.c

示例15: CAMU_SetStereoCameraCalibrationData

Result CAMU_SetStereoCameraCalibrationData(CAMU_StereoCameraCalibrationData data) {
	Result ret = 0;
	u32* cmdbuf = getThreadCommandBuffer();
	cmdbuf[0] = IPC_MakeHeader(0x2C,16,0); // 0x2C0400
	*(CAMU_StereoCameraCalibrationData*) cmdbuf[1] = data;

	if (R_FAILED(ret = svcSendSyncRequest(camHandle))) return ret;
	return cmdbuf[1];
}
开发者ID:Findus79,项目名称:ctrulib,代码行数:9,代码来源:cam.c


注:本文中的IPC_MakeHeader函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。