??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲视频专区在线,亚洲福利一区,亚洲黄色高清http://m.shnenglu.com/sunicdavy/category/12573.html跨^台通用游戏服务器架? 脚本及嵌入技? 3D引擎&Shader代码生成, 开发工h?email: 20998333#qq.comzh-cnFri, 20 Apr 2012 05:14:36 GMTFri, 20 Apr 2012 05:14:36 GMT60让C/C++E序一ơ编译可以发布到多版本Linux之上http://m.shnenglu.com/sunicdavy/archive/2012/04/20/172108.html战魂筑战魂筑Fri, 20 Apr 2012 03:35:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2012/04/20/172108.htmlhttp://m.shnenglu.com/sunicdavy/comments/172108.htmlhttp://m.shnenglu.com/sunicdavy/archive/2012/04/20/172108.html#Feedback1http://m.shnenglu.com/sunicdavy/comments/commentRss/172108.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/172108.html最q页游开攑^台比较多, 每个q_要求的Linux版本各不相同, q给开发h员部|服务器带来了很大的困难. 在本机Linux~译的程?发布时即便将依赖的so附带到目标Linux环境,仍然会碰C赖及版本问题,例如:

[root@localhost bin]# ldd wkcenter
./wkcenter: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./wkcenter)
./wkcenter: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by ./wkcenter)
./wkcenter: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by ./wkcenter)
./wkcenter: /lib/libc.so.6: version `GLIBC_2.9' not found (required by ./wkcenter)
./wkcenter: /lib/libc.so.6: version `GLIBC_2.7' not found (required by ./wkcenter)
./wkcenter: /lib/libc.so.6: version `GLIBC_2.8' not found (required by ./wkcenter)
./wkcenter: /lib/libc.so.6: version `GLIBC_2.11' not found (required by ./wkcenter)

        linux-gate.so.1 =>  (0xffffe000)
        liblog4cpp.so.4 => not found
        libprotobuf.so.7 => not found
        libboost_filesystem.so.1.48.0 => not found
        libboost_system.so.1.48.0 => not found
        libboost_thread.so.1.48.0 => not found
        libboost_program_options.so.1.48.0 => not found
        libunwind-x86.so.7 => not found
        libluabind.so.0.9.0 => not found
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x008ae000)
        libm.so.6 => /lib/libm.so.6 (0x0044b000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00476000)
        libc.so.6 => /lib/libc.so.6 (0x002c1000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x0041d000)
        librt.so.1 => /lib/librt.so.1 (0x00440000)
        /lib/ld-linux.so.2 (0x002a2000)

上面U字部分表示glibc及glibcxx库依赖不正确. 本h使用的Linux~译版本为Mint 11(ZUbuntu), 一般Ubuntu发行版的glibc配备非常? 但是上文中的发布的Linux版本为CentOS 5.8

使用/lib/libc.so.6 查看libc版本?.5, q远低于开发环境的2.11

GNU C Library stable release version 2.5, by Roland McGrath et al.
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.1.2 20080704 (Red Hat 4.1.2-51).
Compiled on a Linux 2.6.9 system on 2012-02-21.
Available extensions:
        The C stubs add-on version 2.1.2.
        crypt add-on version 2.1 by Michael Glad and others
        GNU Libidn by Simon Josefsson
        GNU libio by Per Bothner
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
        Native POSIX Threads Library by Ulrich Drepper et al
        BIND-8.2.3-T5B
        RT using linux kernel aio
Thread-local storage support included.
For bug reporting instructions, please see:
<
http://www.gnu.org/software/libc/bugs.html>.

׃Linux操作pȝ的特有elf加蝲序. (可以参?a >此文). 虽然可以很大E度上解决Windows早期版本的dll hell问题, 但是l部|带来了很大隑ֺ

一般常见的解决Ҏ? 扑ֈ一个与目标Linux版本及glibc版本一致的Linux, 代码及依赖包放在之上编? 完成后再发布.q种Ҏ与Linux下常见Y件安装方法类? 但是对于商用服务器部|步骤来说未免繁? 安全性低.

q有一U方?使用静态链? 所有可执行文g文g依赖的静态库, pȝ?全部静态链接到可执行文件中,可以一ơ性解册个问?/p>

步骤:

    1. 在gcc链接命o行中d-static -static-libgcc -static-libstdc++

    2. 第三方依赖库打开静态链接开? 原来链?so的库,全改为链?a

    3. gcc寚w接库序很敏? 链接库顺序需要按照从前至后ؓ:  目产生的静态库 > W三方库静态库 > pȝ静态库

    4. 链接? 若有未解决的symbol, 可以试在最后添?lpthread?lrt解决

   

在发布版本Linux上运行可能遇到的问题:

terminate called after throwing an instance of 'std::runtime_error'

what(): locale::facet::_S_create_c_locale name not valid

解决Ҏ: 执行之前q行export LC_ALL="C"



战魂筑 2012-04-20 11:35 发表评论
]]>
Linux服务自动安装卸蝲部v脚本http://m.shnenglu.com/sunicdavy/archive/2012/04/12/171026.html战魂筑战魂筑Thu, 12 Apr 2012 01:33:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2012/04/12/171026.htmlhttp://m.shnenglu.com/sunicdavy/comments/171026.htmlhttp://m.shnenglu.com/sunicdavy/archive/2012/04/12/171026.html#Feedback0http://m.shnenglu.com/sunicdavy/comments/commentRss/171026.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/171026.html#!/bin/bash # chkconfig: 3 3 1 # description: svclauncher
ServicePath=/usr/local/bin

ServiceList=(
"wkcenterd --toc /home/davy/dev/kaze/Config/CenterService.toc --logfile /tmp/centerd.log"
"wkagentd --toc /home/davy/dev/kaze/Config/AgentService.toc --logfile /tmp/agentd.log"
)

StartAll()
{
    for((i = 0;i<${#ServiceList[*]};i=i+1))
    do

     echo "start:" $ServicePath/${ServiceList[i]}
     $ServicePath/${ServiceList[i]} > /dev/null &

    done
}

StopAll()
{
    for((i = 0;i<${#ServiceList[*]};i=i+1))
    do

     echo "stop:" $ServicePath/${ServiceList[i]}
     svcname=`echo ${ServiceList[i]} | awk '{print $1}'`
     killall $svcname > /dev/null

    done
}

RestartAll()
{
    StopAll
    StartAll
}


InstallService()
{
    svcname=`basename $0`
    chmod +x $svcname
    cp $svcname /etc/init.d
    ln /etc/init.d/$svcname /etc/rc3.d/S03$svcname
    ln /etc/init.d/$svcname /etc/rc0.d/K03$svcname
    chkconfig --add $svcname
    chkconfig $svcname on
    chkconfig --list | grep $svcname
}

UninstallService()
{
    svcname=`basename $0`
    chkconfig --del $svcname
    rm -f /etc/init.d/$svcname
    rm -f /etc/rc3.d/S03$svcname
    rm -f /etc/rc3.d/K03$svcname
}



case "$1" in
    start)
    StartAll
    ;;
    stop)
    StopAll
    ;;
    restart)
    RestartAll
    ;;
    install)
    InstallService
    ;;
    uninstall)
    UninstallService
    ;;
    *)
           echo "Usage: service $EXEC {install|start|stop|restart|uninst}"
       exit 1
esac
 
exit $? 



战魂筑 2012-04-12 09:33 发表评论
]]>
Linux在VMware中网l设|?/title><link>http://m.shnenglu.com/sunicdavy/archive/2012/02/04/164934.html</link><dc:creator>战魂筑</dc:creator><author>战魂筑</author><pubDate>Sat, 04 Feb 2012 03:41:00 GMT</pubDate><guid>http://m.shnenglu.com/sunicdavy/archive/2012/02/04/164934.html</guid><wfw:comment>http://m.shnenglu.com/sunicdavy/comments/164934.html</wfw:comment><comments>http://m.shnenglu.com/sunicdavy/archive/2012/02/04/164934.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://m.shnenglu.com/sunicdavy/comments/commentRss/164934.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/sunicdavy/services/trackbacks/164934.html</trackback:ping><description><![CDATA[<p>q里使用的是Ubuntu的最行发行版Mint, 其他版本cM</p> <p>以下虚拟机内系l叫Guest, q行VMWare的系l叫Host</p> <p>VMWare的网l方式设为Bridge模式. 注意Host-Only模式只能与Hostq接,局域网的机器及互联|机器无法访?/p> <p><a href="http://m.shnenglu.com/images/cppblog_com/sunicdavy/Windows-Live-Writer/Linux-VMware_A07B/image_6.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://m.shnenglu.com/images/cppblog_com/sunicdavy/Windows-Live-Writer/Linux-VMware_A07B/image_thumb_2.png" width="306" height="276"></a></p> <p>在Guest的网l设|中,IP讄ZHost在一个局域网|段的IP, 讄DNS</p> <p><a href="http://m.shnenglu.com/images/cppblog_com/sunicdavy/Windows-Live-Writer/Linux-VMware_A07B/image_4.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://m.shnenglu.com/images/cppblog_com/sunicdavy/Windows-Live-Writer/Linux-VMware_A07B/image_thumb_1.png" width="402" height="292"></a></p> <p>关闭Guestpȝ</p> <p>接下来将Host的可以上|的q接d׃n,q连接到VMNet1</p> <p><a href="http://m.shnenglu.com/images/cppblog_com/sunicdavy/Windows-Live-Writer/Linux-VMware_A07B/image_2.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://m.shnenglu.com/images/cppblog_com/sunicdavy/Windows-Live-Writer/Linux-VMware_A07B/image_thumb.png" width="599" height="232"></a></p> <p>q入Guestpȝ, 试上网</p><img src ="http://m.shnenglu.com/sunicdavy/aggbug/164934.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/sunicdavy/" target="_blank">战魂筑</a> 2012-02-04 11:41 <a href="http://m.shnenglu.com/sunicdavy/archive/2012/02/04/164934.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>讄q程路径为启动\?/title><link>http://m.shnenglu.com/sunicdavy/archive/2011/12/01/161272.html</link><dc:creator>战魂筑</dc:creator><author>战魂筑</author><pubDate>Thu, 01 Dec 2011 03:28:00 GMT</pubDate><guid>http://m.shnenglu.com/sunicdavy/archive/2011/12/01/161272.html</guid><wfw:comment>http://m.shnenglu.com/sunicdavy/comments/161272.html</wfw:comment><comments>http://m.shnenglu.com/sunicdavy/archive/2011/12/01/161272.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://m.shnenglu.com/sunicdavy/comments/commentRss/161272.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/sunicdavy/services/trackbacks/161272.html</trackback:ping><description><![CDATA[<div id="h9nhrfx" class="csharpcode"><pre> VC有个让新手抓狂的地方, 把工E\径作试模式时的进E当前目? </pre></div> <p>估计很多新手因ؓ打不开文g而耗费大量的时?甚至攑ּ</p> <p>以前使用UWindows方式解决q种问题:</p> <div id="dv3fp9f" class="csharpcode"><pre class="alt"><span id="fnx3nxd" class="lnum"> 1: </span>#include <Shlwapi.h></pre><pre><span id="3zb9zxd" class="lnum"> 2: </span>#include <shlobj.h></pre><pre class="alt"><span id="x1r99lj" class="lnum"> 3: </span> </pre><pre><span id="1pblx99" class="lnum"> 4: </span><span id="vnxj99d" class="preproc">#pragma</span> comment(lib,<span id="px3bdjh" class="str">"shlwapi.lib"</span>)</pre><pre class="alt"><span id="3ln39v9" class="lnum"> 5: </span> </pre><pre><span id="9jljff9" class="lnum"> 6: </span>wchar_t exename[MAX_PATH];</pre><pre class="alt"><span id="xxptttd" class="lnum"> 7: </span>::GetModuleFileName(NULL,exename,MAX_PATH);</pre><pre><span id="jzlnhfl" class="lnum"> 8: </span>::PathRemoveFileSpec( exename );</pre><pre class="alt"><span id="rh39bjp" class="lnum"> 9: </span>::SetCurrentDirectory( exename );</pre></div> <style type="text/css">.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } </style> <p></p> <p> 需要跨q_?可以q样?</p> <div id="39z3vjh" class="csharpcode"><pre class="alt"><span id="39nv9l1" class="lnum"> 1: </span>#include <direct.h></pre><pre><span id="b33r9pj" class="lnum"> 2: </span>#include <boost/filesystem.hpp></pre><pre class="alt"><span id="3lxzjjv" class="lnum"> 3: </span> </pre><pre><span id="rhtnpnl" class="lnum"> 4: </span><span id="9fzbn9p" class="kwrd">int</span> main(<span id="pz9t3f9" class="kwrd">int</span> argc, <span id="d3htv9h" class="kwrd">char</span>* argv[])</pre><pre class="alt"><span id="pn3bxn9" class="lnum"> 5: </span>{ </pre><pre><span id="n19drpv" class="lnum"> 6: </span> _chdir( boost::filesystem::path( argv[0] ).remove_filename().<span id="n3jdnb9" class="kwrd">string</span>().c_str() ); </pre><pre class="alt"><span id="b3hrd9f" class="lnum"> 7: </span>}</pre></div> <style type="text/css">.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } </style> <p></p>     被Windows惯坏? 到处找Linux或者boost版本的GetModuleFileName, l果忘记了当qc语言课上教的命o行传入参?..<img src ="http://m.shnenglu.com/sunicdavy/aggbug/161272.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/sunicdavy/" target="_blank">战魂筑</a> 2011-12-01 11:28 <a href="http://m.shnenglu.com/sunicdavy/archive/2011/12/01/161272.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VC中用SetThreadName引v的线E死?/title><link>http://m.shnenglu.com/sunicdavy/archive/2011/10/12/158109.html</link><dc:creator>战魂筑</dc:creator><author>战魂筑</author><pubDate>Wed, 12 Oct 2011 01:50:00 GMT</pubDate><guid>http://m.shnenglu.com/sunicdavy/archive/2011/10/12/158109.html</guid><wfw:comment>http://m.shnenglu.com/sunicdavy/comments/158109.html</wfw:comment><comments>http://m.shnenglu.com/sunicdavy/archive/2011/10/12/158109.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://m.shnenglu.com/sunicdavy/comments/commentRss/158109.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/sunicdavy/services/trackbacks/158109.html</trackback:ping><description><![CDATA[<p>我在工程里用以下函数给U程讄一个方便调试的名称</p> <div id="jpb3vlj" class="csharpcode"><pre class="alt"> typedef <span id="bt9f99p" class="kwrd">struct</span> tagTHREADNAME_INFO</pre><pre> {</pre><pre class="alt"> DWORD dwType; <span id="j39nbzx" class="rem">// must be 0x1000</span></pre><pre> LPCSTR szName; <span id="ptjbl3j" class="rem">// pointer to name (in user addr space)</span></pre><pre class="alt"> DWORD dwThreadID; <span id="xvpjv3x" class="rem">// thread ID (-1=caller thread)</span></pre><pre> DWORD dwFlags; <span id="9d9pr9r" class="rem">// reserved for future use, must be zero</span></pre><pre class="alt"> } THREADNAME_INFO;</pre><pre> </pre><pre class="alt"> <span id="f9df9ll" class="kwrd">void</span> SetThreadName( DWORD dwThreadID, LPCSTR szThreadName )</pre><pre> {</pre><pre class="alt"> THREADNAME_INFO info;</pre><pre> info.dwType = 0x1000;</pre><pre class="alt"> info.szName = szThreadName;</pre><pre> info.dwThreadID = dwThreadID;</pre><pre class="alt"> info.dwFlags = 0;</pre><pre> </pre><pre class="alt"> <span id="j3n39l9" class="rem">// Visit http://m.shnenglu.com/sunicdavy for original article</span></pre><pre> __try</pre><pre class="alt"> {</pre><pre> RaiseException( 0x406D1388, 0, <span id="3b99vl9" class="kwrd">sizeof</span>(info)/<span id="fnpp9dx" class="kwrd">sizeof</span>(DWORD), (DWORD*)&info );</pre><pre class="alt"> }</pre><pre> __except(EXCEPTION_CONTINUE_EXECUTION)</pre><pre class="alt"> {</pre><pre> <span id="rrb9vd3" class="kwrd">int</span> a =1;</pre><pre class="alt"> }</pre><pre> }</pre></div> <style type="text/css">.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } </style> <style type="text/css">.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } </style> <p>使用期间一直正? 随着工程需求变?我需?strong>频繁?/strong>一个被命名的线E创建工作一D|间后<strong>马上l束释放资源q新创?/strong>,出现了死锁问?/p> <p>死锁L发生在主U程的Sleep或者是SetEvent两个WindowsAPI函数. 而且仅仅在Visual Studio 2008里调试时会发生死?q调试环境一切正?</p> <p>我开始打日志调试, l果发现死锁前能够正常创建线E?但是U程函数Ҏ没有调用q入.之后在ȝESleep处死锁了.</p> <p>׃SetThreadName没有使用正规的API接口,而是使用抛异常方? 而且U程名称应该只在Visual Studio IDE中才能显C? MSDN对RaiseException的描q里也有说明可以使用<b>WaitForDebugEvent</b>接收应用E序抛得异常.因此可以推断是SetThreadName造成的问? 屏蔽SetThreadName,试通过</p><img src ="http://m.shnenglu.com/sunicdavy/aggbug/158109.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/sunicdavy/" target="_blank">战魂筑</a> 2011-10-12 09:50 <a href="http://m.shnenglu.com/sunicdavy/archive/2011/10/12/158109.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>恶心的GetPrivateProfileStringhttp://m.shnenglu.com/sunicdavy/archive/2010/09/02/125606.html战魂筑战魂筑Thu, 02 Sep 2010 02:11:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2010/09/02/125606.htmlhttp://m.shnenglu.com/sunicdavy/comments/125606.htmlhttp://m.shnenglu.com/sunicdavy/archive/2010/09/02/125606.html#Feedback6http://m.shnenglu.com/sunicdavy/comments/commentRss/125606.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/125606.html很久没有用WindowsAPI来读取INIQ在公司写服务器逻辑需要用刎ͼ拿来试了下?/p>

记得很早以前qqGetPrivateProfile*pȝINId函数Q有一个问题很?ini的文件\径必Ll对路径Q否则即便工作\径是讄正确的,也是无法d到ini文g。以前有查过Q说是内部搜索\径的问题。默认是在system32L?Q?q前的处理方法就是把l对路径拿过来和当前路径l合后传lGetPrivateProfile*pAPI?/p>

之后Q我自己一直是用自己封装的文本解析cLdiniQ很久没这个APIQ也没有\径烦?/p>

今天再次到Q故询问了下其他人有没有什么好的方法:

只需要将路径改ؓ当前路径标识卛_Q即Q?/strong>

setting.ini   -->     ./setting.ini

 

再次诅咒q个恶心的API



战魂筑 2010-09-02 10:11 发表评论
]]>
修改U程名称,q在VC调试器中昄http://m.shnenglu.com/sunicdavy/archive/2010/05/04/114342.html战魂筑战魂筑Tue, 04 May 2010 07:28:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2010/05/04/114342.htmlhttp://m.shnenglu.com/sunicdavy/comments/114342.htmlhttp://m.shnenglu.com/sunicdavy/archive/2010/05/04/114342.html#Feedback0http://m.shnenglu.com/sunicdavy/comments/commentRss/114342.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/114342.html
#define MS_VC_EXCEPTION 0x406d1388
 
typedef struct tagTHREADNAME_INFO
{
    DWORD dwType;        // must be 0x1000
    LPCSTR szName;       // pointer to name (in same addr space)
    DWORD dwThreadID;    // thread ID (-1 caller thread)
    DWORD dwFlags;       // reserved for future use, most be zero
} THREADNAME_INFO;
 
void SetThreadName(DWORD dwThreadID, LPCTSTR szThreadName)
{
    THREADNAME_INFO info;
    info.dwType = 0x1000;
    info.szName = szThreadName;
    info.dwThreadID = dwThreadID;
    info.dwFlags = 0;
 
    __try
    {
        RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(DWORD),
(DWORD *)&info);
    }
    except (EXCEPTION_CONTINUE_EXECUTION)
    {
    }
}

 

U程名称限制?个ANSI字符?调用q个函数?触发一个调试器异常,VC调试器将会把字符串设|ؓU程名称,q在调试器中昄



战魂筑 2010-05-04 15:28 发表评论
]]>
Windows里的一个有的地方http://m.shnenglu.com/sunicdavy/archive/2010/04/16/112778.html战魂筑战魂筑Fri, 16 Apr 2010 09:20:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2010/04/16/112778.htmlhttp://m.shnenglu.com/sunicdavy/comments/112778.htmlhttp://m.shnenglu.com/sunicdavy/archive/2010/04/16/112778.html#Feedback1http://m.shnenglu.com/sunicdavy/comments/commentRss/112778.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/112778.html 在Windows XP? 在Q何磁盘里,创徏一个文?再复制粘?׃生成一个新的拷?文g名中有个词叫:"复g"

但是感觉q个词貌似是学多了英语后的h拼出来?旉长了,大家习惯了这个叫?q个词也出来了.

在Windows Vista或者Windows 7?q个词变成了 "副本", 估计是微软也发现"复g"q个词不是很正规或者让人接受而换?/p>

:)



战魂筑 2010-04-16 17:20 发表评论
]]>
Windows XP 2升到SP3所带来的麻?/title><link>http://m.shnenglu.com/sunicdavy/archive/2010/04/14/112565.html</link><dc:creator>战魂筑</dc:creator><author>战魂筑</author><pubDate>Wed, 14 Apr 2010 07:53:00 GMT</pubDate><guid>http://m.shnenglu.com/sunicdavy/archive/2010/04/14/112565.html</guid><wfw:comment>http://m.shnenglu.com/sunicdavy/comments/112565.html</wfw:comment><comments>http://m.shnenglu.com/sunicdavy/archive/2010/04/14/112565.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://m.shnenglu.com/sunicdavy/comments/commentRss/112565.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/sunicdavy/services/trackbacks/112565.html</trackback:ping><description><![CDATA[<p>从Windows XP SP2通过Windows Updates 的SP3推送更新到SP3q不是真正意义上的SP3. 臛_发现有以下兼定w?</p> <p>1. RenderMonkey 1.82 在这U升U版本下会启动会报MSXML错误</p> <p>2. VS2010 安装完成? C#和WPF工程都无法正常创?打开vs2008及老的sln,project都会出现卡死,甚至崩溃的错? 估计也是MSXML的问?/p> <p> </p> <p> </p> <p>解决Ҏ:安装Windows 更高版本或者直接用原生Windows SP3</p><img src ="http://m.shnenglu.com/sunicdavy/aggbug/112565.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/sunicdavy/" target="_blank">战魂筑</a> 2010-04-14 15:53 <a href="http://m.shnenglu.com/sunicdavy/archive/2010/04/14/112565.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>让Windows7快速启动资源管理器不进入库http://m.shnenglu.com/sunicdavy/archive/2009/12/25/104091.html战魂筑战魂筑Fri, 25 Dec 2009 15:17:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2009/12/25/104091.htmlhttp://m.shnenglu.com/sunicdavy/comments/104091.htmlhttp://m.shnenglu.com/sunicdavy/archive/2009/12/25/104091.html#Feedback2http://m.shnenglu.com/sunicdavy/comments/commentRss/104091.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/104091.html        前不久将自己2005q的古董W记本从Windows7换回WindowsXPQ马上感觉到了什么叫盘IO。即便是Ud盘间的拯Q想要顺畅的回复QQ消息Q输入法弹出都变得异常慢。因此还是决定换回Windows7Q这ơ真正感觉到新操作系l在pȝ资源上的法q步?/p>

         Windows7默认点击快速启动中的资源管理器弹出的不是“我的电脑”,而是恶心的“库”。程序员的电脑都是井井有条的Q因此“库”这U东西只会让每次重装pȝ后大喊后悔。有一个简单的Ҏ可以让其直接q入“我的电脑?/p>

           右键点击快速启动的图标Q在弹出的菜单从下往上的“Windows资源理器”上点击右键Q点d性。,在“快h式”标{目标?windir%\explorer.exe”后加入一个空格和一个逗号Q如?windir%\explorer.exe ,”(没有双引PQ即可?/p>

战魂筑 2009-12-25 23:17 发表评论
]]>
使用Windows 7 工作http://m.shnenglu.com/sunicdavy/archive/2009/10/27/99553.html战魂筑战魂筑Tue, 27 Oct 2009 02:32:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2009/10/27/99553.htmlhttp://m.shnenglu.com/sunicdavy/comments/99553.htmlhttp://m.shnenglu.com/sunicdavy/archive/2009/10/27/99553.html#Feedback0http://m.shnenglu.com/sunicdavy/comments/commentRss/99553.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/99553.html    Windows 7 已经发布了,不过我在几个月前已经开始用。实在是不喜ƢVistaQ因此直接蟩q用了win7.M感觉q是不错Q现在来说下Windows 7的用感觉?/p>

    如果用过VistaQ那么Windows 7只能说是方便了,而不能说是漂亮了。但是如果直接从XPq来Q那么就会感觉Windows 7非常漂亮。Windows 7的驱动兼Ҏ很好。我安2005q的BenQ本子所有驱动,包括d器都可以通过自动更新扑ֈ。另外,E序兼容性也没有那么夸张Q基本上大部分的E序都可以兼容,特别是兼容Vista的,基本都可以跑在Windows 7下。即便不能兼容的E序Q就像当q?8/2000到xp一P调节下兼Ҏ就可以了?/p>

    如果你用Windows 7来工作,那么恭喜你,Windows 7的用效率是很高的。还在XP?大页开始菜单中找Visual Studio么?q在调节控制面板?8时代的经典菜单,一个一个的N火墙么? 只需要在开始菜单里输入你要扄东西Q很快就可以扑ֈq些功能?/p>

    虽然Windows 7的jumplist是抄袭MacOSQ但转过来想惻IWindows本n何不是从Mac抄袭q来的呢Q除了jumplistQ还有一个功能也怸般很难被发现Q用鼠标中键点击d栏,可以启动q个E序的新实例。这个对于Chromeq种多进E浏览器来说实在是很方便的事情?/p>

    工作中,公司q在使用VS2005Q但是第一ơ用,不小心习惯性的调整C兼容XP模式Q结果不是IDEq是~译器,一直报错。后来查q网站后Q才发现QVS2005l对不要在Windows 7下打开兼容性?/p>

    另外Q很多VPN׃Vista以上pȝ的安全性问题,都不能在Windows 7下用了。另外让公司配机器又很麻烦,q时最好的Ҏ是装一台虚拟机QVMWare+ xpQ?0分钟装完可以用了。比Windows 7自带的那个要求低多了Q而且q可以在里面跑DX一cd形程序,比远E桌面方便多?/p>

战魂筑 2009-10-27 10:32 发表评论
]]>
Windows 7 感叹http://m.shnenglu.com/sunicdavy/archive/2009/08/17/93564.html战魂筑战魂筑Mon, 17 Aug 2009 02:46:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2009/08/17/93564.htmlhttp://m.shnenglu.com/sunicdavy/comments/93564.htmlhttp://m.shnenglu.com/sunicdavy/archive/2009/08/17/93564.html#Feedback0http://m.shnenglu.com/sunicdavy/comments/commentRss/93564.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/93564.html      安装Windows 7 RTM 7600.16385。从XPQVista?QWindowspȝ一直保持着清一色的无聊Q纯本地应用。最多只是美化界面而已Q虽然有部分l节修改Q但是打开文g通用对话框被各种shell做的臃肿不堪Q因此,xp仍然是王?/p>

      很多人喜Ƣ将东西攑֜桌面Q这倒也W合工作习惯Q但是经q长旉后,桌面会变得凌׃堪,虽然Windowsq段旉会有自动桌面清理Q但也仅仅是文件放|在桌面的一个文件夹中。ؓ什么不学下qq mail里的中{站,7天后都用后自动清理Q而且win2000里的动态桌面到了后面的版本取消了Qؓ什么不能这些功能放到web上?q样做对于家用确实会很方?/p>

     q有是最严重的Windows Media PlayerQ将一文gҎ入居然不能播放这个文件夹。徏立好一个播攑ֈ表后Q仍然不能拖入文件夹Q真不知道MS的开发者^时用不用q个软g。?/p>

战魂筑 2009-08-17 10:46 发表评论
]]>
由Android惛_的OS manifest机制http://m.shnenglu.com/sunicdavy/archive/2009/08/10/92827.html战魂筑战魂筑Mon, 10 Aug 2009 09:57:00 GMThttp://m.shnenglu.com/sunicdavy/archive/2009/08/10/92827.htmlhttp://m.shnenglu.com/sunicdavy/comments/92827.htmlhttp://m.shnenglu.com/sunicdavy/archive/2009/08/10/92827.html#Feedback1http://m.shnenglu.com/sunicdavy/comments/commentRss/92827.htmlhttp://m.shnenglu.com/sunicdavy/services/trackbacks/92827.html     病毒Q说白了是可以做Q意事情的破坏性程序,q不什么,大不了只是一个地斚wC会?br>木马Q简而言之就是只要给我联|,我就可以黑掉?br>     微Y已经把Windowspȝl做烂了。exe可以在管理员权限下Q意运行,从而导致病毒木马的泛滥。其实{q头来看很多手机操作pȝQ例如AndroidQ也是用WindowsXP后ؓexe引入的manifest概念Q但是却从根本上解决了很多安全性弊?br>     Android中,每个q行入口Q必L一个manifest来让OS知道你这个程序需要做什么,由OSZ配备|络Q磁盘读取等{需求?br>     如果病毒的讉K权限降低Q例如跑在虚拟机里面Q病毒就没有毒了Q木马即便能获取机密信息Q也发不Z?br>而Windows呢,׃本n概念设计的缺P一个程序写好后拥有完全权限q行讉KQOSq不了解一个程序能做什么,只有当这个程序调用API时才知道Q但有时也决定于调用时的数据Q比如只有打开pȝ盘文件才受到限制。于是乎Q很多商家看CmoneyQ用API HOOKQrootkit{等底层钩子来模拟出了一套超U虚拟机Q妄想用一个Y件控制住另外一个Y件的讉KQ简直是痴h说梦?br>     也许你会_UNIX/Linux不是在这斚w做的很好么?引入用户及权限,默认不在理员下q行。这点Windows也做了,不过很好么?看看UACQLinux下运行也很麻烦?nbsp;
     试想下,如果Windows也拥有和Android一Lmanifest机制Q那么病毒扫描也׃仅需要检查manifest文g可以。对于老的E序Q可以开启一个权限自动检查模式进行运行,一D|间后Q自动ؓq个老程序生成新的manifestQ如果以后发现这个老程序有侵入pȝ的问题,马上修改q个manifest可以解决问题?br>     你可能要_如果E序试图修改自己的manifest呢?q个可以在操作系l内核进行验证,没哪个程序能修改Windows内核吧?是q个道理Q如果manifest的checksum与以前的不一P那就需要一些用h动验证?/p>

战魂筑 2009-08-10 17:57 发表评论
]]>
ŷҹͽþþ | þҹɫƷAV| ձƷþ| þAV뾫Ʒɫҹ| þ×Ʒþþþþ| wwwþþcom| yy6080þ| þ99þëƬһ | һɫþ88ۺ޾Ʒ| ǾþþƷ| þþþþþۺۺϺݺ| ޾Ʒþþþþ| 칫ҾþþƷ| ޹һ˾þþƷ| þԭۺ| þѾDzݲƷ| þþѹ۳ӰԺ| þù˾Ʒ鶹| պAVþһ| þavСݲ| ݺɫþۺ | þþþ߽ۺϳ| ƷëٸAVѾþ| þþƷav鶹ѿ| þþþ99ƷƬţţӰ| þþþһvr| þۺ97ɫֱ| þù㽶Ƶ| ۿ ۺϾþþþùɫ ŷ һ | þAV뾫Ʒ| 91Ʒþþþþ91| þþƷĻ鶹| 97Ƶþþ| þþþòҰ¸߳| þһѵ | þۺĻ| þѾƷƵ| ۺϾƷ㽶þ97 | þþƷҹɫA| 88þþƷһëƬ| 㽶þþƷ|