2008年5月19日星期一

80Gbps的深度包检测硬件上市(ZZ:solidot)

众所周知,我国的防火墙应用了深度包检测(Deep packet inspection,简写DPI)技术,监控和检查各类非加密信息的流动,非常先进,它可将信息包从L2一直解析到L7,判断是否有违禁内容,是谁在向谁发的,然后看看这些内容是否应该重置,还是低优先级(延迟)处理,或是插播广告。
如此先进的东东你现在也可以使用了,只要有钱。Procera Networks推出了具有深度包检测能力的硬件——单价80万美元,可应付80Gbps流量的PacketLogic PL10000。PL10000可处理500万用户,跟踪4800万实时数据流。这当然是一个强大的平台,但大型ISP们可能需要处理能力更强的硬件。因此Procera 设计的这种新机器还支持信息流同步化,流数据可以分配到不同的PL10000机器上,减少单台机器压力。新的统计引擎还可以让管理员更深入和更精确的查看异常会话。

标签:


The 2008 Google Summer of Code: 21 Projects I'm Excited About(zz)

The annual Google Summer of Code is upon us again. For the uninformed, that’s when Google pays hundreds of students and hundreds of mentors to work on free software projects, ranging from AbiSource to Zumastor. This is where great projects like the GDebiKDE installer were created. And this year looks even better than before, with 175 organizations and 1125 students. So today, I’m going to do a short rundown of some of my favorites. I can’t fit them all in (let’s save some trees!), but these are just some that stood out for me.

OS
One thing that I’ve always wished Debian-based distros to have was a GUI for Aptitude. There are plenty for Apt (Synaptic, Adept, and KPackage are just a few), but the more powerful Aptitude only has its own terminal interface. Because of this, Obey Arthur Liu has begun work on a GTK+ GUI for Aptitude. If Obey completes it, I’m definitely using it.

Cross-platform is now officially the hottest thing for desktop environments. First, KDE announced that KDE 4 was being ported to Windows and OS X. Now, the lesser known Enlightenment project is doing the same thing. Student Dzmitry Mazouka is now porting the Ewl and Etk libraries to the Win32 platform.

The Grand Unified Bootloader (GRUB) is the bootloader that I personally use and what most modern GNU/Linux distributions use. However, it has a slight tendency to scare the average user, because of its black and white terminal interface. Colin David Bennett is going to add a GUI to the upcoming GRUB 2. The GUI will even get fancy with animated menus and such.

Gaming
All gamers have one thing in common. They love to brag about how great they are. Battle for Wesnoth gamers are no exception. However, right now the stats system for Wesnoth is more focused towards tracking potential problems rather than boasting. Therefore, Mykola Konyk is creating a new statistics system for Wesnoth that will greatly enhance the current statistics system. Improvements include an additionally number of stats on the web side and some new graphs and charts.

Graphics
I admit it: I’ve been sucked into that horrible world of Facebook. And I love that the Facebook photo sharing tool allows you to tag a specific area of a photo, rather than just tagging the photo. Many others have fallen in love with this as well, including Paul Hinze. Over the summer, Paul will be working on a tool to allow Gallery2 users to have the same functionality. This could be the tool to finally convince me to switch over to Gallery2 from ZenPhoto.

GIMP is one of the most powerful image editing applications around. Because of this, it’s also one of the most complicated. For example, just looking at the menu bar gives me a headache. Apparently, it gives Evan Estola a headache too. Evan is going to be taking a page out of Apple’s book with his SoC project, Search-based Menu Browsing. Basically, you’ll be able to search the different menu items in GIMP, similar to Apple’s tool.

One of the coolest apps in Gnome is the Cheese Photobooth-clone. However, it’s missing out big on one feature: hardware accelerated effects. Filippo Argiolas aims to rectify this with his Extend Cheese with OpenGL effects. These effects will include a Gstreamer backend with new effects like distortions and color manipulation (including possibly chromakeying, which could lead to bluescreening like Photobooth boasts).

Multimedia
Most likely the most popular audio editor for GNU/Linux is Audacity. However, Audacity doesn’t support very many file formats besides WAV, OGG, AIFF, AU, and MP3 (and this requires LAME and libmad). So if you want to edit a WMA or AAC, you’re out of luck. Therefore, Руслан Ижбулатов has started work on importing and possibly exporting files into Audacity with FFmpeg, the popular audio/video decoder/encoder that supports basically any format. With this, you’ll be able to import and export virtually any format.

If you’re a Windows CE user, you’re probably pretty upset at the lack of a decent media player. Sure, there’s Windows Media Player, but it doesn’t play all of the popular formats (cough .mov cough). Therefore, Geoffroy Couprie has started work on a Windows CE port of VLC. Since VLC plays everything, this is definitely something I’ll be using if I ever switch over to Windows CE.

Another popular (and much more open) mobile platform that doesn’t have the greatest media player is the Maemo platform. Sure, there’s MPlayer, but MPlayer never worked 100% of the time for me. So I’m pretty happy that Antoine Lejeune has started work on the new VLC interface for Maemo.

Lastly, there’s the VLC internet plugin. I love it because the VLC Mozilla plugin will literally play anything, while the other two main internet plugins (MPlayer and Xine)… don’t. However, MPlayer was always my browser plugin mainly because it had an interface and VLC didn’t. I’m therefore really excited that Vladimir Belousov has started work on GUI interfaces for the browsers plug-ins.

Network
My favorite RSS reader is Google Reader. Why? Mostly, it’s because I can read my RSS readers anywhere. I’ve started several times to use offline apps like Akregator, but then I’d have to reread all of the news that I’d already read when I’m at a different computer. It was just too much of a hassle. Arnold Joseph Noronha is going to remove the hassle with his project Google Reader Integration with Liferea. He’s going to be adding support for syncing feed lists and “read” status.

I never got why no one integrated Google’s audio/video Jingle XMPP protocol into their instant messenger. A few smaller apps have, but the two big free ones, Pidgin and Kopete, never did. What especially confused me was that Pidgin’s project leader (Sean Egan) works at Google and is (or was) actively involved in the Jingle development. This year, both Pidgin and Kopete are getting Jingle support, thanks to Michael Ruprecht and Detlev Casanova with their respective YAVVA - Yet Another Voice & Video Application and Jingle video and voice chat in Kopete projects. Michael and Detlev, you have no idea how happy you will make me if you complete your projects.

Pidgin’s clean interface is one of its strongest points, especially compared to apps like Trillian. But I’m a little upset that it can’t really be themed. Yeah, some guys at Gnome-Look figured out how to hack it, but it’s not very elegant and involves overwriting data files (never a good thing). Justin Rodriguez has therefore started work on Pidgin theme improvements, which will add a theme manager for Pidgin. Yee hah!

Office
AbiWord is a great word processor, mainly because it’s so lightweight. However, it lacks one big feature: OOXML (the hated, and yet popular, Microsoft Office 2007 format) export support. Firat Kiyak is trying to fix this problem with his 2008 SoC project, developing OOXML Export plugin for AbiWord, which will allow for exporting to the .docx format. While I (and most other free software activists) dislike OOXML, it is probably going to become a standard and therefore is vital to have support for.

Often the most crucial part of a blog post is the image in it. However, it’s not always easy to find free images that are legally reusable. There is one good place to find free images, though: Flickr. But it’s really a pain to use. First, you have to search for the image (using the advanced search). Then, you have to go to all sizes. Then, you have to download the image. Then, you have to upload it again. Did I hear someone say “time consuming”? Finally though, there’s hope. Husleag Mihai is planning to add support for finding free images on Flickr into OpenOffice.org with his project, Flickr Image Re-Use for OpenOffice.org. In the final version, you’ll be able to search by tag, license, and automatically insert attribution. I for one can’t wait.

One of the things that is critically lacking in Linux is speech recognition. The technology is there: Sphinx2, by all sources, works great. However, there are almost no frontends that are friendly to the average user (the only one even close, Perlbox, is kind of outdated. I’m sorry, it’s very outdated). Gabriel Geraldo França Marcondes is planning on being one of the first to add speech recognition user-friendliness with his Gnome project, Record Speech as Tomboy Note. This one might actually convince me to switch over from KDE to Gnome. At the very least, it’ll make me switch from KNotes.

Another great speech recognition tool being worked on is Saurabh Gupta’s Speech recognition facility for the Open Moko mobile platform. Using the Hidden Markov Model (HMM), Gupta will try to implement voice recognition into Open Moko. If successful, this will seriously bump up Open Moko’s popularity in the mobile world.

Other
An extremely cool KDE-based idea is the Plasma Widgets on the Screensaver idea by Chani Armitage. Simply put, there will now be an option to embed Plasma widgets (the KDE 4 widgets) into the KDE screensaver. That way, you can see stocks, play music, post to Pownce and Twitter, and do anything else you can think of (as long as there’s a Plasma widget for it). I’m definitely looking forward to this one, since most of the default KDE screensavers that come with Kubuntu are pretty bad.

While KDE 4’s compositing Compiz-like effects are extremely awesome, they lack one big effect: the magical cube. Sure, it has the handy Grid Effect, but some of us prefer sticking with the good old cube shipped with Compiz and most other virtual desktop managers. Martin Graesslin is one of these users. He’s planning on creating a desktop cube effect for KWin. Between this and the Wobbly Windows that will ship with KDE 4.1, most of us will soon be able to completely move from Compiz to KDE 4’s KWin.

If you’ve ever used Wine, you’ve used it’s winecfg tool. It’s OK. It’s not as powerful as Windows’ built-in Control Panel, however. A big reason is that many of the configuration tools in Wine are not included in winecfg (the software uninstaller, for example). Owen Rudge is going to fix this with his project, Implementing proper Control Panel support for Wine.

Conclusion
This year’s SoC is going to be a great summer. If even a quarter of these projects get finished, I’ll be one of the happiest people alive. It’s a good time to be a geek.

标签:


2008年5月18日星期日

中华故土地图


乌镇

http://www.macromedia.com/go/getflashplayer" src="http://vhead.blog.sina.com.cn/player/outer_player.swf?auto=0&vid=12881494&uid=1345379121" type="application/x-shockwave-flash" name="ssss" allowFullScreen="true" allowScriptAccess="always" width="475" height="447">


2008年5月16日星期五

windows已安装服务的数据库

已安装服务的数据库


服务的名字由CreateService()函数在服务配置程序安装该服务的时候指定。


该数据的初始拷贝在安装操作系统的时候创建,此时该数据库包括系统启动时需要的设备驱动的表项。对一项以安装的服务或驱动服务来说,该数据库包含以下内容:

service type:它指示该服务是在自己的进程下执行还是和其他服务共享进程。对于驱动服务,它指示是内核驱动还是文件系统驱动。

start type

error control level:当系统启动时,如果该服务或驱动服务启动失败问题的严重程度,并且启动程序将采取的动作.

可执行文件的全路径

可选的依赖性信息:用于决定启动服务或驱动服务的正确顺序.对于服务来说,该信息可以包括该服务启动之前必须启动的服务的列表、该服务器所在的load ordering group的名字、知名load ordering group中服务启动顺序的tag id;对于驱动来说,该信息包括该驱动加载之前必须加载的驱动。

可选的帐户和密码(对于windows服务):如果没有指定帐户,缺省以LocalSystem执行。

驱动对象名字(对于驱动服务):如果没有指定,i/o系统根据驱动服务的名字创建缺省名字。

自动启动服务系统启动时,SCM启动自动启动的服务和这些服务依赖的服务。启动顺序由以下地方决定:

1. load ordering group list中的顺序,HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control中的value ServiceGroupOrder指定。要指定一个服务的load ordering group,在CreateService()和ChangeServiceConfig()由lpLoadOrderGroup指定。

2. The order of services within a group specified in the tags order vector. HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control中的value GroupOrderList

3. 每项服务的依赖关系。
HKEY_LOCAL_MACHINE\System\Select\LastKnownGood指定 最近一次正确配置是HKEY_LOCAL_MACHINE\SYSTEM\ControlSetXXX\Services

其他windows服务相关:


SCM支持访问以下对象的handle

The database of installed services.

A service.

The database lock

SCM系统启动时运行,是一个rpc服务器,这样服务配置程序和服务控制程序能够控制远程计算机上的服务。

标签:


windows开发工具官网介绍

Visual Studio 2005 Professional Edition

overview:Visual Studio 2005 Professional Edition提供给专业独立开发人员或小团队来创建mission-critical和多层的应用。专业版比标准版多了远程服务器开发、调试,sql server2005开发和一个完全的不受限的开发环境。

专业开发者将体会到对.net framework2.0不受限制的访问。.net framework2.0是一个健壮的全功能的开发环境,支持创建工具扩展visual studio ide,开发多层窗口和web应用。

用visual studio 2005开发
享受带有综合应用开发特点的完整的开发环境
在统一的开发环境下开发和调试多层服务器应用
为sql server 2005创建解决方案
利用sdk创建工具扩展visual studio 2005


Visual Studio 2005 SDK Version 4.0
The Visual Studio 2005 Software Development Kit (SDK) version 4.0提供各种工具、文档、示例,以便用户为Visual Studio 2005设计、开发、
测试和部署扩展。
overview:这是官方的visual studio 2005 sdk,允许开发者集成工具、编辑器、设计工具和语言,更加深入visual studio 2005。他增加了以下功能:VS SDK Browser、Package Load Analyzer、Toolbox Control Installer together with a toolbox control installation sample、a redistributable package for Toolbox component vendors that simplifies deploymen、a new tool for generating managed class library documentation (Sandcastle), an updated Setup experience、a new toolbar combo box sample, new integration tests for the EditorWithToolbox sample that use the VsIdeHostAdapter and much more.
系统要求:visual studio2005 标准版以上,安装sp1。

MSDN Library (April 2007 Edition)
包括技术参考文档、白皮书、sdk和code示例。它是visual studio2005 msdn的升级版,包含Visual Studio 2005 Service Pack 1。

更新的内容:
Visual Studio 2005 Service Pack 1 documentation
Visual Studio 2005 general documentation updates
Windows Vista Developer documentation
Windows® Driver Kit (WDK) documentation
SQL Server™ 2005 Books Online product documentation
SQL Server 2005 Compact Edition Books Online
Microsoft Knowledge Base And More...


Visual Studio 2008 Professional Edition (90-day Trial)
Visual Studio 2008 Professional Edition是一套把开发者远景变成现实的综合工具。
overview:Visual Studio 2008 Professional Edition支持web应用(asp.net、ajax)、vista、windows server2008、2007 office、sql server2008及移动设备的开发。

Visual Studio 2008 SDK Version 1.0
Visual Studio 2008 SDK Version 1.0 提供各种工具、文档、示例,以便用户为Visual Studio 2008设计、开发、测试和部署扩展,并在Visual
Studio 2008 Shell基础上创建自己的工具环境。

overview:
1、Visual Studio Shell的开发支持
2、领域特定语言(DSL)工具增强
3、C++,、C# 、 Visual Basic 的开发与测试支持
4、支持Vista
5、用于Toolbox控件、集成开发环境(IDE)、领域特定语言(DSL)、Team Foundation Server扩展、数据设计师扩展等各个方面的代码示例和文档
系统要求:必须安装VS 2008的标准版本或更高版本,而VS 2008 Express不支持

标签:


理解windows服务架构(译自windows TechNet)

(原文地址 http://technet.microsoft.com/en-us/library/aa998749(EXCHG.65).aspx)
windows服务,也称service application,是一些不管用户是否登录都在windows系统上运行的程序。一个windows服务包括一个可执行文件、一个存放application组件的目录和定义服务参数的注册表设置。


windows服务实现了一个统一的接口,SCM可以用该接口控制服务。一个windows服务可以在系统启动的时候自动运行,也可以通过service control program手动运行。service control program是通过SCM功能来控制服务的应用程序。service control program包括services.msc,以及命令行工具net.exe和sc.exe。

SCM进程是一个rpc server service。rpc使service control program和SCM进行本地通信,或通过网络通信来控制远程机器的服务。

SCM的职责:SCM,即service controller,是一个通用的windows进程,它执行各种与服务相关的任务。

一、护已安装服务的数据库SCM维护了一个已安装服务的数据库,包括一个所有服务和保证windows正常启动所必须加载的设备驱动的列表。SCM在注册表的HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services 维护该数据库,它为每个安装的服务和驱动创建了key,key的名字对应服务被服务配置程序安装时指定的名字,服务的名字最长是256个字符。
在services.msc看到的服务名字是display name,由注册表该服务的key下的DisplayName value指定。

二、锁定和解锁services数据库当SCM为了顺序访问配置信息进行初始化的时候,SCM必须锁定services数据库。例如,在一个服务启动之前SCM会锁定数据库,所以当服务启动的时候配置信息不能被改变。启动完毕后,SCM释放锁。重新配置一个服务,服务配置程序(service configuration program)必须向SCM申请锁,并在配置完毕之后解除锁。sc querylock可以查看services数据库是否被锁。

三、枚举安装的服务
SCM从services数据库读取每个key,为每个服务创建一个service record。一个完整的service record包括服务名、启动类型、服务状态(当前服务的状态和可接受的控制码),以及一个指向依赖表的指针。SCM通过service record中的当前状态和依赖关系决定何种动作对该服务有效。例如如果B的运行依赖于A,而B正在运行,那么此时不能停止服务A。

四、启动、停止、暂停和恢复服务
为执行如启动或停止一个服务的常规任务,SCM与它控制下的服务通信。SCM能够在系统启动时自动运行一项服务,也可以手动按需启动一项服务。如果一项自动启动的服务依赖于一项按需启动的服务,按需启动的服务也将自动启动。SCM能判定服务是否被disabled,如果一项服务被disable,依赖于它的自动或手动启动的服务都将不能运行。依赖关系在你准备disable一项服务时显得尤为重要,你不能disable关键服务。操作系统可能为此而不能启动,因为被disabled的服务阻止所有依赖于它的服务的启动,此时,你必须重新操作系统,以“最后一次正确配置”进入系统。windows在HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001存储最后一次正确的配置,当每次成功启动操作系统,该key会更新。如果你以不正确的配置进入windows,你将不正确的配置apply到“最后一次正确配置”。

服务的启动类型:
START_TYPE:
0 BOOT_START
1 SYSTEM_START
2 AUTO_START
3 DEMAND_START
4 DISABLED

sc qc ServiceName 查询一个服务的启动类型、依赖等信息
sc start ServiceName 启动一项服务
net start ServiceName 启动一项服务

一项服务启动的顺序:
1. 获取services数据库中的账户信息一个服务账户的username和password在服务被安装的时候指定。SCM将username存储在value ObjectName中(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\)。password在LSA(Local Security Authority)的秘密部分。账户信息可以通过services.msc在log on面板更改。LocalSystem是一个预定义的本地账户,在本地计算机拥有很高权限。该账户只对系统进程可用。
2. 登录服务账户windows每个活动进程都有一个id,service也不例外。启动一个服务的时候,SCM从services数据库获取账户信息,并且登录windows。在本地计算机,SCM用来登录的账户必须有“Log on as a service”的权限。LocalSystem缺省有“Log on as a service”权限,因为该账户对所有系统资源有访问权限。
3. 创建挂起状态的服务SCM开启挂起状态的新服务,因为只有当SCM向新进程添加必要的安全信息后服务才起作用。
4. 向进程分配access tokenwindows执行的每个进程都需要一个access token,即logon token。access token是描述该服务安全上下文的数据结构。access token中的信息包括id和服务用来和操作系统交互的服务账户的权限。
5. 允许进程执行完成登录过程和分配access token后,SCM允许service运行,履行功能。

停止一项服务的步骤
1. SCM收到服务结束的请求service control program可以向SCM发送“SERVICE_CONTROL_STOP”来结束一个服务。
2. SCM检查服务依赖性如果SCM检测到其他正在运行的服务依赖于要被停止的服务,SCM向service control program返回error code。在触发停止过程前,service control program必须枚举并停止所有依赖特定服务的服务。
3. SCM向该服务转发停止请求如果检测没有依赖的活动服务,SCM向特定服务转发停止请求,该服务必须立即释放给他分配的资源并关闭。

五、维护正在运行服务的状态信息
当一个服务在运行时,它向SCM进程发送状态通知。SCM为每个服务在service record维护该状态信息。SCM跟踪该信息,使其不至于发出与该服务当前状态不符的控制请求。

服务状态信息包括:
服务类型:file system driver、device driver、windows service、是运行自己的进程还是和别的服务共享一个进程。在微软exchange中,smtp和iis共享一个进程。
当前状态:开始、运行、暂停、停止、没运行
可接受的控制码:根据当前状态决定
windows exit code:当一项服务在启动或停止时发生错误用该code来报告错误。为了返回有关该服务的错误code,该值必须设为“ERROR_SERVICE_SPECIFIC_ERROR”来指示在service exit code还有进一步的信息。如果正常启动或停止,该服务将该code设为“NO_ERROR”
service exit code:当一项服务在启动或停止时发生错误用该code来报告错误。除非windows exit code设为“ERROR_SERVICE_SPECIFIC_ERROR”,否则该值被忽略。
wait hint:服务使用该值报告一个operation可能需要的时间。
checkpoint:在一个长时间的启动、停止、暂停,或继续操作中,服务使用该值定期报告进度。

一项服务以LocalSystem帐户运行
1. 不需要另外的服务帐户和变更password。NT AUTHORITY\LocalSystem总是存在,以一个随机16进制数作为密码,该password每七天自动变更一次。
2. 完全控制所有的本地资源。
3. LocalSystem仅仅允许访问本地资源。如果一个服务以LocalSystem帐户运行,它只能够访问本地资源,除非使用另外一个帐户进行网络访问。以LocalSystem帐户运行的服务一般用NT AUTHORITY\NetworkService进行网络访问,该帐户没有密码。

标签:


vmware使用问题

vmware是一个强大的虚拟机工具,“vmware使用问题”系列记录了本人在使用vmware中遇到的一些问题。

1. 一个xp sp2 guest os由于内核损坏进不去,每次进入都是蓝屏。打算将该虚拟机的虚拟磁盘mount,将其中内容拷贝出来。本来的一个虚拟磁盘变成了三个,mount日期最近的一个可以看到全部的文件,但是某些最近的文件提示没有权限。本来已经绝望,后来重装了系统和vmware,再次mount,成功将所有文件拷贝出来,原因模糊。

2. 重装完vmware,打开原来的guest os,提示VMware Authorization Service服务没有开启。打开services.msc,发现与vmware相关的服务只有两个,而对比正常运行的vmware主机,与vmware相关的服务有五项。重装vmware,解决问题。

3. 如果guest os曾经生成过快照,不要删除相关快照文件,否则open虚拟机的时候打不开。
--to be continued

标签:


2008年5月10日星期六

windbg+Virtual PC2007双机调试

只指出与VMware双机调试的不同点:
目标机settings->COM1->Named pipe设为“\\.\pipe\com_1”,在目标机中添加串口。

本博提到的windbg+VMware和windbg+VirtualPC双机调试,串口通信都是以命名管道的方式实现。

SUDT SerialNull是一个串口虚拟工具,可以在不占用真实串口的情况下,创建任意数量并互为连接的纯虚拟串口对。这样串口通信可以以虚拟串口设备的方式实现。




-

标签:


2008年5月8日星期四

VMWare Workstation、GSX Server、ESX Server有什么区别?(zz)

VMware是提供一套虚拟机解决方案的软件,主要产品分为如下三个。
VMware-ESX-Server这个版本并不需要操作系统的支持。它本身就是一个操作系统,用来管理硬件资源。所有的系统都安装在它的上面。带有远程web管理和客户端管理功能。
VMware-GSX-Server这个版本就要安装在一个操作系统下了,这个操作系统叫做HOST OS. 这个HOST OS可以是Windows 2000 Server以上的Windows系统或者是Linux(官方支持列表中只有RH,SUSE,Mandrake很少的几种),和VMware-ESX-Server一样带有远程web管理和客户端管理功能。
VMware-WorkStation这个版本和VMware-GSX-Server版本的机构是一样的。也是要安装在一个操作系统下,对操作系统的要求也是Windows 2000以上或者Linux。和Vmware的区别就是没有web远程管理和客户端管理。

标签:


2008年5月5日星期一

关于使用google的问题

所有语言版的www.google.com搜索敏感字眼,会发生连接重置。
www.google.cn 搜索敏感字眼,不会发生连接重置,搜索结果已经经过过滤。考虑到google.cn服务器落户在中国,www.google.cn应该是在中国政府监管之下的一个颇为本土化的搜索引擎了。

Google.com不转向Google.cn的方法

曾几何时,使用简体中文版windows的用户发现访问google.com会自动转到google.cn,避免这种自动转向可参照如下方法:

1. 控制面板->区域与语言设置->区域选项->标准和格式,选择俄语,应用,IE打开http://www.google.com/,俄语界面;选择中文(台湾),IE打开http://www.google.com/,繁体版。可见http://www.google.com/转向各语言版不是通过IP来判断,而是根据操作系统设置的语言来决定。
2. 非IE核心的浏览器,如Firefox,工具->选项->高级->常规->语言,选择俄语,打开http://www.google.com/,俄语界面。
3. nslookup查出http://www.google.com/几个ip地址,直接用ip地址访问,可实现不转向,这样可以访问http://www.google.com/的中文版。

2008年5月1日星期四

windows下常见的两种调用约定__stdcall、__cdecl——备忘

__stdcall调用:

压栈顺序:从右至左(最后一个参数先进栈)。被调用函数负责平衡堆栈,通常用retn x。
__stdcall的框架看起来是这样的

调用者:
PUSH arg2
PUSH arg1
CALL fun1

被调用者:
PUSH EBP ;保存原来的栈基址
MOV EBP,ESP ;新的基址
……
;ss:[ebp-4]第一个变量
;ss:[ebp+8]是最后一个参数ss:[ebp+C]是倒数第二个参数
……

MOV ESP,EBP
POP EBP
RETN 8

_cdecl 调用:
压栈顺序:从右至左(最后一个参数先进栈)。调用函数负责平衡堆栈,通常用ADD ESP,n。

调用者:
PUSH arg2
PUSH arg1
CALL fun1
ADD ESP,8

被调用者:
PUSH EBP ;保存原来的栈基址
MOV EBP,ESP ;新的基址
……
;ss:[ebp-4]第一个变量
;ss:[ebp+8]是最后一个参数ss:[ebp+C]是倒数第二个参数
……
MOV ESP,EBP
POP EBP
RETN

标签:


This page is powered by Blogger. Isn't yours?

订阅 博文 [Atom]