当前位置:网站首页>客户端那些事儿(2)
客户端那些事儿(2)
2022-07-15 17:14:00 【爱摸鱼的伪程序猿】
前情回顾
在上一篇博客中,我们介绍了客户端里的注册表初始化操作,简要介绍了其他函数的功能。
今天我们将深层次的解析各个功能的实现流程,并以一个简单的流程图的形式将流程描述出来。
功能实现
因为每个函数的功能都需要调用初始化操作,所以就不再介绍了,初始化操作流程可参考上一篇博客:客户端那些事儿
SAMGR_RegisterServiceApi
该函数的功能是构建一个远程寄存器服务应用程序编程接口,步骤如下:
①注册表初始化(InitializeRegistry)
②添加一个路由器(SAMGR_AddRouter)
③返回进程的策略(SAMGR_ProcPolicy)
SAMGR_AddRouter
添加路由器同样分为如下几个步骤:
①查询接口(QueryInterface)
②锁定多重写入,采用按键查找的方式(VECTOR_FindByKey)
③申请一个临时空间(SAMGR_Malloc)
④将元素添加到向量(VECTOR_Add)
⑤释放空间(SAMGR_Free)
SAMGR_ProcPolicy
进程策略的实现也分为几个步骤:
①先获取一个用户的注册身份(RegisterIdentity)
- 在获取身份的过程中获取远程策略(GetRemotePolicy)
②将进程的策略添加到路由器中(AddPolicyToRouter)
构建该远程寄存器服务应用程序编程接口的步骤流程图如下:
SAMGR_FindServiceApi
该函数的功能是查找服务Api,其功能的实现过程分为如下几个步骤:
①注册表初始化(InitializeRegistry)
②采用矢量按键查找的方式,在指定位置获取元素(VECTOR_FindByKey、VECTOR_At)
③创建代理服务器(SAMGR_CreateIProxy)
④再次采用矢量按键查找的方式,在指定位置获取元素(VECTOR_FindByKey、VECTOR_At)
⑤将元素添加到向量(VECTOR_Add)
SAMGR_CreateIProxy
创建代理服务器也需要进行一些步骤:
①查询用户身份(QueryIdentity)
②创建客户端(SAMGR_CreateIClient)
③申请一个临时空间(SAMGR_Malloc)
④注册死亡回调(RegisterDeathCallback)
entry->iUnknown.Invoke = ProxyInvoke; //代理调用
entry->iUnknown.AddRef = AddRef; //添加参考项
entry->iUnknown.Release = Release; //释放空间
该函数功能的实现流程图如下:
如果上面介绍的两个函数的功能是为了验证用户的身份,给用户提供操控的平台,那么接下来的函数功能则是给用户提供了获取功能的能力
这三个函数我称它为服务函数,分别提供了三个服务功能:
SAMGR_RegisterSystemCapabilityApi //注册系统能力Api
SAMGR_QuerySystemCapabilityApi //查询系统功能Api
SAMGR_GetSystemCapabilitiesApi //获取系统功能Api
具体函数功能可以查看前面的代码标注博客:OpenHarmony模块二samgr_client文件下头文件和源文件解析
下期预告
下期我们将开始对服务端进行深层次分析,主要以模块二的samgr_server文件为对象,仔细分析服务端的搭建流程和服务功能的构建实现步骤。
欲知后事如何,且听下回分解
边栏推荐
- C language: use macro to redefine printf and print [debug debugging information]
- 字典树(Trie树)
- ASP. Net
- Gridsearchcv reported an error: valueerror: input contains Nan, infinity or a value too large for dtype ('float64 ')
- TCP three handshakes and four waves diagram
- How to save using OpenCV Mp4 format file
- Dix règles d'optimisation pour clickhouse SQL
- Based on taskscheduler and crontask, realize the function of dynamically adding and deleting scheduled tasks
- Dictionary tree (trie tree)
- HTAP能力加速TPC-H执行前要怎么部署PolarDB for PostgreSQL?
猜你喜欢

Compileflow Taobao workflow engine

8. MySQL -- trigger

TP5的whereOr方法多条件存在

传值、传引用、传指针

Win10右键新建栏目中添加新建Markdown文件(Typora.md)

The most important diagram of machine learning, how to select the model sklearn structure diagram
![[problems of dft/fft - solutions to fence effect]](/img/e2/7bd81b9bee18768757660f9c1c0d35.png)
[problems of dft/fft - solutions to fence effect]

Asymmetric encryption RSA and symmetric encryption AES project application

MySQL autoincrement, index, foreign key, other operations

YYS鼠标连点器
随机推荐
布尔代数值
Dix règles d'optimisation pour clickhouse SQL
Getting started with OpenCV ----- vs how to install opencv Library
php 生成excel表的2种方法
VxWorks环境搭建与学习
7. MySQL -- basic syntax (III) DCL
C语言学习第一周——C语言的历史
在数组中指定位置插入任意一个元素及删除数组中值为x的元素
C language: [bit field operation] (colon is used in the structure)
Using chardet to detect web page coding
Mysql高版本报sql_mode=only_full_group_by异常
Ten optimization rules of Clickhouse SQL
Eight guidelines for modbus-rs485 wiring
1-first knowledge of FPGA
Redis introduction and installation
复杂链表的复制
Gridsearchcv reported an error: valueerror: input contains Nan, infinity or a value too large for dtype ('float64 ')
自增(自减)运算符的运算优先级
Yys connector with image recognition v2.0
consul启动闪退