False static analyzer warning 6335

Hi All,
I have following code...
BOOLEAN MyCreateProcess(...)
PROCESS_INFORMATION ProcessInfo = { 0 };
 auto Cleanup = [&pwszCommandLineLocal, &ProcessInfo]()
  if (NULL != ProcessInfo.hThread)
   CloseHandle(ProcessInfo.hThread);
  if (NULL != ProcessInfo.hProcess)
   CloseHandle(ProcessInfo.hProcess);
  if (NULL != pwszCommandLineLocal)
   free(pwszCommandLineLocal);
 SMART_CLEAN(Cleanup);
 boResult = CreateProcessW(
  pcwszExecutablePath,
  pwszCommandLineLocal,
  NULL,
  NULL,
  FALSE,
  dwCreationFlags,
  NULL,
  NULL,
  &StartupInfo,
  &ProcessInfo
 if (FALSE == boResult)
  return FALSE;
 if (TRUE == bWaitForCompletion)
  WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
  if (NULL != pdwExitCode)
   boResult = GetExitCodeProcess(ProcessInfo.hProcess, pdwExitCode);
   if (FALSE == boResult)
    return FALSE;
 return TRUE;
where SMART_CLEAN(Cleanup) creates a object which calls Cleanup lambda when it goes out of scope. Thus process and thread handle gets closed. But still Static Code Analysis in Visual studio is reporting 6335 only for thread handle.
I think it's false warning. Am I missing something else?
Thanks & Regards,
Amit Kulkarni.

Hi Amit,
>>where SMART_CLEAN(Cleanup) creates a object which calls Cleanup lambda when it goes out of scope. Thus process and thread handle gets closed. But still Static Code Analysis in Visual studio is reporting 6335 only for thread handle.
Which VS version did you use? Please view the detailed code analysis result and know which line code or which method generated this issue.
Best Regards,
Jack
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Static analyzer fails on WIX custom install action project: .dll' could not be opened -- 'An attempt was made to load a program with an incorrect format'

    On our build system, we use the global setting to code analyze all projects. One of our projects is a C# WIX custom action. This projects causes the build to fail with:
    EACustomInstallActions.CA.dll' could not be opened -- 'An attempt was made to load a program with an incorrect format.
    The ...CA.Dll target seems to be created by a WIX custom action. Does anybody have already encountered this issue and found a workaround?
    Full build output:
    <target name="ContractDeclarativeAssemblyCS" success="false">
                  <message level="normal"><![CDATA[Build Declarative Contract Assembly for C# D:\EA_MAIN_DB\AMI\bin\Debug\GEHealthcare.Isip.EACustomInstallActions.dll]]></message>
                  <message level="high"><![CDATA[C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /pdb:obj\x86\Debug\Decl\GEHealthcare.Isip.EACustomInstallActions.pdb /errorreport:prompt /warn:0 /define:DEBUG;TRACE;CONTRACTS_FULL;CODE_ANALYSIS /reference:"C:\Program Files\Windows Installer XML v3\SDK\Microsoft.Deployment.WindowsInstaller.dll" /reference:"C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.SqlServer.ConnectionInfo.dll" /reference:"C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.SqlServer.Management.Sdk.Sfc.dll" /reference:"C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.SqlServer.Smo.dll" /reference:"C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.SqlServer.SqlWmiManagement.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /addmodule:D:\EA_MAIN_DB\AMI\src\radstore\Installer\EACustomInstallActions\obj\x86\Debug\GEHealthcare.Isip.EACustomInstallActions.CA.dll /debug+ /debug:full /filealign:512 /keyfile:..\..\Common\EAKeyPair.snk /optimize+ /out:obj\x86\Debug\Decl\GEHealthcare.Isip.EACustomInstallActions.dll /target:library /warnaserror- ..\..\Common\GlobalAssemblyInfo.cs CustomAction.cs Properties\AssemblyInfo.cs Resource1.Designer.cs SqlServersSelector.cs SqlServersSelector.designer.cs "C:\Program Files\Microsoft\Contracts\Languages\CSharp\ContractDeclarativeAssemblyAttribute.cs"]]></message>
                  <error code="CS0009" file="CSC"><![CDATA[Metadata file 'd:\EA_Main_DB\AMI\src\radstore\Installer\EACustomInstallActions\obj\x86\Debug\GEHealthcare.Isip.EACustomInstallActions.CA.dll' could not be opened -- 'An attempt was made to load a program with an incorrect format. ']]></error>
                </target>

    This problem appears to be ongoing 5 years after this thread was started. I have just run into it.
    When WiX builds a custom action, the build proceeds as normal and produces a managed code output, say MyCustomActions.dll. Windows Installer doesn't support managed code in custom actions, so the managed code has to be wrapped in an unmanaged native code
    wrapper, so in a post-build step, it injects the managed output into the unmanaged wrapper and _that_ then becomes the project's build output and will be named MyCustomActions.CA.dll. I believe that Code Contracts may be trying to open the unmanaged wrapper
    file and discovering that it is not managed code ("invalid format").
    In order for CCRewrite to work here, it would need to run on the managed code _before_ it gets wrapped in the unmanaged wrapper. I am not sure how we can hook into the build process to get that to happen.
    It might be possible to somehow make a WiX Custom Action project by creating a standard C# class library, which would work correctly with CCRewrite, then somehow performing the WiX packaging as a post-build step. I'm not sure what is required though, exactly.
    Any ideas?
    --Tim Long
    Tim Long

  • False low ink warning on the 220 Black cartridge

    Every time I get a low ink warning on the black PGBK 220 cartridge, upon visual inspection, the cartridge still contains approximately 20-25% of the ink.  Non-OEM cartidges especially have a lot a ink left.  Makes me think there's a Canon conspiracy in the printer maintenance software to identtify non-OEM cartidges and generate premature low ink wanings.  Anyone else have this problem or know how to overcome it?

    Hi drott1,
    There are two types of ink warnings that will appear with your printer: a "low ink" warning and an "out of ink" warning.  The "low ink" warning is designed to occur around the 25% mark.  The intention is to give the consumer time to purchase replacement ink if necessary and have it available when the "out of ink" error occurs.  
    Think of it like the low fuel light on a car.  While you still have enough gas to travel around, the warning light is a reminder to fill-up at the nearest gas station so you won't be stranded on the road without fuel.  In a similar way, we don't want you to be stranded without ink in the middle of an important print job.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • Static Analyzer is failing in Xcode 6 GM seed. The same issue was happening in Xcode 6, beta 5 as well.

    While doing "Analyze" with Xcode 6, GM seed , I am getting the following error.
      error: error reading 'pic'
      error: no analyzer checkers are associated with '-mrelocation-model'
      2 errors generated.
      Command /Applications/Xcode 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
      Please let me know , if you are also having the same problem with Xcode 6 and know how to resolve it. Thanks

    Oops. Nobody replied
    I figured it out myself from internet. Just for your information , I am giving my assessment below.
    Previously I was using a compiler flag for a particular file in build phase , with that in Xcode6 it throws error.
    -w -Xanalyzer -analyzer-disable-checker
    the above complier flag alone throws the error. I have added the following compiler flag , it seems to be fixing the error.
    -Xanalyzer deadcode
    Thanks, Ramesh Chandran

  • Sharing static members between Swing application and Web application

    Hi,
    if someone has done this please help:
    I have created 3 classes:
    Mainclass using JFrame which is used as host class for DBConnectionManager class,
    and ConfigBean class used for storing static configuration parameters:
         static public String strUser = "";
    static public String strPassword = "";
    static public String strDB = "";
    static public int nMaxConn = 0;
    static public String strPoolName = "";
    static public boolean bConnected = false;
    static public int nCurrentUsers = 0;
    static public DBConnectionManager manager = null;
         public DBConnectionManager getDBManager()
    return this.manager;
    public void setDBManager(DBConnectionManager manager)
    this.manager = manager;
    DBConnectionManager class uses static instance to see if this is only class created by client users.
    Only static member in this class is getInstance member function for startig manager:
         static synchronized public DBConnectionManager getInstance()
    if (instance == null)
    instance = new DBConnectionManager();
    return instance;
    In Mainclass I also created non static DBConnectionManager class for manipluation with host administrator.
    Then I created web application layout in Tomcat 4 and used index.jsp:
    <%@ page import="java.sql.*,java.io.*" %>
    <jsp:useBean id="cfgbean" class="webvobapli.ConfigBean" scope="application" />
    <%!
    webvobapli.DBConnectionManager db = null;
    String strMessage = "";
    Statement stmt1;
    ResultSet rset1;
    String strQuery = "select count(*) from cards";
    %>
    <html>
    <%
         try
              db = cfgbean.getDBManager();
              if(db==null)
                   strMessage = "Error";
              else
                   Connection con = db.getConnection("central2");
                   if(con != null)
                        stmt1 = con.createStatement();
                        rset1 = stmt1.executeQuery(strQuery);
                        rset1.next();
                        strMessage = rset1.getString(1);
                   else
                        strMessage = "NULL";
         catch(Exception e)
              strMessage = e.toString();
    %>
    <p>Message = <%=strMessage%></p>
    </html>
    Question: why db = cfgbean.getDBManager(); returns null if I created instance of DBConnectionManager
    class in Mainclass and assigned it to ConfigBean as static instance before running web application.
    Shouldn't all java programs share static memory area?
    Beast Regards
    Branislav Cavlin

    Question: why db = cfgbean.getDBManager(); returns null if I created >>instance of DBConnectionManager
    class in Mainclass and assigned it to ConfigBean as static instance >>before running web application.
    Shouldn't all java programs share static memory area?You say you create the db objects BEFORE you run the web application - now I could be misunderstanding what you are saying, but does this not involve two JVM's (one to create initial db objects, which then exits, then second JVM fires you app server/servlet container) - which would explain why a null object is being returned.

  • Calc manager: @RETURN function with WARNING as message type issue

    Hi Gurus,
    I m working in version 11.1.2.2 in IE 9. I have created a simple calculation script as below to test the @Return essbase function.
    function
    FIX ( .....)
    "502100"(
    IF( ("YearTotal" > 50000))
    @RETURN("True:test message" , WARNING);
    ELSE
    @RETURN("False:test message" , WARNING);
    ENDIF
    This script validates fine , however when executed on Save of Data Form gives a Job console error with no error code but message as below
    Invalid network data. Type is matched but length is zero. An application protocol error might exist between server and client processes..
    The same script executed using error message type as *"ERROR"* executes successfuly on save of data form and gives exepected custom error message.
    I read a thread in forum saying the @Return function works only with ERROR as message type for vesrion 11.1.2.1
    How to use Essbase @RETURN function to displayed messages in 11.1.2.1
    I have tried using WARNING and INFO , both doesnt seem to work even in 11.1.2.2, Only ERROR as message type works.
    Has anyone experienced the same with version 11.1.2.2 as well? Is this still a bug?
    Please let me know your inputs.
    Thanks
    SN

    Hi,
    I am sorry for the late response!
    Thank you for all your suggestions!
    I had used in the followng way and it resolved my issue.
    SELECT GUID_PRGEN  "Primary Key as GUID in "RAW" Format
             GUID_PR     "Primary Key as GUID in "RAW" Format
             ATTR20A     "SUBSTANCE ID
             ATTR05A     "Materail Type
             ATTR10A     "Materail Group
             ATTR05B     "Sub-Family
             FROM /SAPSLL/PRGEN
             INTO TABLE T_PRGEN
             WHERE ATTR20A IN S_AT20A.
      IF T_PRGEN IS INITIAL.
        MESSAGE : I007(ZMSSG) WITH 'Data not available for this entry'.
        STOP.
      ENDIF.
    Regards,
    Kittu

  • Static Methods & Switch Statement

    Need help with a switch statement and static methods. My program offers the user a menu to choose what they want to practice.
    I want to use a switch statement to process the selection. Selecting 1, 2 or 3 causes the program to go to one of the following static methods:
    addition()
    subtraction
    multiplication()
    import javax.swing.JOptionPane;  // Needed for JOptionPane
    import java.text.DecimalFormat;  // Needed for DecimalFormat
    public class MathsFinal {
        static boolean exit = false;
        static int totalAnswersAsked = 0;
        public static void main(String[] args)
            int userChoice; 
            int correctAnswers = 0;
            do{
                //custom button text
                do{
                    boolean exitAsking = true;
                    String userChoiceString = JOptionPane.showInputDialog (null,
                            "1. Practice addition\n"
                            + "2. Practice subtraction\n"
                            + "3. Practice multiplication\n"
                            + "4. Quit the program\n"
                            + "\n"
                            + "Enter your choice",
                            "Enter your choice",
                            JOptionPane.QUESTION_MESSAGE);
                    int userAnswer, genNumOne, genNumTwo;
                    if(userChoiceString == null || userChoiceString.equals("4") )
                        { //closed it
                        exit = true;
                    }else if(userChoiceString.equals("1"))
                        { //addition
                        genNumOne = getRandomNumber(9,0);
                        genNumTwo = getRandomNumber(9,0);
                        userAnswer = genNumOne + genNumTwo;
                        correctAnswers += display(genNumOne, genNumTwo, userAnswer, "plus");
                    }else if(userChoiceString.equals("2"))
                        { //subtraction
                        genNumOne = getRandomNumber(9,0);
                        genNumTwo = getRandomNumber(genNumOne,0);
                        userAnswer = genNumOne - genNumTwo;
                        correctAnswers += display(genNumOne, genNumTwo, userAnswer, "minus");
                    }else if(userChoiceString.equals("3"))
                        { //multiplication
                        genNumOne = getRandomNumber(9,0);
                        genNumTwo = getRandomNumber(9,0);
                        userAnswer = genNumOne * genNumTwo;
                        correctAnswers += display(genNumOne, genNumTwo, userAnswer, "times");
                    }else
                        { //user didn't enter a number
                        JOptionPane.showMessageDialog(null,
                                "Please enter a number between 1 and 4",
                                "Wrong entry",
                                JOptionPane.ERROR_MESSAGE);
                        exitAsking = false;
                while(!exit);
            while(!exit);
            //create a DecimalFormat object for percentages.
            DecimalFormat userPercent = new DecimalFormat("#0%");
            //show results using information icon
            JOptionPane.showMessageDialog(null,
                    "You got " + (userPercent.format(((double)correctAnswers / (double)totalAnswersAsked)))  + " right!!",
                    "Thank you for playing",
                    JOptionPane.INFORMATION_MESSAGE);
            //ends the program
            System.exit(0);
        public static int getRandomNumber(int large, int small)
            return  (int)((large - small) * Math.random()) + small;
        public static int display(int genNumOne, int genNumTwo, int userAnswer, String operation)
            String selectAddition = JOptionPane.showInputDialog("What is" + " " + genNumOne + " " + operation + " " + genNumTwo + "?");
            if(selectAddition == null) { //pressed close
                exit = true;
                return 0;
             else if(userAnswer == Integer.parseInt(selectAddition))
              { //answer correct
                totalAnswersAsked++;
                //show results using information icon
                JOptionPane.showMessageDialog(null,
                        "Very good!",
                        "Well done",
                        JOptionPane.INFORMATION_MESSAGE);
                return 1;
             else if(userAnswer != Integer.parseInt(selectAddition))
              { // incorrect answer
                totalAnswersAsked++;
                JOptionPane.showMessageDialog(null,
                        "Sorry that was incorrect. Better luck next time",
                        "Bad luck",
                        JOptionPane.INFORMATION_MESSAGE);
                return 0;
            return 0;
    }

    hi,
    switch statement to process the selection. Selecting 1, 2 or 3
    import javax.swing.JOptionPane;  // Needed for JOptionPane
    import java.text.DecimalFormat;  // Needed for DecimalFormat
    public class MathsFinal {
        static boolean exit = false;
        static int totalAnswersAsked = 0;
        public static void main(String[] args)
            int userChoice; 
            int correctAnswers = 0;
           int userChoiceString=4;
            do{
                //custom button text
                    boolean exitAsking = true;
                    userChoiceString = Integer.parseInt(JOptionPane.showInputDialog (null,
                            "1. Practice addition\n"
                            + "2. Practice subtraction\n"
                            + "3. Practice multiplication\n"
                            + "4. Quit the program\n"
                            + "\n"
                            + "Enter your choice",
                            "Enter your choice",
                            JOptionPane.QUESTION_MESSAGE));
                    int userAnswer, genNumOne, genNumTwo;
                   switch (userChoiceString)
                   case 1:
                        genNumOne = getRandomNumber(9,0);
                        genNumTwo = getRandomNumber(9,0);
                        userAnswer = genNumOne + genNumTwo;
                        correctAnswers += display(genNumOne, genNumTwo, userAnswer, "plus");
                             break;
                        case 2:           
                        genNumOne = getRandomNumber(9,0);
                        genNumTwo = getRandomNumber(genNumOne,0);
                        userAnswer = genNumOne - genNumTwo;
                        correctAnswers += display(genNumOne, genNumTwo, userAnswer, "minus");
                              break;
                        case 3:
                        genNumOne = getRandomNumber(9,0);
                        genNumTwo = getRandomNumber(9,0);
                        userAnswer = genNumOne * genNumTwo;
                        correctAnswers += display(genNumOne, genNumTwo, userAnswer, "times");
                             break;
                        case 4: break;
                     default :
                        JOptionPane.showMessageDialog(null,
                                "Please enter a number between 1 and 4",
                                "Wrong entry",
                                JOptionPane.ERROR_MESSAGE);
                        exitAsking = false;
                } while(userChoiceString != 4);
            //create a DecimalFormat object for percentages.
            DecimalFormat userPercent = new DecimalFormat("#0%");
            //show results using information icon
            JOptionPane.showMessageDialog(null,
                    "You got " + (userPercent.format(((double)correctAnswers / (double)totalAnswersAsked)))  + " right!!",
                    "Thank you for playing",
                    JOptionPane.INFORMATION_MESSAGE);
            //ends the program
            System.exit(0);
        public static int getRandomNumber(int large, int small)
            return  (int)((large - small) * Math.random()) + small;
        public static int display(int genNumOne, int genNumTwo, int userAnswer, String operation)
            String selectAddition = JOptionPane.showInputDialog("What is" + " " + genNumOne + " " + operation + " " + genNumTwo + "?");
            if(selectAddition == null) { //pressed close
                exit = true;
                return 0;
             else if(userAnswer == Integer.parseInt(selectAddition))
              { //answer correct
                totalAnswersAsked++;
                //show results using information icon
                JOptionPane.showMessageDialog(null,
                        "Very good!",
                        "Well done",
                        JOptionPane.INFORMATION_MESSAGE);
                return 1;
             else if(userAnswer != Integer.parseInt(selectAddition))
              { // incorrect answer
                totalAnswersAsked++;
                JOptionPane.showMessageDialog(null,
                        "Sorry that was incorrect. Better luck next time",
                        "Bad luck",
                        JOptionPane.INFORMATION_MESSAGE);
                return 0;
            return 0;

  • Analyzer can't run in Ubuntu12.04

    The os version
       uname  -a
        Linux fuchong-ThinkPad-X230 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
    the SolarisStudio version:
    SolarisStudio12.3-linux-x86-bin.bz2
    tar xvf SolarisStudio12.3-linux-x86-bin.bz2 in work directory.
    the experiment file is test.er
    when i run ~/studio/SolarisStudio12.3-linux-x86-bin/solarisstudio12.3/bin$ ./analyzer
    WARNING: Linux-64-bit, 4 CPUs, Ubuntu_14.04 system "fuchong-ThinkPad-X230" is not supported by the Performance tools.
    analyzer: java.io.IOException: Cannot run program "/home/fuchong/studio/SolarisStudio12.3-linux-x86-bin/solarisstudio12.3/lib/analyzer/lib/../../../bin/er_print": error=2, 没有那个文件或目录
    cant file file /home/fuchong/studio/SolarisStudio12.3-linux-x86-bin/solarisstudio12.3/lib/analyzer/lib/../../../bin/er_print
    but the file is exists :
    fuchong@fuchong-ThinkPad-X230:~/studio/SolarisStudio12.3-linux-x86-bin/solarisstudio12.3/bin$ ls -al /home/fuchong/studio/SolarisStudio12.3-linux-x86-bin/solarisstudio12.3/lib/analyzer/lib/../../../bin/er_print
    -rwxr-xr-x 1 fuchong fuchong 163566 Nov 16  2011 /home/fuchong/studio/SolarisStudio12.3-linux-x86-bin/solarisstudio12.3/lib/analyzer/lib/../../../bin/er_print
    how to to resolve it ?thanks!

    fuyou написал(а):
    when i run ~/studio/SolarisStudio12.3-linux-x86-bin/solarisstudio12.3/bin$ ./analyzer
    WARNING: Linux-64-bit, 4 CPUs, Ubuntu_14.04 system "fuchong-ThinkPad-X230" is not supported by the Performance tools.
    analyzer: java.io.IOException: Cannot run program "/home/fuchong/studio/SolarisStudio12.3-linux-x86-bin/solarisstudio12.3/lib/analyzer/lib/../../../bin/er_print": error=2, 没有那个文件或目录
    cant file file /home/fuchong/studio/SolarisStudio12.3-linux-x86-bin/solarisstudio12.3/lib/analyzer/lib/../../../bin/er_print
    but the file is exists :
    "Cannot find file" and "Cannot run program" are absolutely different errors. By default 64-bit Ubuntu 12.04 cannot launch 32-bit executable files. In your case a special package should be installed:
    apt-get install ia32-libs

  • Error in DB analyzer logs

    HI,
    My SCM 5.0system is running on oracle 10g . I have checked LC & found below error in DB analyzer logs.
    W3  11523 primary key range accesses, selectivity 0.01%: 140299528 rows read, 12593 rows qualified
          CON: PKeyRgSel < 0.3
          VAL: 0.01      < 0.3
    W3  Selects and fetches selectivity 0.21%: 197822 selects and fetches, 71523587 rows read, 152554 rows qualified
          CON: SelFetSel < 0.3
          VAL: 0.21      < 0.3
    * W3  76125 primary key range accesses, selectivity 0.11%: 71444927 rows read, 76461 rows qualified
          CON: PKeyRgSel < 0.3
          VAL: 0.11      < 0.3
    W2  Number of symbol resolutions to create call stacks: 234
          CON: SymbolResolutions > 0
          VAL: 234               > 0
    LC Version - X64/HPUX  7.6.03   Build 012-123-169-237
    As i am new in MAX DB so i need experts advice on the above issues.

    Hello,
    You got the WARNING messages in the DB analyzer protocol. Those are NOT errors.
    You used the DB analyzer to find the bottleneck in liveCache.
    Itu2019s  the performance analysis tool for database.
    1. In general, the MAXDB library has the explanations about the DB analyzer warning messages.
    http://maxdb.sap.com/doc/7_7/default.htm -> Database Analyzer
               In the database analyzer messages section at Optimizer Strategies and Selects and Fetches documents you will see the u201CUser Responseu201D, when you will get the warnings like:
    W3  11523 primary key range accesses, selectivity 0.01%...
    W3  Selects and fetches selectivity 0.21% u2026
    W3  76125 primary key range accesses, selectivity 0.11%...
    =>Find what liveCache application scenario was running at that time.
    Repeat this application scenario & create the SQL trace. Find the statement that causes this warning.
    2. If you are not able to find the reason for those warnings on your system => create the SAP message to help you on this issue.
    Thank you and best regards, Natalia Khlopina

  • False error message as "paper jam" on CP1215 Color Laser Printer. How can I release it?

    On Color Laser Printer CP1215 the False Paper Jam warning message is continuously on.
    How can I erase it?

    Thank you for visiting the HP Support Forums.
    Just a reminder that this is a peer-to-peer community of HP customers, and not a venue to contact HP directly. Most of the users here are consumers like yourself who are offering solutions because they like to help others, and any HP employees you see are here on their own capacity and not representing the company.
    If you have additional or direct feedback for HP about their products or services, or questions about repair, you can use the link below for contact information.
    http://www8.hp.com/us/en/contact-hp/ww-contact-us.​html
    If you have other questions and concerns about using the forum, please feel free to send me a private message.
    semads wrote:
    There was a time not so long ago that the info one received from HP's tech support et al was helpful and relevant, Unfortunately, those days have become rare. This reply is evidence of that. It's almost as if you have a program that scans user's submissions for certain keywords and then posts a reply with a link to a solution that may apply based on the keyword. In the case of the CP1215, the paper jam error is FALSE!!! No one who is complaining about this issue has a paper jam!! You can post replies with your condescending link to your Paper Jam Resolution site all day long and it will NEVER rectify the situation hundreds of people are having with this printer! In my case, I have 2 printers with this exact same issue. My CP1215 as well as my 2200D both are completely useless due to a false "Paper Jam" message that won't allow the printer to print. Neither printer has printed more than 500 pages!!!!!
    Thank you HP for transitioning from one of the best tech companies in the world to just another company that has no time or money to be concerned with the problems its customers are having with one of their products. I used to be proud that I owned HP printers if for no other reason than the quality of the products and the reputation - I even recommended your products to everyone who would listen. Not any more. Maybe one day one of the revolving-door CEO's will do a Google search for problems customers are having with your products and will see that the company's status quo isn't acceptable and do something to fix the problems internally that are affecting so many of your customers and also help the thousands of individuals who have basically hit a wall with regard to finding any kind of solution to the problems they have with their printers.
    OrnahP
    HP Support Forums Moderator
     Clicking the "Kudos Star" to the left is a great way to say thanks!
     When your problem has been solved, accept the solution by clicking "Accept as Solution" to help other members in the future!
    Rules of Participation

  • Staic analyzer does not see unused variables

    I begun to use Eclipse not so long ago, and I find it very convenient. But it's tool "static analyzer" works buggy for me - it makes a lot of warnings about different advanced situations, but does not see most popular and simple situation - unused variables!
    According to documentation on this site, this tool must do it, but it does not. This was issue was in Luna and it is still present for me in Mars. May be I did not set it up properly?
    I would be appreciated if someone help me with this.

    I begun to use Eclipse not so long ago, and I find it very convenient. But it's tool "static analyzer" works buggy for me - it makes a lot of warnings about different advanced situations, but does not see most popular and simple situation - unused variables!
    According to documentation on this site, this tool must do it, but it does not. This was issue was in Luna and it is still present for me in Mars. May be I did not set it up properly?
    I would be appreciated if someone help me with this.

  • Show Warning Message near the field

    Hi all,
    I want to show my warning message near the field which is required instead of right at the bottom.
    I use the following onSubmit() Method when the user hits the submit button to check for required fields:-
    if (this.testfield == null) {
    this.setBackgroundColor(componentId : "testfield", color : "Red");
    this.focus(componentId : "testfield");
    this.setVisible(componentId : "testfield", visible : true, collapsed : false);
    this.showWarning(warning : "Testfield is Required");
    else {
    this.submit(text : "submit");
    This gives me the error message right at the bottom of the presentation as opposed below the field.
    How can I get this message to appear right below the field which is required?
    Any idea?
    I tried this.setText()
    But it does not work.

    The "showWarning" and "showError" methods used to be more useful when we had the option in earlier releases (5.7) to place them at either the top or the bottom of the presentation.
    I now never use either one of them.
    This is not what you want to hear and know you've thought of this, but what I do is add text attributes (errorMessage1, errorMessage2,...) to the BPM object and then place the text fields on the presentation as read-only, bold red foreground color text fields directly above the field causing the error. In my presentation's initialization method, I always use the setVisible method to false and collapse them. In your submit logic, you'd set the value of the error message attribute and set the error message field to be visible and not collapsed. You need to add an on change event for the field causing the error that will make the error field not visible and collapsed. Similarly, if you have a Save button, you need to make all the error fields not visible and collapsed.
    Dan

  • Cannot disable close multiple tabs warning

    I have tried to disable the warning when FF is closing multiple tabs but the warning still pops up.

    Hi,
    <br />
    If you want to disable the warning when closing other tabs, set a preference to false:<br />
    In the Location bar, type "about:config" and press Enter.<br />
    The about:config "This might void your warranty!" warning page may appear. Click I'll be careful, I promise! to continue to the about:config page.<br />
    In the Search field box at the top, type browser.tabs.warnOnCloseOtherTabs.<br />
    Double-click the browser.tabs.warnOnCloseOtherTabs preference to set its value to false.<br />
    Warn me when opening multiple tabs might slow down Firefox: When you open a large number of tabs at once, Firefox will ask you to confirm your choice. This prevents you from accidentally slowing down your system while the pages are loading. Uncheck this option to disable this warning.<br />
    Don't load tabs until selected: Firefox will only load the active tab when it starts or restores your previous session. This can make startup much faster if you are restoring many tabs. The other open tabs will be loaded as you click on them.<br />
    When I open a link in a new tab, switch to it immediately: When you middle-click on a Web link (or hold down Ctrl while clicking with the left mouse button), the page will be opened in a new tab. That page will not be displayed and will load in a background tab. Check this option to load and display the page in a new foreground tab instead.<br />
    Show tab previews in the Windows taskbar: When you move your pointer over the Firefox icon in the Windows 7 taskbar, Windows will show you a preview of the Firefox window. With this option check marked, Windows will show you a separate preview for each tab.
    Regards
    '''Deepak Krishnan P.R'''

  • Javac AST Symbol Resolving for JavacTask.parse()

    Hello!
    I am currently working on a source code processor, based on an AST. I use the original javac library. I know that the javac package is not provided as API, but it suffices for a first prototype.
    I parse a file (multiple files) with JavacTask.parse() and descent into the AST. Please don't hit me for the solution using Reflection! The interesting lines are on *321-328*, where I try to resolve the Symbols manually, because it seems all .sym properties are set to null.
    I don't understand how to resolve the AST previous to descent into it. Is it possible to resolve Symbols with the original library code?
    Warning, big Code:
    package runtimeLoader;
    import java.io.StringWriter;
    import java.lang.reflect.Field;
    import java.util.HashMap;
    import java.util.LinkedList;
    import java.util.Stack;
    import javax.tools.JavaCompiler;
    import javax.tools.JavaFileObject;
    import javax.tools.StandardJavaFileManager;
    import javax.tools.ToolProvider;
    import runtimeLoader.RuntimeLoader.Trace.RuntimeLoaderTrace;
    import com.sun.source.tree.CompilationUnitTree;
    import com.sun.source.tree.MethodInvocationTree;
    import com.sun.source.tree.MethodTree;
    import com.sun.source.util.JavacTask;
    import com.sun.source.util.TreeScanner;
    import com.sun.tools.javac.api.JavacTaskImpl;
    import com.sun.tools.javac.api.JavacTrees;
    import com.sun.tools.javac.code.Scope;
    import com.sun.tools.javac.code.Symbol.MethodSymbol;
    import com.sun.tools.javac.code.Symbol.PackageSymbol;
    import com.sun.tools.javac.code.Type;
    import com.sun.tools.javac.code.TypeTags;
    import com.sun.tools.javac.comp.AttrContext;
    import com.sun.tools.javac.comp.Env;
    import com.sun.tools.javac.comp.Resolve;
    import com.sun.tools.javac.tree.JCTree;
    import com.sun.tools.javac.tree.JCTree.JCAnnotation;
    import com.sun.tools.javac.tree.JCTree.JCAssign;
    import com.sun.tools.javac.tree.JCTree.JCBlock;
    import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
    import com.sun.tools.javac.tree.JCTree.JCExpression;
    import com.sun.tools.javac.tree.JCTree.JCFieldAccess;
    import com.sun.tools.javac.tree.JCTree.JCIdent;
    import com.sun.tools.javac.tree.JCTree.JCLabeledStatement;
    import com.sun.tools.javac.tree.JCTree.JCLiteral;
    import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
    import com.sun.tools.javac.tree.JCTree.JCMethodInvocation;
    import com.sun.tools.javac.tree.JCTree.JCPrimitiveTypeTree;
    import com.sun.tools.javac.tree.JCTree.JCStatement;
    import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
    import com.sun.tools.javac.tree.Pretty;
    import com.sun.tools.javac.util.List;
    import com.sun.tools.javac.util.ListBuffer;
    import com.sun.tools.javac.util.Name;
    import com.sun.tools.javac.util.Name.Table;
    public class Compile {
          * parse, pretty, store temp
          * copy tree, process, pretty, store, compile, EXECUTE, TEST
          * process back, pretty, COMPARE EQUAL
          * nested vars
          * nested classes, methods
          * vars there
         static class ReferenceList {
              public Object ref;
              public LinkedList list = new LinkedList();
              public ReferenceList(Object ref) {
                   this.ref = ref;
                   list.add(ref);
         static class TraceStructure {
              public JCMethodInvocation call = null;
              public JCStatement stat = null;
              public LinkedList<TraceStructure> stats = new LinkedList<TraceStructure>();
         enum UpdateAction {
              UPDATE_CLEANUP,
              UPDATE_PROCESS,
              SCAN_CODE,
              SCAN_SYMBOLS,
              SCAN_RESOLVE,
         static boolean traceHeader = false;
         static boolean traceCall = false;
         static Resolve resolve = null;
         //static TreeScanner treeScanner = null;
         static Stack objectRefStack = new Stack();
         static LinkedList<JCVariableDecl> variableList = new LinkedList<JCVariableDecl>();
         static LinkedList<JCMethodDecl> methodList = new LinkedList<JCMethodDecl>();
         static TraceStructure traceStructure = null;
         public static boolean traceMethod(JCMethodDecl method) {
              boolean traceMethod = false;
              for (JCAnnotation anno : method.mods.annotations) {
                   if (anno.annotationType instanceof JCIdent) {
                        if ("RuntimeLoaderTrace".equals(((JCIdent) anno.annotationType).name.toString())) {
                             traceMethod = true;
                             break;
              return traceMethod;
         public static boolean findMethod(JCMethodDecl method, Object instance) {
              boolean traceMethod = false;
              for (JCAnnotation anno : method.mods.annotations) {
                   if (anno.annotationType instanceof JCIdent) {
                        if ("RuntimeLoaderTrace".equals(((JCIdent) anno.annotationType).name.toString())) {
                             traceMethod = true;
                             break;
              return traceMethod;
         public static void updateTreeRecur(ReferenceList objectRef, UpdateAction action) throws Exception {
              Field[] sourceFieldList = objectRef.ref.getClass().getDeclaredFields();
              HashMap<String, Field> sourceFieldMap = new HashMap<String, Field>();
              if (!traceHeader) {
                   for (Field sourceField : sourceFieldList) {
                        Object value = sourceField.get(objectRef.ref);
                        String name = sourceField.getName();
                        if (value instanceof List) {
                             List sourceList = (List) value;
                             ListBuffer targetListBuffer = new ListBuffer();
                             //System.out.println(objectRef.ref.getClass().getName());
                             if (UpdateAction.UPDATE_PROCESS.equals(action)
                                            && objectRefStack.lastElement() instanceof JCMethodDecl
                                            && objectRef.ref instanceof JCBlock
                                            && "stats".equals(name)) {
                                  if (traceMethod((JCMethodDecl) objectRefStack.lastElement())) {
                                       Table table1 = ((JCMethodDecl) objectRefStack.lastElement()).getName().table;
                                       variableList.clear();
                                       traceStructure = new TraceStructure();
                                       // Analyze
                                       updateTreeRecur(new ReferenceList(objectRef.ref), UpdateAction.SCAN_CODE);
                                       // Header
                                       targetListBuffer.append(
                                                 new CustomLabeledStatement(Name.fromString(table1, "RuntimeLoaderT1"),
                                                           new CustomBlock(0, new ListBuffer().toList())));
                                       targetListBuffer.append(
                                                 new CustomLabeledStatement(Name.fromString(table1, "RuntimeLoaderT2"),
                                                           new CustomBlock(0, new ListBuffer().toList())));
                                       // Variables
                                       for (JCVariableDecl variable : variableList) {
                                            //System.out.println(variable.getType().getClass().getName());
                                            if (variable.getType() instanceof JCPrimitiveTypeTree) {
                                                 int typetag = ((JCPrimitiveTypeTree) variable.getType()).typetag;
                                                 variable.init = new CustomLiteral(typetag, 0);
                                            else {
                                                 variable.init = new CustomLiteral(TypeTags.BOT, null);
                                            targetListBuffer.append(variable);
                                       // Trace
                                       targetListBuffer.append(
                                                 new CustomLabeledStatement(Name.fromString(table1, "RuntimeLoaderC"),
                                                           new CustomBlock(0, new ListBuffer().toList())));
                             for (Object sourceObject : sourceList) {
                                  ReferenceList targetObjectRef = new ReferenceList(sourceObject);
                                  objectRefStack.push(objectRef.ref);
                                  updateTreeRecur(targetObjectRef, action);
                                  objectRefStack.pop();
                                  if (targetObjectRef.ref != null) {
                                       targetObjectRef.list.set(0, targetObjectRef.ref);
                                       for (Object targetObject : targetObjectRef.list) {
                                            if (targetObject != null) {
                                                 targetListBuffer.append(targetObject);
                             sourceField.set(objectRef.ref, targetListBuffer.toList());
                        else if (value instanceof JCTree) {
                             ReferenceList valueRef = new ReferenceList(value);
                             objectRefStack.push(objectRef.ref);
                             updateTreeRecur(valueRef, action);
                             objectRefStack.pop();
                             if (valueRef.ref == null) {
                                  objectRef.ref = null;
                                  return;
                             sourceField.set(objectRef.ref, valueRef.ref);
              if (UpdateAction.UPDATE_CLEANUP.equals(action)) {
                   if (objectRef.ref instanceof JCLabeledStatement) {
                        String label1 = ((JCLabeledStatement) objectRef.ref).label.toString();
                        if ("RuntimeLoaderT1".equals(label1)) {
                             traceHeader = true;
                             objectRef.ref = null;
                             return;
                        else if ("RuntimeLoaderT2".equals(label1)) {
                             traceHeader = false;
                             objectRef.ref = null;
                             return;
                        else if ("RuntimeLoaderC".equals(label1)) {
                             objectRef.ref = ((JCLabeledStatement) objectRef.ref).body;
                             if (objectRef.ref instanceof JCBlock) {
                                  switch (((JCBlock) objectRef.ref).stats.size()) {
                                  case 0:
                                       objectRef.ref = null;
                                       return;
                                  case 1:
                                       objectRef.ref = ((JCBlock) objectRef.ref).stats.get(0);
                                       break;
                   if (traceHeader) {
                        objectRef.ref = null;
                        return;
              else if (UpdateAction.SCAN_CODE.equals(action)) {
                   if (objectRef.ref instanceof JCVariableDecl) {
                        JCVariableDecl object1 = (JCVariableDecl) objectRef.ref;
                        variableList.add(object1);
                        objectRef.ref = new CustomAssign(object1.vartype, object1.init);
                   else if (objectRef.ref instanceof JCMethodInvocation) {
                        JCMethodInvocation object1 = (JCMethodInvocation) objectRef.ref;
                        //System.out.println(object1.meth);
                        if (object1.meth instanceof JCIdent) {
                             System.out.println(((JCIdent)object1.meth).sym);
                             /*if(((JCIdent)object1.meth).sym instanceof MethodSymbol) {
                                  System.out.println(((MethodSymbol)((JCIdent)object1.meth).sym).code);
                        else if (object1.meth instanceof JCFieldAccess) {
                             System.out.println(((JCFieldAccess) object1.meth).sym);
                             //System.out.println(((JCFieldAccess) object1.meth).getExpression() + " " + ((JCFieldAccess) object1.meth).name);
              else if (UpdateAction.SCAN_SYMBOLS.equals(action)) {
                   if (objectRef.ref instanceof JCMethodDecl) {
                        JCMethodDecl object1 = (JCMethodDecl) objectRef.ref;
                        //resolve.resolveInternalMethod(object1.pos(), null, object1.type, object1.getName(), object1.);
                        System.out.println(object1.sym);
                        methodList.add(object1);
                   if (objectRef.ref instanceof JCMethodInvocation) {
                        JCMethodInvocation object1 = (JCMethodInvocation) objectRef.ref;
                        Name name = null;
                        Type type = null;
                        System.out.println(object1.meth.getClass().getName());
                        if (object1.meth instanceof JCIdent) {
                             name = ((JCIdent)object1.meth).name;
                             type = ((JCIdent)object1.meth).type;
                             //System.out.println(object1.type);
                             //System.out.println(((JCIdent)object1.meth).type);
                        else if (object1.meth instanceof JCFieldAccess) {
                             name = ((JCFieldAccess)object1.meth).name;
                             type = ((JCFieldAccess)object1.meth).type;
                        //type = new Type(TypeTags.VOID, null);
                        //type = new Type(TypeTags.VOID, new TypeSymbol());
                        ListBuffer<Type> argtypeListBuffer = new ListBuffer<Type>();
                        AttrContext attrContext = new AttrContext();
                        Env<AttrContext> env = new Env<AttrContext>((JCTree) objectRef.ref, attrContext);
                        System.out.println(type);
                        System.out.println(type.tsym);
                        resolve.resolveInternalMethod(object1.pos(), env, type, name, argtypeListBuffer.toList(), null);
         public static void main(String[] args) throws Exception {
              JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
              StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);
              Iterable<? extends JavaFileObject> fileObjects = fileManager.getJavaFileObjects(
                        "C:/Users/user2/workspace/runtimeLoader/src/runtimeLoader/Test.java"
                        //"C:/Users/user2/workspace/runtimeLoader/src/runtimeLoader/Test2.java"
              JavacTaskImpl javacTaskImpl = (JavacTaskImpl) compiler.getTask(null, fileManager, null, null, null, fileObjects);
              Iterable<? extends CompilationUnitTree> treeList = javacTaskImpl.parse();
              resolve = Resolve.instance(javacTaskImpl.getContext());
              for (CompilationUnitTree sourceTree : treeList) {
                   /*treeScanner = new SourceTreeProcessor();
                   sourceTree.accept(treeScanner, null);*/
                   /*System.out.println(
                             JavacTrees.instance(
                                       javacTaskImpl).getScope(
                                                 JavacTrees.instance(javacTaskImpl).getPath(
                                                           sourceTree, sourceTree)).getEnv());*/
                   objectRefStack.clear();
                   objectRefStack.push(new Object());
                   updateTreeRecur(new ReferenceList(sourceTree), UpdateAction.SCAN_SYMBOLS);
              /*for (CompilationUnitTree sourceTree : treeList) {
                   objectRefStack.clear();
                   objectRefStack.push(new Object());
                   updateTreeRecur(new ReferenceList(sourceTree), UpdateAction.UPDATE_CLEANUP);
                   updateTreeRecur(new ReferenceList(sourceTree), UpdateAction.UPDATE_PROCESS);
                   StringWriter s = new StringWriter();
                   new Pretty(s, false).printExpr((JCTree) sourceTree);
                   //System.out.println(s.toString());
         /*private static class SourceTreeProcessor extends TreeScanner<Void, Void> {
              @Override
              public Void visitMethodInvocation(MethodInvocationTree node, Void p) {
                   //System.out.println(node.getMethodSelect().);
                   return super.visitMethodInvocation(node, p);
         static class CustomLabeledStatement extends JCLabeledStatement {
              protected CustomLabeledStatement(Name arg0, JCStatement arg1) {
                   super(arg0, arg1);
         static class CustomBlock extends JCBlock {
              protected CustomBlock(long arg0, List<JCStatement> arg1) {
                   super(arg0, arg1);
         static class CustomAssign extends JCAssign {
              protected CustomAssign(JCExpression arg0, JCExpression arg1) {
                   super(arg0, arg1);
         static class CustomLiteral extends JCLiteral {
              protected CustomLiteral(int arg0, Object arg1) {
                   super(arg0, arg1);
    }

    Sorry, i am pushing a bit.
    I continue development, and solve the problem temporarily by comparing the literal strings. Because this is highly inaccurate, this issue is very urgent. Please answer shortly, if possible. If you are interested, this project is a first attempt to realize a independent platform for free and open source solution distribution.
    Imagine the case of equal variable names in parallel scope:
         int aNumber = 1;
         int aNumber = 2;
    }without correct resolved symbol names, the names are ambiguous and cannot produce the correct result:
    String[] rl_variableList = {"aNumber", "aNumber"};
    int rl_0_aNumber = 0;
    int rl_1_aNumber = 0;
         rl_0_aNumber = 1;
         rl_1_aNumber = 2;
    }

  • HOW TO Developing an Authorization plug-in

    #if defined (_WIN32)
    #pragma warning(disable : 4996)
    BOOL WINAPI DllMain(
        HINSTANCE hinstDLL,  // handle to DLL module
        DWORD fdwReason,     // reason for calling function
        LPVOID lpReserved )  // reserved
    return TRUE;
    #endif
    How to create here
    /*----------------------------------------------------------------------------+
    |       ___     _       _                                                    |
    |      /   |   | |     | |                                                   |
    |     / /| | __| | ___ | |__   ___                                           |
    |    / /_| |/ _  |/ _ \|  _ \ / _ \                                          |
    |   / ___  | (_| | (_) | |_) |  __/                                          |
    |  /_/   |_|\__,_|\___/|____/ \___|                                          |
    |                                                                            |
    |                                                                            |
    |  ADOBE CONFIDENTIAL                                                        |
    |  __________________                                                        |
    |                                                                            |
    |  Copyright (c) 2003 - 2010, Adobe Systems Incorporated.                    |
    |  All rights reserved.                                                      |
    |                                                                            |
    |  NOTICE:  All information contained herein is, and remains the property    |
    |  of Adobe Systems Incorporated and its suppliers, if any. The intellectual |
    |  and technical concepts contained herein are proprietary to Adobe Systems  |
    |  Incorporated and its suppliers and may be covered by U.S. and Foreign     |
    |  Patents, patents in process, and are protected by trade secret or         |
    |  copyright law. Dissemination of this information or reproduction of this  |
    |  material is strictly forbidden unless prior written permission is         |
    |  obtained from Adobe Systems Incorporated.                                 |
    |                                                                            |
    |          Adobe Systems Incorporated       415.832.2000                     |
    |          601 Townsend Street              415.832.2020 fax                 |
    |          San Francisco, CA 94103                                           |
    |                                                                            |
    +----------------------------------------------------------------------------*/
    #include "StdAfx.h"
    #include "FmsAuthAdaptor.h"
    #include "FmsAuthActions.h"
    #include "FmsMedia.h"
    #include <stdio.h>
    #include <fcntl.h>
    #include <string.h>
    #include "hash.h"
    #include <sstream>
    #if defined (_WIN32)
    #pragma warning(disable : 4996)
    BOOL WINAPI DllMain(
        HINSTANCE hinstDLL,  // handle to DLL module
        DWORD fdwReason,     // reason for calling function
        LPVOID lpReserved )  // reserved
    return TRUE;
    #endif
    // Flag to process SWF Verification in this auth sample.  A real SWF file
    // must be targeted in the SWFVerification code below for the example to work.
    static const bool kAuthorizeSwfVerification = false;
    class FmsAuthAdaptor : public IFmsAuthAdaptor
    public:
      FmsAuthAdaptor(IFmsAuthServerContext2* pFmsAuthServerContext)
       : m_pFmsAuthServerContext(pFmsAuthServerContext) {}
      virtual ~FmsAuthAdaptor() {}
      void authorize(IFmsAuthEvent* pAev);
      void notify(IFmsAuthEvent* pAev);
      void getEvents(I32 aevBitAuth[], I32 aevBitNotf[], unsigned int count);
    private:
      bool getStats(I64 clientStatsHandle, FmsClientStats& baseStats);
      void processStats(IFmsAuthEvent* pAev);
      IFmsAuthServerContext2* m_pFmsAuthServerContext;
    // Utils
    // Note: Do not delete the return value.  The return value is a buffer
    // allocated in FMS memory space, and FMS will manage the memory.
    static char* getStringField(const IFmsAuthEvent* pEv, IFmsAuthEvent::Field prop)
    FmsVariant field;
    if (pEv->getField(prop, field) == IFmsAuthEvent::S_SUCCESS && field.type == field.kString)
      return reinterpret_cast<char*>(field.str);
    return 0;
    // Note: Do not delete the return value.  The return value is a buffer
    // allocated in FMS memory space, and FMS will manage the memory.
    static U8* getBufferField(const IFmsAuthEvent* pEv, IFmsAuthEvent::Field prop)
    FmsVariant field;
    if (pEv->getField(prop, field) == IFmsAuthEvent::S_SUCCESS && field.type == field.kBuffer)
      return field.buf;
    return 0;
    static bool getI8Field(const IFmsAuthEvent* pEv, IFmsAuthEvent::Field prop, I8& iValue)
    FmsVariant field;
    if (pEv->getField(prop, field) == IFmsAuthEvent::S_SUCCESS && field.type == field.kI8)
      iValue = field.i8;
      return true;
    return false;
    static bool getI32Field(const IFmsAuthEvent* pEv, IFmsAuthEvent::Field prop, I32& iValue)
    FmsVariant field;
    if (pEv->getField(prop, field) == IFmsAuthEvent::S_SUCCESS && field.type == field.kI32)
      iValue = field.i32;
      return true;
    return false;
    static bool getI64Field(const IFmsAuthEvent* pEv, IFmsAuthEvent::Field prop, I64& iValue)
    FmsVariant field;
    if (pEv->getField(prop, field) == IFmsAuthEvent::S_SUCCESS && field.type == field.kI64)
      iValue = field.i64;
      return true;
    return false;
    static bool getFloatField(const IFmsAuthEvent* pEv, IFmsAuthEvent::Field prop, float& fValue)
    FmsVariant field;
    if (pEv->getField(prop, field) == IFmsAuthEvent::S_SUCCESS && field.type == field.kFloat)
      fValue = field.f;
      return true;
    return false;
    static bool getU16Field(const IFmsAuthEvent* pEv, IFmsAuthEvent::Field prop, U16& iValue)
    FmsVariant field;
    if (pEv->getField(prop, field) == IFmsAuthEvent::S_SUCCESS && field.type == field.kU16)
      iValue = field.u16;
      return true;
    return false;
    static bool setStringField(IFmsAuthEvent* pEv, IFmsAuthEvent::Field prop, char* pValue)
    FmsVariant field;
    field.setString(reinterpret_cast<I8*>(pValue));
    return pEv->setField(prop, field) == IFmsAuthEvent::S_SUCCESS;
    static bool setI8Field(IFmsAuthEvent* pEv, IFmsAuthEvent::Field prop, I8 iValue)
    FmsVariant field;
    field.setI8(iValue);
    return pEv->setField(prop, field) == IFmsAuthEvent::S_SUCCESS;
    static bool setU8Field(IFmsAuthEvent* pEv, IFmsAuthEvent::Field prop, U8 iValue)
    FmsVariant field;
    field.setU8(iValue);
    return pEv->setField(prop, field) == IFmsAuthEvent::S_SUCCESS;
    static bool setI32Field(IFmsAuthEvent* pEv, IFmsAuthEvent::Field prop, I32 iValue)
    FmsVariant field;
    field.setI32(iValue);
    return pEv->setField(prop, field) == IFmsAuthEvent::S_SUCCESS;
    static bool setI64Field(IFmsAuthEvent* pEv, IFmsAuthEvent::Field prop, I64 iValue)
    FmsVariant field;
    field.setI64(iValue);
    return pEv->setField(prop, field) == IFmsAuthEvent::S_SUCCESS;
    static bool setFloatField(IFmsAuthEvent* pEv, IFmsAuthEvent::Field prop, float fValue)
    FmsVariant field;
    field.setFloat(fValue);
    return pEv->setField(prop, field) == IFmsAuthEvent::S_SUCCESS;
    static bool isADPCMSupported(int iAudioCodecs)
    return (iAudioCodecs & SUPPORT_SND_ADPCM) != 0;
    static bool isVP6Supported(int iVideoCodecs)
    int iAllVP6 = ( SUPPORT_VID_VP6ALPHA | SUPPORT_VID_VP6 );
    return (iVideoCodecs & iAllVP6) != 0;
    static bool isService(int iType)
    return (iType & TYPE_SERVICE) != 0;
    static bool isAMF3(unsigned char uEncod)
    return (uEncod == ENCODE_AMF3);
    // This class will process all authorization events
    class MyFmsAuthorizeEvent
    public:
    MyFmsAuthorizeEvent(IFmsAuthEvent* pAev, IFmsAuthServerContext2* pFmsAuthServerContext)
      : m_pAev(pAev), m_pFmsAuthServerContext(pFmsAuthServerContext) {}
    virtual ~MyFmsAuthorizeEvent() {}
    void authorize();
    private:
    IFmsAuthEvent*   m_pAev;
    IFmsAuthServerContext2* m_pFmsAuthServerContext;
    void MyFmsAuthorizeEvent::authorize()
    bool bAuthorized = true;  // default authorization state
    switch(m_pAev->getType())
      case IFmsAuthEvent::E_CONNECT:
       // only E_CONNECT allows changes to the following fields:
       // F_CLIENT_AUDIO_SAMPLE_ACCESS
       // F_CLIENT_AUDIO_SAMPLE_ACCESS_LOCK
       // F_CLIENT_READ_ACCESS
       // F_CLIENT_READ_ACCESS_LOCK
       // F_CLIENT_VIDEO_SAMPLE_ACCESS
       // F_CLIENT_VIDEO_SAMPLE_ACCESS_LOCK
       // F_CLIENT_WRITE_ACCESS_LOCK
       // F_CLIENT_WRITE_ACCESS
       I8 iValue;
       if (getI8Field(m_pAev, IFmsAuthEvent::F_CLIENT_WRITE_ACCESS, iValue))
        setI8Field(m_pAev, IFmsAuthEvent::F_CLIENT_WRITE_ACCESS, iValue);
       // redirect connection example
       char* pUri = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_URI);
       if (pUri && !strcmp(pUri, "rtmp://localhost/streamtest"))
        setStringField(m_pAev, IFmsAuthEvent::F_CLIENT_REDIRECT_URI,
         "rtmp://localhost:1935/streamtest");
        bAuthorized = false;
       // set DiffServ fields based on a client IP
       // char* pIp = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_IP);
       // if (pIp && !strcmp(pIp, "192.168.1.1"))
        // set the DSCP bits and mask
        U8 m_diffServBits = 170;
        U8 m_diffServMask = 252;
        setU8Field(m_pAev, IFmsAuthEvent::F_CLIENT_DIFFSERV_BITS, m_diffServBits);
        setU8Field(m_pAev, IFmsAuthEvent::F_CLIENT_DIFFSERV_MASK, m_diffServMask);
        bAuthorized = true;
      break;
      case IFmsAuthEvent::E_PLAY:
       char* pStreamName = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_NAME);
       if (pStreamName)
        setStringField(m_pAev, IFmsAuthEvent::F_STREAM_NAME, pStreamName);
       char* pStreamType = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_TYPE);
       if (pStreamType)
        setStringField(m_pAev, IFmsAuthEvent::F_STREAM_TYPE, pStreamType);
       char* pStreamQuery = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_QUERY);
       if (pStreamQuery)
        setStringField(m_pAev, IFmsAuthEvent::F_STREAM_QUERY, pStreamQuery);
       I8 iValue;
       if (getI8Field(m_pAev, IFmsAuthEvent::F_STREAM_RESET, iValue))
        // If iValue is 1 (true) the playlist will be reset and the
        // stream will be the only stream in the playlist; otherwise
        // 0 (false) means the stream will be added to the existing
        // playlist.
        setI8Field(m_pAev, IFmsAuthEvent::F_STREAM_RESET, iValue);
       if (getI8Field(m_pAev, IFmsAuthEvent::F_STREAM_IGNORE, iValue))
        // If iValue is 1 (true) the stream timestamps will be ignored;
        // otherwise 0 (false) means the timestamps will be handled.
        setI8Field(m_pAev, IFmsAuthEvent::F_STREAM_IGNORE, iValue);
       char* pStreamTransition = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_TRANSITION);
       if (pStreamTransition && strlen(pStreamTransition))
        // MBR transition example
        if (!strcmp(pStreamTransition, "switch") ||
         !strcmp(pStreamTransition, "swap"))
         // get the old stream's properties
         char* pOldStreamName = getStringField(m_pAev, IFmsAuthEvent::F_OLD_STREAM_NAME);
         char* pOldStreamType = getStringField(m_pAev, IFmsAuthEvent::F_OLD_STREAM_TYPE);
         char* pOldStreamQuery = getStringField(m_pAev, IFmsAuthEvent::F_OLD_STREAM_QUERY);
         // if pOldStream is empty (optional for switch) current stream is in play
         // do we really want stream transition? 
          // no we do not allow transition
          // bAuthorized = false;
          // now transition will be turned off and old stream continue playing
          // break;    
         // doing nothing will execute transition mode as is
         // or you could modify transition by changing transition properties
         // set it to 1 to indicate they will be hooking up the stream,
         // but that it does not currently exist
         setI32Field(m_pAev, IFmsAuthEvent::F_STREAM_LIVE_PUBLISH_PENDING, 1);
        // get the offset value if transition is set to offset mode for reconnect
        if (!strcmp(pStreamTransition, "resume"))
         float fValue;
         if (getFloatField(m_pAev, IFmsAuthEvent::F_STREAM_OFFSET, fValue))
          float offset = fValue; //offset value in seconds
       else
        // This is a regular play waiting for approval, which may be converted
        // into a play2 command by changing transition properties
      break;
      case IFmsAuthEvent::E_PUBLISH:
       char* pStreamName = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_NAME);
       if (pStreamName)
        setStringField(m_pAev, IFmsAuthEvent::F_STREAM_NAME, pStreamName);
       char* pStreamType = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_TYPE);
       if (pStreamType)
        setStringField(m_pAev, IFmsAuthEvent::F_STREAM_TYPE, pStreamType);
       I32 iValue;
       if (getI32Field(m_pAev, IFmsAuthEvent::F_STREAM_PUBLISH_TYPE, iValue))
        // publish types:
        // 0 : record
        // 1 : append
        // 2 : appendWithGap
        // -1 : live
        setI32Field(m_pAev, IFmsAuthEvent::F_STREAM_PUBLISH_TYPE, iValue);
      break;
      case IFmsAuthEvent::E_FILENAME_TRANSFORM:
        I64 iValue;
        if (getI64Field(m_pAev, IFmsAuthEvent::F_CLIENT_ID, iValue))
         // some fields are not eligible to be modified. The return
         // value will be false when trying to modify the F_CLIENT_ID.
         bool bSet = setI64Field(m_pAev, IFmsAuthEvent::F_CLIENT_ID, iValue);
        char* pStreamName = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_NAME);
        if (pStreamName)
         // some fields are not eligible to be modified. The return
         // value will be false when trying to modify the F_STREAM_NAME.
         bool bSet = setStringField(m_pAev, IFmsAuthEvent::F_STREAM_NAME, pStreamName);
        char* pStreamPath = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_PATH);
        if (pStreamPath)
         setStringField(m_pAev, IFmsAuthEvent::F_STREAM_PATH, pStreamPath);
        char* pStreamType = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_TYPE);
        if (pStreamType)
         setStringField(m_pAev, IFmsAuthEvent::F_STREAM_TYPE, pStreamType); 
      break;
      case IFmsAuthEvent::E_PAUSE:
       bAuthorized = false; // block all E_PAUSE events.
       float fValue;
       if (getFloatField(m_pAev, IFmsAuthEvent::F_STREAM_PAUSE_TIME, fValue))
        float fPauseTime = fValue; // in seconds
       I8 iValue;
       if (getI8Field(m_pAev, IFmsAuthEvent::F_STREAM_PAUSE, iValue))
        // 1 (true) means PAUSE
        // 0 (false) means UNPAUSE
        bool boolPause = iValue != 0;
       if (getI8Field(m_pAev, IFmsAuthEvent::F_STREAM_PAUSE_TOGGLE, iValue))
        // 1 (true) means PAUSE_TOGGLE
        // 0 (false) means no PAUSE_TOGGLE was set
        bool boolPauseToggle = iValue != 0;
       FmsVariant field;
       // Notify Action example: An IFmsNofifyAction is created to notify
       // server side action script (SSAS) of the E_PAUSE event by calling
       // the function name "method" in the script.  In this example two
       // variables will be passed to "method" by calling addParam(field)
       // on the action.
       if (m_pAev->getField(IFmsAuthEvent::F_CLIENT_ID, field) == IFmsAuthEvent::S_SUCCESS)
        I64 clientId = field.i64;
        IFmsNotifyAction* pAction = m_pAev->addNotifyAction("Notified by adaptor");
        pAction->setClientId(field);
        const char mtd[] = "method";
        field.setString(reinterpret_cast<I8*>(const_cast<char*>(mtd)));
        pAction->setMethodName(field);
        // create and insert a U16 "12345" as the first parameter
        field.setU16(12345);
        pAction->addParam(field);
        // create and insert clientId as a double as the second parameter
        field.setDouble((double)clientId);
        pAction->addParam(field);
        // Note: SSAS does not work with I64 or Buffer variants
        // field.setI64(clientId);
        // pAction->addParam(field); // incorrect
      break;
      case IFmsAuthEvent::E_SEEK:
       bAuthorized = false; // block all E_SEEK events
       float fValue;
       if (getFloatField(m_pAev, IFmsAuthEvent::F_STREAM_SEEK_POSITION, fValue))
        // Modification of the seek position example:
        // fValue + 3; will add 3 seconds to the initial seek posistion
        float fSeekTime = fValue; // value in seconds
        setFloatField(m_pAev, IFmsAuthEvent::F_STREAM_SEEK_POSITION, fSeekTime);
      break;
      case IFmsAuthEvent::E_LOADSEGMENT:
       // bAuthorized = false; // block all E_LOADSEGMENT events
       // E_LOADSEGMENT is a read only event that substitutes E_PLAY on
       // FMS Origin servers for recorded streams.
       I64 iValue;
       if (getI64Field(m_pAev, IFmsAuthEvent::F_SEGMENT_START, iValue))
        I64 iStart = iValue; // in bytes
       if (getI64Field(m_pAev, IFmsAuthEvent::F_SEGMENT_END, iValue))
        I64 iEnd = iValue; // in bytes
      break;
      case IFmsAuthEvent::E_RECORD:
       // bAuthorized = false; // block all E_RECORD events
       float fValue;
       if (getFloatField(m_pAev, IFmsAuthEvent::F_STREAM_RECORD_MAXSIZE, fValue))
        float recMaxSize = fValue; // in kilobytes
        setFloatField(m_pAev, IFmsAuthEvent::F_STREAM_RECORD_MAXSIZE, recMaxSize);
       if (getFloatField(m_pAev, IFmsAuthEvent::F_STREAM_RECORD_MAXDURATION, fValue))
        float recMaxDuration = fValue; // in seconds
        setFloatField(m_pAev, IFmsAuthEvent::F_STREAM_RECORD_MAXDURATION, recMaxDuration);
      break;
      case IFmsAuthEvent::E_SWF_VERIFY:
       // SWF Verification example:
       // kAuthorizeSwfVerification is assigned false by default.  The
       // target SWF file must be updated for this to work.
       if(kAuthorizeSwfVerification)
        I8 swfvVersion = 0;
        if(getI8Field(m_pAev, IFmsAuthEvent::F_CLIENT_SWFV_VERSION, swfvVersion))
         std::stringstream stream;
         stream << "Swf verification version is " << static_cast<int>(swfvVersion);
         m_pFmsAuthServerContext->log(stream.str().c_str(), IFmsServerContext::kInformation, false);
        I64 swfvDepth;
        if(getI64Field(m_pAev, IFmsAuthEvent::F_CLIENT_SWFV_DEPTH, swfvDepth))
         I32 swfvTTL;
         if(getI32Field(m_pAev, IFmsAuthEvent::F_CLIENT_SWFV_TTL, swfvTTL))
          swfvTTL /= 2;
          setI32Field(m_pAev, IFmsAuthEvent::F_CLIENT_SWFV_TTL, swfvTTL);
         U8 digest[kSHA256DigestLen];
         // Target a real SWF file instead of sample.swf
         hashSwfFileAtDepth("C:\\sample.swf", swfvDepth, digest);
         FmsVariant field;
         field.setBuffer(digest, kSHA256DigestLen);
         m_pAev->setField(IFmsAuthEvent::F_CLIENT_SWFV_DIGEST, field);
      break;
      case IFmsAuthEvent::E_APPSTART:
      case IFmsAuthEvent::E_APPSTOP:
      case IFmsAuthEvent::E_DISCONNECT:
      case IFmsAuthEvent::E_STOP:
      case IFmsAuthEvent::E_UNPUBLISH:
      case IFmsAuthEvent::E_ACTION:
      case IFmsAuthEvent::E_CODEC_CHANGE:
      case IFmsAuthEvent::E_RECORD_STOP:
      case IFmsAuthEvent::E_CLIENT_PAUSE:
      case IFmsAuthEvent::E_SWF_VERIFY_COMPLETE:
      case IFmsAuthEvent::E_CLIENT_SEEK:
      case IFmsAuthEvent::E_START_TRANSMIT:
      case IFmsAuthEvent::E_STOP_TRANSMIT:
      case IFmsAuthEvent::E_MAXEVENT:
      break;
    IFmsAuthServerContext2::AuthFailureDesc* desc = NULL;
    if(!bAuthorized)
      desc = new IFmsAuthServerContext2::AuthFailureDesc("Blocked by auth adaptor",
       IFmsAuthServerContext2::kDefaultStatus, -1);
    char buf[1024];
    const char* const action = bAuthorized ? "approved" : "rejected";
    sprintf(buf, "Received authorization type=%d id=%p %s\n", m_pAev->getType(),
      m_pAev, action);
    // log to the configured FMS log directory. If the third parameter is true,
    // also send the log to the system event log.
    m_pFmsAuthServerContext->log(buf, IFmsServerContext::kInformation, false);
    m_pFmsAuthServerContext->onAuthorize(m_pAev, bAuthorized, desc);
    delete desc;
    class MyFmsNotifyEvent
    public:
      MyFmsNotifyEvent(IFmsAuthEvent* pAev, IFmsAuthServerContext2* pFmsAuthServerContext)
       : m_pAev(pAev), m_pFmsAuthServerContext(pFmsAuthServerContext) {}
      virtual ~MyFmsNotifyEvent() {}
      void notify() const;
    private:
      IFmsAuthEvent* m_pAev;
      IFmsAuthServerContext2* m_pFmsAuthServerContext;
    void MyFmsNotifyEvent::notify() const
    switch(m_pAev->getType())
      case IFmsAuthEvent::E_PLAY:
       char* pAppName = getStringField(m_pAev, IFmsAuthEvent::F_APP_NAME);
       char* pAppInst = getStringField(m_pAev, IFmsAuthEvent::F_APP_INST);
       char* pAppUri = getStringField(m_pAev, IFmsAuthEvent::F_APP_URI);
       char* pClIp = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_IP);
       char* pClUri = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_URI);
       char* pClNewUri = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_REDIRECT_URI);
       char* pClVhost = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_VHOST);
       char* pClRef = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_REFERRER);
       char* pClPurl = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_PAGE_URL);
       char* pClAgent = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_USER_AGENT);
       char* pClRAccess = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_READ_ACCESS);
       char* pClWAccess = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_WRITE_ACCESS);
       char* pClAudioAccess = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_AUDIO_SAMPLE_ACCESS);
       char* pClVideoAccess = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_VIDEO_SAMPLE_ACCESS);
       char* pClProto = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_PROTO);
       char* pClUstem = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_URI_STEM);
       char* pStreamName = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_NAME);
       char* pStreamType = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_TYPE);
       char* pStreamQuery = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_QUERY);
       char* pStreamPath = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_PATH);
       I32 iValue;
       if (getI32Field(m_pAev, IFmsAuthEvent::F_CLIENT_AUDIO_CODECS, iValue))
        bool bADPCM = isADPCMSupported(iValue);
       if (getI32Field(m_pAev, IFmsAuthEvent::F_CLIENT_VIDEO_CODECS, iValue))
        bool bVP6 = isVP6Supported(iValue);
       if (getI32Field(m_pAev, IFmsAuthEvent::F_CLIENT_TYPE, iValue))
        bool bService = isService(iValue);
       if (getI32Field(m_pAev, IFmsAuthEvent::F_STREAM_ID, iValue))
        I32 iStreamId = iValue;
       float fValue;
       if (getFloatField(m_pAev, IFmsAuthEvent::F_STREAM_LENGTH, fValue))
        float fLength = fValue; // in seconds
       if (getFloatField(m_pAev, IFmsAuthEvent::F_STREAM_POSITION, fValue))
        float iPosition = fValue; // in seconds
       I64 lValue;
       if (getI64Field(m_pAev, IFmsAuthEvent::F_CLIENT_ID, lValue))
        I64 iClientId = lValue; 
       I8 sValue;
       if (getI8Field(m_pAev, IFmsAuthEvent::F_CLIENT_SECURE, sValue))
        bool bSecure = sValue != 0;
       if (getI8Field(m_pAev, IFmsAuthEvent::F_CLIENT_AMF_ENCODING, sValue))
        bool bAMF3 = isAMF3(sValue);
       if (getI8Field(m_pAev, IFmsAuthEvent::F_CLIENT_READ_ACCESS_LOCK, sValue))
        bool bRead = sValue != 0;
       if (getI8Field(m_pAev, IFmsAuthEvent::F_CLIENT_WRITE_ACCESS_LOCK, sValue))
        bool bWrite = sValue != 0;
       if (getI8Field(m_pAev, IFmsAuthEvent::F_CLIENT_AUDIO_SAMPLE_ACCESS_LOCK, sValue))
        bool bAudioRead = sValue != 0;
       if (getI8Field(m_pAev, IFmsAuthEvent::F_CLIENT_VIDEO_SAMPLE_ACCESS_LOCK, sValue))
        bool bVideoRead = sValue != 0;
       if (getI8Field(m_pAev, IFmsAuthEvent::F_STREAM_RESET, sValue))
        bool bReset = sValue != 0;
       if (getI8Field(m_pAev, IFmsAuthEvent::F_STREAM_IGNORE, sValue))
        bool bIgnore = sValue != 0;
      break;
      case IFmsAuthEvent::E_SEEK:
       float fValue;
       if (getFloatField(m_pAev, IFmsAuthEvent::F_STREAM_SEEK_POSITION, fValue))
        float fSeekTime = fValue;
       // Disconnect Action example: disconnect the client that was
       // specified by the E_SEEK notify event
       FmsVariant field;
       if (m_pAev->getField(IFmsAuthEvent::F_CLIENT_ID, field) == IFmsAuthEvent::S_SUCCESS)
        IFmsDisconnectAction* pAction =
         const_cast<IFmsAuthEvent*>(m_pAev)->
          addDisconnectAction("Seek is not allowed. Blocked by adaptor");
        pAction->setClientId(field);
      break;
      case IFmsAuthEvent::E_CODEC_CHANGE:
       char* pAppName = getStringField(m_pAev, IFmsAuthEvent::F_APP_NAME);
       char* pAppInst = getStringField(m_pAev, IFmsAuthEvent::F_APP_INST);
       char* pAppUri = getStringField(m_pAev, IFmsAuthEvent::F_APP_URI);
       char* pClIp = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_IP);
       char* pClUri = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_URI);
       char* pClNewUri = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_REDIRECT_URI);
       char* pClVhost = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_VHOST);
       char* pClRef = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_REFERRER);
       char* pClPurl = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_PAGE_URL);
       char* pClAgent = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_USER_AGENT);
       char* pClRAccess = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_READ_ACCESS);
       char* pClWAccess = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_WRITE_ACCESS);
       char* pClAudioAccess = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_AUDIO_SAMPLE_ACCESS);
       char* pClVideoAccess = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_VIDEO_SAMPLE_ACCESS);
       char* pClProto = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_PROTO);
       char* pClUstem = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_URI_STEM);
       char* pStreamName = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_NAME);
       char* pStreamType = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_TYPE);
       char* pStreamQuery = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_QUERY);
       char* pStreamPath = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_PATH);
       U16 fType;
       if (getU16Field(m_pAev, IFmsAuthEvent::F_STREAM_CODEC_TYPE, fType))
        U16 streamCodecType = fType;
        if (streamCodecType == kVIDEO_CODEC)
         U16 fValue;
         if (getU16Field(m_pAev, IFmsAuthEvent::F_STREAM_CODEC, fValue))
          U16 streamCodecValue = fValue;
          if (streamCodecValue == VIDEO_CODEC_SORENSON)
           // Disconnect Action example: Disallow clients trying
           // to publish content with the sorenson video codec.
           FmsVariant field;
           if (m_pAev->getField(IFmsAuthEvent::F_CLIENT_ID, field) == IFmsAuthEvent::S_SUCCESS)
            IFmsDisconnectAction* pAction =
             const_cast<IFmsAuthEvent*>(m_pAev)->
             addDisconnectAction("Sorenson is not allowed. Blocked by adaptor");
            pAction->setClientId(field);
      break;
      case IFmsAuthEvent::E_RECORD_STOP:
       char* pAppName = getStringField(m_pAev, IFmsAuthEvent::F_APP_NAME);
       char* pAppInst = getStringField(m_pAev, IFmsAuthEvent::F_APP_INST);
       char* pAppUri = getStringField(m_pAev, IFmsAuthEvent::F_APP_URI);
       char* pClIp = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_IP);
       char* pClUri = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_URI);
       char* pClNewUri = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_REDIRECT_URI);
       char* pClVhost = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_VHOST);
       char* pClRef = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_REFERRER);
       char* pClPurl = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_PAGE_URL);
       char* pClAgent = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_USER_AGENT);
       char* pClRAccess = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_READ_ACCESS);
       char* pClWAccess = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_WRITE_ACCESS);
       char* pClAudioAccess = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_AUDIO_SAMPLE_ACCESS);
       char* pClVideoAccess = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_VIDEO_SAMPLE_ACCESS);
       char* pClProto = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_PROTO);
       char* pClUstem = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_URI_STEM);
       char* pStreamName = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_NAME);
       char* pStreamType = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_TYPE);
       char* pStreamQuery = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_QUERY);
       char* pStreamPath = getStringField(m_pAev, IFmsAuthEvent::F_STREAM_PATH);
       float fValue;
       if (getFloatField(m_pAev, IFmsAuthEvent::F_STREAM_RECORD_MAXSIZE, fValue))
        float recMaxSize = fValue; // in kilobytes
       if (getFloatField(m_pAev, IFmsAuthEvent::F_STREAM_RECORD_MAXDURATION, fValue))
        float recMaxDuration = fValue; // in seconds
      break;
      case IFmsAuthEvent::E_SWF_VERIFY_COMPLETE:
       char* pClIp = getStringField(m_pAev, IFmsAuthEvent::F_CLIENT_IP);
       I8 version; // version of SWF verification
       getI8Field(m_pAev, IFmsAuthEvent::F_CLIENT_SWFV_VERSION, version);
       I64 depth; // depth in the SWF file hashed
       getI64Field(m_pAev, IFmsAuthEvent::F_CLIENT_SWFV_DEPTH, depth);
       I32 ttl; // time to live of the SWF hash provided
       getI32Field(m_pAev, IFmsAuthEvent::F_CLIENT_SWFV_TTL, ttl);
       // digest provided to match against
       U8* buffer = getBufferField(m_pAev, IFmsAuthEvent::F_CLIENT_SWFV_DIGEST);
       // result of the attempted match-- see FmsAuthEvents.h enum
       // eSWFMatch for the meaning of this field
       I32 match;
       getI32Field(m_pAev, IFmsAuthEvent::F_CLIENT_SWFV_RESULT, match);
       std::stringstream stream;
       stream << "swf verification for client: "
         << std::string(pClIp)
         << " is complete, the result is: " << match;
       m_pFmsAuthServerContext->log(stream.str().c_str(), IFmsServerContext::kInformation, false);
      break;
      case IFmsAuthEvent::E_APPSTART:
      case IFmsAuthEvent::E_APPSTOP:
      case IFmsAuthEvent::E_CONNECT:
      case IFmsAuthEvent::E_DISCONNECT:
      case IFmsAuthEvent::E_FILENAME_TRANSFORM:
      case IFmsAuthEvent::E_STOP:
      case IFmsAuthEvent::E_PAUSE:
      case IFmsAuthEvent::E_PUBLISH:
      case IFmsAuthEvent::E_UNPUBLISH:
      case IFmsAuthEvent::E_LOADSEGMENT:
      case IFmsAuthEvent::E_ACTION:
      case IFmsAuthEvent::E_RECORD:
      case IFmsAuthEvent::E_CLIENT_PAUSE:
      case IFmsAuthEvent::E_SWF_VERIFY:
      case IFmsAuthEvent::E_CLIENT_SEEK:
      case IFmsAuthEvent::E_START_TRANSMIT:
      case IFmsAuthEvent::E_STOP_TRANSMIT:
      case IFmsAuthEvent::E_MAXEVENT:
      break;
    char buf[1024];
    sprintf(buf, "Received notification type=%d id=%p\n", m_pAev->getType(), m_pAev);
    // log to the configured FMS log directory. If the third parameter is true,
    // also send the log to the system event log.
    m_pFmsAuthServerContext->log(buf, IFmsServerContext::kInformation, false);
    m_pFmsAuthServerContext->onNotify(m_pAev);
    /* All authorization events flow through this wrapper function.
    * Note: This sample auth adaptor has MyFmsAppAuthEvent allocated on the
    * stack, but time intensive implementations may warrant authorization to
    * be allocated on the heap so work may be passed to a thread pool.  This
    * prevents starvation of the calling FMS threads in custom code that may
    * have processing delays (ie database calls, network filesystem access, etc..).
    void FmsAuthAdaptor::authorize(IFmsAuthEvent* pAev)
      MyFmsAuthorizeEvent(pAev, m_pFmsAuthServerContext).authorize();
    /* All notification events flow through this wrapper function.
    * Note: This sample auth adaptor has MyFmsNotifyEvent allocated on the
    * stack, but time intensive implementations may warrant notifications to
    * be allocated on the heap so work may be passed to a thread pool.  This
    * prevents starvation of the calling FMS threads in custom code that may
    * have processing delays (ie database calls, network filesystem access, etc..).
    void FmsAuthAdaptor::notify(IFmsAuthEvent* pAev)
      processStats(pAev);
      MyFmsNotifyEvent(pAev, m_pFmsAuthServerContext).notify();
    * Get client statistics.
    bool FmsAuthAdaptor::getStats(I64 clientStatsHandle, FmsClientStats& baseStats)
    bool bValue= m_pFmsAuthServerContext->getClientStats(clientStatsHandle, baseStats);
    return bValue;
    * Example obtainting client stats from an E_CONNECT or E_STOP event
    void FmsAuthAdaptor::processStats(IFmsAuthEvent* pAev)
      I64 statsHandle;
      FmsClientStats baseStats;
      if (!getI64Field(pAev, IFmsAuthEvent::F_CLIENT_STATS_HANDLE, statsHandle))
       return;
      char* pAppName = getStringField(pAev, IFmsAuthEvent::F_APP_NAME);
      if (pAev->getType() == IFmsAuthEvent::E_CONNECT)
       getStats(statsHandle, baseStats);
       // log data
       char buf[1024];
       char hashKey[9];
       memset(hashKey, 0, 9);
       memcpy(hashKey, &statsHandle, sizeof(statsHandle));
       sprintf(buf, "client Stats Handle= %s, bytes_in= %f, bytes_out= %f\n", hashKey,
        static_cast<double>(baseStats.bytes_in), static_cast<double>(baseStats.bytes_out));
       m_pFmsAuthServerContext->log(buf, IFmsServerContext::kInformation, false);
      else if (pAev->getType() == IFmsAuthEvent::E_STOP)
       getStats(statsHandle, baseStats);
    /* By default, all authorization and notifications events will be sent.
    * Call excludeEvents with the bit set to 1, to stop recieving events.
    * Note: The events:
    * E_APPSTART, E_APPSTOP, E_DISCONNECT, E_STOP, E_UNPUBLISH, E_CODEC_CHANGE
    * are excluded by default and are not authorizable.
    void FmsAuthAdaptor::getEvents(I32 aevBitAuth[], I32 aevBitNotf[], unsigned int count)
    // exclude certain auth events
    IFmsAuthEvent::EventType authExcludeEvent[] = { IFmsAuthEvent::E_SEEK };
    // set E_SEEK to a non authorizable event
    m_pFmsAuthServerContext->excludeEvents(aevBitAuth, count, authExcludeEvent, 1);
    // Warning: if E_CODEC_CHANGE event is not excluded, all messages will be
    // scanned to detect codec change. Subscribe to this event only as needed.
    // Example that excludes certain notify events. (E_PAUSE, E_CODEC_CHANGE)
    IFmsAuthEvent::EventType notifyExcludeEvent[] =
      { IFmsAuthEvent::E_PAUSE, IFmsAuthEvent::E_CODEC_CHANGE };
    m_pFmsAuthServerContext->excludeEvents(aevBitNotf, count, notifyExcludeEvent, 2);
    extern "C" void FCExport FmsCreateAuthAdaptor3(IFmsAuthServerContext2* pAuthServerCtx,
                  IFmsAuthAdaptor*& pFmsAuthAdaptor, U32& iVersion)
    pFmsAuthAdaptor = new FmsAuthAdaptor(pAuthServerCtx);
    U32 version = pAuthServerCtx->getVersion();
    U16 w2 = LWORD(version);
    U16 w1 = HWORD(version);
    iVersion = MKLONG(INTERFACE_MINOR_VERSION, INTERFACE_MAJOR_VERSION);
    char buf[1024];
    char *ptr = buf;
    int valueLen = pAuthServerCtx->getConfig("UserKey1", &ptr, sizeof(buf));
    if (!valueLen)
      valueLen = pAuthServerCtx->getConfig("UserKey2", &ptr, sizeof(buf));
      if (!valueLen)
       return;
      if (valueLen < 0)
       // failed to find this key
       return;
    if (valueLen < 0)
      // failed to find this key
      return;
    // value length is bigger then the buffer size, and a real adaptor should
        // allocate valueLen + 1 bytes and call again
    extern "C" void FCExport FmsDestroyAuthAdaptor3(IFmsAuthAdaptor* pAuthAdaptor )
    delete pAuthAdaptor;

    There is no API to Acrobat's document compare feature.
    It is certainly possible for an experienced plug-in programmer to
    create a new compare plug-in. For example, extract text from two PDFs
    and compare it. Comparison algorithms have been much studied so should
    be findable in academic literature.
    Going beyond text comparison would be a major exercise.
    Aandi Inston

Maybe you are looking for