|
[求助]关于编码转换的问题
使用Unicode |
|
[分享][原创]最简单的MFC程序
发这个干啥 |
|
[注意]强烈谴责论坛上的某些恶心的“举报者“!呼吁全论坛抵制!
都是违规了 请你张张脑子,这个本来就是滥用签名,你再怎么玩出花来了它还是滥用签名 如果你真的想帮助别人,你可以帮他们的驱动签名,不过必须能看到源代码并由签名持有人手动编译 |
|
[注意]强烈谴责论坛上的某些恶心的“举报者“!呼吁全论坛抵制!
这个东西是一个安全漏洞,你私下用也就罢了,公开肯定是要被封的 另外请不要跟我说这对谁谁blahblah,这就跟苹果封它不喜欢的app是一回事,怎么没见人为这个洗地的 |
|
[求助]清理内存垃圾是如何实现的??
现在windows的软件优化内存,哪个不是使用 SetProcessWorkingSetSize 大家都错你也跟着错? 如果你有更好的解决办法,请拿出来,而不是在冷嘲热讽 你扯了这么多,扯到了一点解决办法没? 你问这个问题就跟问我如何不工作也能赚钱一样,做梦.你要么省点花要么就给我去工作 对于内存,你要么关程序要么买,难道你还能有啥方法突破物理极限,制造出不存在的内存? 我想你既然在这里问如何清理内存,你肯定是不想买的,那么看来就只有关程序这一个办法咯? [QUOTE=bujin888;1228285] 遍历进程handle GetProcessWorkingSetSize(handle,&oldsize1,&oldsize2); SetProcessWorkingSetSize(handle,-1,-1); SetProcessWorkingSetSize(handle,oldsize1,oldsize2); 360的内存清理 不仅使用内存回收技术!而且通过进程规则 把不需要的进程和服务给关闭掉! [/QUOTE] 他2L都说过了我还再说一遍干啥? |
|
[求助]清理内存垃圾是如何实现的??
清理内存,只有关闭程序一途 |
|
[求助]清理内存垃圾是如何实现的??
[QUOTE=bujin888;1228863] 谁说-1无效的? 在这个函数中-1和0xFFFFFFFF是等效的!其次在win7 ring3层没看见说-1 无效 只有为0时才无效 BOOL __stdcall SetProcessWorkingSetSize(HANDLE hProcess, SIZE_T dwMinimumWorkingSetSize, SIZE_T dwMaximumWorkingSetSize) { return SetProcessWorkingSetSizeEx(hProcess, dwMinimumWorkingSetSize, dwMaximumWorkingSetSize, 0); } BOOL __stdcall SetProcessWorkingSetSizeEx(HANDLE hProcess, SIZE_T dwMinimumWorkingSetSize, SIZE_T dwMaximumWorkingSetSize, DWORD Flags) { int v4; // edi@3 signed int v5; // esi@3 int ProcessInformation; // [sp+8h] [bp-40h]@1 char Dst; // [sp+Ch] [bp-3Ch]@1 SIZE_T v9; // [sp+10h] [bp-38h]@3 SIZE_T v10; // [sp+14h] [bp-34h]@3 DWORD v11; // [sp+38h] [bp-10h]@3 int v12; // [sp+40h] [bp-8h]@1 int v13; // [sp+44h] [bp-4h]@1 bool dwMinimumWorkingSetSizea; // [sp+54h] [bp+Ch]@3 v12 = 33; v13 = 14; ProcessInformation = 0; memset(&Dst, 0, 0x34u); if ( dwMinimumWorkingSetSize && dwMaximumWorkingSetSize ) { v10 = dwMaximumWorkingSetSize; v11 = Flags; v9 = dwMinimumWorkingSetSize; v4 = RtlAcquirePrivilege(&v12, 2, 0, &dwMaximumWorkingSetSize); v5 = NtSetInformationProcess(hProcess, ProcessQuotaLimits, &ProcessInformation, 0x38u); dwMinimumWorkingSetSizea = v5 >= 0; if ( v4 >= 0 ) { RtlReleasePrivilege(dwMaximumWorkingSetSize); dwMaximumWorkingSetSize = 0; } } else { v5 = -1073741811; dwMinimumWorkingSetSizea = 0; } if ( !dwMinimumWorkingSetSizea ) BaseSetLastNTError(v5); return dwMinimumWorkingSetSizea; } 内核中也没看见 case ProcessQuotaLimits: Length = sizeof(QUOTA_LIMITS); if (ProcessInformationLength != Length) { Status = STATUS_INFO_LENGTH_MISMATCH; break; } Status = ObReferenceObjectByHandle(ProcessHandle, PROCESS_QUERY_INFORMATION, PsProcessType, PreviousMode, (PVOID*)&Process, NULL); if (!NT_SUCCESS(Status)) break; Status = STATUS_SUCCESS; _SEH2_TRY { QuotaLimits->MaximumWorkingSetSize = Process->Vm.MaximumWorkingSetSize << PAGE_SHIFT; QuotaLimits->MinimumWorkingSetSize = Process->Vm.MinimumWorkingSetSize << PAGE_SHIFT; QuotaLimits->TimeLimit.LowPart = MAXULONG; QuotaLimits->TimeLimit.HighPart = MAXULONG; if (Process->QuotaBlock == &PspDefaultQuotaBlock) { QuotaLimits->PagedPoolLimit = (SIZE_T)-1; QuotaLimits->NonPagedPoolLimit = (SIZE_T)-1; QuotaLimits->PagefileLimit = (SIZE_T)-1; } else { QuotaLimits->PagedPoolLimit = Process->QuotaBlock->QuotaEntry[PagedPool].Limit; QuotaLimits->NonPagedPoolLimit = Process->QuotaBlock->QuotaEntry[NonPagedPool].Limit; QuotaLimits->PagefileLimit = Process->QuotaBlock->QuotaEntry[2].Limit; } } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { Status = _SEH2_GetExceptionCode(); } _SEH2_END; [/QUOTE] #include <windows.h> #include <iostream> using namespace std; int main() { SIZE_T min, max; GetProcessWorkingSetSize(GetCurrentProcess(), &min, &max); cout << min << "\t" << max << endl; if (!SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1)) { cout << "failed"; } else { GetProcessWorkingSetSize(GetCurrentProcess(), &min, &max); cout << min << "\t" << max << endl; } } 另外你的代码是从ReactOS中提取出来的,不是Windows NT的实现 另外你的代码是NtQueryInformationProcess的片段,不是NtSetInformationProcess的片段,这真是哈哈哈哈.那么就让我给大家展示一下ReactOS的NtSetInformationProcess中对这个功能的实现吧! case ProcessQuotaLimits: DPRINT1("Quota Limits not implemented\n"); Status = STATUS_NOT_IMPLEMENTED; break; 关于具体实现大家可以自己去WRK的ps\psquery.c:1889(PspSetQuotaLimits)一探究竟 |
|
[求助]清理内存垃圾是如何实现的??
第一,******是一个不雅的汉语口语词汇 第二,一个人的语言很粗俗和一个人很牛屄之间不仅没有逻辑关系更没有统计关系。谁否定这点他要么没逻辑要么没文化看不懂文章 第三,****************************************************************************************************,************** 第四,你其实是在说:“我信用卡欠一万块钱,我借高利贷还了这一万,现在我不欠任何钱了。” SetProcessWorkingSetSize(hProcess, -1, -1)只是将内存中的页面移动到硬盘上的页面文件,我没想到你竟然知道这点后还这么做。这个函数没有释放任何内存,所以被占据的内存地址依然被占据着,纵使他们现在不占用内存实际物理页面,换言之一个32位程序用尽了它自己的2G地址空间后,你“释放内存”后它依然不能分配任何新内存。 更何况这个函数是将所有目前没用到的内存页面全部移出,无论他们是代码是变量是常量是资源是一分钟内59秒每秒访问一亿次就你执行的这一秒没访问还是一个被泄露的内存,他们统统都要滚蛋。内存页面是滚蛋了,但是程序对这些数据的需求没有滚蛋,所以系统又要把页面从硬盘再挪出来。就这样你还好意思说“这样程序既不卡”?而且随着时间的推移,所有非泄漏内存都会被程序访问(这就是内存泄漏的定义啊),也就是说所有被你移出去的内存页面最终还是要一个不落的回到内存里面去。写到这里,我真想替系统和被你清理的程序们对你说一句:******。 第五,由于这也不能说那也不能说,我决定引用知名Linux内核开发者Linus Torvalds的原话好了:“RTFSC”你不说也就罢了,还特意补充解释一下你的高明之处,真是张口就错。按照MSDN上的解释,-1(除了它的特殊作用以外)对于dwMinimumWorkingSetSize和dwMaximumWorkingSetSize来说是一个无效的大小: (dwMinimumWorkingSetSize)This parameter must be greater than zero but less than or equal to the maximum working set size. (dwMaximumWorkingSetSize)This parameter must be greater than or equal to 13 pages (for example, 53,248 on systems with a 4K page size), and less than the system-wide maximum (number of available pages minus 512 pages). 既然如此,只要两个参数都是-1,Windows将永远不会修改工作集的大小,因为那根本就是个不合法的大小。你的备份恢复简直就是画蛇添足纯属多余。 最后,我其实不是对API不爽,我是对你不爽。API是无罪的,但你知道你在干什么么?你是在误人子弟!你可知道,如果我不站出来指出你的荒谬之处,就很有可能有一个没法升级电脑的小学生为了玩LOL而用了你的代码,而很有可能导致他爸爸的Word程序因为内存不足而崩溃,而很有可能导致重要的医疗器械的技术文档消失,而很有可能导致工厂不能按时生产出需要的器械,而很有可能导致在医院的一个小妹妹因为得不到治疗而死,而很有可能导致他哥哥冲冠一怒打死了主刀医生,而很有可能导致医生背后的黑暗组织以为是敌人的行动,而很有可能导致他们对二炮部队发动恐怖袭击,而很有可能导致二炮部队的应急程序启动使用东风洗地,而很有可能导致全球核战,而很有可能导致外星人注意到了核弹的辐射,而很有可能导致外星人使用二相箔对宇宙进行降维打击,而很有可能导致宇宙的灭亡。一想到你的所作所为会有如此可怕的后果,作为一个有良知有爱心有道德有血性的中国人怎能不激动?怎能不站出来制止你的所作所为?是中国人就转! |
|
请问 用LSP从浏览器拦截网址,那种方式是效率最高的?
Windows下IPC最终都是用MMF来实现的 |
|
|
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值