Welcome to MSDN Blogs Sign in | Join | Help

Microsoft Global Services India is looking for people with the following skills.

Here is what we need in YOU.

 

•    Excellent Native Windows Programming development using Windows API. People with managed code experiences, please stop here.

•    Features, changes and offerings across various Windows OS ( NT, Windows 2K, XPSP2, Win2K3)

•    Windows Internals,  Kernel concepts

•    Knowledge of Shims and various compatibility modes

•    Good understanding on the Windows API.

•    Good debugging capabilities (using Windbg preferred)

•    2 years of People Management and Process Leadership experience


•    Experience in executing offshore projects, customer interaction and global delivery

•    Passion for Consulting.

•    Good written and Verbal communication skills.

 

If you feel that you have what it takes to work for the number one software development company in the world, please feel free to send your resumes to sridhar dot poduri at microsoft dot com. I will first go through the resumes and then forward them to the appropriate people.

By now, everyone knows that Gears of War is the most popular game on the Xbox 360 game console. How about having a glimpse of the gears' demo using Silverlight?

You can get a sneek preview by going here

The following is an excerpt for a job posting inviting qualified people for the post of Dev Manager in the Visual C++ team here at Microsoft. For all C++ folks like us, this is good news that we are not yet extinct. All the phrases/sentences in bold, italics, underlines are my customizations to drive home the importance and value of C++.

The top 1,500 ISVs generate over 80% of worldwide software revenues. In addition to driving the global Windows ecosystem, these companies are directly responsible for $5B-$7B of yearly Microsoft revenue. Central to the success of these customers, as well as Microsoft's own internal development, is Visual C++.

Given the strategic importance of the ISV segment, the Visual C++ team is on a mission to revolutionize our toolset in providing a much more productive and successful native developer experience.

We are looking for a strong Visual C++ Development Manager to drive adoption and satisfaction among professional C++ developers. We are in the starting phase of a major reinvigoration of the experience for C++ and native development targeting very large and complex development projects. The added demands of security and the advent of many-core processing create significant challenges and opportunities to create market leading technologies and tools.

The Visual C++ team is working hand in hand with the Windows division on enhancing the appeal of Vista and Windows 7 for ISV developers and with the CLR team to create a technology stack that allows layering of services to provide a seamless spectrum from native code over type safety and garbage collection to the full .Net stack.

Yummy!!! this makes my day! am sticking to C++, no matter what happens and what noise i hear from everyone else!!!

Microsoft is a great company to work for. When i say 'great' i dont mean only the benefits; but the kind of challenging work you get. In case you are interested in giving an interview at Microsoft, please do let me know by emailing me at sridhar dot poduri at microsoft dot com. For more information, here is a video that was shot my a colleague of mine. He works for the International recruitment team here at MS. Enjoy!!

The Recruiters Lounge - Who is behind SourceCon?
The Recruiters Lounge - Who is behind SourceCon?

 

 

Its now official. I will be delivering a session on Application Compatibility in Windows Vista at the Community Launch of Windows Vista and Office 2007 on 29th April, 2007, being organised by the Microsoft User Group Hyderabad.

If you stay in or around Hyderabad, this is a great time to spend one full day getting a glimpse of all the latest technologies on the Microsoft Platform. That alone should be sufficient to attend, but we also have lots of goodies for participants. More information and registration is available on http://www.mugh.net

 See you all there :)

With dual core processors on the desktops and notebooks already becoming mainstream, applications that are concurrent-aware and have support for parallelism will distinguish themselves from applications that do not have support. In case you are not already aware of Concurrency, read the excellent paper by Herb Sutter at http://www.gotw.ca/publications/concurrency-ddj.htm where he talks about concurrency and how the "Free Lunch is Over".

In this respect, C++, for all its notorious distinction of complexity, is the best prepared language to take advantage of the Concurrency revolution. Beginning with Visual C++ 2005, Visual C++ supports the OpenMP libraries, which provide parallel and multi-proc support in your programs. In most cases, this is as simple as adding a #pragma omp parallel preprocessor option to the block of code you wish to parallelize and add support for the OpenMP libraries through the project property settings.

During compilation, the compiler takes care of the appropriate code generation and emits instructions that automatically execute code in parallel. This support is not only available for native code but also while using C++/CLI, the new syntax for targetting the Microsoft CLR. Don't tell anyone, C++/CLI is the "only" CLR language that makes parallelism and  concurrent programming ridiculously easy. With just a few #pragmas, you can write programs that shine on the new multi-proc machines.

For more information, visit the Visual C++ developer center on MSDN located at http://msdn.microsoft.com/visualc

This posting is provided "AS IS" with no warranties, and confers no rights. The Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

Microsoft brings Windows Live Messenger to XBox 360 by ZDNet's Steve O'Hear -- Along with the recently added IPTV capabilities, this further positions the XBox 360 as Redmond's trojan horse designed to deliver Internet services into our living rooms.

 

This posting is provided "AS IS" with no warranties, and confers no rights. The Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

I recently got a mail from a colleague, working in China, on how to receive session change notifications in a NT service running under Vista. I was already working on a similar problem and was able to crank up VS and get some code up and running. Here is the way to do it

1) As soon as you create your service, call RegisterServiceCtrlHandlerEx function and pass a functor to it (this is usually called HandlerEx and is documented by the same name in MSDN).

2) Beware, the HandlerEx is just a palceholder for any function you may choose to write. It can even be named after your pet!

3) Within the HandlerEx function, handle the SERVICE_CONTROL_SESSIONCHANGE opcode.

4) Once you receive the SERVICE_CONTROL_SESSIONCHANGE event, use the event data and event type to write code for your requirements.

5) Please note that the event type can be WTS_SESSION_LOGIN, WTS_SESSION_LOGOFF, WTS_REMOTE_CONNECT etc.

6) For more information, please lookup the HandlerEx function in MSDN.

You can download sample code from here

 

This posting is provided "AS IS" with no warranties, and confers no rights. The Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

It is unfortunate that IBM has mounted a worldwide campaign to try to undermine the Ecma Open XML document format and inflame those who may favor open source products or have some anti-Microsoft bias.  IBM was the single ‘no’ vote in the Emca International standards process against Open XML, with otherwise overwhelming support for the standards body to take an important step – opening up important document technology to the industry.  Clearly, IBM is more focused on trying to create some new advantage for their own products that support the alternative.  Against all IBM’s rhetoric about promoting the development of open standards for technology, IBM simply hopes to serve their commercial product interests.

At this point IBM is working overtime within standards groups around the world, and is whipping up the OSS blogging community via Bob Sutor, to try to create irrational fears about Microsoft and this technology, claiming during the ISO ‘contradiction’ period that The Ecma Open XML standard should not become an ISO standard.  They are trying to manufacture so many arcane issues in this area that the ordinary reader will be so confused they will worry about Open XML enough to stop it.  This article explains the simple facts…

Ecma International is a very well respected standards organization consisting of dozens of major companies who have worked hard on the Open XML standard, insured that it met the broadest set of industry requirements, and approved it unanimously – except for IBM.  Ecma consists of technology companies, including Microsoft’s competitors, and organizations who all have a major stake in document technology.  They all understand that bringing this technology behind billions of documents into the open standards process is a very positive development for the industry.

There is no formal ‘contradiction’ between the ODF standard and the Open XML standard.  The two technologies were originally developed to serve very different customer needs and therefore satisfy very different detailed technical requirements.  The standards review period for ‘contradictions’ is meant to avoid having two standards that actually prevent each other from working, as in two radio technologies which interfere with one another in the same frequencies.  Open XML and ODF can co-exist in the marketplace.  There are translators under development by several parties in an open fashion that enable one format to be ‘mapped’ or approximated to the other, as has been done with different document formats for decades.  Many products are likely to support a choice between formats, as several (Novell, Corel, Microsoft) have already announced.  There continues to be competition between many formats that are widely supported, including HTML, RTF, ‘DOC’, PDF and now ODF and Open XML.  This richness of formats and choice in the marketplace insures that users get what they need.

It is clear that the world is better off with a choice of document format standards, not one single mandatory standard for the future.  ODF has been found to have a number of gaps and flaws and was not explicitly tested to conform to all the features of billions of documents that are already in use today.  Users have voted time and time again to have multiple standards available to them for audio, for video, for images, for networking, for printing, for wireless communication, for many widespread purposes. Today no one document format meets all of every user’s needs and with the complexity, change and innovation that is possible with software, one format solving all needs is unrealistic and unlikely to be the case in the future.  It is more likely that ODF and Open XML will evolve to serve even more requirements, including ever-improving interoperability.

The Open XML format is indeed detailed, in order to enable high fidelity document results and interoperability.  If the Ecma organization had issued a generic specification, then different implementations or applications would get very different results through their own interpretation of the specification.  Microsoft would be accused of hiding the details, of harming interoperability, and of being the only company that could faithfully use the format.  With all the rich detail of the format, any vendor can use as much or as little of the specification as they need, and they will not be guessing about the results.  A human resources application, an accounting application and a word processing application can all use the same information with confidence. 

Of course, IBM is ironically saying that the rich detail of the specification forces everyone to use it all and causes problems.  –while saying silent about the fact that ODF has not supported formulas at all, and that different applications using ODF indeed get different results for the same document information.  The world demands ever-detailed information for interoperability and the Ecma specification provides it.  –with flexibility for implementers to use only what they need.  As one example, IBM and their zealous allies point to arcane issues such as the date system in the spreadsheet portion of the specification that calls out the year 1900 as a leap year, when it was not.  This was an artifact of convenience within Lotus 123 that is now included in perhaps millions of spreadsheets and date calculations, and has been ‘worked around’ in well known ways for years.  The Open XML specification does not ignore the past, and therefore cause existing documents to break their calculations, but embraces it, keeps the existing calculations whole, and takes it forward into the open world of XML information.

Again, ODF and Open XML serve different customer needs, and the level of detail in each specification, 700 pages vs. 6000 pages respectively, is proof enough for most.  The Ecma Open XML specification offers many examples and descriptions with the spec, in order to ease implementation, and many developers in the industry, hundreds already are using the technology today.

The licensing approach for Open XML offers an elegant, simple solution to a major industry problem.  –and has been endorsed by the best legal minds in the open source licensing speciality.  Microsoft provides an open promise to the industry that they can use the specification in whole or in part and can extend it.  Rather than give up its intellectual property within the specification and then promptly be open to intellectual property lawsuits, Microsoft has simply shared its contributions to the Open XML technology with the world with a promise to everyone that they can use it without any fees.  This approach in fact is very similar to the approach for ODF, and has had worldwide scrutiny for months, with the conclusion that in fact this non-licensing approach to the intellectual property does work in reality for everyone.

As a result, we are already seeing competitive products and new innovative products already spring up using Open XML, so there will shortly be many different products that can be chosen, well beyond Microsoft Office, to work with these files.  Corel and Novell have announced that their productivity suites will support Open XML.  The Translation utilities between ODF and Open XML are completely open for any developer on any platform to use, including all other productivity suites and including open source applications (such as Novell’s).  In addition, companies such as the ones participating in the Openxmldeveloper.org community are starting to see and develop the many new opportunities for different types of applications to use the formats.  Innovation is likely to rapidly result in thousands of different applications bridging the parallel universes of backend data and desktop applications using the unique features and flexibility of Open XML.

Should the world have only one document format as an ISO standard?  Are all user needs for documents the same?  Will some customers such as national archives, legal institutions and public records agencies need to preserve older document exactly as they were produced?  Might PDF be valuable as another ISO standard?  Will other companies be free to experiment and evolve their use of XML in their organizations?    Of course.  With multiple ISO document standards possible, that can be translated in various ways back and forth in an open way to accomplish interoperability, users will have the tools they need to meet their demanding and changing needs. 

Microsoft for its part embraces this reality, has opened up its technology to the world, has worked with many different users, developers and competitors to meet the broadest set of requirements, and looks forward to the ISO process for everyone to provide high quality technical review and input to the Ecma organization.   IBM appears to be on an unacceptable path of arguing against their own well-known policy of supporting many open standards, to try to mandate only one document format standard that their new products happen to now support.

 

This posting is provided "AS IS" with no warranties, and confers no rights. The Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

A few weeks ago, i posted a few guidelines on how Services running in Session 0 under Windows Vista can create applications in interactive user sessions. I also had the chance to present the same at a couple of developer sessions here in India. I have received a lot of feedback on the guidelines that i mentioned earlier. This post is an attempt to clean up the confusion and clarify the rudimentaries in detail.

1) If you already have a Service application running on pre-XP Operating Systems (Windows 2000 etc) you may choose to follow the guidelines from my earlier post.  Please note, however, that while doing so will only make your service compatible with Vista; but it is not the best way to do so. Some of the issues your service might run into include Fast User Switching scenarios (FUS is enabled in Vista, even for domain-joined computers), obtaining the interactive user token etc.

2) If you are looking to write great applications for Windows Vista and if you must write services, then the best way to do it is as:

 a) First call WTSEnumerateSessions to obtain a list and count of all the Terminal Services Sessions on your local machine or the machine where the service is intended to run.

b) From the list of Terminal Services Sessions, determine the one which is currently Active. A Session that is active, will have its State set as WTSActive.

c) For the active session, get the SessionId.

d) Using the SessionId obtained above, make a call to WTSQueryUserToken to obtain a valid user token for that session.

e) Use the token obtained to make a call to CreateProcessAsUser.

This posting is provided "AS IS" with no warranties, and confers no rights. The Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

Today I talk about the different launch paths under Windows Vista. There are two different launch paths available: Standard User Launch and Elevated Launch. The architecture of application launch is as shown in the figure below

 

Standard User Launch Path

The Windows Vista standard user launch path is similar to the Windows XP launch path, but includes some modifications.

  1. ShellExecute() calls CreateProcess().

  2. CreateProcess() calls AppCompat, Fusion, and Installer Detection to assess if the application requires elevation. The executable is then inspected to determine its requestedExecutionLevel, which is stored in the executable's application manifest. The AppCompat database stores information for an application's application compatibility fix entries. Installer Detection detects setup executables.

  3. CreateProcess() returns a Win32 error code stating ERROR_ELEVATION_REQUIRED.

  4. ShellExecute() looks specifically for this new error and, upon receiving it, calls across to the Application Information service (AIS) to attempt the elevated launch.

Elevated Launch Path

The Windows Vista elevated launch path is a new Windows launch path.

  1. AIS receives the call from ShellExecute() and re-evaluates the requested execution level and Group Policy to determine if the elevation is allowed and to define the elevation user experience.

  2. If the requested execution level requires elevation, the service launches the elevation prompt on the caller’s interactive desktop (based on Group Policy), using the HWND passed in from ShellExecute().

  3. Once the user has given consent or valid credentials, AIS will retrieve the corresponding access token associated with the appropriate user, if necessary. For example, an application requesting a requestedExecutionLevel of highestAvailable will retrieve different access tokens for a user that is only a member of the Backup Operators group than for a member of the local Administrators group.

AIS re-issues a CreateProcessAsUser() call, supplying the administrator access token and specifying the caller’s interactive desktop.

 This posting is provided "AS IS" with no warranties, and confers no rights. The Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

 

The following section applies only to Visual Studio Debugger

A mixed-mode application is any application that combines native code (C++) with managed code (such as Visual Basic, Visual C#, or C++ that runs on the common language runtime). Debugging mixed-mode applications is largely transparent in Visual Studio; it is not too different from debugging a single-mode application. There are a few special considerations, however.

Visual Studio does not support mixed-mode debugging on Windows 95, Windows 98, or Windows Millennium Edition.

Property Evaluation in Mixed-Mode Applications

In a mixed-mode application, the evaluation of properties by the debugger is an expensive operation. As a result, debugging operations such as stepping might appear slow. If you experience poor performance in mixed-mode debugging, you might want to turn off property evaluation in the debugger windows.

To turn off property evaluation

· From the Tools menu, choose Options.

· In the Options dialog box, open the Debugging folder and select the General category.

· Clear the Enable property evaluation and other implicit function calls check box.

· Because native call stacks and managed call stacks differ, the debugger cannot always provide the complete call stack for mixed code. When native code calls managed code, you may notice some discrepancies.

Because of differences between call stacks for managed and native code, the debugger cannot always show the complete call stack when the code types mix. When native code calls managed code, you may notice the following discrepancies in the Call Stack window:

· The native frame immediately above the managed code may be missing from the Call Stack window.

· For mixed-mode applications launched outside the debugger, the Call Stack window may display only the managed code and none of the native frames will be visible.

To step out of managed code when native frames are missing from the call stack display

1. In the native code, set a location breakpoint after the call to managed code.

2. From the Debug menu, choose Continue.

When the managed call is completed, execution will stop at the breakpoint in native code.

If you are using Windbg (available from http://www.microsoft.com/whdc)

WinDbg, CDB, and NTSD can be used to perform limited debugging of target applications that contain managed code.

Introduction to Managed Code

Managed code is code that is executed in conjunction with the Microsoft .NET common language runtime. The .NET common language runtime manages raw code and data for the application, providing enhanced services such as garbage collection and platform-independent code.

Compiled code that requires this runtime is called managed code. Code that does not require this runtime is called unmanaged code. An application that consists entirely of managed code is called a managed application.

A managed .NET application can execute on any platform that supports the .NET common language runtime. This is because the binary code produced by the compiler is not platform-specific. Binary code in a managed application is in Microsoft intermediate language (MSIL). The binary also includes object information and other references; this information is called metadata.

A managed application differs from a traditional application in that many details of the application's execution are left up to the runtime, such as how data structures are laid out and how native code is generated and used. When the application is run, the runtime makes decisions about data usage and code usage as the application is running, producing native code specific to the platform when desired. The process of generating native code from MSIL is called managing or just-in-time (JIT) compiling, or sometimes JITting. The component of the runtime that performs this translation step is called the JIT compiler.

Once the JIT compiler has compiled the MSIL for a specific method, that method's stub is replaced with the address of the compiled code. Whenever this method is called subsequently, the native code will execute and the JIT compiler will not have to be involved in the process.

Building Managed Code

Managed code can be built by a number of compilers manufactured by a variety of software producers. In particular, Microsoft Visual Studio .NET can build managed code from four different languages:

· C++ with managed extensions

· C#

· Visual Basic

· JScript

By default, Microsoft Visual C++ .NET does not build managed applications. You must request this through a command-line switch or through the graphical interface.

Debugging Managed Code

Managed code can be debugged by using the sos.dll extension. This is located in the clr10 subdirectory of your Debugging Tools for Windows installation.

To use this extension, load it and then type the following command:

0:000> !clr10\sos.help

This will give a listing of all available extension commands, along with their parameters.

 

This posting is provided "AS IS" with no warranties, and confers no rights. The Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

 

Recently one of the customers had a problem with deploying their Windows Services over Vista. The Service, upon startup, displays a tray icon on the system tray and can be used to interact with the user. While the Service works fine on Windows XP and Windows 2003, it does not work properly under Vista.

The following post explains what has changed in Vista, why we had to change it, and how it is going to impact applications. Finally i devote a section to discussing how developers wanting to write services interact with the user, make minor code changes and make their applications compatible with Vista.

Backgrounder

In Windows XP, Windows Server 2003, and earlier versions of the Windows operating system, all services run in the same session as the first user who logs on to the console. This session is called Session 0. Running services and user applications together in Session 0 poses a security risk because services can run at elevated privilege(Local System account for example) and therefore are targets for malicious agents who are looking for a means to elevate their own privilege level.

The Microsoft Windows Vista operating system mitigates this security risk by isolating services in Session 0 and making Session 0 non-interactive. In Windows Vista, only system processes and services run in Session 0. The first user logs on to Session 1, and subsequent users log on to subsequent sessions. This means that services never run in the same session as users' applications and are therefore protected from attacks that originate in application code.

Before I explain more in detail about the Session 0 isolation and verious application compatibility issues, let me quickly walk you through determining which session your application runs under (this applies to all versions of Windows prior to Vista).

1) Open Task Manager (Click Windows Key + r and type “taskmgr”)

2) Select the Process tab.

3) Go To View Menu.. Select Columns

4) In the dialog, click the checkbox for “Session ID” and click OK:

5) Focus on the Session IDs for various applications. Notice that Services and applications run under the same session.

Under Windows Vista, the user applications (Visual Studio, Explorer) are not running in Session 0. All services are running in Session 0. (If the display does not show all the services, enable the check-box “Show processes from all users” at the bottom of the display.)

Session 0 Isolation and UI

Session 0 isolation introduces a problem for Services that need to display UI to the user. Since the Service is now running in a different Session and Desktop, the UI would not be visible to the end user and hence the application would appear to hang. Windows Vista has a temporary mitigation for this. In the next section, you will see how Windows Vista notifies you to switch to the Session 0 desktop to respond to interaction from legacy Services.

As mentioned, this mitigation is only temporary. The recommended way of showing UI is CreateProcessAsUser function to create a process in the user's session.

When the system detects that a service running in Session 0 is trying to communicate with the user, it displays a dialog similar to the one shown below. The developer can now switch to a desktop in Session 0 to interact with the dialog. Otherwise the service would be waiting for input and appear to hang.

Displaying UI in the User's Session

As mentioned above, the recommended way of showing UI is to use the CreateProcessAsUser function to create a process in the user's session. Looking up in MSDN, CreateProcessAsUser has the following syntax...

BOOL CreateProcessAsUser( HANDLE hToken, LPCTSTR lpApplicationName, LPTSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCTSTR lpCurrentDirectory, LPSTARTUPINFO lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation );

The first parameter is a HANDLE to a token and is a primary token that identifies the user. The immediate question before us is "How do i get a token for the user?" Another function LogonUser can be used to obtain the token for a user. However, LogonUser requires that one pass the user id and password in plain text format :) which is certainly not desirable.

I suggest the following method to obtain a primary token that identifies a user.

1) Call OpenProcess with PROCESS_ALL_ACCESS and open a user process. If the call is successful, it returns a handle to the process.

2) Use the handle obtained above to make a call to OpenProcessToken and specify TOKEN_ASSIGN_PRIMARY and TOKEN_DUPLICATE as the desired access. If the call is successful, it returns a handle to the process token.

3) Use the token handle obtained in step 2 above, and call DuplicateTokenEx function and specify TOKEN_ASSIGN_PRIMARY and TOKEN_ALL_ACCESS as the access rights. Also specify token type as TokenPrimary. If the call succeeds, it returns you a handle to a token which can be used as a primary token.

4) Call CreateProcessAsUser function to create an application in the user's session.

Few clarifications on the sequence of operations to be performed.

1) Every process that is launched by a user has the user's token associated with the process. This is done so that a particular process can be mapped back to the user who launched it.

2) The OpenProcessToken only returns an impersonated token which cannot be used in functions that require a primary token.

3) Further to step 2 above, we need to convert the impersonated token into a primary token and thus we use the function DuplicateTokenEx to achieve the same goal.

4) Once we convert the impersonated token into a primary token, we can use it in all the functions that need a primary token.

5) Once we are done using the token, we have to close it by calling CloseHandle.

 

I think this answers the most perplexing question regaring Session 0 and UI communication in Vista. Please feel free to post your comments, feedback and any other tips that you might have and i shall post an update accordingly.

 

This posting is provided "AS IS" with no warranties, and confers no rights. The Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

Hi All,

This is my first post on MSDN Blogs. I work for the Vista Application Compatibility Team at Microsoft Global Services India. I intend to blog about the various application compatibility issues when migrating applications to Vista and also suggest ways to go about ensuring compatibility with Vista.

 

This posting is provided "AS IS" with no warranties, and confers no rights. The Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

 
Page view tracker